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