arch: arm64: boot: dts: allwinner: Support Orange Pi Zero2w

This commit is contained in:
orangepi-xunlong 2023-06-15 21:29:28 +08:00
parent f23614d875
commit 9e23e4e868
3 changed files with 475 additions and 3 deletions

View File

@ -1,5 +1,6 @@
# SPDX-License-Identifier: GPL-2.0 # SPDX-License-Identifier: GPL-2.0
dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h616-orangepi-zero2.dtb dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h616-orangepi-zero2.dtb
dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h616-orangepi-zero3.dtb dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h616-orangepi-zero3.dtb
dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h616-orangepi-zero2w.dtb
subdir-y := $(dts-dirs) overlay subdir-y := $(dts-dirs) overlay

View File

@ -0,0 +1,406 @@
// SPDX-License-Identifier: (GPL-2.0+ or MIT)
/*
* Copyright (C) 2020 Arm Ltd.
*/
/dts-v1/;
#include "sun50i-h616.dtsi"
#include "sun50i-h616-cpu-opp.dtsi"
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/interrupt-controller/arm-gic.h>
#include <dt-bindings/leds/common.h>
/ {
model = "OrangePi Zero2 W";
compatible = "xunlong,orangepi-zero2w", "allwinner,sun50i-h616";
aliases {
serial0 = &uart0;
serial2 = &uart2;
serial3 = &uart3;
serial4 = &uart4;
serial5 = &uart5;
};
chosen {
stdout-path = "serial0:115200n8";
};
connector {
compatible = "hdmi-connector";
type = "d";
port {
hdmi_con_in: endpoint {
remote-endpoint = <&hdmi_out_con>;
};
};
};
leds: leds {
compatible = "gpio-leds";
led-green {
label = "green_led";
gpios = <&pio 2 13 GPIO_ACTIVE_HIGH>; /* PC13 */
linux,default-trigger = "heartbeat";
};
};
reg_vcc5v: vcc5v {
/* board wide 5V supply directly from the USB-C socket */
compatible = "regulator-fixed";
regulator-name = "vcc-5v";
regulator-min-microvolt = <5000000>;
regulator-max-microvolt = <5000000>;
regulator-always-on;
};
reg_vcc33_wifi: vcc33-wifi {
/* Always on 3.3V regulator for WiFi and BT */
compatible = "regulator-fixed";
regulator-name = "vcc33-wifi";
regulator-min-microvolt = <3300000>;
regulator-max-microvolt = <3300000>;
regulator-always-on;
vin-supply = <&reg_vcc5v>;
};
reg_vcc_wifi_io: vcc-wifi-io {
/* Always on 1.8V/300mA regulator for WiFi and BT IO */
compatible = "regulator-fixed";
regulator-name = "vcc-wifi-io";
regulator-min-microvolt = <1800000>;
regulator-max-microvolt = <1800000>;
regulator-always-on;
vin-supply = <&reg_vcc33_wifi>;
};
wifi_pwrseq: wifi-pwrseq {
compatible = "mmc-pwrseq-simple";
clocks = <&rtc 1>;
clock-names = "osc32k-out";
reset-gpios = <&pio 6 18 GPIO_ACTIVE_LOW>; /* PG18 */
post-power-on-delay-ms = <200>;
};
};
&de {
status = "okay";
};
&hdmi {
//hvcc-supply = <&reg_bldo1>;
status = "okay";
};
&hdmi_out {
hdmi_out_con: endpoint {
remote-endpoint = <&hdmi_con_in>;
};
};
&gpu {
mali-supply = <&reg_dcdc1>;
status = "disabled";
};
&emac0 {
pinctrl-names = "default";
pinctrl-0 = <&ext_rgmii_pins>;
phy-mode = "rgmii";
phy-handle = <&ext_rgmii_phy>;
allwinner,rx-delay-ps = <1800>;
allwinner,tx-delay-ps = <700>;
status = "disabled";
};
&mdio0 {
ext_rgmii_phy: ethernet-phy@1 {
compatible = "ethernet-phy-ieee802.3-c22";
reg = <1>;
motorcomm,clk-out-frequency-hz = <125000000>;
motorcomm,keep-pll-enabled;
motorcomm,auto-sleep-disabled;
};
};
&mmc0 {
vmmc-supply = <&reg_dldo1>;
cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>; /* PF6 */
bus-width = <4>;
max-frequency = <50000000>;
status = "okay";
};
&mmc1 {
vmmc-supply = <&reg_vcc33_wifi>;
vqmmc-supply = <&reg_vcc_wifi_io>;
mmc-pwrseq = <&wifi_pwrseq>;
bus-width = <4>;
non-removable;
mmc-ddr-1_8v;
status = "okay";
};
&r_i2c {
status = "okay";
axp313a: pmic@36 {
compatible = "x-powers,axp313a";
reg = <0x36>;
wakeup-source;
regulators{
reg_dcdc1: dcdc1 {
regulator-name = "axp313a-dcdc1";
regulator-min-microvolt = <500000>;
regulator-max-microvolt = <1100000>;
regulator-step-delay-us = <25>;
regulator-final-delay-us = <50>;
regulator-always-on;
};
reg_dcdc2: dcdc2 {
regulator-name = "axp313a-dcdc2";
regulator-min-microvolt = <500000>;
regulator-max-microvolt = <1200000>;
regulator-step-delay-us = <25>;
regulator-final-delay-us = <50>;
regulator-ramp-delay = <200>;
regulator-always-on;
};
reg_dcdc3: dcdc3 {
regulator-name = "axp313a-dcdc3";
regulator-min-microvolt = <1100000>;
regulator-max-microvolt = <1100000>;
regulator-step-delay-us = <25>;
regulator-final-delay-us = <50>;
regulator-always-on;
};
reg_aldo1: ldo1 {
regulator-name = "axp313a-aldo1";
regulator-min-microvolt = <1800000>;
regulator-max-microvolt = <1800000>;
regulator-step-delay-us = <25>;
regulator-final-delay-us = <50>;
regulator-always-on;
};
reg_dldo1: ldo2 {
regulator-name = "axp313a-dldo1";
regulator-min-microvolt = <3300000>;
regulator-max-microvolt = <3300000>;
regulator-step-delay-us = <25>;
regulator-final-delay-us = <50>;
regulator-always-on;
};
};
};
};
&uart0 {
pinctrl-names = "default";
pinctrl-0 = <&uart0_ph_pins>;
status = "okay";
};
&usbotg {
/*
* PHY0 pins are connected to a USB-C socket, but a role switch
* is not implemented: both CC pins are pulled to GND.
* The VBUS pins power the device, so a fixed peripheral mode
* is the best choice.
* The board can be powered via GPIOs, in this case port0 *can*
* act as a host (with a cable/adapter ignoring CC), as VBUS is
* then provided by the GPIOs. Any user of this setup would
* need to adjust the DT accordingly: dr_mode set to "host",
* enabling OHCI0 and EHCI0.
*/
dr_mode = "peripheral";
status = "okay";
};
&usbphy {
status = "okay";
};
&ehci0 {
status = "disabled";
};
&ehci1 {
status = "okay";
};
&ehci2 {
status = "okay";
};
&ehci3 {
status = "okay";
};
&ohci0 {
status = "disabled";
};
&ohci1 {
status = "okay";
};
&ohci2 {
status = "okay";
};
&ohci3 {
status = "okay";
};
&ir {
pinctrl-names = "default";
pinctrl-0 = <&ir_rx_pin>;
status = "disabled";
};
&i2c0 {
pinctrl-names = "default";
pinctrl-0 = <&i2c0_pi_pins>;
status = "disabled";
};
&i2c1 {
pinctrl-names = "default";
pinctrl-0 = <&i2c1_pi_pins>;
status = "disabled";
};
&i2c2 {
pinctrl-names = "default";
pinctrl-0 = <&i2c2_pi_pins>;
status = "disabled";
};
&i2c3 {
pinctrl-names = "default";
pinctrl-0 = <&i2c3_pins>;
status = "disabled";
};
&i2c4 {
pinctrl-names = "default";
pinctrl-0 = <&i2c4_pins>;
status = "disabled";
};
&uart2 {
pinctrl-names = "default";
pinctrl-0 = <&uart2_pi_pins>;
status = "disabled";
};
&uart3 {
pinctrl-names = "default";
pinctrl-0 = <&uart3_pi_pins>;
status = "disabled";
};
&uart4 {
pinctrl-names = "default";
pinctrl-0 = <&uart4_pi_pins>;
status = "disabled";
};
&uart5 {
pinctrl-names = "default";
pinctrl-0 = <&uart5_ph_pins>;
status = "disabled";
};
&spi0 {
status = "okay";
pinctrl-names = "default";
pinctrl-0 = <&spi0_pins>, <&spi0_cs0_pin>;
spidev@0 {
status = "disabled";
compatible = "rohm,dh2228fv";
reg = <0>;
spi-max-frequency = <1000000>;
};
flash@0 {
status = "okay";
#address-cells = <1>;
#size-cells = <1>;
compatible = "jedec,spi-nor";
reg = <0>;
spi-max-frequency = <40000000>;
};
};
&spi1 {
status = "disabled";
#address-cells = <1>;
#size-cells = <0>;
pinctrl-names = "default";
pinctrl-0 = <&spi1_pins>, <&spi1_cs1_pin>;
spidev@1 {
compatible = "rohm,dh2228fv";
status = "disabled";
reg = <1>;
spi-max-frequency = <1000000>;
};
};
&codec {
allwinner,audio-routing =
"Line Out", "LINEOUT";
status = "okay";
};
&ahub_dam_plat {
status = "okay";
};
&ahub_dam_mach {
status = "okay";
};
&ahub1_plat {
status = "okay";
};
&ahub1_mach {
status = "okay";
};
&cpu0 {
cpu-supply = <&reg_dcdc2>;
status = "okay";
};
&pwm1 {
pinctrl-names = "default";
pinctrl-0 = <&pwm1_pi_pin>;
};
&pwm2 {
pinctrl-names = "default";
pinctrl-0 = <&pwm2_pi_pin>;
};
&pwm3 {
pinctrl-names = "default";
pinctrl-0 = <&pwm3_pi_pin>;
};
&pwm4 {
pinctrl-names = "default";
pinctrl-0 = <&pwm4_pi_pin>;
};

