Create sun50i-h618-orangepi-zero2w.dts

This commit is contained in:
wt
2026-01-31 23:51:32 +07:00
parent 340bc1d9b8
commit f0cad643d4
+492
View File
@@ -0,0 +1,492 @@
// 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/input/input.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;
ethernet0 = &emac1;
};
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";
};
100m_link {
label = "100m_link";
gpios = <&pio 2 15 GPIO_ACTIVE_HIGH>; /* PC15 */
default-state = "off";
};
100m_act {
label = "100m_act";
gpios = <&pio 2 16 GPIO_ACTIVE_HIGH>; /* PC16 */
default-state = "off";
};
};
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_vcc3v3: vcc3v3 {
compatible = "regulator-fixed";
regulator-name = "vcc-3v3";
regulator-min-microvolt = <3300000>;
regulator-max-microvolt = <3300000>;
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>;
};
ac200_pwm_clk: ac200_clk {
compatible = "pwm-clock";
#clock-cells = <0>;
// pwm5 period_ns = 500 > 334 for select 24M clock.
pwms = <&pwm 5 500 0>;
clock-frequency = <2000000>;
status = "okay";
};
};
&pwm5 {
// clk_bypass_output = 1 for Clock direct output without frequency division
// so pwm5 output is 24MHz for AC200 & AC300 clock
clk_bypass_output = <0x1>;
status = "okay";
};
&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";
};
&mmc0 {
vmmc-supply = <&reg_vcc3v3>;
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;
interrupt-parent = <&pio>;
interrupts = <2 9 IRQ_TYPE_LEVEL_LOW>; /* PC9 */
interrupt-controller;
#interrupt-cells = <1>;
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 = "okay";
};
&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 {
status = "okay";
pinctrl-names = "default";
pinctrl-0 = <&i2c3_pa_pins>;
ac200_x: mfd@10 {
compatible = "x-powers,ac200";
reg = <0x10>;
clocks = <&ac200_pwm_clk>;
// ephy id
nvmem-cells = <&ephy_calibration>;
nvmem-cell-names = "calibration";
ac200_ephy: phy {
compatible = "x-powers,ac200-ephy";
status = "okay";
};
};
};
&i2c4 {
pinctrl-names = "default";
pinctrl-0 = <&i2c4_ph_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>;
partition@0 {
label = "spl-uboot";
reg = <0x00000000 0x00200000>; // 2MB
};
partition@1 {
label = "uboot-env";
reg = <0x00200000 0x00020000>; // 128KB
};
partition@2 {
label = "rootfs";
reg = <0x00220000 0x00de0000>; // 13.875MB
};
};
};
&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>;
};
&emac1 {
pinctrl-names = "default";
pinctrl-0 = <&rmii_pins>;
phy-mode = "rmii";
phy-handle = <&rmii_phy>;
phy-supply = <&reg_dldo1>;
allwinner,rx-delay-ps = <3100>;
allwinner,tx-delay-ps = <700>;
status = "okay";
};
&mdio1 {
rmii_phy: ethernet-phy@1 {
compatible = "ethernet-phy-ieee802.3-c22";
reg = <1>;
};
};
&r_lradc {
vref-supply = <&reg_aldo1>;
status = "okay";
button-500 {
label = "KEY_1";
linux,code = <KEY_1>;
channel = <0>;
voltage = <500000>;
};
button-800 {
label = "KEY_ENTER";
linux,code = <KEY_ENTER>;
channel = <0>;
voltage = <800000>;
};
};