ARM: dts: sunxi: Sync R40 dts(i) from v5.4
Subsystems (2)
PATCH 1/1 ARM: dts: sunxi: Sync R40 dts(i) from v5.4
Sync R40 dts(i) files from linux-next v5.4 tag.
This sync would update r40 dts(i) and v40-bananapi-m2-berry dts files.
--- arch/arm/dts/sun8i-r40-bananapi-m2-ultra.dts | 7 +- arch/arm/dts/sun8i-r40.dtsi | 24 ++-- arch/arm/dts/sun8i-v40-bananapi-m2-berry.dts | 135 ++++++++++++++++--- 3 files changed, 136 insertions(+), 30 deletions(-)
arch/arm/dts/sun8i-r40-bananapi-m2-ultra.dts +6 -1
@@ -201,10 +201,15 @@ &pio { pinctrl-names = "default"; pinctrl-0 = <&clk_out_a_pin>; + vcc-pa-supply = <®_aldo2>; + vcc-pc-supply = <®_dcdc1>; + vcc-pd-supply = <®_dcdc1>; + vcc-pe-supply = <®_eldo1>; + vcc-pf-supply = <®_dcdc1>; + vcc-pg-supply = <®_dldo1>; }; ®_aldo2 { - regulator-always-on; regulator-min-microvolt = <2500000>; regulator-max-microvolt = <2500000>; regulator-name = "vcc-pa";
arch/arm/dts/sun8i-r40.dtsi +10 -14
@@ -119,10 +119,10 @@ compatible = "allwinner,sun8i-r40-de2-clk", "allwinner,sun8i-h3-de2-clk"; reg = <0x01000000 0x100000>; - clocks = <&ccu CLK_DE>, - <&ccu CLK_BUS_DE>; - clock-names = "mod", - "bus"; + clocks = <&ccu CLK_BUS_DE>, + <&ccu CLK_DE>; + clock-names = "bus", + "mod"; resets = <&ccu RST_BUS_DE>; #clock-cells = <1>; #reset-cells = <1>;
@@ -322,8 +322,7 @@ }; rtc: rtc at 1c20400 { - compatible = "allwinner,sun8i-r40-rtc", - "allwinner,sun8i-h3-rtc"; + compatible = "allwinner,sun8i-r40-rtc"; reg = <0x01c20400 0x400>; interrupts = <GIC_SPI 24 IRQ_TYPE_LEVEL_HIGH>; clock-output-names = "osc32k", "osc32k-out";
@@ -409,6 +408,8 @@ wdt: watchdog at 1c20c90 { compatible = "allwinner,sun4i-a10-wdt"; reg = <0x01c20c90 0x10>; + interrupts = <GIC_SPI 24 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&osc24M>; }; uart0: serial at 1c28000 {
@@ -562,9 +563,7 @@ interrupts = <GIC_SPI 56 IRQ_TYPE_LEVEL_HIGH>; clocks = <&ccu CLK_BUS_SATA>, <&ccu CLK_SATA>; resets = <&ccu RST_BUS_SATA>; - resets-name = "ahci"; - #address-cells = <1>; - #size-cells = <0>; + reset-names = "ahci"; status = "disabled"; };
@@ -614,12 +613,9 @@ #size-cells = <0>; tcon_top_mixer0_in: port at 0 { - #address-cells = <1>; - #size-cells = <0>; reg = <0>; - tcon_top_mixer0_in_mixer0: endpoint at 0 { - reg = <0>; + tcon_top_mixer0_in_mixer0: endpoint { remote-endpoint = <&mixer0_out_tcon_top>; }; };
@@ -818,7 +814,7 @@ resets = <&ccu RST_BUS_HDMI1>; reset-names = "ctrl"; phys = <&hdmi_phy>; - phy-names = "hdmi-phy"; + phy-names = "phy"; status = "disabled"; ports {
arch/arm/dts/sun8i-v40-bananapi-m2-berry.dts +120 -15
202 lines not on this page · raw message
Signature · 1 line
2.18.0.321.gffc6fa0e3
PATCH 1/1 ARM: dts: sunxi: Sync R40 dts(i) from v5.4
On Tue, 21 Jan 2020 14:05:12 +0530
Jagan Teki <[email protected]> wrote:
Hi Jagan,
thanks for taking care of this.
Quoted 1 line
Sync R40 dts(i) files from linux-next v5.4 tag.
Why this tag? Shouldn't it be just the v5.4 release tag?
But honestly we should take the latest from Maxime's sunxi/for-next branch. This isn't merged into mainline yet, but has been reviewed by the community and committed by Maxime, which is usually as good as it gets. This would avoid doing this exercise in a month again, especially since there are some fixes to the R40 .dtsi in there.
Quoted 2 lines
This sync would update r40 dts(i) and v40-bananapi-m2-berry dts files.
So thanks for bringing this up, but see below:
Quoted 50 lines
Signed-off-by Jagan Teki <[email protected]>Signed-off-by Andre Przywara <[email protected]>--- arch/arm/dts/sun8i-r40-bananapi-m2-ultra.dts | 7 +- arch/arm/dts/sun8i-r40.dtsi | 24 ++-- arch/arm/dts/sun8i-v40-bananapi-m2-berry.dts | 135 ++++++++++++++++--- 3 files changed, 136 insertions(+), 30 deletions(-)arch/arm/dts/sun8i-r40-bananapi-m2-ultra.dts +6
-1@@ -201,10 +201,15 @@ &pio { pinctrl-names = "default"; pinctrl-0 = <&clk_out_a_pin>; + vcc-pa-supply = <®_aldo2>; + vcc-pc-supply = <®_dcdc1>; + vcc-pd-supply = <®_dcdc1>; + vcc-pe-supply = <®_eldo1>; + vcc-pf-supply = <®_dcdc1>; + vcc-pg-supply = <®_dldo1>; }; ®_aldo2 { - regulator-always-on; regulator-min-microvolt = <2500000>; regulator-max-microvolt = <2500000>; regulator-name = "vcc-pa";arch/arm/dts/sun8i-r40.dtsi +4
-4@@ -119,10 +119,10 @@ compatible = "allwinner,sun8i-r40-de2-clk", "allwinner,sun8i-h3-de2-clk"; reg = <0x01000000 0x100000>; - clocks = <&ccu CLK_DE>, - <&ccu CLK_BUS_DE>; - clock-names = "mod", - "bus"; + clocks = <&ccu CLK_BUS_DE>, + <&ccu CLK_DE>; + clock-names = "bus", + "mod"; resets = <&ccu RST_BUS_DE>; #clock-cells = <1>; #reset-cells = <1>;
arch/arm/dts/sun8i-r40.dtsi line 325
Quoted 6 lines
arch/arm/dts/sun8i-r40.dtsi +1
-2@@ -322,8 +322,7 @@ }; rtc: rtc at 1c20400 { - compatible = "allwinner,sun8i-r40-rtc", - "allwinner,sun8i-h3-rtc"; + compatible = "allwinner,sun8i-r40-rtc";
This is an example where the kernel DT changed in a slightly incompatible way.
It removes the H3 RTC string, so any kernels before v5.3 won't recognise the RTC anymore. This is an issue for EFI booting, especially distro installers.
From the pure RTC perspective it seems feasible to just keep the H3 fallback, but this brings issues with the new clock that's derived from the compatible as well. So we need to test a few older kernels with the new and probably amended DT (where we sync the kernel DT, but skip this one change).
I did a similar exercise in the past with some A64 and H5 boards, and found some issues, which is the reason I didn't send an update yet.
But maybe doing this for the R40 is a good exercise, because it has a more limited scope (only two boards in U-Boot), and the changes are minimal.
Do you have access to the M2 Ultra? I have the M2 Berry, so I would test some older kernels, to identify problematic versions (for instance v5.2/v5.3). Maybe you could verify any solutions on the M2 Ultra then.
Cheers,
Andre
Quoted 260 lines
arch/arm/dts/sun8i-r40.dtsi +5
-8reg = <0x01c20400 0x400>; interrupts = <GIC_SPI 24 IRQ_TYPE_LEVEL_HIGH>; clock-output-names = "osc32k", "osc32k-out";@@ -409,6 +408,8 @@ wdt: watchdog at 1c20c90 { compatible = "allwinner,sun4i-a10-wdt"; reg = <0x01c20c90 0x10>; + interrupts = <GIC_SPI 24 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&osc24M>; }; uart0: serial at 1c28000 {@@ -562,9 +563,7 @@ interrupts = <GIC_SPI 56 IRQ_TYPE_LEVEL_HIGH>; clocks = <&ccu CLK_BUS_SATA>, <&ccu CLK_SATA>; resets = <&ccu RST_BUS_SATA>; - resets-name = "ahci"; - #address-cells = <1>; - #size-cells = <0>; + reset-names = "ahci"; status = "disabled"; };@@ -614,12 +613,9 @@ #size-cells = <0>; tcon_top_mixer0_in: port at 0 { - #address-cells = <1>; - #size-cells = <0>; reg = <0>; - tcon_top_mixer0_in_mixer0: endpoint at 0 { - reg = <0>; + tcon_top_mixer0_in_mixer0: endpoint { remote-endpoint = <&mixer0_out_tcon_top>; }; };@@ -818,7 +814,7 @@ resets = <&ccu RST_BUS_HDMI1>; reset-names = "ctrl"; phys = <&hdmi_phy>; - phy-names = "hdmi-phy"; + phy-names = "phy"; status = "disabled"; ports {arch/arm/dts/sun8i-v40-bananapi-m2-berry.dts +120
-15@@ -50,6 +50,7 @@ compatible = "sinovoip,bpi-m2-berry", "allwinner,sun8i-r40"; aliases { + ethernet0 = &gmac; serial0 = &uart0; };@@ -57,6 +58,17 @@ stdout-path = "serial0:115200n8"; }; + connector { + compatible = "hdmi-connector"; + type = "a"; + + port { + hdmi_con_in: endpoint { + remote-endpoint = <&hdmi_out_con>; + }; + }; + }; + leds { compatible = "gpio-leds";@@ -84,12 +96,18 @@ wifi_pwrseq: wifi_pwrseq { compatible = "mmc-pwrseq-simple"; reset-gpios = <&pio 6 10 GPIO_ACTIVE_LOW>; /* PG10 WIFI_EN */ + clocks = <&ccu CLK_OUTA>; + clock-names = "ext_clock"; }; }; &ahci { - phy-supply = <®_eldo3>; /* VDD12-SATA */ - ahci-supply = <®_dldo4>; /* VDD25-SATA */ + ahci-supply = <®_dldo4>; + phy-supply = <®_eldo3>; + status = "okay"; +}; + +&de { status = "okay"; };@@ -98,6 +116,32 @@ status = "okay"; }; +&gmac { + pinctrl-names = "default"; + pinctrl-0 = <&gmac_rgmii_pins>; + phy-handle = <&phy1>; + phy-mode = "rgmii"; + phy-supply = <®_dc1sw>; + status = "okay"; +}; + +&gmac_mdio { + phy1: ethernet-phy at 1 { + compatible = "ethernet-phy-ieee802.3-c22"; + reg = <1>; + }; +}; + +&hdmi { + status = "okay"; +}; + +&hdmi_out { + hdmi_out_con: endpoint { + remote-endpoint = <&hdmi_con_in>; + }; +}; + &i2c0 { status = "okay";@@ -111,6 +155,41 @@ #include "axp22x.dtsi" +&mmc0 { + vmmc-supply = <®_dcdc1>; + bus-width = <4>; + cd-gpios = <&pio 7 13 GPIO_ACTIVE_LOW>; /* PH13 */ + status = "okay"; +}; + +&mmc1 { + pinctrl-names = "default"; + pinctrl-0 = <&mmc1_pg_pins>; + vmmc-supply = <®_dldo2>; + vqmmc-supply = <®_dldo1>; + mmc-pwrseq = <&wifi_pwrseq>; + bus-width = <4>; + non-removable; + status = "okay"; +}; + +&pio { + pinctrl-names = "default"; + pinctrl-0 = <&clk_out_a_pin>; + vcc-pa-supply = <®_aldo2>; + vcc-pc-supply = <®_dcdc1>; + vcc-pd-supply = <®_dcdc1>; + vcc-pe-supply = <®_eldo1>; + vcc-pf-supply = <®_dcdc1>; + vcc-pg-supply = <®_dldo1>; +}; + +®_aldo2 { + regulator-min-microvolt = <2500000>; + regulator-max-microvolt = <2500000>; + regulator-name = "vcc-pa"; +}; + ®_aldo3 { regulator-always-on; regulator-min-microvolt = <2700000>;@@ -118,6 +197,12 @@ regulator-name = "avcc"; }; +®_dc1sw { + regulator-min-microvolt = <3000000>; + regulator-max-microvolt = <3000000>; + regulator-name = "vcc-gmac-phy"; +}; + ®_dcdc1 { regulator-always-on; regulator-min-microvolt = <3000000>;@@ -152,12 +237,27 @@ regulator-name = "vcc-wifi-io"; }; +/* + * Our WiFi chip needs both DLDO2 and DLDO3 to be powered at the same + * time, with the two being in sync, to be able to meet maximum power + * consumption during transmits. Since this is not really supported + * right now, just use the two as always on, and we will fix it later. + */ + ®_dldo2 { + regulator-always-on; regulator-min-microvolt = <3300000>; regulator-max-microvolt = <3300000>; regulator-name = "vcc-wifi"; }; +®_dldo3 { + regulator-always-on; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + regulator-name = "vcc-wifi-2"; +}; + ®_dldo4 { regulator-min-microvolt = <2500000>; regulator-max-microvolt = <2500000>;@@ -170,28 +270,33 @@ regulator-name = "vdd1v2-sata"; }; -&mmc0 { - vmmc-supply = <®_dcdc1>; - bus-width = <4>; - cd-gpios = <&pio 7 13 GPIO_ACTIVE_LOW>; /* PH13 */ +&tcon_tv0 { status = "okay"; }; -&mmc1 { +&uart0 { pinctrl-names = "default"; - pinctrl-0 = <&mmc1_pg_pins>; - vmmc-supply = <®_dldo2>; - vqmmc-supply = <®_dldo1>; - mmc-pwrseq = <&wifi_pwrseq>; - bus-width = <4>; - non-removable; + pinctrl-0 = <&uart0_pb_pins>; status = "okay"; }; -&uart0 { +&uart3 { pinctrl-names = "default"; - pinctrl-0 = <&uart0_pb_pins>; + pinctrl-0 = <&uart3_pg_pins>, <&uart3_rts_cts_pg_pins>; + uart-has-rtscts; status = "okay"; + + bluetooth { + compatible = "brcm,bcm43438-bt"; + clocks = <&ccu CLK_OUTA>; + clock-names = "lpo"; + vbat-supply = <®_dldo2>; + vddio-supply = <®_dldo1>; + device-wakeup-gpios = <&pio 6 11 GPIO_ACTIVE_HIGH>; /* PG11 */ + /* TODO host wake line connected to PMIC GPIO pins */ + shutdown-gpios = <&pio 7 12 GPIO_ACTIVE_HIGH>; /* PH12 */ + max-speed = <1500000>; + }; }; &usbphy {
PATCH 1/1 ARM: dts: sunxi: Sync R40 dts(i) from v5.4
Hi Andre,
Quoted 4 lines · Andre Przywara
On Tue, 21 Jan 2020 14:05:12 +0530
Jagan Teki <[email protected]> wrote:
Quoted 8 lines
Hi Jagan,
thanks for taking care of this.
Quoted 1 line
Sync R40 dts(i) files from linux-next v5.4 tag.
Why this tag? Shouldn't it be just the v5.4 release tag?
But honestly we should take the latest from Maxime's sunxi/for-next branch. This isn't merged into mainline yet, but has been reviewed by the community and committed by Maxime, which is usually as good as it gets. This would avoid doing this exercise in a month again, especially since there are some fixes to the R40 .dtsi in there.
And all Maxime's sunxi changes would first merged into linux-next, isn't it? Since I usually sync linux-next as it has latest changed merged.
Quoted 66 lines
Quoted 3 lines
This sync would update r40 dts(i) and v40-bananapi-m2-berry dts files.
So thanks for bringing this up, but see below:
Quoted 50 lines
Signed-off-by Jagan Teki <[email protected]>Signed-off-by Andre Przywara <[email protected]>--- arch/arm/dts/sun8i-r40-bananapi-m2-ultra.dts | 7 +- arch/arm/dts/sun8i-r40.dtsi | 24 ++-- arch/arm/dts/sun8i-v40-bananapi-m2-berry.dts | 135 ++++++++++++++++--- 3 files changed, 136 insertions(+), 30 deletions(-)arch/arm/dts/sun8i-r40-bananapi-m2-ultra.dts +6
-1@@ -201,10 +201,15 @@ &pio { pinctrl-names = "default"; pinctrl-0 = <&clk_out_a_pin>; + vcc-pa-supply = <®_aldo2>; + vcc-pc-supply = <®_dcdc1>; + vcc-pd-supply = <®_dcdc1>; + vcc-pe-supply = <®_eldo1>; + vcc-pf-supply = <®_dcdc1>; + vcc-pg-supply = <®_dldo1>; }; ®_aldo2 { - regulator-always-on; regulator-min-microvolt = <2500000>; regulator-max-microvolt = <2500000>; regulator-name = "vcc-pa";arch/arm/dts/sun8i-r40.dtsi +4
-4@@ -119,10 +119,10 @@ compatible = "allwinner,sun8i-r40-de2-clk", "allwinner,sun8i-h3-de2-clk"; reg = <0x01000000 0x100000>; - clocks = <&ccu CLK_DE>, - <&ccu CLK_BUS_DE>; - clock-names = "mod", - "bus"; + clocks = <&ccu CLK_BUS_DE>, + <&ccu CLK_DE>; + clock-names = "bus", + "mod"; resets = <&ccu RST_BUS_DE>; #clock-cells = <1>; #reset-cells = <1>;arch/arm/dts/sun8i-r40.dtsi line 325
Quoted 6 lines
arch/arm/dts/sun8i-r40.dtsi +1
-2@@ -322,8 +322,7 @@ }; rtc: rtc at 1c20400 { - compatible = "allwinner,sun8i-r40-rtc", - "allwinner,sun8i-h3-rtc"; + compatible = "allwinner,sun8i-r40-rtc";This is an example where the kernel DT changed in a slightly incompatible way.
It removes the H3 RTC string, so any kernels before v5.3 won't recognise the RTC anymore. This is an issue for EFI booting, especially distro installers.
Quoted 3 lines
From the pure RTC perspective it seems feasible to just keep the H3 fallback, but this brings issues with the new clock that's derived from the compatible as well. So we need to test a few older kernels with the new and probably amended DT (where we sync the kernel DT, but skip this one change).
I did a similar exercise in the past with some A64 and H5 boards, and found some issues, which is the reason I didn't send an update yet.
If the installers are trying to use the latest u-boot, can't they use latest linux versions or so? Otherwise dts sync approach is incompatibility for those use cases.
Quoted 3 lines
But maybe doing this for the R40 is a good exercise, because it has a more limited scope (only two boards in U-Boot), and the changes are minimal.
Do you have access to the M2 Ultra? I have the M2 Berry, so I would test some older kernels, to identify problematic versions (for instance v5.2/v5.3). Maybe you could verify any solutions on the M2 Ultra then.
Yes, I have. Let me know if you have any specific image to verify.