View File

@ -356,31 +356,49 @@
drive-strength = <40>; drive-strength = <40>;
}; };
i2c0_pins: i2c0-pins { /omit-if-no-ref/
pins = "PI6", "PI7"; i2c0_pi_pins: i2c0-pi-pins {
pins = "PI5", "PI6";
function = "i2c0"; function = "i2c0";
}; };
/omit-if-no-ref/
i2c1_pins: i2c1-pins { i2c1_pins: i2c1-pins {
pins = "PH0", "PH1"; pins = "PH0", "PH1";
function = "i2c1"; function = "i2c1";
}; };
/omit-if-no-ref/
i2c1_pi_pins: i2c1-pi-pins {
pins = "PI7", "PI8";
function = "i2c1";
};
/omit-if-no-ref/
i2c2_pins: i2c2-pins { i2c2_pins: i2c2-pins {
pins = "PH2", "PH3"; pins = "PH2", "PH3";
function = "i2c2"; function = "i2c2";
}; };
/omit-if-no-ref/
i2c2_pi_pins: i2c2-pi-pins {
pins = "PI9", "PI10";
function = "i2c2";
};
/omit-if-no-ref/
i2c3_pins: i2c3-pins { i2c3_pins: i2c3-pins {
pins = "PH4", "PH5"; pins = "PH4", "PH5";
function = "i2c3"; function = "i2c3";
}; };
/omit-if-no-ref/
i2c4_pins: i2c4-pins { i2c4_pins: i2c4-pins {
pins = "PH6", "PH7"; pins = "PH6", "PH7";
function = "i2c4"; function = "i2c4";
}; };
/omit-if-no-ref/
i2s3_pins: i2s3-pins { i2s3_pins: i2s3-pins {
pins = "PH5", "PH6", "PH7", "PH8", "PH9"; pins = "PH5", "PH6", "PH7", "PH8", "PH9";
function = "i2s3"; function = "i2s3";
@ -391,31 +409,60 @@
function = "ir_rx"; function = "ir_rx";
}; };
/omit-if-no-ref/
pwm1_pin: pwm1-pin { pwm1_pin: pwm1-pin {
pins = "PH3"; pins = "PH3";
function = "pwm1"; function = "pwm1";
}; };
/omit-if-no-ref/
pwm2_pin: pwm2-pin { pwm2_pin: pwm2-pin {
pins = "PH2"; pins = "PH2";
function = "pwm2"; function = "pwm2";
}; };
/omit-if-no-ref/
pwm3_pin: pwm3-pin { pwm3_pin: pwm3-pin {
pins = "PH0"; pins = "PH0";
function = "pwm3"; function = "pwm3";
}; };
/omit-if-no-ref/
pwm4_pin: pwm4-pin { pwm4_pin: pwm4-pin {
pins = "PH1"; pins = "PH1";
function = "pwm4"; function = "pwm4";
}; };
/omit-if-no-ref/
pwm5_pin: pwm5-pin { pwm5_pin: pwm5-pin {
pins = "PA12"; pins = "PA12";
function = "pwm5"; function = "pwm5";
}; };
/omit-if-no-ref/
pwm1_pi_pin: pwm1-pi-pin {
pins = "PI11";
function = "pwm1";
};
/omit-if-no-ref/
pwm2_pi_pin: pwm2-pi-pin {
pins = "PI12";
function = "pwm2";
};
/omit-if-no-ref/
pwm3_pi_pin: pwm3-pi-pin {
pins = "PI13";
function = "pwm3";
};
/omit-if-no-ref/
pwm4_pi_pin: pwm4-pi-pin {
pins = "PI14";
function = "pwm4";
};
mmc0_pins: mmc0-pins { mmc0_pins: mmc0-pins {
pins = "PF0", "PF1", "PF2", "PF3", pins = "PF0", "PF1", "PF2", "PF3",
"PF4", "PF5"; "PF4", "PF5";
@ -508,6 +555,24 @@
function = "uart2"; function = "uart2";
}; };
/omit-if-no-ref/
uart2_pi_pins: uart2-pi-pins {
pins = "PI5", "PI6";
function = "uart2";
};
/omit-if-no-ref/
uart3_pi_pins: uart3-pi-pins {
pins = "PI9", "PI10";
function = "uart3";
};
/omit-if-no-ref/
uart4_pi_pins: uart4-pi-pins {
pins = "PI13", "PI14";
function = "uart4";
};
/omit-if-no-ref/ /omit-if-no-ref/
uart5_ph_pins: uart5-ph-pins { uart5_ph_pins: uart5-ph-pins {
pins = "PH2", "PH3"; pins = "PH2", "PH3";
@ -759,7 +824,7 @@
clocks = <&ccu CLK_BUS_I2C0>; clocks = <&ccu CLK_BUS_I2C0>;
resets = <&ccu RST_BUS_I2C0>; resets = <&ccu RST_BUS_I2C0>;
pinctrl-names = "default"; pinctrl-names = "default";
pinctrl-0 = <&i2c0_pins>; pinctrl-0 = <&i2c0_pi_pins>;
status = "disabled"; status = "disabled";
#address-cells = <1>; #address-cells = <1>;
#size-cells = <0>; #size-cells = <0>;