Skip to content

Commit 322bf10

Browse files
Andre-ARMjernejsk
authored andcommitted
arm64: dts: allwinner: h616: Split Orange Pi Zero 2 DT
The Orange Pi Zero 2 got a successor (Zero 3), which shares quite some DT nodes with the Zero 2, but comes with a different PMIC. Move the common parts (except the PMIC) into a new shared file, and include that from the existing board .dts file. No functional change, the generated DTB is the same, except for some phandle numbering differences. Signed-off-by: Andre Przywara <andre.przywara@arm.com> Acked-by: Jernej Skrabec <jernej.skrabec@gmail.com> Link: https://lore.kernel.org/r/20230804170856.1237202-2-andre.przywara@arm.com Signed-off-by: Jernej Skrabec <jernej.skrabec@gmail.com>
1 parent d0d73ee commit 322bf10

2 files changed

Lines changed: 135 additions & 118 deletions

File tree

Lines changed: 134 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,134 @@
1+
// SPDX-License-Identifier: (GPL-2.0+ or MIT)
2+
/*
3+
* Copyright (C) 2020 Arm Ltd.
4+
*
5+
* DT nodes common between Orange Pi Zero 2 and Orange Pi Zero 3.
6+
* Excludes PMIC nodes and properties, since they are different between the two.
7+
*/
8+
9+
#include "sun50i-h616.dtsi"
10+
11+
#include <dt-bindings/gpio/gpio.h>
12+
#include <dt-bindings/interrupt-controller/arm-gic.h>
13+
#include <dt-bindings/leds/common.h>
14+
15+
/ {
16+
aliases {
17+
ethernet0 = &emac0;
18+
serial0 = &uart0;
19+
};
20+
21+
chosen {
22+
stdout-path = "serial0:115200n8";
23+
};
24+
25+
leds {
26+
compatible = "gpio-leds";
27+
28+
led-0 {
29+
function = LED_FUNCTION_POWER;
30+
color = <LED_COLOR_ID_RED>;
31+
gpios = <&pio 2 12 GPIO_ACTIVE_HIGH>; /* PC12 */
32+
default-state = "on";
33+
};
34+
35+
led-1 {
36+
function = LED_FUNCTION_STATUS;
37+
color = <LED_COLOR_ID_GREEN>;
38+
gpios = <&pio 2 13 GPIO_ACTIVE_HIGH>; /* PC13 */
39+
};
40+
};
41+
42+
reg_vcc5v: vcc5v {
43+
/* board wide 5V supply directly from the USB-C socket */
44+
compatible = "regulator-fixed";
45+
regulator-name = "vcc-5v";
46+
regulator-min-microvolt = <5000000>;
47+
regulator-max-microvolt = <5000000>;
48+
regulator-always-on;
49+
};
50+
51+
reg_usb1_vbus: regulator-usb1-vbus {
52+
compatible = "regulator-fixed";
53+
regulator-name = "usb1-vbus";
54+
regulator-min-microvolt = <5000000>;
55+
regulator-max-microvolt = <5000000>;
56+
vin-supply = <&reg_vcc5v>;
57+
enable-active-high;
58+
gpio = <&pio 2 16 GPIO_ACTIVE_HIGH>; /* PC16 */
59+
};
60+
};
61+
62+
&ehci1 {
63+
status = "okay";
64+
};
65+
66+
/* USB 2 & 3 are on headers only. */
67+
68+
&emac0 {
69+
pinctrl-names = "default";
70+
pinctrl-0 = <&ext_rgmii_pins>;
71+
phy-mode = "rgmii";
72+
phy-handle = <&ext_rgmii_phy>;
73+
allwinner,rx-delay-ps = <3100>;
74+
allwinner,tx-delay-ps = <700>;
75+
status = "okay";
76+
};
77+
78+
&mdio0 {
79+
ext_rgmii_phy: ethernet-phy@1 {
80+
compatible = "ethernet-phy-ieee802.3-c22";
81+
reg = <1>;
82+
};
83+
};
84+
85+
&mmc0 {
86+
cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>; /* PF6 */
87+
bus-width = <4>;
88+
status = "okay";
89+
};
90+
91+
&ohci1 {
92+
status = "okay";
93+
};
94+
95+
&spi0 {
96+
status = "okay";
97+
pinctrl-names = "default";
98+
pinctrl-0 = <&spi0_pins>, <&spi0_cs0_pin>;
99+
100+
flash@0 {
101+
#address-cells = <1>;
102+
#size-cells = <1>;
103+
compatible = "jedec,spi-nor";
104+
reg = <0>;
105+
spi-max-frequency = <40000000>;
106+
};
107+
};
108+
109+
&uart0 {
110+
pinctrl-names = "default";
111+
pinctrl-0 = <&uart0_ph_pins>;
112+
status = "okay";
113+
};
114+
115+
&usbotg {
116+
/*
117+
* PHY0 pins are connected to a USB-C socket, but a role switch
118+
* is not implemented: both CC pins are pulled to GND.
119+
* The VBUS pins power the device, so a fixed peripheral mode
120+
* is the best choice.
121+
* The board can be powered via GPIOs, in this case port0 *can*
122+
* act as a host (with a cable/adapter ignoring CC), as VBUS is
123+
* then provided by the GPIOs. Any user of this setup would
124+
* need to adjust the DT accordingly: dr_mode set to "host",
125+
* enabling OHCI0 and EHCI0.
126+
*/
127+
dr_mode = "peripheral";
128+
status = "okay";
129+
};
130+
131+
&usbphy {
132+
usb1_vbus-supply = <&reg_usb1_vbus>;
133+
status = "okay";
134+
};

