Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:yuri:tanix-tx6s
u-boot
52-add-tanix-tx6s-defconfig.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 52-add-tanix-tx6s-defconfig.patch of Package u-boot
diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile index e66c32e268..41ed32f2bc 100644 --- a/arch/arm/dts/Makefile +++ b/arch/arm/dts/Makefile @@ -764,6 +764,12 @@ dtb-$(CONFIG_MACH_SUN50I_H6) += \ sun50i-h6-tanix-tx6-mini.dtb dtb-$(CONFIG_MACH_SUN50I_H616) += \ sun50i-h616-orangepi-zero2.dtb \ + sun50i-h616-tanix-tx6s.dtb \ + sun50i-h616-tanix-tx6s-axp313.dtb \ + sun50i-h313-x96-q.dtb \ + sun50i-h313-x96-q-lpddr3.dtb \ + sun50i-h618-orangepi-zero3.dtb \ + sun50i-h618-vontar-h618.dtb \ sun50i-h616-x96-mate.dtb dtb-$(CONFIG_MACH_SUN50I) += \ sun50i-a64-amarula-relic.dtb \ diff --git a/arch/arm/dts/sun50i-h313-cpu-opp.dtsi b/arch/arm/dts/sun50i-h313-cpu-opp.dtsi new file mode 100644 index 0000000000..a429049d8c --- /dev/null +++ b/arch/arm/dts/sun50i-h313-cpu-opp.dtsi @@ -0,0 +1,91 @@ +// SPDX-License-Identifier: (GPL-2.0+ OR MIT) +// Copyright (C) 2021 Piotr Oniszczuk <piotr.oniszczuk@gmail.com> + +/* + X96-q DDR3 vendor Android DT: + 480000000 900mV + 600000000 900mV + 792000000 900mV + 1008000000 920mV + 1200000000 980mV + 1344000000 1120mV + 1416000000 1140mV + 1512000000 1160mV +*/ + +/ { + cpu_opp_table: opp-table-cpu { + compatible = "allwinner,sun50i-h616-operating-points"; + nvmem-cells = <&cpu_speed_grade>; + opp-shared; + + opp-480000000 { + clock-latency-ns = <244144>; /* 8 32k periods */ + opp-hz = /bits/ 64 <480000000>; + + opp-microvolt-speed0 = <900000 900000 1100000>; + opp-microvolt-speed1 = <900000 900000 1100000>; + opp-microvolt-speed2 = <900000 900000 1100000>; + }; + + opp-600000000 { + clock-latency-ns = <244144>; /* 8 32k periods */ + opp-hz = /bits/ 64 <600000000>; + + opp-microvolt-speed0 = <900000 900000 1100000>; + opp-microvolt-speed1 = <900000 900000 1100000>; + opp-microvolt-speed2 = <900000 900000 1100000>; + }; + + opp-792000000 { + clock-latency-ns = <244144>; /* 8 32k periods */ + opp-hz = /bits/ 64 <792000000>; + opp-microvolt-speed0 = <900000 900000 1100000>; + opp-microvolt-speed1 = <900000 900000 1100000>; + opp-microvolt-speed2 = <900000 900000 1100000>; + }; + + opp-1008000000 { + clock-latency-ns = <244144>; /* 8 32k periods */ + opp-hz = /bits/ 64 <1008000000>; + + opp-microvolt-speed0 = <920000 920000 1100000>; + opp-microvolt-speed1 = <920000 920000 1100000>; + opp-microvolt-speed2 = <920000 920000 1100000>; + }; + + opp-1200000000 { + clock-latency-ns = <244144>; /* 8 32k periods */ + opp-hz = /bits/ 64 <1200000000>; + + opp-microvolt-speed0 = <980000 980000 1100000>; + opp-microvolt-speed1 = <980000 980000 1100000>; + opp-microvolt-speed2 = <980000 980000 1100000>; + }; + + opp-1512000000 { + clock-latency-ns = <244144>; /* 8 32k periods */ + opp-hz = /bits/ 64 <1512000000>; + + opp-microvolt-speed0 = <1100000 1100000 1100000>; + opp-microvolt-speed1 = <1100000 1100000 1100000>; + opp-microvolt-speed2 = <1100000 1100000 1100000>; + }; + }; +}; + +&cpu0 { + operating-points-v2 = <&cpu_opp_table>; +}; + +&cpu1 { + operating-points-v2 = <&cpu_opp_table>; +}; + +&cpu2 { + operating-points-v2 = <&cpu_opp_table>; +}; + +&cpu3 { + operating-points-v2 = <&cpu_opp_table>; +}; diff --git a/arch/arm/dts/sun50i-h313-x96-q-lpddr3.dts b/arch/arm/dts/sun50i-h313-x96-q-lpddr3.dts new file mode 100644 index 0000000000..19e95f143d --- /dev/null +++ b/arch/arm/dts/sun50i-h313-x96-q-lpddr3.dts @@ -0,0 +1,309 @@ +// SPDX-License-Identifier: (GPL-2.0+ or MIT) +/* + * Author: piotr.oniszczuk@gmail.com + */ + +/dts-v1/; + +#include "sun50i-h616.dtsi" +#include "sun50i-h313-cpu-opp.dtsi" +#include <dt-bindings/gpio/gpio.h> +#include <dt-bindings/interrupt-controller/arm-gic.h> +#include <dt-bindings/leds/common.h> + +/ { + model = "hechuang,x96-q LPDDR3"; + compatible = "hechuang,x96-q", "allwinner,sun50i-h616"; + + aliases { + mmc0 = &mmc0; + mmc2 = &mmc2; + ethernet0 = &emac1; + ethernet1 = &wlan; + serial0 = &uart0; + }; + + chosen { + stdout-path = "serial0:115200n8"; + }; + + connector { + compatible = "hdmi-connector"; + type = "d"; + + port { + hdmi_con_in: endpoint { + remote-endpoint = <&hdmi_out_con>; + }; + }; + }; + + leds { + compatible = "gpio-leds"; + + led-red { + function = LED_FUNCTION_DISK_ACTIVITY; + color = <LED_COLOR_ID_RED>; + gpios = <&pio 7 6 GPIO_ACTIVE_HIGH>; /* PH6 */ + linux,default-trigger = "mmc0"; + }; + }; + + 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_usb1_vbus: usb1-vbus { + compatible = "regulator-fixed"; + regulator-name = "usb1-vbus"; + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>; + vin-supply = <®_vcc5v>; + enable-active-high; + /* gpio = <&pio 2 16 GPIO_ACTIVE_HIGH>; PC16 */ + status = "okay"; + }; + + reg_vcc_wifi: reg_vcc_wifi { + compatible = "regulator-fixed"; + regulator-name = "vcc-wifi"; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + gpio = <&pio 6 18 GPIO_ACTIVE_HIGH>; /* PG18 WL_REG_ON */ + regulator-always-on; + enable-active-high; + status = "okay"; + }; + + wifi_pwrseq: wifi_pwrseq { + compatible = "mmc-pwrseq-simple"; + clocks = <&rtc CLK_OSC32K_FANOUT>; + clock-names = "ext_clock"; + pinctrl-names = "default"; + pinctrl-0 = <&clk_losc>; /* PG10 with MUX3 set */ + }; +}; + +&cpu0 { + cpu-supply = <®_dcdc2>; + status = "okay"; +}; + +&de { + status = "okay"; +}; + +&ehci0 { + status = "okay"; +}; + +&ehci1 { + status = "okay"; +}; + +&ehci2 { + status = "okay"; +}; + +&ehci3 { + status = "okay"; +}; + +&hdmi { + hvcc-supply = <®_aldo1>; + status = "okay"; +}; + +&hdmi_out { + hdmi_out_con: endpoint { + remote-endpoint = <&hdmi_con_in>; + }; +}; + +&gpu { + mali-supply = <®_dcdc1>; + status = "okay"; +}; + +&emac1 { + pinctrl-names = "default"; + pinctrl-0 = <&rmii_pins>; + phy-mode = "rmii"; + phy-handle = <&rmii_phy>; + phy-supply = <®_aldo1>; + allwinner,rx-delay-ps = <3100>; + allwinner,tx-delay-ps = <700>; + status = "okay"; +}; + +&mdio1 { + rmii_phy: ethernet-phy@0 { + compatible = "ethernet-phy-ieee802.3-c22"; + reg = <0>; + }; +}; + +&mmc0 { + vmmc-supply = <®_dldo1>; + broken-cd; + bus-width = <4>; + status = "okay"; +}; + +&mmc1 { + vmmc-supply = <®_dldo1>; + vqmmc-supply = <®_vcc_wifi>; + mmc-pwrseq = <&wifi_pwrseq>; + bus-width = <4>; + non-removable; + status = "okay"; + + wlan: wifi@1 { + reg = <1>; + interrupt-parent = <&pio>; + interrupts = <6 15 IRQ_TYPE_EDGE_RISING>; /* PG15 WL_HOSTWAKE*/ + interrupt-names = "host-wake"; + local-mac-address = [dc 44 6d c0 ff 02]; + }; +}; + +&mmc2 { + vmmc-supply = <®_dldo1>; + bus-width = <8>; + non-removable; + cap-mmc-hw-reset; + status = "okay"; +}; + +&ohci0 { + status = "okay"; +}; + +&ohci1 { + status = "okay"; +}; + +&ohci2 { + status = "okay"; +}; + +&ohci3 { + status = "okay"; +}; + +&r_i2c { + status = "okay"; + + axp313a: pmic@36 { + compatible = "x-powers,axp313a"; + reg = <0x36>; + wakeup-source; + vin1-supply = <®_vcc5v>; + vin2-supply = <®_vcc5v>; + vin3-supply = <®_vcc5v>; + + regulators { + reg_dcdc1: dcdc1 { + regulator-always-on; + regulator-min-microvolt = <810000>; + regulator-max-microvolt = <1160000>; + regulator-name = "vdd-gpu"; + }; + + reg_dcdc2: dcdc2 { + regulator-always-on; + regulator-min-microvolt = <810000>; + regulator-max-microvolt = <1160000>; + regulator-name = "vdd-cpu"; + }; + + reg_dcdc3: dcdc3 { + regulator-always-on; + regulator-min-microvolt = <1200000>; + regulator-max-microvolt = <1200000>; + regulator-name = "vdd-dram"; + }; + + reg_aldo1: aldo1 { + regulator-always-on; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + regulator-name = "vcc1v8"; + }; + + reg_dldo1: dldo1 { + regulator-always-on; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + regulator-name = "vcc3v3"; + }; + }; + }; +}; + +&uart0 { + pinctrl-names = "default"; + pinctrl-0 = <&uart0_ph_pins>; + status = "okay"; +}; + +&uart1 { + pinctrl-names = "default"; + pinctrl-0 = <&uart1_pins>, <&uart1_rts_cts_pins>; + uart-has-rtscts; + status = "okay"; + + bluetooth { + compatible = "brcm,bcm43438-bt"; + clocks = <&rtc 1>; + clock-names = "lpo"; + vbat-supply = <®_dldo1>; + vddio-supply = <®_dldo1>; + device-wakeup-gpios = <&r_pio 0 6 GPIO_ACTIVE_HIGH>; /* PL6 */ + host-wakeup-gpios = <&r_pio 0 5 GPIO_ACTIVE_HIGH>; /* PL5 */ + shutdown-gpios = <&r_pio 0 4 GPIO_ACTIVE_HIGH>; /* PL4 */ + }; +}; + +&usbotg { + dr_mode = "peripheral"; + status = "okay"; +}; + +&usbphy { + usb1_vbus-supply = <®_usb1_vbus>; + status = "okay"; +}; + +&ir { + linux,rc-map-name = "rc-beelink-gs1"; + status = "okay"; +}; + +&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"; +}; + diff --git a/arch/arm/dts/sun50i-h313-x96-q.dts b/arch/arm/dts/sun50i-h313-x96-q.dts new file mode 100644 index 0000000000..2a2c89aa20 --- /dev/null +++ b/arch/arm/dts/sun50i-h313-x96-q.dts @@ -0,0 +1,367 @@ +// SPDX-License-Identifier: (GPL-2.0+ or MIT) +/* + * Author: piotr.oniszczuk@gmail.com + */ + +/dts-v1/; + +#include "sun50i-h616.dtsi" +#include "sun50i-h313-cpu-opp.dtsi" +#include <dt-bindings/gpio/gpio.h> +#include <dt-bindings/interrupt-controller/arm-gic.h> +#include <dt-bindings/leds/common.h> + +/ { + model = "hechuang,x96-q"; + compatible = "hechuang,x96-q", "allwinner,sun50i-h616"; + + aliases { + mmc0 = &mmc0; + mmc2 = &mmc2; + ethernet0 = &emac1; + ethernet1 = &wlan; + serial0 = &uart0; + }; + + chosen { + stdout-path = "serial0:115200n8"; + }; + + connector { + compatible = "hdmi-connector"; + type = "d"; + + port { + hdmi_con_in: endpoint { + remote-endpoint = <&hdmi_out_con>; + }; + }; + }; + + leds { + compatible = "gpio-leds"; + + led-red { + function = LED_FUNCTION_DISK_ACTIVITY; + color = <LED_COLOR_ID_RED>; + gpios = <&pio 7 6 GPIO_ACTIVE_HIGH>; /* PH6 */ + linux,default-trigger = "mmc0"; + }; + }; + + 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_usb1_vbus: usb1-vbus { + compatible = "regulator-fixed"; + regulator-name = "usb1-vbus"; + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>; + vin-supply = <®_vcc5v>; + enable-active-high; + /* gpio = <&pio 2 16 GPIO_ACTIVE_HIGH>; PC16 */ + status = "okay"; + }; + + reg_vcc_wifi: reg_vcc_wifi { + compatible = "regulator-fixed"; + regulator-name = "vcc-wifi"; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + gpio = <&pio 6 18 GPIO_ACTIVE_HIGH>; /* PG18 WL_REG_ON */ + regulator-always-on; + enable-active-high; + status = "okay"; + }; + + wifi_pwrseq: wifi_pwrseq { + compatible = "mmc-pwrseq-simple"; + clocks = <&rtc CLK_OSC32K_FANOUT>; + clock-names = "ext_clock"; + pinctrl-names = "default"; + pinctrl-0 = <&clk_losc>; /* PG10 with MUX3 set */ + }; +}; + +&cpu0 { + cpu-supply = <®_dcdca>; + status = "okay"; +}; + +&de { + status = "okay"; +}; + +&ehci0 { + status = "okay"; +}; + +&ehci1 { + status = "okay"; +}; + +&ehci2 { + status = "okay"; +}; + +&ehci3 { + status = "okay"; +}; + +&hdmi { + hvcc-supply = <®_bldo1>; + status = "okay"; +}; + +&hdmi_out { + hdmi_out_con: endpoint { + remote-endpoint = <&hdmi_con_in>; + }; +}; + +&gpu { + mali-supply = <®_dcdcc>; + status = "okay"; +}; + +&emac1 { + pinctrl-names = "default"; + pinctrl-0 = <&rmii_pins>; + phy-mode = "rmii"; + phy-handle = <&rmii_phy>; + phy-supply = <®_aldo1>; + allwinner,rx-delay-ps = <3100>; + allwinner,tx-delay-ps = <700>; + status = "okay"; +}; + +&mdio1 { + rmii_phy: ethernet-phy@0 { + compatible = "ethernet-phy-ieee802.3-c22"; + reg = <0>; + }; +}; + +&mmc0 { + vmmc-supply = <®_dcdce>; + broken-cd; + bus-width = <4>; + status = "okay"; +}; + +&mmc1 { + vmmc-supply = <®_dcdce>; + vqmmc-supply = <®_vcc_wifi>; + mmc-pwrseq = <&wifi_pwrseq>; + bus-width = <4>; + non-removable; + status = "okay"; + + wlan: wifi@1 { + reg = <1>; + interrupt-parent = <&pio>; + interrupts = <6 15 IRQ_TYPE_EDGE_RISING>; /* PG15 WL_HOSTWAKE*/ + interrupt-names = "host-wake"; + local-mac-address = [dc 44 6d c0 ff 02]; + }; +}; + +&mmc2 { + vmmc-supply = <®_dcdce>; + bus-width = <8>; + non-removable; + cap-mmc-hw-reset; + status = "okay"; +}; + +&ohci0 { + status = "okay"; +}; + +&ohci1 { + status = "okay"; +}; + +&ohci2 { + status = "okay"; +}; + +&ohci3 { + status = "okay"; +}; + +&r_rsb { + status = "okay"; + + axp305: pmic@745 { + compatible = "x-powers,axp305", "x-powers,axp805", + "x-powers,axp806"; + interrupt-controller; + #interrupt-cells = <1>; + reg = <0x745>; + + x-powers,self-working-mode; + vina-supply = <®_vcc5v>; + vinb-supply = <®_vcc5v>; + vinc-supply = <®_vcc5v>; + vind-supply = <®_vcc5v>; + vine-supply = <®_vcc5v>; + aldoin-supply = <®_vcc5v>; + bldoin-supply = <®_vcc5v>; + cldoin-supply = <®_vcc5v>; + + regulators { + reg_aldo1: aldo1 { + regulator-always-on; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + regulator-name = "vcc-sys"; + }; + + reg_aldo2: aldo2 { /* 3.3V on headers */ + regulator-always-on; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + regulator-name = "vcc3v3-ext"; + }; + + reg_aldo3: aldo3 { /* 3.3V on headers */ + regulator-always-on; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + regulator-name = "vcc3v3-ext2"; + }; + + reg_bldo1: bldo1 { + regulator-always-on; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + regulator-name = "vcc1v8"; + }; + + bldo2 { + /* unused */ + }; + + bldo3 { + /* unused */ + }; + + bldo4 { + /* unused */ + }; + + cldo1 { + /* reserved */ + }; + + cldo2 { + /* unused */ + }; + + cldo3 { + /* unused */ + }; + + reg_dcdca: dcdca { + regulator-always-on; + regulator-min-microvolt = <810000>; + regulator-max-microvolt = <1160000>; + regulator-name = "vdd-cpu"; + }; + + reg_dcdcc: dcdcc { + regulator-always-on; + regulator-min-microvolt = <810000>; + regulator-max-microvolt = <1160000>; + regulator-name = "vdd-gpu-sys"; + }; + + reg_dcdcd: dcdcd { + regulator-always-on; + regulator-min-microvolt = <1500000>; + regulator-max-microvolt = <1500000>; + regulator-name = "vdd-dram"; + }; + + reg_dcdce: dcdce { + regulator-always-on; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + regulator-name = "vcc-eth-mmc"; + }; + + sw { + /* unused */ + }; + }; + }; +}; + +&uart0 { + pinctrl-names = "default"; + pinctrl-0 = <&uart0_ph_pins>; + status = "okay"; +}; + +&uart1 { + pinctrl-names = "default"; + pinctrl-0 = <&uart1_pins>, <&uart1_rts_cts_pins>; + uart-has-rtscts; + status = "okay"; + + bluetooth { + compatible = "brcm,bcm43438-bt"; + clocks = <&rtc 1>; + clock-names = "lpo"; + vbat-supply = <®_dcdce>; + vddio-supply = <®_dcdce>; + device-wakeup-gpios = <&r_pio 0 6 GPIO_ACTIVE_HIGH>; /* PL6 */ + host-wakeup-gpios = <&r_pio 0 5 GPIO_ACTIVE_HIGH>; /* PL5 */ + shutdown-gpios = <&r_pio 0 4 GPIO_ACTIVE_HIGH>; /* PL4 */ + }; +}; + +&usbotg { + dr_mode = "peripheral"; + status = "okay"; +}; + +&usbphy { + usb1_vbus-supply = <®_usb1_vbus>; + status = "okay"; +}; + +&ir { + linux,rc-map-name = "rc-beelink-gs1"; + status = "okay"; +}; + +&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"; +}; + diff --git a/arch/arm/dts/sun50i-h6-beelink-gs1.dts b/arch/arm/dts/sun50i-h6-beelink-gs1.dts index d6897ec979..73e4f20b0e 100644 --- a/arch/arm/dts/sun50i-h6-beelink-gs1.dts +++ b/arch/arm/dts/sun50i-h6-beelink-gs1.dts @@ -119,6 +119,14 @@ }; }; +&sound_hdmi { + status = "okay"; +}; + +&i2s1 { + status = "okay"; +}; + &mdio { ext_rgmii_phy: ethernet-phy@1 { compatible = "ethernet-phy-ieee802.3-c22"; @@ -138,6 +146,7 @@ vqmmc-supply = <®_bldo2>; non-removable; cap-mmc-hw-reset; + mmc-hs200-1_8v; bus-width = <8>; status = "okay"; }; @@ -256,7 +265,7 @@ reg_dcdca: dcdca { regulator-always-on; regulator-min-microvolt = <810000>; - regulator-max-microvolt = <1160000>; + regulator-max-microvolt = <1200000>; regulator-ramp-delay = <2500>; regulator-name = "vdd-cpu"; }; diff --git a/arch/arm/dts/sun50i-h6-eachlink-h6mini.dts b/arch/arm/dts/sun50i-h6-eachlink-h6mini.dts new file mode 100644 index 0000000000..1d8076eda9 --- /dev/null +++ b/arch/arm/dts/sun50i-h6-eachlink-h6mini.dts @@ -0,0 +1,236 @@ +// SPDX-License-Identifier: (GPL-2.0+ or MIT) +/* + * Author: piotr.oniszczuk@gmail.com based on Jernej Skrabec <jernej.skrabec@siol.net> work. + */ + +/dts-v1/; + +#include "sun50i-h6.dtsi" + +#include <dt-bindings/gpio/gpio.h> +#include "sun50i-h6-cpu-opp.dtsi" +#include "sun50i-h6-gpu-opp.dtsi" + +/ { + model = "Eachlink H6 Mini"; + compatible = "eachlink,h6mini", "allwinner,sun50i-h6"; + + aliases { + serial0 = &uart0; + ethernet0 = &emac; + ethernet1 = &rtl8723bs; + }; + + chosen { + stdout-path = "serial0:115200n8"; + }; + + connector { + compatible = "hdmi-connector"; + ddc-en-gpios = <&pio 7 2 GPIO_ACTIVE_HIGH>; /* PH2 */ + type = "a"; + + port { + hdmi_con_in: endpoint { + remote-endpoint = <&hdmi_out_con>; + }; + }; + }; + + reg_vcc3v3: vcc3v3 { + compatible = "regulator-fixed"; + regulator-name = "vcc3v3"; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + }; + + reg_vcc33_wifi: vcc33-wifi { + compatible = "regulator-fixed"; + regulator-name = "vcc33-wifi"; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + regulator-always-on; + enable-active-high; + }; + + reg_vcccpu: vcccpu { + compatible = "regulator-fixed"; + regulator-name = "vcccpu"; + regulator-min-microvolt = <1200000>; + regulator-max-microvolt = <1200000>; + regulator-always-on; + }; + + reg_dcdcc: dcdcc { + compatible = "regulator-fixed"; + regulator-name = "vdd-gpu"; + regulator-min-microvolt = <1080000>; + regulator-max-microvolt = <1080000>; + regulator-always-on; + }; + + wifi_pwrseq: wifi_pwrseq { + compatible = "mmc-pwrseq-simple"; + reset-gpios = <&r_pio 1 3 GPIO_ACTIVE_LOW>; /* PM3 */ + }; + + openvfd { + compatible = "open,vfd"; + dev_name = "openvfd"; + openvfd_gpio_clk = <&pio 3 25 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>; /* PD25 */ + openvfd_gpio_dat = <&pio 3 26 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>; /* PD26 */ + vfd_gpio_chip_name = "300b000.pinctrl"; + openvfd_chars = [00 01 02 03 04]; + openvfd_dot_bits = [00 01 02 03 04 05 06]; + openvfd_display_type = <0x03010001>; + status = "okay"; + }; +}; + +&cpu0 { + cpu-supply = <®_vcccpu>; +}; + +&ac200_pwm_clk { + status = "okay"; +}; + +&de { + status = "okay"; +}; + +&hdmi { + status = "okay"; +}; + +&hdmi_out { + hdmi_out_con: endpoint { + remote-endpoint = <&hdmi_con_in>; + }; +}; + +&sound_hdmi { + status = "okay"; +}; + +&dwc3 { + status = "okay"; +}; + +&ehci0 { + status = "okay"; +}; + +&ehci3 { + status = "okay"; +}; + +&emac { + pinctrl-names = "default"; + pinctrl-0 = <&ext_rmii_pins>; + phy-mode = "rmii"; + phy-handle = <&ext_rmii_phy>; + status = "okay"; +}; + +&i2c3 { + status = "okay"; +}; + +&mdio { + ext_rmii_phy: ethernet-phy@1 { + compatible = "ethernet-phy-ieee802.3-c22"; + reg = <1>; + }; +}; + +&i2s1 { + status = "okay"; +}; + +&mmc0 { + vmmc-supply = <®_vcc3v3>; + cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>; + bus-width = <4>; + status = "okay"; +}; + +&mmc1 { + vmmc-supply = <®_vcc3v3>; + vqmmc-supply = <®_vcc33_wifi>; + mmc-pwrseq = <&wifi_pwrseq>; + bus-width = <4>; + non-removable; + status = "okay"; + + rtl8723bs: wifi@1 { + reg = <1>; + interrupt-parent = <&r_pio>; + interrupts = <1 0 IRQ_TYPE_LEVEL_LOW>; /* PM0 */ + interrupt-names = "host-wake"; + }; +}; + +&mmc2 { + vmmc-supply = <®_vcc3v3>; + vqmmc-supply = <®_vcc3v3>; + non-removable; + cap-mmc-hw-reset; + max-frequency = <35000000>; + bus-width = <8>; + status = "okay"; +}; + +&ohci0 { + status = "okay"; +}; + +&ohci3 { + status = "okay"; +}; + +&pwm { + status = "okay"; +}; + +&r_ir { + linux,rc-map-name = "rc-beelink-gs1"; + status = "okay"; +}; + +&uart0 { + pinctrl-names = "default"; + pinctrl-0 = <&uart0_ph_pins>; + status = "okay"; +}; + +&uart1 { + pinctrl-names = "default"; + pinctrl-0 = <&uart1_pins>, <&uart1_rts_cts_pins>; + status = "okay"; + + bluetooth { + compatible = "realtek,rtl8723cs-bt"; + device-wake-gpios = <&r_pio 1 2 GPIO_ACTIVE_LOW>; /* PM2 */ + enable-gpios = <&r_pio 1 4 GPIO_ACTIVE_HIGH>; /* PM4 */ + host-wake-gpios = <&r_pio 1 1 GPIO_ACTIVE_HIGH>; /* PM1 */ + }; +}; + +&usb2otg { + dr_mode = "host"; + status = "okay"; +}; + +&usb2phy { + status = "okay"; +}; + +&usb3phy { + status = "okay"; +}; + +&gpu { + mali-supply = <®_dcdcc>; + status = "okay"; +}; diff --git a/arch/arm/dts/sun50i-h6-gpu-opp.dtsi b/arch/arm/dts/sun50i-h6-gpu-opp.dtsi index b48049c4fc..5ce054b3e9 100644 --- a/arch/arm/dts/sun50i-h6-gpu-opp.dtsi +++ b/arch/arm/dts/sun50i-h6-gpu-opp.dtsi @@ -10,66 +10,21 @@ opp-microvolt = <810000 810000 1200000>; }; - opp-264000000 { - opp-hz = /bits/ 64 <264000000>; - opp-microvolt = <810000 810000 1200000>; - }; - opp-312000000 { opp-hz = /bits/ 64 <312000000>; opp-microvolt = <810000 810000 1200000>; }; - opp-336000000 { - opp-hz = /bits/ 64 <336000000>; - opp-microvolt = <810000 810000 1200000>; - }; - - opp-360000000 { - opp-hz = /bits/ 64 <360000000>; - opp-microvolt = <820000 820000 1200000>; - }; - - opp-384000000 { - opp-hz = /bits/ 64 <384000000>; - opp-microvolt = <830000 830000 1200000>; - }; - opp-408000000 { opp-hz = /bits/ 64 <408000000>; opp-microvolt = <840000 840000 1200000>; }; - opp-420000000 { - opp-hz = /bits/ 64 <420000000>; - opp-microvolt = <850000 850000 1200000>; - }; - - opp-432000000 { - opp-hz = /bits/ 64 <432000000>; - opp-microvolt = <860000 860000 1200000>; - }; - - opp-456000000 { - opp-hz = /bits/ 64 <456000000>; - opp-microvolt = <870000 870000 1200000>; - }; - opp-504000000 { opp-hz = /bits/ 64 <504000000>; opp-microvolt = <890000 890000 1200000>; }; - opp-540000000 { - opp-hz = /bits/ 64 <540000000>; - opp-microvolt = <910000 910000 1200000>; - }; - - opp-576000000 { - opp-hz = /bits/ 64 <576000000>; - opp-microvolt = <930000 930000 1200000>; - }; - opp-624000000 { opp-hz = /bits/ 64 <624000000>; opp-microvolt = <950000 950000 1200000>; diff --git a/arch/arm/dts/sun50i-h6-orangepi-3-lts.dts b/arch/arm/dts/sun50i-h6-orangepi-3-lts.dts new file mode 100644 index 0000000000..f2f7aea0c2 --- /dev/null +++ b/arch/arm/dts/sun50i-h6-orangepi-3-lts.dts @@ -0,0 +1,412 @@ +// SPDX-License-Identifier: (GPL-2.0+ OR MIT) +// Developed by <piotr.oniszczuk@gmail.com> +// based on OndÅ™ej Jirman <megous@megous.com> work + +/dts-v1/; + +#include "sun50i-h6.dtsi" +#include "sun50i-h6-cpu-opp.dtsi" +#include "sun50i-h6-gpu-opp.dtsi" +#include <dt-bindings/leds/common.h> +#include <dt-bindings/gpio/gpio.h> + +/ { + model = "OrangePi 3 LTS"; + compatible = "xunlong,orangepi-3-lts", "allwinner,sun50i-h6"; + + aliases { + mmc0 = &mmc0; + mmc1 = &mmc1; + mmc2 = &mmc2; + serial0 = &uart0; + serial1 = &uart1; + ethernet0 = &emac; + }; + + chosen { + stdout-path = "serial0:115200n8"; + }; + + connector { + compatible = "hdmi-connector"; + ddc-en-gpios = <&pio 7 2 GPIO_ACTIVE_HIGH>; /* PH2 */ + type = "a"; + + port { + hdmi_con_in: endpoint { + remote-endpoint = <&hdmi_out_con>; + }; + }; + }; + + ext_osc32k: ext_osc32k_clk { + #clock-cells = <0>; + compatible = "fixed-clock"; + clock-frequency = <32768>; + clock-output-names = "ext_osc32k"; + }; + + leds { + compatible = "gpio-leds"; + + led-0 { + function = LED_FUNCTION_DISK_ACTIVITY; + label = "orangepi:red:mmc0"; + gpios = <&r_pio 0 4 GPIO_ACTIVE_HIGH>; /* PL4 */ + linux,default-trigger = "mmc0"; + }; + + led-1 { + function = LED_FUNCTION_STATUS; + label = "orangepi:green:status"; + gpios = <&r_pio 0 7 GPIO_ACTIVE_HIGH>; /* PL7 */ + linux,default-trigger = "heartbeat"; + }; + }; + + reg_vcc5v: vcc5v { + /* board wide 5V supply directly from the DC jack */ + compatible = "regulator-fixed"; + regulator-name = "vcc-5v"; + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>; + regulator-always-on; + }; + + reg_gmac_2v5: gmac-2v5 { + compatible = "regulator-fixed"; + regulator-name = "gmac-2v5"; + regulator-min-microvolt = <2500000>; + regulator-max-microvolt = <2500000>; + enable-active-high; + gpio = <&pio 3 6 GPIO_ACTIVE_HIGH>; /* PD6 */ + }; + + reg_vcc33_wifi: vcc33-wifi { + compatible = "regulator-fixed"; + regulator-name = "vcc33-wifi"; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + regulator-always-on; + gpio = <&pio 7 7 GPIO_ACTIVE_HIGH>; /* PH7 */ + vin-supply = <®_vcc5v>; + }; + + reg_vcc_wifi_io: vcc-wifi-io { + compatible = "regulator-fixed"; + regulator-name = "vcc-wifi-io"; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + regulator-always-on; + vin-supply = <®_vcc33_wifi>; + }; + + wifi_pwrseq: wifi-pwrseq { + compatible = "mmc-pwrseq-simple"; + clocks = <&rtc CLK_OSC32K_FANOUT>; + clock-names = "ext_clock"; + reset-gpios = <&r_pio 1 3 GPIO_ACTIVE_LOW>; /* PM3 */ + post-power-on-delay-ms = <200>; + }; +}; + +&cpu0 { + cpu-supply = <®_dcdca>; +}; + +&de { + status = "okay"; +}; + +&dwc3 { + status = "okay"; +}; + +&ehci0 { + status = "okay"; +}; + +&ehci3 { + status = "okay"; +}; + +&gpu { + mali-supply = <®_dcdcc>; + status = "okay"; +}; + +&hdmi { + status = "okay"; +}; + +&hdmi_out { + hdmi_out_con: endpoint { + remote-endpoint = <&hdmi_con_in>; + }; +}; + +&emac { + pinctrl-names = "default"; + pinctrl-0 = <&ext_rgmii_pins>; + phy-mode = "rgmii"; + phy-handle = <&ext_rgmii_phy>; + /* + * The board uses 2.5V RGMII signalling. Power sequence to enable + * the phy is to enable GMAC-2V5 and GMAC-3V (aldo2) power rails + * at the same time and to wait 100ms. The driver enables phy-io + * first. Delay is achieved with enable-ramp-delay on reg_aldo2. + */ + phy-supply = <®_aldo2>; + phy-io-supply = <®_gmac_2v5>; + allwinner,rx-delay-ps = <1500>; + allwinner,tx-delay-ps = <700>; + status = "okay"; +}; + +&mdio { + ext_rgmii_phy: ethernet-phy@1 { + compatible = "ethernet-phy-ieee802.3-c22"; + reg = <1>; + motorcomm,clk-out-frequency-hz = <125000000>; + reset-gpios = <&pio 3 14 GPIO_ACTIVE_LOW>; /* PD14 */ + reset-assert-us = <15000>; + reset-deassert-us = <40000>; + }; +}; + +&mmc0 { + vmmc-supply = <®_cldo1>; + cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>; /* PF6 */ + bus-width = <4>; + status = "okay"; +}; + +&mmc1 { + vmmc-supply = <®_vcc33_wifi>; + vqmmc-supply = <®_vcc_wifi_io>; + mmc-pwrseq = <&wifi_pwrseq>; + bus-width = <4>; + non-removable; + mmc-ddr-1_8v; + status = "okay"; + + wifi: wifi@1 { + reg = <1>; + }; +}; + +&mmc2 { + vmmc-supply = <®_cldo1>; + vqmmc-supply = <®_bldo2>; + cap-mmc-hw-reset; + non-removable; + bus-width = <8>; + status = "okay"; +}; + +&ohci0 { + status = "okay"; +}; + +&ohci3 { + status = "okay"; +}; + +&pio { + vcc-pc-supply = <®_bldo2>; + vcc-pd-supply = <®_cldo1>; + vcc-pg-supply = <®_bldo3>; + vcc-pg-supply = <®_vcc_wifi_io>; +}; + +&r_ir { + linux,rc-map-name = "rc-beelink-gs1"; + status = "okay"; +}; + +&r_pio { + vcc-pm-supply = <®_bldo3>; +}; + +&r_rsb { + status = "okay"; + clock-frequency = <100000>; + + axp805: pmic@745 { + compatible = "x-powers,axp805", "x-powers,axp806"; + reg = <0x745>; + interrupt-parent = <&r_intc>; + interrupts = <GIC_SPI 96 IRQ_TYPE_LEVEL_LOW>; + interrupt-controller; + #interrupt-cells = <1>; + x-powers,self-working-mode; + vina-supply = <®_vcc5v>; + vinb-supply = <®_vcc5v>; + vinc-supply = <®_vcc5v>; + vind-supply = <®_vcc5v>; + vine-supply = <®_vcc5v>; + aldoin-supply = <®_vcc5v>; + bldoin-supply = <®_vcc5v>; + cldoin-supply = <®_vcc5v>; + + regulators { + reg_aldo1: aldo1 { + regulator-always-on; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + regulator-name = "vcc-pl-led-ir"; + }; + + reg_aldo2: aldo2 { + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + regulator-name = "vcc33-audio-tv-ephy-mac"; + regulator-enable-ramp-delay = <200000>; + }; + + /* ALDO3 is shorted to CLDO1 */ + reg_aldo3: aldo3 { + regulator-always-on; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + regulator-name = "vcc33-io-pd-emmc-sd-usb-uart-1"; + }; + + reg_bldo1: bldo1 { + regulator-always-on; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + regulator-name = "vcc18-dram-bias-pll"; + }; + + reg_bldo2: bldo2 { + regulator-always-on; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + regulator-name = "vcc-efuse-pcie-hdmi-pc"; + }; + + reg_bldo3: bldo3 { + regulator-always-on; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + regulator-name = "vcc-dcxoio"; + }; + + reg_cldo1: cldo1 { + regulator-always-on; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + regulator-name = "vcc33-io-pd-emmc-sd-usb-uart-2"; + }; + + reg_cldo2: cldo2 { + /* + * This regulator is connected with CLDO3. + * Before the kernel can support synchronized + * enable of coupled regulators, keep them + * both always on as a ugly hack. + */ + regulator-always-on; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + regulator-name = "vcc-wifi-1"; + }; + + cldo3 { + /* + * This regulator is connected with CLDO2. + * See the comments for CLDO2. + */ + regulator-always-on; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + regulator-name = "vcc-wifi-2"; + }; + + reg_dcdca: dcdca { + regulator-always-on; + regulator-min-microvolt = <810000>; + regulator-max-microvolt = <1200000>; + regulator-name = "vdd-cpu"; + }; + + reg_dcdcc: dcdcc { + regulator-enable-ramp-delay = <32000>; + regulator-min-microvolt = <810000>; + regulator-max-microvolt = <1080000>; + regulator-ramp-delay = <2500>; + regulator-name = "vdd-gpu"; + }; + + reg_dcdcd: dcdcd { + regulator-always-on; + regulator-min-microvolt = <960000>; + regulator-max-microvolt = <960000>; + regulator-name = "vdd-sys"; + }; + + reg_dcdce: dcdce { + regulator-always-on; + regulator-min-microvolt = <1200000>; + regulator-max-microvolt = <1200000>; + regulator-name = "vcc-dram"; + }; + + sw { + /* unused */ + }; + }; + }; +}; + +&rtc { + clocks = <&ext_osc32k>; +}; + +&uart0 { + pinctrl-names = "default"; + pinctrl-0 = <&uart0_ph_pins>; + status = "okay"; +}; + +&uart1 { + pinctrl-names = "default"; + pinctrl-0 = <&uart1_pins>, <&uart1_rts_cts_pins>; + uart-has-rtscts; + //status = "okay"; + status = "disabled"; + + bluetooth { + compatible = "brcm,bcm43438-bt"; + clocks = <&rtc CLK_OSC32K_FANOUT>; + clock-names = "lpo"; + vbat-supply = <®_vcc33_wifi>; + vddio-supply = <®_vcc_wifi_io>; + device-wakeup-gpios = <&r_pio 1 2 GPIO_ACTIVE_HIGH>; /* PM2 */ + host-wakeup-gpios = <&r_pio 1 1 GPIO_ACTIVE_HIGH>; /* PM1 */ + shutdown-gpios = <&r_pio 1 4 GPIO_ACTIVE_HIGH>; /* PM4 */ + max-speed = <115200>; + }; +}; + +&usb2otg { + /* + * This board doesn't have a controllable VBUS even though it + * does have an ID pin. Using it as anything but a USB host is + * unsafe. + */ + dr_mode = "host"; + status = "okay"; +}; + +&usb2phy { + usb0_id_det-gpios = <&pio 2 15 GPIO_ACTIVE_HIGH>; /* PC15 */ + usb0_vbus-supply = <®_vcc5v>; + usb3_vbus-supply = <®_vcc5v>; + status = "okay"; +}; + +&usb3phy { + status = "okay"; +}; diff --git a/arch/arm/dts/sun50i-h6-orangepi-3.dts b/arch/arm/dts/sun50i-h6-orangepi-3.dts index f1957bb1ed..14e51e2902 100644 --- a/arch/arm/dts/sun50i-h6-orangepi-3.dts +++ b/arch/arm/dts/sun50i-h6-orangepi-3.dts @@ -5,6 +5,7 @@ #include "sun50i-h6.dtsi" #include "sun50i-h6-cpu-opp.dtsi" +#include "sun50i-h6-gpu-opp.dtsi" #include <dt-bindings/gpio/gpio.h> @@ -15,6 +16,7 @@ aliases { serial0 = &uart0; serial1 = &uart1; + ethernet0 = &emac; }; chosen { @@ -64,26 +66,15 @@ regulator-always-on; }; - reg_vcc33_wifi: vcc33-wifi { - /* Always on 3.3V regulator for WiFi and BT */ + reg_gmac_2v5: gmac-2v5 { compatible = "regulator-fixed"; - regulator-name = "vcc33-wifi"; - regulator-min-microvolt = <3300000>; - regulator-max-microvolt = <3300000>; - regulator-always-on; - vin-supply = <®_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 = <®_vcc33_wifi>; + regulator-name = "gmac-2v5"; + regulator-min-microvolt = <2500000>; + regulator-max-microvolt = <2500000>; + enable-active-high; + gpio = <&pio 3 6 GPIO_ACTIVE_HIGH>; /* PD6 */ }; - + wifi_pwrseq: wifi-pwrseq { compatible = "mmc-pwrseq-simple"; clocks = <&rtc CLK_OSC32K_FANOUT>; @@ -128,6 +119,35 @@ }; }; +&emac { + pinctrl-names = "default"; + pinctrl-0 = <&ext_rgmii_pins>; + phy-mode = "rgmii-txid"; + phy-handle = <&ext_rgmii_phy>; + /* + * The board uses 2.5V RGMII signalling. Power sequence to enable + * the phy is to enable GMAC-2V5 and GMAC-3V (aldo2) power rails + * at the same time and to wait 100ms. The driver enables phy-io + * first. Delay is achieved with enable-ramp-delay on reg_aldo2. + */ + phy-supply = <®_aldo2>; + phy-io-supply = <®_gmac_2v5>; + allwinner,rx-delay-ps = <1500>; + allwinner,tx-delay-ps = <700>; + status = "okay"; +}; + +&mdio { + ext_rgmii_phy: ethernet-phy@1 { + compatible = "ethernet-phy-ieee802.3-c22"; + reg = <1>; + + reset-gpios = <&pio 3 14 GPIO_ACTIVE_LOW>; /* PD14 */ + reset-assert-us = <15000>; + reset-deassert-us = <40000>; + }; +}; + &mmc0 { vmmc-supply = <®_cldo1>; cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>; /* PF6 */ @@ -136,8 +156,8 @@ }; &mmc1 { - vmmc-supply = <®_vcc33_wifi>; - vqmmc-supply = <®_vcc_wifi_io>; + vmmc-supply = <®_cldo2>; + vqmmc-supply = <®_bldo3>; mmc-pwrseq = <&wifi_pwrseq>; bus-width = <4>; non-removable; @@ -172,13 +192,17 @@ &pio { vcc-pc-supply = <®_bldo2>; vcc-pd-supply = <®_cldo1>; - vcc-pg-supply = <®_vcc_wifi_io>; + vcc-pg-supply = <®_bldo3>; }; &r_ir { status = "okay"; }; +&r_pio { + vcc-pm-supply = <®_bldo3>; +}; + &r_rsb { status = "okay"; @@ -211,6 +235,7 @@ regulator-min-microvolt = <3300000>; regulator-max-microvolt = <3300000>; regulator-name = "vcc33-audio-tv-ephy-mac"; + regulator-enable-ramp-delay = <100000>; }; /* ALDO3 is shorted to CLDO1 */ @@ -234,13 +259,12 @@ regulator-max-microvolt = <1800000>; regulator-name = "vcc-efuse-pcie-hdmi-pc"; }; - - bldo3 { - /* unused */ - }; - - bldo4 { - /* unused */ + + reg_bldo3: bldo3 { + regulator-always-on; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + regulator-name = "vcc-dcxoio"; }; reg_cldo1: cldo1 { @@ -250,19 +274,34 @@ regulator-name = "vcc33-io-pd-emmc-sd-usb-uart-2"; }; - cldo2 { - /* unused */ + reg_cldo2: cldo2 { + /* + * This regulator is connected with CLDO3. + * Before the kernel can support synchronized + * enable of coupled regulators, keep them + * both always on as a ugly hack. + */ + regulator-always-on; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + regulator-name = "vcc-wifi-1"; }; cldo3 { - /* unused */ + /* + * This regulator is connected with CLDO2. + * See the comments for CLDO2. + */ + regulator-always-on; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + regulator-name = "vcc-wifi-2"; }; reg_dcdca: dcdca { regulator-always-on; - regulator-min-microvolt = <800000>; - regulator-max-microvolt = <1160000>; - regulator-ramp-delay = <2500>; + regulator-min-microvolt = <810000>; + regulator-max-microvolt = <1080000>; regulator-name = "vdd-cpu"; }; diff --git a/arch/arm/dts/sun50i-h6-orangepi.dtsi b/arch/arm/dts/sun50i-h6-orangepi.dtsi index a5811d55bb..b5f3d6dcd5 100644 --- a/arch/arm/dts/sun50i-h6-orangepi.dtsi +++ b/arch/arm/dts/sun50i-h6-orangepi.dtsi @@ -5,6 +5,7 @@ /dts-v1/; #include "sun50i-h6.dtsi" +#include "sun50i-h6-gpu-opp.dtsi" #include <dt-bindings/gpio/gpio.h> diff --git a/arch/arm/dts/sun50i-h6-pine-h64.dts b/arch/arm/dts/sun50i-h6-pine-h64.dts index b868ad17af..99eff3eee5 100644 --- a/arch/arm/dts/sun50i-h6-pine-h64.dts +++ b/arch/arm/dts/sun50i-h6-pine-h64.dts @@ -5,6 +5,7 @@ #include "sun50i-h6.dtsi" #include "sun50i-h6-cpu-opp.dtsi" +#include "sun50i-h6-gpu-opp.dtsi" #include <dt-bindings/gpio/gpio.h> diff --git a/arch/arm/dts/sun50i-h6-tanix-tx6-a.dts b/arch/arm/dts/sun50i-h6-tanix-tx6-a.dts new file mode 100644 index 0000000000..019eb85592 --- /dev/null +++ b/arch/arm/dts/sun50i-h6-tanix-tx6-a.dts @@ -0,0 +1,112 @@ +// SPDX-License-Identifier: (GPL-2.0+ OR MIT) +// Copyright (c) 2019 Jernej Skrabec <jernej.skrabec@siol.net> Piotr Oniszczuk <piotr.oniszczuk@gmail.com> + +/dts-v1/; + +#include "sun50i-h6-tanix.dtsi" + +/ { + model = "Tanix TX6-A"; + compatible = "oranth,tanix-tx6", "allwinner,sun50i-h6"; + + aliases { + ethernet0 = &emac; + ethernet1 = &wifi; + }; + + reg_vcc33_wifi: vcc33-wifi { + compatible = "regulator-fixed"; + regulator-name = "vcc33-wifi"; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + gpio = <&pio 7 4 GPIO_ACTIVE_HIGH>; /* PH4 */ + regulator-always-on; + enable-active-high; + }; + + reg_vdd_cpu: vdd-cpu { + compatible = "regulator-fixed"; + regulator-name = "vdd-cpu"; + regulator-min-microvolt = <1200000>; + regulator-max-microvolt = <1200000>; + }; + + openvfd { + compatible = "open,vfd"; + dev_name = "openvfd"; + openvfd_gpio_clk = <&pio 7 5 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>; /* PH5 */ + openvfd_gpio_dat = <&pio 7 6 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>; /* PH6 */ + vfd_gpio_chip_name = "300b000.pinctrl"; + openvfd_chars = [02 04 03 02 01]; + openvfd_dot_bits = [00 01 03 02 04 05 06]; + openvfd_display_type = <0x03000001>; + status = "okay"; + }; +}; + +&cpu0 { + cpu-supply = <®_vdd_cpu>; +}; + +&r_ir { + linux,rc-map-name = "rc-tanix-tx3mini"; +}; + +&uart1 { + pinctrl-names = "default"; + pinctrl-0 = <&uart1_pins>, <&uart1_rts_cts_pins>; + uart-has-rtscts; + status = "okay"; + + bluetooth { + compatible = "realtek,rtl8822cs-bt"; + device-wake-gpios = <&r_pio 1 2 GPIO_ACTIVE_HIGH>; /* PM2 */ + host-wake-gpios = <&r_pio 1 1 GPIO_ACTIVE_HIGH>; /* PM1 */ + enable-gpios = <&r_pio 1 4 GPIO_ACTIVE_HIGH>; /* PM4 */ + }; +}; + +&ac200_pwm_clk { + status = "okay"; +}; + +&emac { + pinctrl-names = "default"; + pinctrl-0 = <&ext_rmii_pins>; + phy-mode = "rmii"; + phy-handle = <&ext_rmii_phy>; + status = "okay"; +}; + +&i2c3 { + status = "okay"; +}; + +&mdio { + ext_rmii_phy: ethernet-phy@1 { + compatible = "ethernet-phy-ieee802.3-c22"; + reg = <1>; + }; +}; + +&pwm { + status = "okay"; +}; + +&mmc1 { + vmmc-supply = <®_vcc3v3>; + vqmmc-supply = <®_vcc33_wifi>; + mmc-pwrseq = <&wifi_pwrseq>; + bus-width = <4>; + non-removable; + status = "okay"; + + wifi: sdio_wifi@1 { + reg = <1>; + interrupt-parent = <&r_pio>; + interrupts = <1 0 IRQ_TYPE_EDGE_RISING>; /* PM0 */ + interrupt-names = "host-wake"; + local-mac-address = [dc 44 6d c0 ff 01]; + keep-power-in-suspend; + }; +}; diff --git a/arch/arm/dts/sun50i-h6-tanix-tx6-mini.dts b/arch/arm/dts/sun50i-h6-tanix-tx6-mini.dts index 08d84160d8..6c86a2298f 100644 --- a/arch/arm/dts/sun50i-h6-tanix-tx6-mini.dts +++ b/arch/arm/dts/sun50i-h6-tanix-tx6-mini.dts @@ -1,15 +1,94 @@ // SPDX-License-Identifier: (GPL-2.0+ OR MIT) -// Copyright (c) 2021 Jernej Skrabec <jernej.skrabec@gmail.com> +// Copyright (c) 2021 Jernej Skrabec <jernej.skrabec@gmail.com>, piotr.oniszczuk@gmail.com /dts-v1/; #include "sun50i-h6-tanix.dtsi" +#include "sun50i-h6-cpu-opp.dtsi" / { model = "Tanix TX6 mini"; compatible = "oranth,tanix-tx6-mini", "allwinner,sun50i-h6"; + + aliases { + ethernet0 = &emac; + ethernet1 = &xr819; + }; + + reg_vcc33_wifi: vcc33-wifi { + compatible = "regulator-fixed"; + regulator-name = "vcc33-wifi"; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + gpio = <&pio 7 4 GPIO_ACTIVE_HIGH>; /* PH4 */ + regulator-always-on; + enable-active-high; + }; + + reg_vdd_cpu: vdd-cpu { + compatible = "regulator-fixed"; + regulator-name = "vdd-cpu"; + regulator-min-microvolt = <1200000>; + regulator-max-microvolt = <1200000>; + }; +}; + +&cpu0 { + cpu-supply = <®_vdd_cpu>; }; +&wifi_pwrseq { + compatible = "mmc-pwrseq-simple"; + reset-gpios = <&r_pio 1 3 GPIO_ACTIVE_LOW>; /* PM3 */ + post-power-on-delay-ms = <200>; + }; + &r_ir { linux,rc-map-name = "rc-tanix-tx3mini"; }; + +&ac200_pwm_clk { + status = "okay"; +}; + +&emac { + pinctrl-names = "default"; + pinctrl-0 = <&ext_rmii_pins>; + phy-mode = "rmii"; + phy-handle = <&ext_rmii_phy>; + status = "okay"; +}; + +&i2c3 { + status = "okay"; +}; + +&mdio { + ext_rmii_phy: ethernet-phy@1 { + compatible = "ethernet-phy-ieee802.3-c22"; + reg = <1>; + }; +}; + +&pwm { + status = "okay"; +}; + +&mmc1 { + vmmc-supply = <®_vcc3v3>; + vqmmc-supply = <®_vcc33_wifi>; + mmc-pwrseq = <&wifi_pwrseq>; + bus-width = <4>; + non-removable; + status = "okay"; + + xr819: sdio_wifi@1 { + reg = <1>; + compatible = "xradio,xr819"; + interrupt-parent = <&r_pio>; + interrupts = <1 0 IRQ_TYPE_EDGE_RISING>; /* PM0 */ + interrupt-names = "host-wake"; + local-mac-address = [dc 44 6d c0 ff 01]; + keep-power-in-suspend; + }; +}; diff --git a/arch/arm/dts/sun50i-h6-tanix-tx6.dts b/arch/arm/dts/sun50i-h6-tanix-tx6.dts index 9a38ff9b3f..edfae2a612 100644 --- a/arch/arm/dts/sun50i-h6-tanix-tx6.dts +++ b/arch/arm/dts/sun50i-h6-tanix-tx6.dts @@ -1,5 +1,5 @@ // SPDX-License-Identifier: (GPL-2.0+ OR MIT) -// Copyright (c) 2019 Jernej Skrabec <jernej.skrabec@siol.net> +// Copyright (c) 2019 Jernej Skrabec <jernej.skrabec@siol.net> Piotr Oniszczuk <piotr.oniszczuk@gmail.com> /dts-v1/; @@ -8,10 +8,48 @@ / { model = "Tanix TX6"; compatible = "oranth,tanix-tx6", "allwinner,sun50i-h6"; + + aliases { + ethernet0 = &emac; + ethernet1 = &wifi; + }; + + reg_vcc33_wifi: vcc33-wifi { + compatible = "regulator-fixed"; + regulator-name = "vcc33-wifi"; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + gpio = <&pio 7 4 GPIO_ACTIVE_HIGH>; /* PH4 */ + regulator-always-on; + enable-active-high; + }; + + reg_vdd_cpu: vdd-cpu { + compatible = "regulator-fixed"; + regulator-name = "vdd-cpu"; + regulator-min-microvolt = <1200000>; + regulator-max-microvolt = <1200000>; + }; + + openvfd { + compatible = "open,vfd"; + dev_name = "openvfd"; + openvfd_gpio_clk = <&pio 3 25 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>; /* PD25 */ + openvfd_gpio_dat = <&pio 3 26 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>; /* PD26 */ + vfd_gpio_chip_name = "300b000.pinctrl"; + openvfd_chars = [02 04 03 02 01]; + openvfd_dot_bits = [00 01 03 02 04 05 06]; + openvfd_display_type = <0x03000001>; + status = "okay"; + }; +}; + +&cpu0 { + cpu-supply = <®_vdd_cpu>; }; &r_ir { - linux,rc-map-name = "rc-tanix-tx5max"; + linux,rc-map-name = "rc-tanix-tx3mini"; }; &uart1 { @@ -27,3 +65,48 @@ enable-gpios = <&r_pio 1 4 GPIO_ACTIVE_HIGH>; /* PM4 */ }; }; + +&ac200_pwm_clk { + status = "okay"; +}; + +&emac { + pinctrl-names = "default"; + pinctrl-0 = <&ext_rmii_pins>; + phy-mode = "rmii"; + phy-handle = <&ext_rmii_phy>; + status = "okay"; +}; + +&i2c3 { + status = "okay"; +}; + +&mdio { + ext_rmii_phy: ethernet-phy@1 { + compatible = "ethernet-phy-ieee802.3-c22"; + reg = <1>; + }; +}; + +&pwm { + status = "okay"; +}; + +&mmc1 { + vmmc-supply = <®_vcc3v3>; + vqmmc-supply = <®_vcc33_wifi>; + mmc-pwrseq = <&wifi_pwrseq>; + bus-width = <4>; + non-removable; + status = "okay"; + + wifi: sdio_wifi@1 { + reg = <1>; + interrupt-parent = <&r_pio>; + interrupts = <1 0 IRQ_TYPE_EDGE_RISING>; /* PM0 */ + interrupt-names = "host-wake"; + local-mac-address = [dc 44 6d c0 ff 01]; + keep-power-in-suspend; + }; +}; diff --git a/arch/arm/dts/sun50i-h6-tanix.dtsi b/arch/arm/dts/sun50i-h6-tanix.dtsi index 4903d63581..26e4b690d7 100644 --- a/arch/arm/dts/sun50i-h6-tanix.dtsi +++ b/arch/arm/dts/sun50i-h6-tanix.dtsi @@ -5,6 +5,7 @@ #include "sun50i-h6.dtsi" #include "sun50i-h6-cpu-opp.dtsi" +#include "sun50i-h6-gpu-opp.dtsi" #include <dt-bindings/gpio/gpio.h> @@ -29,14 +30,6 @@ }; }; - /* used for FD650 LED display driver */ - i2c { - compatible = "i2c-gpio"; - sda-gpios = <&pio 7 6 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>; /* PH6 */ - scl-gpios = <&pio 7 5 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>; /* PH5 */ - i2c-gpio,delay-us = <5>; - }; - reg_vcc1v8: regulator-vcc1v8 { compatible = "regulator-fixed"; regulator-name = "vcc1v8"; @@ -134,6 +127,7 @@ mmc-pwrseq = <&wifi_pwrseq>; bus-width = <4>; non-removable; + keep-power-in-suspend; status = "okay"; }; diff --git a/arch/arm/dts/sun50i-h6.dtsi b/arch/arm/dts/sun50i-h6.dtsi index 3c85c8cc8e..d7b301a31b 100644 --- a/arch/arm/dts/sun50i-h6.dtsi +++ b/arch/arm/dts/sun50i-h6.dtsi @@ -17,6 +17,16 @@ #address-cells = <1>; #size-cells = <1>; + ac200_pwm_clk: ac200_clk { + compatible = "pwm-clock"; + #clock-cells = <0>; + clock-frequency = <24000000>; + pinctrl-names = "default"; + pinctrl-0 = <&pwm1_pin>; + pwms = <&pwm 1 42 0>; + status = "disabled"; + }; + cpus { #address-cells = <1>; #size-cells = <0>; @@ -89,6 +99,13 @@ method = "smc"; }; + scpi_protocol: scpi { + compatible = "arm,scpi"; + mboxes = <&msgbox 2>, <&msgbox 3>; + mbox-names = "tx", "rx"; + shmem = <&scpi_sram>; + }; + timer { compatible = "arm,armv8-timer"; arm,no-tick-in-suspend; @@ -102,6 +119,24 @@ (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_HIGH)>; }; + sound_hdmi: sound { + compatible = "simple-audio-card"; + simple-audio-card,format = "i2s"; + simple-audio-card,name = "HDMI"; + simple-audio-card,mclk-fs = <128>; + simple-audio-card,frame-inversion; + + simple-audio-card,codec { + sound-dai = <&hdmi>; + }; + + simple-audio-card,cpu { + sound-dai = <&i2s1>; + dai-tdm-slot-num = <2>; + dai-tdm-slot-width = <32>; + }; + }; + soc { compatible = "simple-bus"; #address-cells = <1>; @@ -164,6 +199,18 @@ iommus = <&iommu 5>; }; + deinterlace: deinterlace@1420000 { + compatible = "allwinner,sun50i-h6-deinterlace"; + reg = <0x01420000 0x2000>; + clocks = <&ccu CLK_BUS_DEINTERLACE>, + <&ccu CLK_DEINTERLACE>, + <&ccu CLK_MBUS_DEINTERLACE>; + clock-names = "bus", "mod", "ram"; + resets = <&ccu RST_BUS_DEINTERLACE>; + interrupts = <GIC_SPI 79 IRQ_TYPE_LEVEL_HIGH>; + iommus = <&iommu 2>; + }; + video-codec@1c0e000 { compatible = "allwinner,sun50i-h6-video-engine"; reg = <0x01c0e000 0x2000>; @@ -173,7 +220,7 @@ resets = <&ccu RST_BUS_VE>; interrupts = <GIC_SPI 89 IRQ_TYPE_LEVEL_HIGH>; allwinner,sram = <&ve_sram 1>; - iommus = <&iommu 3>; + iommus = <&iommu 1>, <&iommu 3>; }; gpu: gpu@1800000 { @@ -208,6 +255,19 @@ #size-cells = <1>; ranges; + sram_a2: sram@100000 { + compatible = "mmio-sram"; + reg = <0x00100000 0x18000>; + #address-cells = <1>; + #size-cells = <1>; + ranges = <0 0x00100000 0x18000>; + + scpi_sram: scpi-sram@17c00 { + compatible = "arm,scp-shmem"; + reg = <0x17c00 0x200>; + }; + }; + sram_c: sram@28000 { compatible = "mmio-sram"; reg = <0x00028000 0x1e000>; @@ -242,6 +302,7 @@ reg = <0x03001000 0x1000>; clocks = <&osc24M>, <&rtc CLK_OSC32K>, <&rtc CLK_IOSC>; clock-names = "hosc", "losc", "iosc"; + protected-clocks = <CLK_BUS_MSGBOX>; #clock-cells = <1>; #reset-cells = <1>; }; @@ -281,6 +342,10 @@ cpu_speed_grade: cpu-speed-grade@1c { reg = <0x1c 0x4>; }; + + ephy_calib: ephy_calib@2c { + reg = <0x2c 0x2>; + }; }; timer@3009000 { @@ -334,6 +399,13 @@ drive-strength = <40>; }; + ext_rmii_pins: rmii_pins { + pins = "PA0", "PA1", "PA2", "PA3", "PA4", + "PA5", "PA6", "PA7", "PA8", "PA9"; + function = "emac"; + drive-strength = <40>; + }; + hdmi_pins: hdmi-pins { pins = "PH8", "PH9", "PH10"; function = "hdmi"; @@ -354,6 +426,11 @@ function = "i2c2"; }; + i2c3_pins: i2c3-pins { + pins = "PB17", "PB18"; + function = "i2c3"; + }; + mmc0_pins: mmc0-pins { pins = "PF0", "PF1", "PF2", "PF3", "PF4", "PF5"; @@ -380,6 +457,11 @@ bias-pull-up; }; + pwm1_pin: pwm1-pin { + pins = "PB19"; + function = "pwm1"; + }; + /omit-if-no-ref/ spi0_pins: spi0-pins { pins = "PC0", "PC2", "PC3"; @@ -613,6 +695,31 @@ #size-cells = <0>; }; + i2c3: i2c@5002c00 { + compatible = "allwinner,sun6i-a31-i2c"; + reg = <0x05002c00 0x400>; + interrupts = <GIC_SPI 7 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&ccu CLK_BUS_I2C3>; + resets = <&ccu RST_BUS_I2C3>; + pinctrl-names = "default"; + pinctrl-0 = <&i2c3_pins>; + status = "disabled"; + #address-cells = <1>; + #size-cells = <0>; + + ac200: mfd@10 { + compatible = "x-powers,ac200"; + reg = <0x10>; + clocks = <&ac200_pwm_clk>; + + ac200_ephy: phy { + compatible = "x-powers,ac200-ephy"; + nvmem-cells = <&ephy_calib>; + nvmem-cell-names = "ephy_calib"; + }; + }; + }; + emac: ethernet@5020000 { compatible = "allwinner,sun50i-h6-emac", "allwinner,sun50i-a64-emac"; @@ -643,7 +750,6 @@ dmas = <&dma 4>, <&dma 4>; resets = <&ccu RST_BUS_I2S1>; dma-names = "rx", "tx"; - status = "disabled"; }; spdif: spdif@5093000 { @@ -780,6 +886,7 @@ }; hdmi: hdmi@6000000 { + #sound-dai-cells = <0>; compatible = "allwinner,sun50i-h6-dw-hdmi"; reg = <0x06000000 0x10000>; reg-io-width = <1>; @@ -935,6 +1042,7 @@ clocks = <&osc24M>, <&rtc CLK_OSC32K>, <&rtc CLK_IOSC>, <&ccu CLK_PLL_PERIPH0>; clock-names = "hosc", "losc", "iosc", "pll-periph"; + protected-clocks = <CLK_R_APB1_TWD>; #clock-cells = <1>; #reset-cells = <1>; }; diff --git a/arch/arm/dts/sun50i-h616-cpu-opp.dtsi b/arch/arm/dts/sun50i-h616-cpu-opp.dtsi new file mode 100644 index 0000000000..37e533c1fe --- /dev/null +++ b/arch/arm/dts/sun50i-h616-cpu-opp.dtsi @@ -0,0 +1,117 @@ +// SPDX-License-Identifier: (GPL-2.0+ OR MIT) +// Copyright (C) 2021 Piotr Oniszczuk <piotr.oniszczuk@gmail.com> +/* + Opi Zero2:bin0 bin1 Tx6s:bin0 bin1 + 480000000 820mV 880mV / 820mV 880mV + 600000000 820mV 880mV / 820mV 880mV + 792000000 860mV 940mV / 860mV 940mV + 1008000000 900mV 1020mV / 900mV 1020mV + 1200000000 960mV 1100mV / 960mV 1100mV + 1296000000 1100mV 1100mV / 1100mV 1100mV + 1344000000 1120mV 1120mV / 1120mV 1120mV + 1512000000 1120mV 1120mV / 1120mV 1120mV +*/ + +/ { + cpu_opp_table: opp-table-cpu { + compatible = "allwinner,sun50i-h616-operating-points"; + nvmem-cells = <&cpu_speed_grade>; + opp-shared; + + opp-480000000 { + clock-latency-ns = <244144>; /* 8 32k periods */ + opp-hz = /bits/ 64 <480000000>; + + opp-microvolt-speed0 = <900000 900000 1100000>; + opp-microvolt-speed1 = <900000 900000 1100000>; + opp-microvolt-speed2 = <900000 900000 1100000>; + }; + + opp-600000000 { + clock-latency-ns = <244144>; /* 8 32k periods */ + opp-hz = /bits/ 64 <600000000>; + + opp-microvolt-speed0 = <900000 900000 1100000>; + opp-microvolt-speed1 = <920000 920000 1100000>; + opp-microvolt-speed2 = <920000 920000 1100000>; + }; + + opp-792000000 { + clock-latency-ns = <244144>; /* 8 32k periods */ + opp-hz = /bits/ 64 <792000000>; + opp-microvolt-speed0 = <900000 900000 1100000>; + opp-microvolt-speed1 = <940000 940000 1100000>; + opp-microvolt-speed2 = <940000 940000 1100000>; + }; + + opp-1008000000 { + clock-latency-ns = <244144>; /* 8 32k periods */ + opp-hz = /bits/ 64 <1008000000>; + + opp-microvolt-speed0 = <900000 900000 1100000>; + opp-microvolt-speed1 = <1020000 1020000 1100000>; + opp-microvolt-speed2 = <1020000 1020000 1100000>; + }; + + opp-1200000000 { + clock-latency-ns = <244144>; /* 8 32k periods */ + opp-hz = /bits/ 64 <1200000000>; + + opp-microvolt-speed0 = <960000 960000 1100000>; + opp-microvolt-speed1 = <1100000 1100000 1100000>; + opp-microvolt-speed2 = <1100000 1100000 1100000>; + }; + + opp-1344000000 { + clock-latency-ns = <244144>; /* 8 32k periods */ + opp-hz = /bits/ 64 <1344000000>; + + opp-microvolt-speed0 = <1050000 1050000 1100000>; + opp-microvolt-speed1 = <1100000 1100000 1100000>; + opp-microvolt-speed2 = <1100000 1100000 1100000>; + }; + + opp-1416000000 { + clock-latency-ns = <244144>; /* 8 32k periods */ + opp-hz = /bits/ 64 <1416000000>; + + opp-microvolt-speed0 = <1100000 1100000 1100000>; + opp-microvolt-speed1 = <1100000 1100000 1100000>; + opp-microvolt-speed2 = <1100000 1100000 1100000>; + }; + + opp-1512000000 { + clock-latency-ns = <244144>; /* 8 32k periods */ + opp-hz = /bits/ 64 <1512000000>; + + opp-microvolt-speed0 = <1100000 1100000 1100000>; + opp-microvolt-speed1 = <1100000 1100000 1100000>; + opp-microvolt-speed2 = <1100000 1100000 1100000>; + }; + + opp-1608000000 { + clock-latency-ns = <244144>; /* 8 32k periods */ + opp-hz = /bits/ 64 <1608000000>; + + opp-microvolt-speed0 = <1120000 1120000 1120000>; + opp-microvolt-speed1 = <1120000 1120000 1120000>; + opp-microvolt-speed2 = <1120000 1120000 1120000>; + }; + }; +}; + +&cpu0 { + operating-points-v2 = <&cpu_opp_table>; +}; + +&cpu1 { + operating-points-v2 = <&cpu_opp_table>; +}; + +&cpu2 { + operating-points-v2 = <&cpu_opp_table>; +}; + +&cpu3 { + operating-points-v2 = <&cpu_opp_table>; +}; diff --git a/arch/arm/dts/sun50i-h616-orangepi-zero2.dts b/arch/arm/dts/sun50i-h616-orangepi-zero2.dts index cb8600d0ea..b6f9bef36c 100644 --- a/arch/arm/dts/sun50i-h616-orangepi-zero2.dts +++ b/arch/arm/dts/sun50i-h616-orangepi-zero2.dts @@ -6,7 +6,7 @@ /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> @@ -17,27 +17,42 @@ aliases { ethernet0 = &emac0; + ethernet1 = &wlan; serial0 = &uart0; + mmc0 = &mmc0; /* mmc0/mmcblk0 for SD */ + mmc1 = &mmc1; /* mmc1/mmcblk1 for SDIO */ }; chosen { stdout-path = "serial0:115200n8"; }; + connector { + compatible = "hdmi-connector"; + type = "d"; + + port { + hdmi_con_in: endpoint { + remote-endpoint = <&hdmi_out_con>; + }; + }; + }; + leds { compatible = "gpio-leds"; led-0 { - function = LED_FUNCTION_POWER; + function = LED_FUNCTION_DISK_ACTIVITY; color = <LED_COLOR_ID_RED>; gpios = <&pio 2 12 GPIO_ACTIVE_HIGH>; /* PC12 */ - default-state = "on"; + linux,default-trigger = "mmc0"; }; led-1 { function = LED_FUNCTION_STATUS; color = <LED_COLOR_ID_GREEN>; gpios = <&pio 2 13 GPIO_ACTIVE_HIGH>; /* PC13 */ + linux,default-trigger = "heartbeat"; }; }; @@ -59,6 +74,41 @@ enable-active-high; gpio = <&pio 2 16 GPIO_ACTIVE_HIGH>; /* PC16 */ }; + + 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 = <®_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 = <®_vcc33_wifi>; + }; + + wifi_pwrseq: wifi-pwrseq { + compatible = "mmc-pwrseq-simple"; + clocks = <&rtc CLK_OSC32K_FANOUT>; + clock-names = "ext_clock"; + pinctrl-names = "default"; + pinctrl-0 = <&clk_losc>; /* PG10 with MUX3 set */ + reset-gpios = <&pio 6 18 GPIO_ACTIVE_LOW>; /* PG18 */ + post-power-on-delay-ms = <200>; + }; +}; + +&cpu0 { + cpu-supply = <®_dcdca>; + status = "okay"; }; &ehci1 { @@ -92,6 +142,20 @@ status = "okay"; }; +&mmc1 { + vmmc-supply = <®_vcc33_wifi>; + vqmmc-supply = <®_vcc_wifi_io>; + mmc-pwrseq = <&wifi_pwrseq>; + bus-width = <4>; + non-removable; + mmc-ddr-1_8v; + status = "okay"; + + wlan: wifi@1 { + reg = <1>; + }; +}; + &ohci1 { status = "okay"; }; @@ -172,14 +236,14 @@ reg_dcdca: dcdca { regulator-always-on; regulator-min-microvolt = <810000>; - regulator-max-microvolt = <1100000>; + regulator-max-microvolt = <1160000>; regulator-name = "vdd-cpu"; }; reg_dcdcc: dcdcc { regulator-always-on; regulator-min-microvolt = <810000>; - regulator-max-microvolt = <990000>; + regulator-max-microvolt = <1160000>; regulator-name = "vdd-gpu-sys"; }; @@ -204,14 +268,6 @@ }; }; -&pio { - vcc-pc-supply = <®_aldo1>; - vcc-pf-supply = <®_aldo1>; - vcc-pg-supply = <®_bldo1>; - vcc-ph-supply = <®_aldo1>; - vcc-pi-supply = <®_aldo1>; -}; - &spi0 { status = "okay"; pinctrl-names = "default"; @@ -252,3 +308,68 @@ usb1_vbus-supply = <®_usb1_vbus>; status = "okay"; }; + +&uart1 { + pinctrl-names = "default"; + pinctrl-0 = <&uart1_pins>, <&uart1_rts_cts_pins>; + uart-has-rtscts; + status = "okay"; + + bluetooth { + compatible = "brcm,bcm43438-bt"; + clocks = <&rtc 1>; + clock-names = "lpo"; + vbat-supply = <®_dcdce>; + vddio-supply = <®_dcdce>; + device-wakeup-gpios = <&r_pio 0 6 GPIO_ACTIVE_HIGH>; /* PL6 */ + host-wakeup-gpios = <&r_pio 0 5 GPIO_ACTIVE_HIGH>; /* PL5 */ + shutdown-gpios = <&r_pio 0 4 GPIO_ACTIVE_HIGH>; /* PL4 */ + }; +}; + +&i2c3 { + status = "okay"; +}; + +&de { + status = "okay"; +}; + +&hdmi { + hvcc-supply = <®_bldo1>; + status = "okay"; +}; + +&hdmi_out { + hdmi_out_con: endpoint { + remote-endpoint = <&hdmi_con_in>; + }; +}; + +&gpu { + mali-supply = <®_dcdcc>; + status = "okay"; +}; + +&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"; +}; + diff --git a/arch/arm/dts/sun50i-h616-tanix-tx6s-axp313.dts b/arch/arm/dts/sun50i-h616-tanix-tx6s-axp313.dts new file mode 100644 index 0000000000..b2e4318a33 --- /dev/null +++ b/arch/arm/dts/sun50i-h616-tanix-tx6s-axp313.dts @@ -0,0 +1,314 @@ +// SPDX-License-Identifier: (GPL-2.0+ or MIT) +/* + * Author: piotr.oniszczuk@gmail.com + */ + +/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 = "Tanix TX6s (axp313)"; + compatible = "tanix,tx6s", "allwinner,sun50i-h616"; + + aliases { + mmc0 = &mmc0; + mmc2 = &mmc2; + ethernet0 = &emac1; + ethernet1 = &wlan; + serial0 = &uart0; + }; + + chosen { + stdout-path = "serial0:115200n8"; + }; + + connector { + compatible = "hdmi-connector"; + type = "d"; + + port { + hdmi_con_in: endpoint { + remote-endpoint = <&hdmi_out_con>; + }; + }; + }; + + 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_usb1_vbus: usb1-vbus { + compatible = "regulator-fixed"; + regulator-name = "usb1-vbus"; + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>; + vin-supply = <®_vcc5v>; + enable-active-high; + /* gpio = <&pio 2 16 GPIO_ACTIVE_HIGH>; PC16 */ + status = "okay"; + }; + + reg_vcc_wifi: reg_vcc_wifi { + compatible = "regulator-fixed"; + regulator-name = "vcc-wifi"; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + gpio = <&pio 6 18 GPIO_ACTIVE_HIGH>; /* PG18 WL_REG_ON */ + regulator-always-on; + enable-active-high; + status = "okay"; + }; + + wifi_pwrseq: wifi_pwrseq { + compatible = "mmc-pwrseq-simple"; + clocks = <&rtc CLK_OSC32K_FANOUT>; + clock-names = "ext_clock"; + pinctrl-names = "default"; + pinctrl-0 = <&clk_losc>; /* PG10 with MUX3 set */ + }; + + openvfd { + compatible = "open,vfd"; + dev_name = "openvfd"; + openvfd_gpio_clk = <&pio 8 11 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>; + openvfd_gpio_dat = <&pio 8 12 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>; + vfd_gpio_chip_name = "0300b000.pinctrl"; + openvfd_chars = [02 04 03 02 01]; + openvfd_dot_bits = [00 01 03 02 04 05 06]; + openvfd_display_type = <0x03000001>; + status = "okay"; + }; +}; + +&cpu0 { + cpu-supply = <®_dcdc2>; + status = "okay"; +}; + +&de { + status = "okay"; +}; + +&ehci0 { + status = "okay"; +}; + +&ehci1 { + status = "okay"; +}; + +&ehci2 { + status = "okay"; +}; + +&ehci3 { + status = "okay"; +}; + +&hdmi { + hvcc-supply = <®_aldo1>; + status = "okay"; +}; + +&hdmi_out { + hdmi_out_con: endpoint { + remote-endpoint = <&hdmi_con_in>; + }; +}; + +&gpu { + mali-supply = <®_dcdc1>; + status = "okay"; +}; + +&i2c3 { + status = "okay"; +}; + +&emac1 { + pinctrl-names = "default"; + pinctrl-0 = <&rmii_pins>; + phy-mode = "rmii"; + phy-handle = <&rmii_phy>; + phy-supply = <®_aldo1>; + 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>; + }; +}; + +&mmc0 { + vmmc-supply = <®_dldo1>; + broken-cd; + bus-width = <4>; + status = "okay"; +}; + +&mmc1 { + vmmc-supply = <®_dldo1>; + vqmmc-supply = <®_vcc_wifi>; + mmc-pwrseq = <&wifi_pwrseq>; + bus-width = <4>; + non-removable; + status = "okay"; + + wlan: wifi@1 { + reg = <1>; + interrupt-parent = <&pio>; + interrupts = <6 15 IRQ_TYPE_EDGE_RISING>; /* PG15 WL_HOSTWAKE*/ + interrupt-names = "host-wake"; + local-mac-address = [dc 44 6d c0 ff 02]; + }; +}; + +&mmc2 { + vmmc-supply = <®_dldo1>; + bus-width = <8>; + non-removable; + cap-mmc-hw-reset; + status = "okay"; +}; + +&ohci0 { + status = "okay"; +}; + +&ohci1 { + status = "okay"; +}; + +&ohci2 { + status = "okay"; +}; + +&ohci3 { + status = "okay"; +}; + +&r_i2c { + status = "okay"; + + axp313a: pmic@36 { + compatible = "x-powers,axp313a"; + reg = <0x36>; + wakeup-source; + vin1-supply = <®_vcc5v>; + vin2-supply = <®_vcc5v>; + vin3-supply = <®_vcc5v>; + + regulators { + reg_dcdc1: dcdc1 { + regulator-always-on; + regulator-min-microvolt = <810000>; + regulator-max-microvolt = <1160000>; + regulator-name = "vdd-gpu"; + }; + + reg_dcdc2: dcdc2 { + regulator-always-on; + regulator-min-microvolt = <810000>; + regulator-max-microvolt = <1160000>; + regulator-name = "vdd-cpu"; + }; + + reg_dcdc3: dcdc3 { + regulator-always-on; + regulator-min-microvolt = <1200000>; + regulator-max-microvolt = <1200000>; + regulator-name = "vdd-dram"; + }; + + reg_aldo1: aldo1 { + regulator-always-on; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + regulator-name = "vcc1v8"; + }; + + reg_dldo1: dldo1 { + regulator-always-on; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + regulator-name = "vcc3v3"; + }; + }; + }; +}; + +&uart0 { + pinctrl-names = "default"; + pinctrl-0 = <&uart0_ph_pins>; + status = "okay"; +}; + +&uart1 { + pinctrl-names = "default"; + pinctrl-0 = <&uart1_pins>, <&uart1_rts_cts_pins>; + uart-has-rtscts; + status = "okay"; + + bluetooth { + compatible = "brcm,bcm43438-bt"; + clocks = <&rtc 1>; + clock-names = "lpo"; + vbat-supply = <®_dldo1>; + vddio-supply = <®_dldo1>; + device-wakeup-gpios = <&r_pio 0 6 GPIO_ACTIVE_HIGH>; /* PL6 */ + host-wakeup-gpios = <&r_pio 0 5 GPIO_ACTIVE_HIGH>; /* PL5 */ + shutdown-gpios = <&r_pio 0 4 GPIO_ACTIVE_HIGH>; /* PL4 */ + }; +}; + +&usbotg { + dr_mode = "peripheral"; + status = "okay"; +}; + +&usbphy { + usb1_vbus-supply = <®_usb1_vbus>; + status = "okay"; +}; + +&ir { + linux,rc-map-name = "rc-beelink-gs1"; + status = "okay"; +}; + +&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"; +}; + diff --git a/arch/arm/dts/sun50i-h616-tanix-tx6s.dts b/arch/arm/dts/sun50i-h616-tanix-tx6s.dts new file mode 100644 index 0000000000..9f35ec086c --- /dev/null +++ b/arch/arm/dts/sun50i-h616-tanix-tx6s.dts @@ -0,0 +1,371 @@ +// SPDX-License-Identifier: (GPL-2.0+ or MIT) +/* + * Author: piotr.oniszczuk@gmail.com + */ + +/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 = "Tanix TX6s"; + compatible = "tanix,tx6s", "allwinner,sun50i-h616"; + + aliases { + mmc0 = &mmc0; + mmc2 = &mmc2; + ethernet0 = &emac1; + ethernet1 = &wlan; + serial0 = &uart0; + }; + + chosen { + stdout-path = "serial0:115200n8"; + }; + + connector { + compatible = "hdmi-connector"; + type = "d"; + + port { + hdmi_con_in: endpoint { + remote-endpoint = <&hdmi_out_con>; + }; + }; + }; + + 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_usb1_vbus: usb1-vbus { + compatible = "regulator-fixed"; + regulator-name = "usb1-vbus"; + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>; + vin-supply = <®_vcc5v>; + enable-active-high; + /* gpio = <&pio 2 16 GPIO_ACTIVE_HIGH>; PC16 */ + status = "okay"; + }; + + reg_vcc_wifi: reg_vcc_wifi { + compatible = "regulator-fixed"; + regulator-name = "vcc-wifi"; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + gpio = <&pio 6 18 GPIO_ACTIVE_HIGH>; /* PG18 WL_REG_ON */ + regulator-always-on; + enable-active-high; + status = "okay"; + }; + + wifi_pwrseq: wifi_pwrseq { + compatible = "mmc-pwrseq-simple"; + clocks = <&rtc CLK_OSC32K_FANOUT>; + clock-names = "ext_clock"; + pinctrl-names = "default"; + pinctrl-0 = <&clk_losc>; /* PG10 with MUX3 set */ + }; + + openvfd { + compatible = "open,vfd"; + dev_name = "openvfd"; + openvfd_gpio_clk = <&pio 8 11 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>; + openvfd_gpio_dat = <&pio 8 12 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>; + vfd_gpio_chip_name = "0300b000.pinctrl"; + openvfd_chars = [02 04 03 02 01]; + openvfd_dot_bits = [00 01 03 02 04 05 06]; + openvfd_display_type = <0x03000001>; + status = "okay"; + }; +}; + +&cpu0 { + cpu-supply = <®_dcdca>; + status = "okay"; +}; + +&de { + status = "okay"; +}; + +&ehci0 { + status = "okay"; +}; + +&ehci1 { + status = "okay"; +}; + +&ehci2 { + status = "okay"; +}; + +&ehci3 { + status = "okay"; +}; + +&hdmi { + hvcc-supply = <®_bldo1>; + status = "okay"; +}; + +&hdmi_out { + hdmi_out_con: endpoint { + remote-endpoint = <&hdmi_con_in>; + }; +}; + +&gpu { + mali-supply = <®_dcdcc>; + status = "okay"; +}; + +&i2c3 { + status = "okay"; +}; + +&emac1 { + pinctrl-names = "default"; + pinctrl-0 = <&rmii_pins>; + phy-mode = "rmii"; + phy-handle = <&rmii_phy>; + phy-supply = <®_aldo1>; + 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>; + }; +}; + +&mmc0 { + vmmc-supply = <®_dcdce>; + broken-cd; + bus-width = <4>; + status = "okay"; +}; + +&mmc1 { + vmmc-supply = <®_dcdce>; + vqmmc-supply = <®_vcc_wifi>; + mmc-pwrseq = <&wifi_pwrseq>; + bus-width = <4>; + non-removable; + status = "okay"; + + wlan: wifi@1 { + reg = <1>; + interrupt-parent = <&pio>; + interrupts = <6 15 IRQ_TYPE_EDGE_RISING>; /* PG15 WL_HOSTWAKE*/ + interrupt-names = "host-wake"; + }; +}; + +&mmc2 { + vmmc-supply = <®_dcdce>; + bus-width = <8>; + non-removable; + cap-mmc-hw-reset; + status = "okay"; +}; + +&ohci0 { + status = "okay"; +}; + +&ohci1 { + status = "okay"; +}; + +&ohci2 { + status = "okay"; +}; + +&ohci3 { + status = "okay"; +}; + +&r_rsb { + status = "okay"; + + axp305: pmic@745 { + compatible = "x-powers,axp305", "x-powers,axp805", + "x-powers,axp806"; + interrupt-controller; + #interrupt-cells = <1>; + reg = <0x745>; + + x-powers,self-working-mode; + vina-supply = <®_vcc5v>; + vinb-supply = <®_vcc5v>; + vinc-supply = <®_vcc5v>; + vind-supply = <®_vcc5v>; + vine-supply = <®_vcc5v>; + aldoin-supply = <®_vcc5v>; + bldoin-supply = <®_vcc5v>; + cldoin-supply = <®_vcc5v>; + + regulators { + reg_aldo1: aldo1 { + regulator-always-on; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + regulator-name = "vcc-sys"; + }; + + reg_aldo2: aldo2 { /* 3.3V on headers */ + regulator-always-on; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + regulator-name = "vcc3v3-ext"; + }; + + reg_aldo3: aldo3 { /* 3.3V on headers */ + regulator-always-on; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + regulator-name = "vcc3v3-ext2"; + }; + + reg_bldo1: bldo1 { + regulator-always-on; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + regulator-name = "vcc1v8"; + }; + + bldo2 { + /* unused */ + }; + + bldo3 { + /* unused */ + }; + + bldo4 { + /* unused */ + }; + + cldo1 { + /* reserved */ + }; + + cldo2 { + /* unused */ + }; + + cldo3 { + /* unused */ + }; + + reg_dcdca: dcdca { + regulator-always-on; + regulator-min-microvolt = <810000>; + regulator-max-microvolt = <1160000>; + regulator-name = "vdd-cpu"; + }; + + reg_dcdcc: dcdcc { + regulator-always-on; + regulator-min-microvolt = <810000>; + regulator-max-microvolt = <1160000>; + regulator-name = "vdd-gpu-sys"; + }; + + reg_dcdcd: dcdcd { + regulator-always-on; + regulator-min-microvolt = <1500000>; + regulator-max-microvolt = <1500000>; + regulator-name = "vdd-dram"; + }; + + reg_dcdce: dcdce { + regulator-always-on; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + regulator-name = "vcc-eth-mmc"; + }; + + sw { + /* unused */ + }; + }; + }; +}; + +&uart0 { + pinctrl-names = "default"; + pinctrl-0 = <&uart0_ph_pins>; + status = "okay"; +}; + +&uart1 { + pinctrl-names = "default"; + pinctrl-0 = <&uart1_pins>, <&uart1_rts_cts_pins>; + uart-has-rtscts; + status = "okay"; + + bluetooth { + compatible = "brcm,bcm43438-bt"; + clocks = <&rtc 1>; + clock-names = "lpo"; + vbat-supply = <®_dcdce>; + vddio-supply = <®_dcdce>; + device-wakeup-gpios = <&r_pio 0 6 GPIO_ACTIVE_HIGH>; /* PL6 */ + host-wakeup-gpios = <&r_pio 0 5 GPIO_ACTIVE_HIGH>; /* PL5 */ + shutdown-gpios = <&r_pio 0 4 GPIO_ACTIVE_HIGH>; /* PL4 */ + }; +}; + +&usbotg { + dr_mode = "peripheral"; + status = "okay"; +}; + +&usbphy { + usb1_vbus-supply = <®_usb1_vbus>; + status = "okay"; +}; + +&ir { + linux,rc-map-name = "rc-beelink-gs1"; + status = "okay"; +}; + +&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"; +}; + diff --git a/arch/arm/dts/sun50i-h616-x96-mate.dts b/arch/arm/dts/sun50i-h616-x96-mate.dts index 07424c28b6..fba01ed67a 100644 --- a/arch/arm/dts/sun50i-h616-x96-mate.dts +++ b/arch/arm/dts/sun50i-h616-x96-mate.dts @@ -6,7 +6,7 @@ /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> diff --git a/arch/arm/dts/sun50i-h616.dtsi b/arch/arm/dts/sun50i-h616.dtsi index 74aed0d232..8e2d6b6624 100644 --- a/arch/arm/dts/sun50i-h616.dtsi +++ b/arch/arm/dts/sun50i-h616.dtsi @@ -7,8 +7,12 @@ #include <dt-bindings/clock/sun50i-h616-ccu.h> #include <dt-bindings/clock/sun50i-h6-r-ccu.h> #include <dt-bindings/clock/sun6i-rtc.h> +#include <dt-bindings/clock/sun8i-de2.h> +#include <dt-bindings/clock/sun8i-tcon-top.h> #include <dt-bindings/reset/sun50i-h616-ccu.h> #include <dt-bindings/reset/sun50i-h6-r-ccu.h> +#include <dt-bindings/reset/sun8i-de2.h> +#include <dt-bindings/thermal/thermal.h> / { interrupt-parent = <&gic>; @@ -25,6 +29,9 @@ reg = <0>; enable-method = "psci"; clocks = <&ccu CLK_CPUX>; + clock-latency-ns = <244144>; /* 8 32k periods */ + #cooling-cells = <2>; + operating-points-v2 = <&cpu_opp_table>; }; cpu1: cpu@1 { @@ -33,6 +40,9 @@ reg = <1>; enable-method = "psci"; clocks = <&ccu CLK_CPUX>; + clock-latency-ns = <244144>; /* 8 32k periods */ + #cooling-cells = <2>; + operating-points-v2 = <&cpu_opp_table>; }; cpu2: cpu@2 { @@ -41,6 +51,9 @@ reg = <2>; enable-method = "psci"; clocks = <&ccu CLK_CPUX>; + clock-latency-ns = <244144>; /* 8 32k periods */ + #cooling-cells = <2>; + operating-points-v2 = <&cpu_opp_table>; }; cpu3: cpu@3 { @@ -49,21 +62,26 @@ reg = <3>; enable-method = "psci"; clocks = <&ccu CLK_CPUX>; + clock-latency-ns = <244144>; /* 8 32k periods */ + #cooling-cells = <2>; + operating-points-v2 = <&cpu_opp_table>; }; }; + de: display-engine { + compatible = "allwinner,sun50i-h6-display-engine"; + allwinner,pipelines = <&mixer0>; + status = "disabled"; + }; + reserved-memory { #address-cells = <2>; #size-cells = <2>; ranges; - /* - * 256 KiB reserved for Trusted Firmware-A (BL31). - * This is added by BL31 itself, but some bootloaders fail - * to propagate this into the DTB handed to kernels. - */ - secmon@40000000 { - reg = <0x0 0x40000000 0x0 0x40000>; + /* 512KiB reserved for ARM Trusted Firmware (BL31) */ + secmon_reserved: secmon@40000000 { + reg = <0x0 0x40000000 0x0 0x80000>; no-map; }; }; @@ -108,6 +126,51 @@ #size-cells = <1>; ranges = <0x0 0x0 0x0 0x40000000>; + bus@1000000 { + compatible = "allwinner,sun50i-h616-de33", + "allwinner,sun50i-a64-de2"; + reg = <0x1000000 0x400000>; + allwinner,sram = <&de3_sram 1>; + #address-cells = <1>; + #size-cells = <1>; + ranges = <0 0x1000000 0x400000>; + + display_clocks: clock@8000 { + compatible = "allwinner,sun50i-h616-de33-clk"; + reg = <0x8000 0x100>; + clocks = <&ccu CLK_DE>, <&ccu CLK_BUS_DE>; + clock-names = "mod", "bus"; + resets = <&ccu RST_BUS_DE>; + #clock-cells = <1>; + #reset-cells = <1>; + }; + + mixer0: mixer@100000 { + compatible = "allwinner,sun50i-h616-de33-mixer-0"; + reg = <0x100000 0x100000>, + <0x8100 0x40>, + <0x280000 0x20000>; + clocks = <&display_clocks CLK_BUS_MIXER0>, + <&display_clocks CLK_MIXER0>; + clock-names = "bus", "mod"; + resets = <&display_clocks RST_MIXER0>; + iommus = <&iommu 0>; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + mixer0_out: port@1 { + reg = <1>; + + mixer0_out_tcon_top_mixer0: endpoint { + remote-endpoint = <&tcon_top_mixer0_in_mixer0>; + }; + }; + }; + }; + }; + syscon: syscon@3000000 { compatible = "allwinner,sun50i-h616-system-control"; reg = <0x03000000 0x1000>; @@ -115,13 +178,46 @@ #size-cells = <1>; ranges; + sram_a2: sram@100000 { + compatible = "mmio-sram"; + reg = <0x00100000 0x18000>; + #address-cells = <1>; + #size-cells = <1>; + ranges = <0 0x00100000 0x18000>; + + scpi_sram: scpi-sram@17c00 { + compatible = "arm,scp-shmem"; + reg = <0x17c00 0x200>; + }; + }; + sram_c: sram@28000 { compatible = "mmio-sram"; reg = <0x00028000 0x30000>; #address-cells = <1>; #size-cells = <1>; ranges = <0 0x00028000 0x30000>; + + de3_sram: sram-section@0 { + compatible = "allwinner,sun50i-h616-sram-c", + "allwinner,sun50i-a64-sram-c"; + reg = <0x0000 0x1e000>; + }; }; + + sram_c1: sram@1a00000 { + compatible = "mmio-sram"; + reg = <0x01a00000 0x200000>; + #address-cells = <1>; + #size-cells = <1>; + ranges = <0 0x01a00000 0x200000>; + + ve_sram: sram-section@0 { + compatible = "allwinner,sun50i-h616-sram-c1"; + reg = <0x000000 0x200000>; + }; + }; + }; ccu: clock@3001000 { @@ -133,6 +229,21 @@ #reset-cells = <1>; }; + sid: efuse@3006000 { + compatible = "allwinner,sun50i-h616-sid"; + reg = <0x03006000 0x1000>; + #address-cells = <1>; + #size-cells = <1>; + + cpu_speed_grade: cpu-speed-grade@0 { + reg = <0x00 0x02>; + }; + + ths_calibration: thermal-sensor-calibration@14 { + reg = <0x14 0x8>; + }; + }; + watchdog: watchdog@30090a0 { compatible = "allwinner,sun50i-h616-wdt", "allwinner,sun6i-a31-wdt"; @@ -168,11 +279,19 @@ drive-strength = <40>; }; + rmii_pins: rmii-pins { + pins = "PA0", "PA1", "PA2", "PA3", "PA4", + "PA5", "PA6", "PA7", "PA8", "PA9"; + function = "emac1"; + drive-strength = <40>; + }; + i2c0_pins: i2c0-pins { pins = "PI6", "PI7"; function = "i2c0"; }; + /omit-if-no-ref/ i2c3_ph_pins: i2c3-ph-pins { pins = "PH4", "PH5"; function = "i2c3"; @@ -183,6 +302,12 @@ function = "ir_rx"; }; + /omit-if-no-ref/ + i2s3_pins: i2s3-pins { + pins = "PH5", "PH6", "PH7", "PH8", "PH9"; + function = "i2s3"; + }; + mmc0_pins: mmc0-pins { pins = "PF0", "PF1", "PF2", "PF3", "PF4", "PF5"; @@ -238,6 +363,11 @@ function = "uart0"; }; + uart5_ph_pins: uart5-ph-pins { + pins = "PH2", "PH3"; + function = "uart5"; + }; + /omit-if-no-ref/ uart1_pins: uart1-pins { pins = "PG6", "PG7"; @@ -249,6 +379,11 @@ pins = "PG8", "PG9"; function = "uart1"; }; + + clk_losc: clk-losc { + pins = "PG10"; + function = "clock"; + }; }; gic: interrupt-controller@3021000 { @@ -262,6 +397,17 @@ #interrupt-cells = <3>; }; + iommu: iommu@30f0000 { + compatible = "allwinner,sun50i-h616-iommu", + "allwinner,sun50i-h6-iommu"; + reg = <0x030f0000 0x10000>; + interrupts = <GIC_SPI 61 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&ccu CLK_BUS_IOMMU>; + resets = <&ccu RST_BUS_IOMMU>; + #iommu-cells = <1>; + status = "okay"; + }; + mmc0: mmc@4020000 { compatible = "allwinner,sun50i-h616-mmc", "allwinner,sun50i-a100-mmc"; @@ -325,6 +471,242 @@ #size-cells = <0>; }; + dma: dma-controller@3002000 { + compatible = "allwinner,sun50i-h616-dma"; + reg = <0x03002000 0x1000>; + interrupts = <GIC_SPI 42 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&ccu CLK_BUS_DMA>, <&ccu CLK_MBUS_DMA>; + clock-names = "bus", "mbus"; + dma-channels = <16>; + dma-requests = <49>; + resets = <&ccu RST_BUS_DMA>; + #dma-cells = <1>; + }; + + codec: codec@05096000 { + #sound-dai-cells = <0>; + compatible = "allwinner,sun50i-h616-codec"; + reg = <0x05096000 0x31c>; + interrupts = <GIC_SPI 58 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&ccu CLK_BUS_AUDIO_CODEC>, + <&ccu CLK_AUDIO_CODEC_1X>, + <&ccu CLK_AUDIO_CODEC_4X>; + clock-names = "apb", "audio-codec-1x", "audio-codec-4x"; + resets = <&ccu RST_BUS_AUDIO_CODEC>; + dmas = <&dma 6>; + dma-names = "tx"; + status = "disabled"; + }; + + ahub_dam_plat:ahub_dam_plat@5097000 { + #sound-dai-cells = <0>; + /* sound card without pcm for hardware mix setting */ + compatible = "allwinner,sunxi-snd-plat-ahub_dam"; + reg = <0x05097000 0x1000>; + resets = <&ccu RST_BUS_AUDIO_HUB>; + clocks = <&ccu CLK_AUDIO_CODEC_1X>, + <&ccu CLK_AUDIO_CODEC_4X>, + <&ccu CLK_AUDIO_HUB>, + <&ccu CLK_BUS_AUDIO_HUB>; + clock-names = "clk_pll_audio", + "clk_pll_audio_4x", + "clk_audio_hub", + "clk_bus_audio_hub"; + status = "disabled"; + }; + + ahub_dam_mach:ahub_dam_mach { + compatible = "allwinner,sunxi-snd-mach"; + soundcard-mach,name = "ahubdam"; + status = "disabled"; + soundcard-mach,cpu { + sound-dai = <&ahub_dam_plat>; + }; + soundcard-mach,codec { + }; + }; + + ahub1_plat:ahub1_plat { + #sound-dai-cells = <0>; + compatible = "allwinner,sunxi-snd-plat-ahub"; + apb_num = <1>; /* for dma port 4 */ + dmas = <&dma 4>, <&dma 4>; + dma-names = "tx", "rx"; + playback_cma = <128>; + capture_cma = <128>; + tx_fifo_size = <128>; + rx_fifo_size = <128>; + + tdm_num = <1>; + tx_pin = <0>; + rx_pin = <0>; + status = "disabled"; + }; + + ahub1_mach:ahub1_mach { + compatible = "allwinner,sunxi-snd-mach"; + soundcard-mach,name = "ahubhdmi"; + + soundcard-mach,format = "i2s"; + soundcard-mach,frame-master = <&ahub1_cpu>; + soundcard-mach,bitclock-master = <&ahub1_cpu>; + /* soundcard-mach,frame-inversion; */ + /* soundcard-mach,bitclock-inversion; */ + soundcard-mach,slot-num = <2>; + soundcard-mach,slot-width = <32>; + status = "disabled"; + ahub1_cpu: soundcard-mach,cpu { + sound-dai = <&ahub1_plat>; + soundcard-mach,pll-fs = <4>; + soundcard-mach,mclk-fs = <0>; + }; + + ahub1_codec: soundcard-mach,codec { + sound-dai = <&hdmi>; + }; + }; + + hdmi: hdmi@6000000 { + #sound-dai-cells = <0>; + compatible = "allwinner,sun50i-h616-dw-hdmi", + "allwinner,sun50i-h6-dw-hdmi"; + reg = <0x06000000 0x10000>; + reg-io-width = <1>; + interrupts = <GIC_SPI 63 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&ccu CLK_BUS_HDMI>, <&ccu CLK_HDMI_SLOW>, + <&ccu CLK_HDMI>, <&ccu CLK_HDMI_CEC>, + <&ccu CLK_HDCP>, <&ccu CLK_BUS_HDCP>; + clock-names = "iahb", "isfr", "tmds", "cec", "hdcp", + "hdcp-bus"; + resets = <&ccu RST_BUS_HDMI>, <&ccu RST_BUS_HDCP>; + reset-names = "ctrl", "hdcp"; + phys = <&hdmi_phy>; + phy-names = "phy"; + status = "disabled"; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + hdmi_in: port@0 { + reg = <0>; + + hdmi_in_tcon_top: endpoint { + remote-endpoint = <&tcon_top_hdmi_out_hdmi>; + }; + }; + + hdmi_out: port@1 { + reg = <1>; + }; + }; + }; + + hdmi_phy: hdmi-phy@6010000 { + compatible = "allwinner,sun50i-h616-hdmi-phy"; + reg = <0x06010000 0x10000>; + clocks = <&ccu CLK_BUS_HDMI>, <&ccu CLK_HDMI_SLOW>; + clock-names = "bus", "mod"; + resets = <&ccu RST_BUS_HDMI_SUB>; + reset-names = "phy"; + #phy-cells = <0>; + }; + + tcon_top: tcon-top@6510000 { + compatible = "allwinner,sun50i-h6-tcon-top"; + reg = <0x06510000 0x1000>; + clocks = <&ccu CLK_BUS_TCON_TOP>, + <&ccu CLK_TCON_TV0>; + clock-names = "bus", + "tcon-tv0"; + clock-output-names = "tcon-top-tv0"; + resets = <&ccu RST_BUS_TCON_TOP>; + #clock-cells = <1>; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + tcon_top_mixer0_in: port@0 { + #address-cells = <1>; + #size-cells = <0>; + reg = <0>; + + tcon_top_mixer0_in_mixer0: endpoint@0 { + reg = <0>; + remote-endpoint = <&mixer0_out_tcon_top_mixer0>; + }; + }; + + tcon_top_mixer0_out: port@1 { + #address-cells = <1>; + #size-cells = <0>; + reg = <1>; + + tcon_top_mixer0_out_tcon_tv: endpoint@2 { + reg = <2>; + remote-endpoint = <&tcon_tv_in_tcon_top_mixer0>; + }; + }; + + tcon_top_hdmi_in: port@4 { + #address-cells = <1>; + #size-cells = <0>; + reg = <4>; + + tcon_top_hdmi_in_tcon_tv: endpoint@0 { + reg = <0>; + remote-endpoint = <&tcon_tv_out_tcon_top>; + }; + }; + + tcon_top_hdmi_out: port@5 { + reg = <5>; + + tcon_top_hdmi_out_hdmi: endpoint { + remote-endpoint = <&hdmi_in_tcon_top>; + }; + }; + }; + }; + + tcon_tv: lcd-controller@6515000 { + compatible = "allwinner,sun50i-h6-tcon-tv", + "allwinner,sun8i-r40-tcon-tv"; + reg = <0x06515000 0x1000>; + interrupts = <GIC_SPI 66 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&ccu CLK_BUS_TCON_TV0>, + <&tcon_top CLK_TCON_TOP_TV0>; + clock-names = "ahb", + "tcon-ch1"; + resets = <&ccu RST_BUS_TCON_TV0>; + reset-names = "lcd"; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + tcon_tv_in: port@0 { + reg = <0>; + + tcon_tv_in_tcon_top_mixer0: endpoint { + remote-endpoint = <&tcon_top_mixer0_out_tcon_tv>; + }; + }; + + tcon_tv_out: port@1 { + #address-cells = <1>; + #size-cells = <0>; + reg = <1>; + + tcon_tv_out_tcon_top: endpoint@1 { + reg = <1>; + remote-endpoint = <&tcon_top_hdmi_in_tcon_tv>; + }; + }; + }; + }; + uart0: serial@5000000 { compatible = "snps,dw-apb-uart"; reg = <0x05000000 0x400>; @@ -504,6 +886,26 @@ }; }; + emac1: ethernet@5030000 { + compatible = "allwinner,sun50i-h616-emac0", + "allwinner,sun50i-a64-emac"; + reg = <0x05030000 0x10000>; + interrupts = <GIC_SPI 15 IRQ_TYPE_LEVEL_HIGH>; + interrupt-names = "macirq"; + resets = <&ccu RST_BUS_EMAC1>; + reset-names = "stmmaceth"; + clocks = <&ccu CLK_BUS_EMAC1>; + clock-names = "stmmaceth"; + syscon = <&syscon 1>; + status = "disabled"; + + mdio1: mdio { + compatible = "snps,dwmac-mdio"; + #address-cells = <1>; + #size-cells = <0>; + }; + }; + usbotg: usb@5100000 { compatible = "allwinner,sun50i-h616-musb", "allwinner,sun8i-h3-musb"; @@ -664,14 +1066,52 @@ status = "disabled"; }; + deinterlace: deinterlace@1420000 { + compatible = "allwinner,sun50i-h6-deinterlace"; + reg = <0x01420000 0x40000>; + clocks = <&ccu CLK_BUS_DEINTERLACE>, + <&ccu CLK_DEINTERLACE>, + <&ccu CLK_MBUS_VE>; + clock-names = "bus", "mod", "ram"; + resets = <&ccu RST_BUS_DEINTERLACE>; + interrupts = <GIC_SPI 89 IRQ_TYPE_LEVEL_HIGH>; + }; + + video-codec@1c0e000 { + compatible = "allwinner,sun50i-h616-video-engine"; + reg = <0x01c0e000 0x2000>; + clocks = <&ccu CLK_BUS_VE>, <&ccu CLK_VE>, + <&ccu CLK_MBUS_VE>; + clock-names = "ahb", "mod", "ram"; + resets = <&ccu RST_BUS_VE>; + interrupts = <GIC_SPI 93 IRQ_TYPE_LEVEL_HIGH>; + allwinner,sram = <&ve_sram 1>; + iommus = <&iommu 2>, <&iommu 3>; + }; + + gpu: gpu@0x01800000 { + compatible = "allwinner,sun50i-h616-mali", "arm,mali-bifrost"; + reg = <0x1800000 0x40000>; + interrupt-parent = <&gic>; + interrupts = <GIC_SPI 95 IRQ_TYPE_LEVEL_HIGH>, + <GIC_SPI 96 IRQ_TYPE_LEVEL_HIGH>, + <GIC_SPI 97 IRQ_TYPE_LEVEL_HIGH>; + interrupt-names = "job", "mmu", "gpu"; + clocks = <&ccu CLK_GPU0>, <&ccu CLK_BUS_GPU>; + clock-names = "core", "bus"; + resets = <&ccu RST_BUS_GPU>; + operating-points-v2 = <&gpu_opp_table>; + #cooling-cells = <2>; + status = "disabled"; + }; + rtc: rtc@7000000 { - compatible = "allwinner,sun50i-h616-rtc"; + compatible = "allwinner,sun50i-h616-rtc", + "allwinner,sun50i-h6-rtc"; reg = <0x07000000 0x400>; - interrupts = <GIC_SPI 104 IRQ_TYPE_LEVEL_HIGH>; - clocks = <&r_ccu CLK_R_APB1_RTC>, <&osc24M>, - <&ccu CLK_PLL_SYSTEM_32K>; - clock-names = "bus", "hosc", - "pll-32k"; + interrupts = <GIC_SPI 101 IRQ_TYPE_LEVEL_HIGH>, + <GIC_SPI 102 IRQ_TYPE_LEVEL_HIGH>; + clock-output-names = "osc32k", "osc32k-out", "iosc"; #clock-cells = <1>; }; @@ -747,5 +1187,155 @@ #address-cells = <1>; #size-cells = <0>; }; + + ths: thermal-sensor@5070400 { + /* The Thermal Sensor Controller(THS) embeds four thermal sensors, + sensor0 is located in GPU + sensor1 is located in VE + sensor2 is located in CPU + sensor3 is located in DDR + */ + compatible = "allwinner,sun50i-h616-ths"; + reg = <0x05070400 0x400>; + interrupts = <GIC_SPI 19 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&ccu CLK_BUS_THS>; + clock-names = "bus"; + resets = <&ccu RST_BUS_THS>; + nvmem-cells = <&ths_calibration>; + nvmem-cell-names = "calibration"; + #thermal-sensor-cells = <1>; + }; + + sunxi-info { + compatible = "allwinner,sun50i-h6-sys-info"; + status = "okay"; + }; + + addr_mgt: addr-mgt { + compatible = "allwinner,sunxi-addr_mgt"; + type_addr_wifi = <0x2>; + type_addr_bt = <0x2>; + type_addr_eth = <0x2>; + status = "okay"; + }; + + dump_reg: dump_reg@20000 { + compatible = "allwinner,sunxi-dump-reg"; + reg = <0x0 0x03001000 0x0 0x0f20>; + status = "okay"; + }; + }; + + thermal-zones { + cpu-thermal { + polling-delay-passive = <0>; + polling-delay = <0>; + thermal-sensors = <&ths 2>; + + trips { + cpu_alert: cpu-alert { + temperature = <85000>; + hysteresis = <2000>; + type = "passive"; + }; + + cpu-crit { + temperature = <100000>; + hysteresis = <0>; + type = "critical"; + }; + }; + + cooling-maps { + map0 { + trip = <&cpu_alert>; + cooling-device = <&cpu0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>, + <&cpu1 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>, + <&cpu2 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>, + <&cpu3 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>; + }; + }; + }; + + gpu-thermal { + polling-delay-passive = <0>; + polling-delay = <0>; + thermal-sensors = <&ths 0>; + + trips { + gpu_alert: gpu-alert { + temperature = <85000>; + hysteresis = <2000>; + type = "passive"; + }; + + gpu-crit { + temperature = <100000>; + hysteresis = <0>; + type = "critical"; + }; + }; + + cooling-maps { + map0 { + trip = <&gpu_alert>; + cooling-device = <&gpu THERMAL_NO_LIMIT THERMAL_NO_LIMIT>; + }; + }; + }; + + ve-thermal { + polling-delay-passive = <0>; + polling-delay = <0>; + thermal-sensors = <&ths 1>; + + trips { + ve_alert: ve-alert { + temperature = <85000>; + hysteresis = <2000>; + type = "passive"; + }; + }; + }; + + ddr-thermal { + polling-delay-passive = <0>; + polling-delay = <0>; + thermal-sensors = <&ths 3>; + + trips { + ddr_alert: ddr-alert { + temperature = <85000>; + hysteresis = <2000>; + type = "passive"; + }; + }; + }; }; + + gpu_opp_table: gpu-opp-table { + compatible = "operating-points-v2"; + opp-125000000 { + opp-hz = /bits/ 64 <125000000>; + opp-microvolt = <810000>; + }; + opp-250000000 { + opp-hz = /bits/ 64 <250000000>; + opp-microvolt = <810000>; + }; + opp-432000000 { + opp-hz = /bits/ 64 <432000000>; + opp-microvolt = <810000>; + }; + opp-600000000 { + opp-hz = /bits/ 64 <600000000>; + opp-microvolt = <960000>; + }; + opp-800000000 { + opp-hz = /bits/ 64 <800000000>; + opp-microvolt = <1080000>; + }; + }; + }; + diff --git a/arch/arm/dts/sun50i-h618-orangepi-zero3.dts b/arch/arm/dts/sun50i-h618-orangepi-zero3.dts new file mode 100644 index 0000000000..ce748e909b --- /dev/null +++ b/arch/arm/dts/sun50i-h618-orangepi-zero3.dts @@ -0,0 +1,399 @@ +// 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 Zero3"; + compatible = "xunlong,orangepi-zero3", "allwinner,sun50i-h616"; + + aliases { + ethernet0 = &emac0; + ethernet1 = &wlan; + serial0 = &uart0; + serial5 = &uart5; + mmc0 = &mmc0; /* mmc0/mmcblk0 for SD */ + mmc1 = &mmc1; /* mmc1/mmcblk1 for SDIO */ + }; + + 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-red { + function = LED_FUNCTION_DISK_ACTIVITY; + label = "red_led"; + gpios = <&pio 2 12 GPIO_ACTIVE_HIGH>; /* PC12 */ + linux,default-trigger = "mmc0"; + }; + + led-green { + function = LED_FUNCTION_STATUS; + 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_usb1_vbus: usb1-vbus { + compatible = "regulator-fixed"; + regulator-name = "usb1-vbus"; + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>; + vin-supply = <®_vcc5v>; + enable-active-high; + gpio = <&pio 2 16 GPIO_ACTIVE_HIGH>; /* PC16 */ + status = "okay"; + }; + + 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 = <®_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 = <®_vcc33_wifi>; + }; + + wifi_pwrseq: wifi-pwrseq { + compatible = "mmc-pwrseq-simple"; + clocks = <&rtc CLK_OSC32K_FANOUT>; + clock-names = "ext_clock"; + pinctrl-names = "default"; + pinctrl-0 = <&clk_losc>; /* PG10 with MUX3 set */ + reset-gpios = <&pio 6 18 GPIO_ACTIVE_LOW>; /* PG18 */ + post-power-on-delay-ms = <200>; + }; +}; + +&cpu0 { + cpu-supply = <®_dcdc2>; + status = "okay"; +}; + +&de { + status = "okay"; +}; + +&hdmi { + //hvcc-supply = <®_bldo1>; + status = "okay"; +}; + +&hdmi_out { + hdmi_out_con: endpoint { + remote-endpoint = <&hdmi_con_in>; + }; +}; + +&gpu { + mali-supply = <®_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 = "okay"; +}; + +&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 = <®_dldo1>; + cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>; /* PF6 */ + bus-width = <4>; + max-frequency = <50000000>; + status = "okay"; +}; + +&mmc1 { + vmmc-supply = <®_vcc33_wifi>; + vqmmc-supply = <®_vcc_wifi_io>; + mmc-pwrseq = <&wifi_pwrseq>; + bus-width = <4>; + non-removable; + mmc-ddr-1_8v; + status = "okay"; + + wlan: wifi@1 { + reg = <1>; + }; +}; + +&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"; +}; + +&uart1 { + pinctrl-names = "default"; + pinctrl-0 = <&uart1_pins>, <&uart1_rts_cts_pins>; + uart-has-rtscts; + status = "okay"; + + bluetooth { + compatible = "brcm,bcm43438-bt"; + clocks = <&rtc 1>; + clock-names = "lpo"; + vbat-supply = <®_dldo1>; + vddio-supply = <®_dldo1>; + device-wakeup-gpios = <&r_pio 0 6 GPIO_ACTIVE_HIGH>; /* PL6 */ + host-wakeup-gpios = <&r_pio 0 5 GPIO_ACTIVE_HIGH>; /* PL5 */ + shutdown-gpios = <&r_pio 0 4 GPIO_ACTIVE_HIGH>; /* PL4 */ + }; +}; + +&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 { + usb1_vbus-supply = <®_usb1_vbus>; + 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"; +}; + +&i2c1 { + status = "disabled"; +}; + +&i2c2 { + status = "disabled"; +}; + +&i2c3 { + status = "disabled"; +}; + +&i2c4 { + 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_cs0_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"; +}; diff --git a/arch/arm/dts/sun50i-h618-vontar-h618.dts b/arch/arm/dts/sun50i-h618-vontar-h618.dts new file mode 100644 index 0000000000..c199fe9722 --- /dev/null +++ b/arch/arm/dts/sun50i-h618-vontar-h618.dts @@ -0,0 +1,314 @@ +// SPDX-License-Identifier: (GPL-2.0+ or MIT) +/* + * Author: piotr.oniszczuk@gmail.com + */ + +/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 = "Vontar H618"; + compatible = "tanix,tx6s", "allwinner,sun50i-h616"; + + aliases { + mmc0 = &mmc0; + mmc2 = &mmc2; + ethernet0 = &emac1; + ethernet1 = &wlan; + serial0 = &uart0; + }; + + chosen { + stdout-path = "serial0:115200n8"; + }; + + connector { + compatible = "hdmi-connector"; + type = "d"; + + port { + hdmi_con_in: endpoint { + remote-endpoint = <&hdmi_out_con>; + }; + }; + }; + + 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_usb1_vbus: usb1-vbus { + compatible = "regulator-fixed"; + regulator-name = "usb1-vbus"; + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>; + vin-supply = <®_vcc5v>; + enable-active-high; + /* gpio = <&pio 2 16 GPIO_ACTIVE_HIGH>; PC16 */ + status = "okay"; + }; + + reg_vcc_wifi: reg_vcc_wifi { + compatible = "regulator-fixed"; + regulator-name = "vcc-wifi"; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + gpio = <&pio 6 18 GPIO_ACTIVE_HIGH>; /* PG18 WL_REG_ON */ + regulator-always-on; + enable-active-high; + status = "okay"; + }; + + wifi_pwrseq: wifi_pwrseq { + compatible = "mmc-pwrseq-simple"; + clocks = <&rtc CLK_OSC32K_FANOUT>; + clock-names = "ext_clock"; + pinctrl-names = "default"; + pinctrl-0 = <&clk_losc>; /* PG10 with MUX3 set */ + }; + + openvfd { + compatible = "open,vfd"; + dev_name = "openvfd"; + openvfd_gpio_clk = <&pio 8 11 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>; + openvfd_gpio_dat = <&pio 8 12 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>; + vfd_gpio_chip_name = "0300b000.pinctrl"; + openvfd_chars = [02 01 02 03 04]; + openvfd_dot_bits = [00 01 03 02 04 05 06]; + openvfd_display_type = <0x03000000>; + status = "okay"; + }; +}; + +&cpu0 { + cpu-supply = <®_dcdc2>; + status = "okay"; +}; + +&de { + status = "okay"; +}; + +&ehci0 { + status = "okay"; +}; + +&ehci1 { + status = "okay"; +}; + +&ehci2 { + status = "okay"; +}; + +&ehci3 { + status = "okay"; +}; + +&hdmi { + hvcc-supply = <®_aldo1>; + status = "okay"; +}; + +&hdmi_out { + hdmi_out_con: endpoint { + remote-endpoint = <&hdmi_con_in>; + }; +}; + +&gpu { + mali-supply = <®_dcdc1>; + status = "okay"; +}; + +&i2c3 { + status = "okay"; +}; + +&emac1 { + pinctrl-names = "default"; + pinctrl-0 = <&rmii_pins>; + phy-mode = "rmii"; + phy-handle = <&rmii_phy>; + phy-supply = <®_aldo1>; + 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>; + }; +}; + +&mmc0 { + vmmc-supply = <®_dldo1>; + broken-cd; + bus-width = <4>; + status = "okay"; +}; + +&mmc1 { + vmmc-supply = <®_dldo1>; + vqmmc-supply = <®_vcc_wifi>; + mmc-pwrseq = <&wifi_pwrseq>; + bus-width = <4>; + non-removable; + status = "okay"; + + wlan: wifi@1 { + reg = <1>; + interrupt-parent = <&pio>; + interrupts = <6 15 IRQ_TYPE_EDGE_RISING>; /* PG15 WL_HOSTWAKE*/ + interrupt-names = "host-wake"; + local-mac-address = [dc 44 6d c0 ff 02]; + }; +}; + +&mmc2 { + vmmc-supply = <®_dldo1>; + bus-width = <8>; + non-removable; + cap-mmc-hw-reset; + status = "okay"; +}; + +&ohci0 { + status = "okay"; +}; + +&ohci1 { + status = "okay"; +}; + +&ohci2 { + status = "okay"; +}; + +&ohci3 { + status = "okay"; +}; + +&r_i2c { + status = "okay"; + + axp313a: pmic@36 { + compatible = "x-powers,axp313a"; + reg = <0x36>; + wakeup-source; + vin1-supply = <®_vcc5v>; + vin2-supply = <®_vcc5v>; + vin3-supply = <®_vcc5v>; + + regulators { + reg_dcdc1: dcdc1 { + regulator-always-on; + regulator-min-microvolt = <810000>; + regulator-max-microvolt = <1160000>; + regulator-name = "vdd-gpu"; + }; + + reg_dcdc2: dcdc2 { + regulator-always-on; + regulator-min-microvolt = <810000>; + regulator-max-microvolt = <1160000>; + regulator-name = "vdd-cpu"; + }; + + reg_dcdc3: dcdc3 { + regulator-always-on; + regulator-min-microvolt = <1200000>; + regulator-max-microvolt = <1200000>; + regulator-name = "vdd-dram"; + }; + + reg_aldo1: aldo1 { + regulator-always-on; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + regulator-name = "vcc1v8"; + }; + + reg_dldo1: dldo1 { + regulator-always-on; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + regulator-name = "vcc3v3"; + }; + }; + }; +}; + +&uart0 { + pinctrl-names = "default"; + pinctrl-0 = <&uart0_ph_pins>; + status = "okay"; +}; + +&uart1 { + pinctrl-names = "default"; + pinctrl-0 = <&uart1_pins>, <&uart1_rts_cts_pins>; + uart-has-rtscts; + status = "okay"; + + bluetooth { + compatible = "brcm,bcm43438-bt"; + clocks = <&rtc 1>; + clock-names = "lpo"; + vbat-supply = <®_dldo1>; + vddio-supply = <®_dldo1>; + device-wakeup-gpios = <&r_pio 0 6 GPIO_ACTIVE_HIGH>; /* PL6 */ + host-wakeup-gpios = <&r_pio 0 5 GPIO_ACTIVE_HIGH>; /* PL5 */ + shutdown-gpios = <&r_pio 0 4 GPIO_ACTIVE_HIGH>; /* PL4 */ + }; +}; + +&usbotg { + dr_mode = "peripheral"; + status = "okay"; +}; + +&usbphy { + usb1_vbus-supply = <®_usb1_vbus>; + status = "okay"; +}; + +&ir { + linux,rc-map-name = "rc-beelink-gs1"; + status = "okay"; +}; + +&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"; +}; + diff --git a/configs/tanix-tx6s_defconfig b/configs/tanix-tx6s_defconfig new file mode 100644 index 0000000000..e9bd6d60fb --- /dev/null +++ b/configs/tanix-tx6s_defconfig @@ -0,0 +1,26 @@ +CONFIG_ARM=y +CONFIG_ARCH_SUNXI=y +CONFIG_DEFAULT_DEVICE_TREE="sun50i-h616-tanix-tx6s" +CONFIG_SPL=y +CONFIG_DRAM_CLK=648 +CONFIG_DRAM_ODT_EN=y +CONFIG_DRAM_SUN50I_H616_DX_ODT=0x03030303 +CONFIG_DRAM_SUN50I_H616_DX_DRI=0x0e0e0e0e +CONFIG_DRAM_SUN50I_H616_CA_DRI=0x1c12 +CONFIG_DRAM_SUN50I_H616_ODT_EN=0x00000001 +CONFIG_DRAM_SUN50I_H616_TPR0=0xc0000c05 +#CONFIG_DRAM_SUN50I_H616_TPR2=0x00000000 +CONFIG_DRAM_SUN50I_H616_TPR10=0x2f0007 +CONFIG_DRAM_SUN50I_H616_TPR11=0xffffdddd +CONFIG_DRAM_SUN50I_H616_TPR12=0xfedf7557 +CONFIG_MACH_SUN50I_H616=y +CONFIG_R_I2C_ENABLE=y +CONFIG_SPL_I2C=y +CONFIG_SPL_SYS_I2C_LEGACY=y +CONFIG_SYS_I2C_MVTWSI=y +CONFIG_SYS_I2C_SLAVE=0x7f +#CONFIG_SYS_I2C_SPEED=100000 +CONFIG_SYS_I2C_SPEED=400000 +CONFIG_SUPPORT_EMMC_BOOT=y +CONFIG_PHY_REALTEK=y +CONFIG_SUN8I_EMAC=y \ No newline at end of file
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor