x86: remove built-in vhost-net driver
[openwrt/staging/nbd.git] / package / boot / uboot-sunxi / patches / 250-sun8i-h3-add-support-for-zeropi.patch
1 From 2527b24f39d8f27ba2fd922ca27a1f14119cfa1b Mon Sep 17 00:00:00 2001
2 From: Yu-Tung Chang <mtwget@gmail.com>
3 Date: Sat, 19 Jun 2021 16:16:45 +0800
4 Subject: [PATCH] sunxi: h3: Add initial ZeroPi support
5
6 ZeroPi is a new board of high performance with low cost
7 designed by FriendlyElec., using the Allwinner H3 SOC.
8
9 ZeroPi features
10 - Allwinner H3, Quad-core Cortex-A7@1.2GHz
11 - 256MB/512MB DDR3 RAM
12 - microsd slot
13 - 10/100/1000Mbps Ethernet
14 - Debug Serial Port
15 - DC 5V/2A power-supply
16
17 Signed-off-by: Yu-Tung Chang <mtwget@gmail.com>
18 Reviewed-by: Andre Przywara <andre.przywara@arm.com>
19 Signed-off-by: Andre Przywara <andre.przywara@arm.com>
20 ---
21 --- a/arch/arm/dts/Makefile
22 +++ b/arch/arm/dts/Makefile
23 @@ -560,7 +560,8 @@ dtb-$(CONFIG_MACH_SUN8I_H3) += \
24 sun8i-h3-orangepi-plus.dtb \
25 sun8i-h3-orangepi-plus2e.dtb \
26 sun8i-h3-orangepi-zero-plus2.dtb \
27 - sun8i-h3-rervision-dvk.dtb
28 + sun8i-h3-rervision-dvk.dtb \
29 + sun8i-h3-zeropi.dtb
30 dtb-$(CONFIG_MACH_SUN8I_R40) += \
31 sun8i-r40-bananapi-m2-ultra.dtb \
32 sun8i-v40-bananapi-m2-berry.dtb
33 --- /dev/null
34 +++ b/arch/arm/dts/sun8i-h3-zeropi.dts
35 @@ -0,0 +1,85 @@
36 +/*
37 + * Copyright (C) 2020 Yu-Tung Chang <mtwget@gmail.com>
38 + *
39 + * This file is dual-licensed: you can use it either under the terms
40 + * of the GPL or the X11 license, at your option. Note that this dual
41 + * licensing only applies to this file, and not this project as a
42 + * whole.
43 + *
44 + * a) This file is free software; you can redistribute it and/or
45 + * modify it under the terms of the GNU General Public License as
46 + * published by the Free Software Foundation; either version 2 of the
47 + * License, or (at your option) any later version.
48 + *
49 + * This file is distributed in the hope that it will be useful,
50 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
51 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
52 + * GNU General Public License for more details.
53 + *
54 + * Or, alternatively,
55 + *
56 + * b) Permission is hereby granted, free of charge, to any person
57 + * obtaining a copy of this software and associated documentation
58 + * files (the "Software"), to deal in the Software without
59 + * restriction, including without limitation the rights to use,
60 + * copy, modify, merge, publish, distribute, sublicense, and/or
61 + * sell copies of the Software, and to permit persons to whom the
62 + * Software is furnished to do so, subject to the following
63 + * conditions:
64 + *
65 + * The above copyright notice and this permission notice shall be
66 + * included in all copies or substantial portions of the Software.
67 + *
68 + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
69 + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
70 + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
71 + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
72 + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
73 + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
74 + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
75 + * OTHER DEALINGS IN THE SOFTWARE.
76 + */
77 +
78 +#include "sun8i-h3-nanopi.dtsi"
79 +
80 +/ {
81 + model = "FriendlyARM ZeroPi";
82 + compatible = "friendlyarm,zeropi", "allwinner,sun8i-h3";
83 +
84 + aliases {
85 + ethernet0 = &emac;
86 + };
87 +
88 + reg_gmac_3v3: gmac-3v3 {
89 + compatible = "regulator-fixed";
90 + regulator-name = "gmac-3v3";
91 + regulator-min-microvolt = <3300000>;
92 + regulator-max-microvolt = <3300000>;
93 + startup-delay-us = <100000>;
94 + enable-active-high;
95 + gpio = <&pio 3 6 GPIO_ACTIVE_HIGH>; /* PD6 */
96 + };
97 +};
98 +
99 +&external_mdio {
100 + ext_rgmii_phy: ethernet-phy@7 {
101 + compatible = "ethernet-phy-ieee802.3-c22";
102 + reg = <7>;
103 + };
104 +};
105 +
106 +&emac {
107 + pinctrl-names = "default";
108 + pinctrl-0 = <&emac_rgmii_pins>;
109 + phy-supply = <&reg_gmac_3v3>;
110 + phy-handle = <&ext_rgmii_phy>;
111 + phy-mode = "rgmii-id";
112 +
113 + allwinner,leds-active-low;
114 + status = "okay";
115 +};
116 +
117 +&usb_otg {
118 + status = "okay";
119 + dr_mode = "host";
120 +};
121 --- a/board/sunxi/MAINTAINERS
122 +++ b/board/sunxi/MAINTAINERS
123 @@ -508,3 +508,9 @@ YONES TOPTECH BS1078 V2 BOARD
124 M: Peter Korsgaard <peter@korsgaard.com>
125 S: Maintained
126 F: configs/Yones_Toptech_BS1078_V2_defconfig
127 +
128 +ZEROPI BOARD
129 +M: Yu-Tung Chang <mtwget@gmail.com>
130 +S: Maintained
131 +F: configs/zeropi_defconfig
132 +F: arch/arm/dts/sun8i-h3-zeropi.dts
133 --- /dev/null
134 +++ b/configs/zeropi_defconfig
135 @@ -0,0 +1,13 @@
136 +CONFIG_ARM=y
137 +CONFIG_ARCH_SUNXI=y
138 +CONFIG_DEFAULT_DEVICE_TREE="sun8i-h3-zeropi"
139 +CONFIG_SPL=y
140 +CONFIG_MACH_SUN8I_H3=y
141 +CONFIG_DRAM_CLK=408
142 +CONFIG_MACPWR="PD6"
143 +# CONFIG_VIDEO_DE2 is not set
144 +# CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
145 +CONFIG_CONSOLE_MUX=y
146 +CONFIG_SUN8I_EMAC=y
147 +CONFIG_USB_EHCI_HCD=y
148 +CONFIG_USB_OHCI_HCD=y