arch/arm64/boot/dts/allwinner/sun50i-h616-orangepi-zero2.dts

Lines changed: 1 addition & 118 deletions
Original file line numberDiff line numberDiff line change
@@ -5,95 +5,19 @@
55

66
/dts-v1/;
77

8-
#include "sun50i-h616.dtsi"
9-
10-
#include <dt-bindings/gpio/gpio.h>
11-
#include <dt-bindings/interrupt-controller/arm-gic.h>
12-
#include <dt-bindings/leds/common.h>
8+
#include "sun50i-h616-orangepi-zero.dtsi"
139

1410
/ {
1511
model = "OrangePi Zero2";
1612
compatible = "xunlong,orangepi-zero2", "allwinner,sun50i-h616";
17-
18-
aliases {
19-
ethernet0 = &emac0;
20-
serial0 = &uart0;
21-
};
22-
23-
chosen {
24-
stdout-path = "serial0:115200n8";
25-
};
26-
27-
leds {
28-
compatible = "gpio-leds";
29-
30-
led-0 {
31-
function = LED_FUNCTION_POWER;
32-
color = <LED_COLOR_ID_RED>;
33-
gpios = <&pio 2 12 GPIO_ACTIVE_HIGH>; /* PC12 */
34-
default-state = "on";
35-
};
36-
37-
led-1 {
38-
function = LED_FUNCTION_STATUS;
39-
color = <LED_COLOR_ID_GREEN>;
40-
gpios = <&pio 2 13 GPIO_ACTIVE_HIGH>; /* PC13 */
41-
};
42-
};
43-
44-
reg_vcc5v: vcc5v {
45-
/* board wide 5V supply directly from the USB-C socket */
46-
compatible = "regulator-fixed";
47-
regulator-name = "vcc-5v";
48-
regulator-min-microvolt = <5000000>;
49-
regulator-max-microvolt = <5000000>;
50-
regulator-always-on;
51-
};
52-
53-
reg_usb1_vbus: regulator-usb1-vbus {
54-
compatible = "regulator-fixed";
55-
regulator-name = "usb1-vbus";
56-
regulator-min-microvolt = <5000000>;
57-
regulator-max-microvolt = <5000000>;
58-
vin-supply = <&reg_vcc5v>;
59-
enable-active-high;
60-
gpio = <&pio 2 16 GPIO_ACTIVE_HIGH>; /* PC16 */
61-
};
6213
};
6314

64-
&ehci1 {
65-
status = "okay";
66-
};
67-
68-
/* USB 2 & 3 are on headers only. */
69-
7015
&emac0 {
71-
pinctrl-names = "default";
72-
pinctrl-0 = <&ext_rgmii_pins>;
73-
phy-mode = "rgmii";
74-
phy-handle = <&ext_rgmii_phy>;
7516
phy-supply = <&reg_dcdce>;
76-
allwinner,rx-delay-ps = <3100>;
77-
allwinner,tx-delay-ps = <700>;
78-
status = "okay";
79-
};
80-
81-
&mdio0 {
82-
ext_rgmii_phy: ethernet-phy@1 {
83-
compatible = "ethernet-phy-ieee802.3-c22";
84-
reg = <1>;
85-
};
8617
};
8718

8819
&mmc0 {
8920
vmmc-supply = <&reg_dcdce>;
90-
cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>; /* PF6 */
91-
bus-width = <4>;
92-
status = "okay";
93-
};
94-
95-
&ohci1 {
96-
status = "okay";
9721
};
9822

9923
&r_rsb {
@@ -211,44 +135,3 @@
211135
vcc-ph-supply = <&reg_aldo1>;
212136
vcc-pi-supply = <&reg_aldo1>;
213137
};
214-
215-
&spi0 {
216-
status = "okay";
217-
pinctrl-names = "default";
218-
pinctrl-0 = <&spi0_pins>, <&spi0_cs0_pin>;
219-
220-
flash@0 {
221-
#address-cells = <1>;
222-
#size-cells = <1>;
223-
compatible = "jedec,spi-nor";
224-
reg = <0>;
225-
spi-max-frequency = <40000000>;
226-
};
227-
};
228-
229-
&uart0 {
230-
pinctrl-names = "default";
231-
pinctrl-0 = <&uart0_ph_pins>;
232-
status = "okay";
233-
};
234-
235-
&usbotg {
236-
/*
237-
* PHY0 pins are connected to a USB-C socket, but a role switch
238-
* is not implemented: both CC pins are pulled to GND.
239-
* The VBUS pins power the device, so a fixed peripheral mode
240-
* is the best choice.
241-
* The board can be powered via GPIOs, in this case port0 *can*
242-
* act as a host (with a cable/adapter ignoring CC), as VBUS is
243-
* then provided by the GPIOs. Any user of this setup would
244-
* need to adjust the DT accordingly: dr_mode set to "host",
245-
* enabling OHCI0 and EHCI0.
246-
*/
247-
dr_mode = "peripheral";
248-
status = "okay";
249-
};
250-
251-
&usbphy {
252-
usb1_vbus-supply = <&reg_usb1_vbus>;
253-
status = "okay";
254-
};

0 commit comments

Comments
 (0)