uboot-sunxi: update to version 2018.05
[openwrt/openwrt.git] / package / boot / uboot-sunxi / patches / 320-sunxi-Add-support-for-Orange-Pi-R1.patch
1 From 068fb0d5728c5ec93cb961718d59e7c718886edd Mon Sep 17 00:00:00 2001
2 From: Hauke Mehrtens <hauke@hauke-m.de>
3 Date: Tue, 26 Sep 2017 22:16:59 +0200
4 Subject: sunxi: Add support for Orange Pi R1
5
6 The device tree files are also submitted for inclusion into the Linux
7 kernel.
8
9 Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
10 ---
11 arch/arm/dts/Makefile | 1 +
12 arch/arm/dts/sun8i-h2-plus-orangepi-r1.dts | 77 ++++++++++++++++++++++++++++++
13 board/sunxi/MAINTAINERS | 5 ++
14 configs/orangepi_r1_defconfig | 26 ++++++++++
15 4 files changed, 109 insertions(+)
16 create mode 100644 arch/arm/dts/sun8i-h2-plus-orangepi-r1.dts
17 create mode 100644 configs/orangepi_r1_defconfig
18
19 --- a/arch/arm/dts/Makefile
20 +++ b/arch/arm/dts/Makefile
21 @@ -350,6 +350,7 @@ dtb-$(CONFIG_MACH_SUN8I_A83T) += \
22 sun8i-a83t-cubietruck-plus.dtb \
23 sun8i-a83t-tbs-a711.dts
24 dtb-$(CONFIG_MACH_SUN8I_H3) += \
25 + sun8i-h2-plus-orangepi-r1.dtb \
26 sun8i-h2-plus-orangepi-zero.dtb \
27 sun8i-h3-bananapi-m2-plus.dtb \
28 sun8i-h3-libretech-all-h3-cc.dtb \
29 --- /dev/null
30 +++ b/arch/arm/dts/sun8i-h2-plus-orangepi-r1.dts
31 @@ -0,0 +1,91 @@
32 +/*
33 + * Copyright (C) 2017 Icenowy Zheng <icenowy@aosc.xyz>
34 + *
35 + * This file is dual-licensed: you can use it either under the terms
36 + * of the GPL or the X11 license, at your option. Note that this dual
37 + * licensing only applies to this file, and not this project as a
38 + * whole.
39 + *
40 + * a) This file is free software; you can redistribute it and/or
41 + * modify it under the terms of the GNU General Public License as
42 + * published by the Free Software Foundation; either version 2 of the
43 + * License, or (at your option) any later version.
44 + *
45 + * This file is distributed in the hope that it will be useful,
46 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
47 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
48 + * GNU General Public License for more details.
49 + *
50 + * Or, alternatively,
51 + *
52 + * b) Permission is hereby granted, free of charge, to any person
53 + * obtaining a copy of this software and associated documentation
54 + * files (the "Software"), to deal in the Software without
55 + * restriction, including without limitation the rights to use,
56 + * copy, modify, merge, publish, distribute, sublicense, and/or
57 + * sell copies of the Software, and to permit persons to whom the
58 + * Software is furnished to do so, subject to the following
59 + * conditions:
60 + *
61 + * The above copyright notice and this permission notice shall be
62 + * included in all copies or substantial portions of the Software.
63 + *
64 + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
65 + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
66 + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
67 + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
68 + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
69 + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
70 + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
71 + * OTHER DEALINGS IN THE SOFTWARE.
72 + */
73 +
74 +/* Orange Pi R1 is based on Orange Pi Zero design */
75 +#include "sun8i-h2-plus-orangepi-zero.dts"
76 +
77 +/ {
78 + model = "Xunlong Orange Pi R1";
79 + compatible = "xunlong,orangepi-r1", "allwinner,sun8i-h2-plus";
80 +
81 + /delete-node/ reg_vcc_wifi;
82 +
83 + /*
84 + * Ths pin of this regulator is the same with the Wi-Fi extra
85 + * regulator on the original Zero. However it's used for USB
86 + * Ethernet rather than the Wi-Fi now.
87 + */
88 + reg_vcc_usb_eth: reg-vcc-usb-ethernet {
89 + compatible = "regulator-fixed";
90 + regulator-min-microvolt = <5000000>;
91 + regulator-max-microvolt = <5000000>;
92 + regulator-name = "vcc-usb-ethernet";
93 + enable-active-high;
94 + gpio = <&pio 0 20 GPIO_ACTIVE_HIGH>;
95 + };
96 +
97 + aliases {
98 + ethernet1 = &rtl8189etv;
99 + };
100 +};
101 +
102 +&ohci1 {
103 + /*
104 + * RTL8152B USB-Ethernet adapter is connected to USB1,
105 + * and it's a USB 2.0 device. So the OHCI1 controller
106 + * can be left disabled.
107 + */
108 + status = "disabled";
109 +};
110 +
111 +&mmc1 {
112 + vmmc-supply = <&reg_vcc3v3>;
113 + vqmmc-supply = <&reg_vcc3v3>;
114 +
115 + rtl8189etv: sdio_wifi@1 {
116 + reg = <1>;
117 + };
118 +};
119 +
120 +&usbphy {
121 + usb1_vbus-supply = <&reg_vcc_usb_eth>;
122 +};
123 --- a/board/sunxi/MAINTAINERS
124 +++ b/board/sunxi/MAINTAINERS
125 @@ -342,6 +342,11 @@ M: Jagan Teki <jagan@amarulasolutions.co
126 S: Maintained
127 F: configs/orangepi_prime_defconfig
128
129 +ORANGEPI R1 BOARD
130 +M: Hauke Mehrtens <hauke@hauke-m.de>
131 +S: Maintained
132 +F: configs/orangepi_r1_defconfig
133 +
134 PINE64 BOARDS
135 M: Andre Przywara <andre.przywara@arm.com>
136 S: Maintained
137 --- /dev/null
138 +++ b/configs/orangepi_r1_defconfig
139 @@ -0,0 +1,18 @@
140 +CONFIG_ARM=y
141 +CONFIG_ARCH_SUNXI=y
142 +CONFIG_SPL_SPI_FLASH_SUPPORT=y
143 +CONFIG_MACH_SUN8I_H3=y
144 +CONFIG_DRAM_CLK=624
145 +CONFIG_DRAM_ZQ=3881979
146 +CONFIG_DRAM_ODT_EN=y
147 +# CONFIG_VIDEO_DE2 is not set
148 +CONFIG_DEFAULT_DEVICE_TREE="sun8i-h2-plus-orangepi-r1"
149 +# CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
150 +CONFIG_CONSOLE_MUX=y
151 +CONFIG_SPL=y
152 +# CONFIG_CMD_IMLS is not set
153 +# CONFIG_CMD_FLASH is not set
154 +# CONFIG_CMD_FPGA is not set
155 +CONFIG_SPL_SPI_SUNXI=y
156 +CONFIG_SUN8I_EMAC=y
157 +CONFIG_USB_EHCI_HCD=y