Add support for Orange Pi 3
Subsystems (13)
v2 cover Add support for Orange Pi 3
From: Ondrej Jirman <megous-5qf/[email protected]>
This series implements support for Xunlong Orange Pi 3 board.
Unfortunately, this board needs some small driver patches, so I have split the boards DT patch into chunks that require patches for drivers in various subsystems.
In v2 of this series I've reordered the patches and I've put less controversial patches first.
Suggested merging plan/dependencies:
- Basic board dts can work alone. (patches 1-2)
- Pinctrl and stmmac patches are needed for ethernet support. (patches 3-7)
- HDMI depends on sorting out how to model DDC voltage shifter in DT, which is not clear yet. (patches 8-10)
- WiFi stuff will have to wait for H6 RTC patches, which in turn depend on ChenYu's RTC series, to be merged. That will take a while yet. I'm just keeping them in the series for completness. (patches 11-13)
This patch is also needed to not get segfault on boot (it was already merged a day ago or so):
https://lkml.org/lkml/2019/4/5/856
Changes in v2:
- added dt-bindings documentation for the board's compatible string (suggested by Clement)
- addressed checkpatch warnings and code formatting issues (on Maxime's suggestions)
- stmmac: dropped useless parenthesis, reworded description of the patch (suggested by Sergei)
- drop useles dev_info() about the selected io bias voltage
- docummented io voltage bias selection variant macros
- wifi: marked WiFi DTS patch and realted mmc1_pins as "DO NOT MERGE", because wifi depends on H6 RTC support that's not merged yet (suggested by Clement)
- added missing signed-of-bys
- changed &usb2otg dr_mode to otg, and added a note about VBUS
- improved wording of HDMI driver's DDC power supply patch
Open questions ATM:
- should mmc1_pins be default pinconf for mmc1?
- how to model DDC IO voltage shifter enable signal for HDMI? (it's not really a power supply, but it's modelled as one in the patches for now)
Please take a look.
thank you and regards,
Ondrej Jirman
Icenowy Zheng (2):
net: stmmac: sun8i: add support for Allwinner H6 EMAC
net: stmmac: sun8i: force select external PHY when no internal one
Ondrej Jirman (11):
dt-bindings: sunxi: Add compatible for OrangePi 3 board
arm64: dts: allwinner: h6: Add Orange Pi 3 DTS
pinctrl: sunxi: Prepare for alternative bias voltage setting methods
pinctrl: sunxi: Support I/O bias voltage setting on H6
arm64: dts: allwinner: orange-pi-3: Enable ethernet
drm: sun4i: Add support for enabling DDC I2C bus to dw_hdmi glue
dt-bindings: display: sun4i-drm: Add DDC power supply
arm64: dts: allwinner: orange-pi-3: Enable HDMI output
brcmfmac: Loading the correct firmware for brcm43456
[DO NOT MERGE] arm64: dts: allwinner: h6: Add MMC1 pins [DO NOT MERGE] arm64: dts: allwinner: orange-pi-3: Enable WiFi
.../devicetree/bindings/arm/sunxi.yaml | 5 + .../bindings/display/sunxi/sun4i-drm.txt | 1 + arch/arm64/boot/dts/allwinner/Makefile | 1 + .../dts/allwinner/sun50i-h6-orangepi-3.dts | 343 ++++++++++++++++++ arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi | 8 + drivers/gpu/drm/sun4i/sun8i_dw_hdmi.c | 17 +- drivers/gpu/drm/sun4i/sun8i_dw_hdmi.h | 1 + .../net/ethernet/stmicro/stmmac/dwmac-sun8i.c | 21 ++ .../broadcom/brcm80211/brcmfmac/sdio.c | 4 +- drivers/pinctrl/sunxi/pinctrl-sun50i-h6.c | 1 + drivers/pinctrl/sunxi/pinctrl-sun9i-a80.c | 2 +- drivers/pinctrl/sunxi/pinctrl-sunxi.c | 49 ++- drivers/pinctrl/sunxi/pinctrl-sunxi.h | 9 +- 13 files changed, 441 insertions(+), 21 deletions(-) create mode 100644 arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi-3.dts
Signature · 1 line
2.21.0
PATCH v2 1/13 dt-bindings: sunxi: Add compatible for OrangePi 3 board
From: Ondrej Jirman <megous-5qf/[email protected]>
Add new Xunlong Orange Pi 3 board compatible string to the bindings documentation.
--- Documentation/devicetree/bindings/arm/sunxi.yaml | 5 +++++ 1 file changed, 5 insertions(+)
Documentation/devicetree/bindings/arm/sunxi.yaml +5 -0
@@ -711,6 +711,11 @@ properties: - const: xunlong,orangepi-2 - const: allwinner,sun8i-h3 + - description: Xunlong OrangePi 3 + items: + - const: xunlong,orangepi-3 + - const: allwinner,sun50i-h6 + - description: Xunlong OrangePi Lite items: - const: xunlong,orangepi-lite
Signature · 1 line
2.21.0
Maxime Ripard
AppliedRe: [PATCH v2 01/13] dt-bindings: sunxi: Add compatible for OrangePi 3 board
Quoted 6 lines · On Tue, Apr 09, 2019 at 02:24:40AM +0200, [email protected] wrote:
From: Ondrej Jirman <[email protected]>
Add new Xunlong Orange Pi 3 board compatible string to the bindings documentation.
Signed-off-by Ondrej Jirman <[email protected]>
Applied, thanks!
Maxime
--
Maxime Ripard, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
PATCH v2 2/13 arm64: dts: allwinner: h6: Add Orange Pi 3 DTS
In reply to [email protected]From: Ondrej Jirman <megous-5qf/[email protected]>
Orange Pi 3 is a H6 based SBC made by Xulong, released in January 2019. It has the following features:
- Allwinner H6 quad-core 64-bit ARM Cortex-A53
- GPU Mali-T720
- 1GB or 2GB LPDDR3 RAM
- AXP805 PMIC
- AP6256 Wifi/BT 5.0
- USB 2.0 host port (A)
- USB 2.0 micro usb, OTG
- USB 3.0 Host + 4 port USB hub (GL3510)
- Gigabit Ethernet (Realtek RTL8211E phy)
- HDMI 2.0 port
- soldered eMMC (optional)
- 3x LED (one is on the bottom)
- microphone
- audio jack
- PCIe
Add basic support for the board.
--- arch/arm64/boot/dts/allwinner/Makefile | 1 + .../dts/allwinner/sun50i-h6-orangepi-3.dts | 216 ++++++++++++++++++ 2 files changed, 217 insertions(+) create mode 100644 arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi-3.dts
arch/arm64/boot/dts/allwinner/Makefile +1 -0
@@ -20,6 +20,7 @@ dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h5-orangepi-pc2.dtb dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h5-orangepi-prime.dtb dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h5-orangepi-zero-plus.dtb dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h5-orangepi-zero-plus2.dtb +dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h6-orangepi-3.dtb dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h6-orangepi-lite2.dtb dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h6-orangepi-one-plus.dtb dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h6-pine-h64.dtb
arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi-3.dts new file +216 -0
216 lines not on this page · raw message
Signature · 6 lines
2.21.0 -- You received this message because you are subscribed to the Google Groups "linux-sunxi" group. To unsubscribe from this group and stop receiving emails from it, send an email to linux-sunxi+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/[email protected] For more options, visit https://groups.google.com/d/optout.
Re: [PATCH v2 02/13] arm64: dts: allwinner: h6: Add Orange Pi 3 DTS
Hi,
arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi-3.dts line 63
Quoted 3 lines · On Tue, Apr 09, 2019 at 02:24:41AM +0200…
+&mmc0 {
arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi-3.dts new file +2
-0+ pinctrl-names = "default"; + pinctrl-0 = <&mmc0_pins>;
Since 5 minutes ago, that's now the default.
arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi-3.dts line 209
Quoted 8 lines
+&usb2otg {
arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi-3.dts new file +7
-0+ /* + * Beware that this board will not automatically disconnect + * VBUS from DCIN, when self-powered and used as a peripheral. + */ + dr_mode = "otg"; + status = "okay"; +};
As we were discussing, I guess leaving it as host is the safest option.
I can fix both issues while applying if that's ok for you.
Maxime
--
Maxime Ripard, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
Re: [PATCH v2 02/13] arm64: dts: allwinner: h6: Add Orange Pi 3 DTS
Quoted 8 lines · Maxime Ripard
Hi,
arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi-3.dts line 63
Quoted 3 lines · On Tue, Apr 09, 2019 at 02:24:41AM +0200…
+&mmc0 {
arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi-3.dts new file +2
-0+ pinctrl-names = "default"; + pinctrl-0 = <&mmc0_pins>;Since 5 minutes ago, that's now the default.
Ah. :)
Quoted 12 lines
arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi-3.dts line 209
Quoted 8 lines
+&usb2otg {
arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi-3.dts new file +7
-0+ /* + * Beware that this board will not automatically disconnect + * VBUS from DCIN, when self-powered and used as a peripheral. + */ + dr_mode = "otg"; + status = "okay"; +};As we were discussing, I guess leaving it as host is the safest option.
Quoted 1 line
I can fix both issues while applying if that's ok for you.
It's ok with me. Thank you.
o.
Quoted 6 lines
Maxime
--
Maxime Ripard, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
Re: [PATCH v2 02/13] arm64: dts: allwinner: h6: Add Orange Pi 3 DTS
Quoted 24 lines · Ondřej Jirman
Quoted 8 lines · Maxime Ripard
Hi,
arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi-3.dts line 63
Quoted 3 lines · On Tue, Apr 09, 2019 at 02:24:41AM +0200…
+&mmc0 {
arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi-3.dts new file +2
-0+ pinctrl-names = "default"; + pinctrl-0 = <&mmc0_pins>;Since 5 minutes ago, that's now the default.
Ah. :)
Quoted 12 lines
arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi-3.dts line 209
Quoted 8 lines
+&usb2otg {
arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi-3.dts new file +7
-0+ /* + * Beware that this board will not automatically disconnect + * VBUS from DCIN, when self-powered and used as a peripheral. + */ + dr_mode = "otg"; + status = "okay"; +};As we were discussing, I guess leaving it as host is the safest option.
Quoted 3 lines
Quoted 1 line
I can fix both issues while applying if that's ok for you.
It's ok with me. Thank you.
Done, thanks!
Maxime
--
Maxime Ripard, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
Signature · 3 lines
You received this message because you are subscribed to the Google Groups "linux-sunxi" group. To unsubscribe from this group and stop receiving emails from it, send an email to linux-sunxi+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/[email protected] For more options, visit https://groups.google.com/d/optout.
Re: [linux-sunxi] [PATCH v2 02/13] arm64: dts: allwinner: h6: Add Orange Pi 3 DTS
In reply to [email protected]Based on the conversation about using common dtsi from this thread[1], I'm commenting here to make show the diff directly on the nodes, giving comments on each node so-that we can see the diff globally.
Quoted 86 lines · megous via linux-sunxi
From: Ondrej Jirman <megous-5qf/[email protected]>
Orange Pi 3 is a H6 based SBC made by Xulong, released in January 2019. It has the following features:
- Allwinner H6 quad-core 64-bit ARM Cortex-A53
- GPU Mali-T720
- 1GB or 2GB LPDDR3 RAM
- AXP805 PMIC
- AP6256 Wifi/BT 5.0
- USB 2.0 host port (A)
- USB 2.0 micro usb, OTG
- USB 3.0 Host + 4 port USB hub (GL3510)
- Gigabit Ethernet (Realtek RTL8211E phy)
- HDMI 2.0 port
- soldered eMMC (optional)
- 3x LED (one is on the bottom)
- microphone
- audio jack
- PCIeAdd basic support for the board.
Signed-off-by Ondrej Jirman <megous-5qf/[email protected]>--- arch/arm64/boot/dts/allwinner/Makefile | 1 + .../dts/allwinner/sun50i-h6-orangepi-3.dts | 216 ++++++++++++++++++ 2 files changed, 217 insertions(+) create mode 100644 arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi-3.dtsarch/arm64/boot/dts/allwinner/Makefile +1
-0@@ -20,6 +20,7 @@ dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h5-orangepi-pc2.dtb dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h5-orangepi-prime.dtb dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h5-orangepi-zero-plus.dtb dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h5-orangepi-zero-plus2.dtb +dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h6-orangepi-3.dtb dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h6-orangepi-lite2.dtb dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h6-orangepi-one-plus.dtb dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h6-pine-h64.dtbarch/arm64/boot/dts/allwinner/sun50i-h6-orangepi-3.dts new file +37
-0@@ -0,0 +1,216 @@ +// SPDX-License-Identifier: (GPL-2.0+ or MIT) +/* + * Copyright (C) 2019 Ondřej Jirman <megous-5qf/[email protected]> + */ + +/dts-v1/; + +#include "sun50i-h6.dtsi" + +#include <dt-bindings/gpio/gpio.h> + +/ { + model = "OrangePi 3"; + compatible = "xunlong,orangepi-3", "allwinner,sun50i-h6"; + + aliases { + serial0 = &uart0; + }; + + chosen { + stdout-path = "serial0:115200n8"; + }; + + leds { + compatible = "gpio-leds"; + + power { + label = "orangepi:red:power"; + gpios = <&r_pio 0 4 GPIO_ACTIVE_HIGH>; /* PL4 */ + default-state = "on"; + }; + + status { + label = "orangepi:green:status"; + gpios = <&r_pio 0 7 GPIO_ACTIVE_HIGH>; /* PL7 */ + }; + };
arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi-3.dts line 47
Quoted 10 lines
arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi-3.dts new file +10
-0+ + 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; + }; +};
all above nodes are common to all h6 opi boards.
arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi-3.dts line 59
Quoted 12 lines
arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi-3.dts new file +12
-0+ +&cpu0 { + cpu-supply = <®_dcdca>; +}; + +&ehci0 { + status = "okay"; +}; + +&ehci3 { + status = "okay"; +};
common to all h6 opi boards.
arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi-3.dts line 68
Quoted 9 lines
arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi-3.dts new file +9
-0+ +&mmc0 { + pinctrl-names = "default"; + pinctrl-0 = <&mmc0_pins>; + vmmc-supply = <®_cldo1>; + cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>; /* PF6 */ + bus-width = <4>; + status = "okay"; +};
common to all h6 opi boards.
arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi-3.dts line 76
Quoted 8 lines
arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi-3.dts new file +8
-0+ +&ohci0 { + status = "okay"; +}; + +&ohci3 { + status = "okay"; +};
common to all h6 opi boards.
Quoted 15 lines
arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi-3.dts new file +15
-0+ +&pio { + vcc-pc-supply = <®_bldo2>; + vcc-pd-supply = <®_cldo1>; +}; + +&r_i2c { + status = "okay"; + + axp805: pmic@36 { + compatible = "x-powers,axp805", "x-powers,axp806"; + reg = <0x36>; + interrupt-parent = <&r_intc>; + interrupts = <0 IRQ_TYPE_LEVEL_LOW>; + interrupt-controller;
arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi-3.dts line 101
Quoted 10 lines
arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi-3.dts new file +10
-0+ #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>;
all these supply voltage regulators are common to h6 opi boards.
arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi-3.dts line 109
Quoted 8 lines
arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi-3.dts new file +8
-0+ + regulators { + reg_aldo1: aldo1 { + regulator-always-on; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + regulator-name = "vcc-pl-led-ir"; + };
same like other h6 boards.
arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi-3.dts line 115
Quoted 6 lines
arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi-3.dts new file +6
-0+ + reg_aldo2: aldo2 { + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + regulator-name = "vcc33-audio-tv-ephy-mac"; + };
rest of h6 opi boards used it for vcc-ac200, we may append ac200 and make it common since the voltage is same.
arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi-3.dts line 123
Quoted 8 lines
arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi-3.dts new file +8
-0+ + /* 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"; + };
same like above regulator.
arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi-3.dts line 129
Quoted 6 lines
arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi-3.dts new file +6
-0+ + reg_bldo1: bldo1 { + regulator-always-on; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + regulator-name = "vcc18-dram-bias-pll";
same like other h6 boards.
arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi-3.dts line 137
Quoted 8 lines
arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi-3.dts new file +8
-0+ }; + + reg_bldo2: bldo2 { + regulator-always-on; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + regulator-name = "vcc-efuse-pcie-hdmi-pc"; + };
same like other h6 boards.
arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi-3.dts line 141
Quoted 4 lines
arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi-3.dts new file +4
-0+ + bldo3 { + /* unused */ + };
This is used in other h6 opi boards so we may attach status or re-enable it on board dts file.
arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi-3.dts line 145
Quoted 4 lines
arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi-3.dts new file +4
-0+ + bldo4 { + /* unused */ + };
same like other h6 boards.
arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi-3.dts line 152
Quoted 7 lines
arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi-3.dts new file +7
-0+ + reg_cldo1: cldo1 { + regulator-always-on; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + regulator-name = "vcc33-io-pd-emmc-sd-usb-uart-2"; + };
same like other h6 boards.
arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi-3.dts line 160
Quoted 8 lines
arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi-3.dts new file +8
-0+ + cldo2 { + /* unused */ + }; + + cldo3 { + /* unused */ + };
These two used for wifi, so we may define on board dts or attach status property.
Quoted 21 lines
arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi-3.dts new file +21
-0+ + reg_dcdca: dcdca { + regulator-always-on; + regulator-min-microvolt = <800000>; + regulator-max-microvolt = <1160000>; + regulator-name = "vdd-cpu"; + }; + + reg_dcdcc: dcdcc { + regulator-min-microvolt = <810000>; + regulator-max-microvolt = <1080000>; + regulator-name = "vdd-gpu"; + }; + + reg_dcdcd: dcdcd { + regulator-always-on; + regulator-min-microvolt = <960000>; + regulator-max-microvolt = <960000>; + regulator-name = "vdd-sys"; + }; +
arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi-3.dts line 191
Quoted 10 lines
arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi-3.dts new file +10
-0+ reg_dcdce: dcdce { + regulator-always-on; + regulator-min-microvolt = <1200000>; + regulator-max-microvolt = <1200000>; + regulator-name = "vcc-dram"; + }; + + sw { + /* unused */ + };
all above regulators are common to h6 boards.
Quoted 8 lines
arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi-3.dts new file +8
-0+ }; + }; +}; + +&uart0 { + pinctrl-names = "default"; + pinctrl-0 = <&uart0_ph_pins>; + status = "okay";
arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi-3.dts line 209
Quoted 10 lines
arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi-3.dts new file +10
-0+}; + +&usb2otg { + /* + * Beware that this board will not automatically disconnect + * VBUS from DCIN, when self-powered and used as a peripheral. + */ + dr_mode = "otg"; + status = "okay"; +};
above nodes uart0, usb2otg are common to h6 opi boards.
arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi-3.dts
Quoted 8 lines
arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi-3.dts new file +7
-1+ +&usb2phy { + usb0_id_det-gpios = <&pio 2 15 GPIO_ACTIVE_HIGH>; /* PC15 */ + usb0_vbus-supply = <®_vcc5v>; + usb3_vbus-supply = <®_vcc5v>; + status = "okay"; +}; --
id detect pin can be differ, so we may move this on board specific dts.
Note: the emac node is also common between h6 opi boards.
Re: [linux-sunxi] [PATCH v2 02/13] arm64: dts: allwinner: h6: Add Orange Pi 3 DTS
Hi Jagan,
Quoted 3 lines · Jagan Teki
Based on the conversation about using common dtsi from this thread[1], I'm commenting here to make show the diff directly on the nodes, giving comments on each node so-that we can see the diff globally.
Thanks for the suggestions below. It mostly repeats the differences and commonalities I already stated in the previous discussion.
I don't have much to add to what I already said previously, though, because you didn't address my concerns there. But I can restate and expand on those concerns.
Previously I already agreed it's possible to base orangepi-3.dts on orangepi.dtsi, and proposed a maintainable way forward, and why to follow it (to quote myself):
Schematics allow for high amount of variability in the power tree (see all the NC (not connected) / 0R resistors) in the schematic around AXP805. Every board based on this Xunlong design can be subtly different.
I already suggested a maintainable solution, below. Where base dtsi has empty config for regulators and every board based on that just defines it completely for itself.
A few regulators (for CPU/GPU) will most probably have the same meaning on every derived board, so these can probably be kept in dtsi without causing too much annoyance.
It's unpleasant to have wrong regulator setup defined in an underlying dtsi, and then trying to override it by removing/adding random properties in the board dts for the new boards based on that, so that it fits.
The rest of the current HW descriptions in the sun50i-h6-orangepi.dtsi can be shared (as of now).
My suggestion was this:
So to base Orange Pi 3 dts on top of existing sun50i-h6-orangepi.dtsi I'd have to first move some things out of the base dtsi to the OrangePi Lite2 and One Plus board dts files, in order to have sun50i-h6-orangepi.dtsi only describe HW that is *really* shared by these 2 boards and Orange Pi 3.
If I do that, I'd undefine all the axp805 regulator nodes and move the configurations to each of the 3 board files. That will probably end up being the least confusing and most maintainable. See axp81x.dtsi lines 86-144 for what I mean.
You seem to be suggesting a solution where every time we add an OrangePi H6 based board, the person adding it will have to go through the base dtsi and all the other boards based on it, status disable or otherwise change regulators in the base dtsi, patch all the other boards to re-enable it.
It would be already unpleasant just adding a third board based on this approach. And when the fourth board is added, with another small differences in the regulator use/meanings, the person will be looking at patching 4 dts files
+ adding one for his own board. For what benefit, to save some bytes right now?
I think maintainability, ease of adding new boards is more important, than having a dtsi that tries to maximally cover all the commonalities between the existing boards right now, without regards for the future. That's why I suggested an approach like in axp81x.dtsi lines 86-144.
thank you and regards,
o.
Quoted 325 lines
Quoted 86 lines · megous via linux-sunxi
From: Ondrej Jirman <[email protected]>
Orange Pi 3 is a H6 based SBC made by Xulong, released in January 2019. It has the following features:
- Allwinner H6 quad-core 64-bit ARM Cortex-A53
- GPU Mali-T720
- 1GB or 2GB LPDDR3 RAM
- AXP805 PMIC
- AP6256 Wifi/BT 5.0
- USB 2.0 host port (A)
- USB 2.0 micro usb, OTG
- USB 3.0 Host + 4 port USB hub (GL3510)
- Gigabit Ethernet (Realtek RTL8211E phy)
- HDMI 2.0 port
- soldered eMMC (optional)
- 3x LED (one is on the bottom)
- microphone
- audio jack
- PCIeAdd basic support for the board.
Signed-off-by Ondrej Jirman <[email protected]>--- arch/arm64/boot/dts/allwinner/Makefile | 1 + .../dts/allwinner/sun50i-h6-orangepi-3.dts | 216 ++++++++++++++++++ 2 files changed, 217 insertions(+) create mode 100644 arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi-3.dtsarch/arm64/boot/dts/allwinner/Makefile +1
-0@@ -20,6 +20,7 @@ dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h5-orangepi-pc2.dtb dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h5-orangepi-prime.dtb dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h5-orangepi-zero-plus.dtb dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h5-orangepi-zero-plus2.dtb +dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h6-orangepi-3.dtb dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h6-orangepi-lite2.dtb dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h6-orangepi-one-plus.dtb dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h6-pine-h64.dtbarch/arm64/boot/dts/allwinner/sun50i-h6-orangepi-3.dts new file +37
-0@@ -0,0 +1,216 @@ +// SPDX-License-Identifier: (GPL-2.0+ or MIT) +/* + * Copyright (C) 2019 Ondřej Jirman <[email protected]> + */ + +/dts-v1/; + +#include "sun50i-h6.dtsi" + +#include <dt-bindings/gpio/gpio.h> + +/ { + model = "OrangePi 3"; + compatible = "xunlong,orangepi-3", "allwinner,sun50i-h6"; + + aliases { + serial0 = &uart0; + }; + + chosen { + stdout-path = "serial0:115200n8"; + }; + + leds { + compatible = "gpio-leds"; + + power { + label = "orangepi:red:power"; + gpios = <&r_pio 0 4 GPIO_ACTIVE_HIGH>; /* PL4 */ + default-state = "on"; + }; + + status { + label = "orangepi:green:status"; + gpios = <&r_pio 0 7 GPIO_ACTIVE_HIGH>; /* PL7 */ + }; + };arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi-3.dts line 47
Quoted 10 lines
arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi-3.dts new file +10
-0+ + 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; + }; +};all above nodes are common to all h6 opi boards.
arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi-3.dts line 59
Quoted 12 lines
arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi-3.dts new file +12
-0+ +&cpu0 { + cpu-supply = <®_dcdca>; +}; + +&ehci0 { + status = "okay"; +}; + +&ehci3 { + status = "okay"; +};common to all h6 opi boards.
arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi-3.dts line 68
Quoted 9 lines
arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi-3.dts new file +9
-0+ +&mmc0 { + pinctrl-names = "default"; + pinctrl-0 = <&mmc0_pins>; + vmmc-supply = <®_cldo1>; + cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>; /* PF6 */ + bus-width = <4>; + status = "okay"; +};common to all h6 opi boards.
arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi-3.dts line 76
Quoted 8 lines
arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi-3.dts new file +8
-0+ +&ohci0 { + status = "okay"; +}; + +&ohci3 { + status = "okay"; +};common to all h6 opi boards.
Quoted 15 lines
arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi-3.dts new file +15
-0+ +&pio { + vcc-pc-supply = <®_bldo2>; + vcc-pd-supply = <®_cldo1>; +}; + +&r_i2c { + status = "okay"; + + axp805: pmic@36 { + compatible = "x-powers,axp805", "x-powers,axp806"; + reg = <0x36>; + interrupt-parent = <&r_intc>; + interrupts = <0 IRQ_TYPE_LEVEL_LOW>; + interrupt-controller;arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi-3.dts line 101
Quoted 10 lines
arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi-3.dts new file +10
-0+ #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>;all these supply voltage regulators are common to h6 opi boards.
arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi-3.dts line 109
Quoted 8 lines
arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi-3.dts new file +8
-0+ + regulators { + reg_aldo1: aldo1 { + regulator-always-on; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + regulator-name = "vcc-pl-led-ir"; + };same like other h6 boards.
arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi-3.dts line 115
Quoted 6 lines
arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi-3.dts new file +6
-0+ + reg_aldo2: aldo2 { + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + regulator-name = "vcc33-audio-tv-ephy-mac"; + };rest of h6 opi boards used it for vcc-ac200, we may append ac200 and make it common since the voltage is same.
arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi-3.dts line 123
Quoted 8 lines
arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi-3.dts new file +8
-0+ + /* 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"; + };same like above regulator.
arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi-3.dts line 129
Quoted 6 lines
arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi-3.dts new file +6
-0+ + reg_bldo1: bldo1 { + regulator-always-on; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + regulator-name = "vcc18-dram-bias-pll";same like other h6 boards.
arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi-3.dts line 137
Quoted 8 lines
arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi-3.dts new file +8
-0+ }; + + reg_bldo2: bldo2 { + regulator-always-on; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + regulator-name = "vcc-efuse-pcie-hdmi-pc"; + };same like other h6 boards.
arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi-3.dts line 141
Quoted 4 lines
arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi-3.dts new file +4
-0+ + bldo3 { + /* unused */ + };This is used in other h6 opi boards so we may attach status or re-enable it on board dts file.
arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi-3.dts line 145
Quoted 4 lines
arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi-3.dts new file +4
-0+ + bldo4 { + /* unused */ + };same like other h6 boards.
arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi-3.dts line 152
Quoted 7 lines
arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi-3.dts new file +7
-0+ + reg_cldo1: cldo1 { + regulator-always-on; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + regulator-name = "vcc33-io-pd-emmc-sd-usb-uart-2"; + };same like other h6 boards.
arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi-3.dts line 160
Quoted 8 lines
arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi-3.dts new file +8
-0+ + cldo2 { + /* unused */ + }; + + cldo3 { + /* unused */ + };These two used for wifi, so we may define on board dts or attach status property.
Quoted 21 lines
arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi-3.dts new file +21
-0+ + reg_dcdca: dcdca { + regulator-always-on; + regulator-min-microvolt = <800000>; + regulator-max-microvolt = <1160000>; + regulator-name = "vdd-cpu"; + }; + + reg_dcdcc: dcdcc { + regulator-min-microvolt = <810000>; + regulator-max-microvolt = <1080000>; + regulator-name = "vdd-gpu"; + }; + + reg_dcdcd: dcdcd { + regulator-always-on; + regulator-min-microvolt = <960000>; + regulator-max-microvolt = <960000>; + regulator-name = "vdd-sys"; + }; +arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi-3.dts line 191
Quoted 10 lines
arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi-3.dts new file +10
-0+ reg_dcdce: dcdce { + regulator-always-on; + regulator-min-microvolt = <1200000>; + regulator-max-microvolt = <1200000>; + regulator-name = "vcc-dram"; + }; + + sw { + /* unused */ + };all above regulators are common to h6 boards.
Quoted 8 lines
arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi-3.dts new file +8
-0+ }; + }; +}; + +&uart0 { + pinctrl-names = "default"; + pinctrl-0 = <&uart0_ph_pins>; + status = "okay";arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi-3.dts line 209
Quoted 10 lines
arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi-3.dts new file +10
-0+}; + +&usb2otg { + /* + * Beware that this board will not automatically disconnect + * VBUS from DCIN, when self-powered and used as a peripheral. + */ + dr_mode = "otg"; + status = "okay"; +};above nodes uart0, usb2otg are common to h6 opi boards.
arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi-3.dts
Quoted 8 lines
arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi-3.dts new file +7
-1+ +&usb2phy { + usb0_id_det-gpios = <&pio 2 15 GPIO_ACTIVE_HIGH>; /* PC15 */ + usb0_vbus-supply = <®_vcc5v>; + usb3_vbus-supply = <®_vcc5v>; + status = "okay"; +}; --id detect pin can be differ, so we may move this on board specific dts.
Note: the emac node is also common between h6 opi boards.
Re: [linux-sunxi] [PATCH v2 02/13] arm64: dts: allwinner: h6: Add Orange Pi 3 DTS
Quoted 59 lines · Ondřej Jirman
Hi Jagan,
Quoted 3 lines · Jagan Teki
Based on the conversation about using common dtsi from this thread[1], I'm commenting here to make show the diff directly on the nodes, giving comments on each node so-that we can see the diff globally.
Thanks for the suggestions below. It mostly repeats the differences and commonalities I already stated in the previous discussion.
I don't have much to add to what I already said previously, though, because you didn't address my concerns there. But I can restate and expand on those concerns.
Previously I already agreed it's possible to base
orangepi-3.dtsonorangepi.dtsi, and proposed a maintainable way forward, and why to follow it (to quote myself):Schematics allow for high amount of variability in the power tree (see all the NC (not connected) / 0R resistors) in the schematic around AXP805. Every board based on this Xunlong design can be subtly different.
I already suggested a maintainable solution, below. Where base dtsi has empty config for regulators and every board based on that just defines it completely for itself.
A few regulators (for CPU/GPU) will most probably have the same meaning on every derived board, so these can probably be kept in dtsi without causing too much annoyance.
It's unpleasant to have wrong regulator setup defined in an underlying dtsi, and then trying to override it by removing/adding random properties in the board dts for the new boards based on that, so that it fits.
The rest of the current HW descriptions in the
sun50i-h6-orangepi.dtsican be shared (as of now).My suggestion was this:
So to base Orange Pi 3 dts on top of existing
sun50i-h6-orangepi.dtsiI'd have to first move some things out of the base dtsi to the OrangePi Lite2 and One Plus board dts files, in order to havesun50i-h6-orangepi.dtsionly describe HW that is *really* shared by these 2 boards and Orange Pi 3.If I do that, I'd undefine all the axp805 regulator nodes and move the configurations to each of the 3 board files. That will probably end up being the least confusing and most maintainable. See
axp81x.dtsilines 86-144 for what I mean.You seem to be suggesting a solution where every time we add an OrangePi H6 based board, the person adding it will have to go through the base dtsi and all the other boards based on it, status disable or otherwise change regulators in the base dtsi, patch all the other boards to re-enable it.
It would be already unpleasant just adding a third board based on this approach. And when the fourth board is added, with another small differences in the regulator use/meanings, the person will be looking at patching 4 dts files
+ adding one for his own board. For what benefit, to save some bytes right now?
Quoted 4 lines
I think maintainability, ease of adding new boards is more important, than having a dtsi that tries to maximally cover all the commonalities between the existing boards right now, without regards for the future. That's why I suggested an approach like in
axp81x.dtsilines 86-144.
I agree.
Maxime
--
Maxime Ripard, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
Signature · 3 lines
You received this message because you are subscribed to the Google Groups "linux-sunxi" group. To unsubscribe from this group and stop receiving emails from it, send an email to linux-sunxi+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/[email protected] For more options, visit https://groups.google.com/d/optout.
Re: [linux-sunxi] [PATCH v2 02/13] arm64: dts: allwinner: h6: Add Orange Pi 3 DTS
In reply to Ondřej JirmanHi Ondřej Jirman,
Quoted 15 lines · Ondřej Jirman
Hi Jagan,
Quoted 3 lines · Jagan Teki
Based on the conversation about using common dtsi from this thread[1], I'm commenting here to make show the diff directly on the nodes, giving comments on each node so-that we can see the diff globally.
Thanks for the suggestions below. It mostly repeats the differences and commonalities I already stated in the previous discussion.
I don't have much to add to what I already said previously, though, because you didn't address my concerns there. But I can restate and expand on those concerns.
Quoted 7 lines
Previously I already agreed it's possible to base
orangepi-3.dtsonorangepi.dtsi, and proposed a maintainable way forward, and why to follow it (to quote myself):Schematics allow for high amount of variability in the power tree (see all the NC (not connected) / 0R resistors) in the schematic around AXP805. Every board based on this Xunlong design can be subtly different.
Well, how about defining them in required dts file and group it common regulators in dtsi? The idea of all these 3 H6 OPI boards are evaluated in the same design consideration by adding new IP's in new boards design by keeping the core things common like lite2 has wifi, one plus has emac and 3 has PCIe etc. This is what I got from Steven(OrangePI).
Quoted 5 lines
I already suggested a maintainable solution, below. Where base dtsi has empty config for regulators and every board based on that just defines it completely for itself.
Quoted 7 lines
A few regulators (for CPU/GPU) will most probably have the same meaning on every derived board, so these can probably be kept in dtsi without causing too much annoyance.
It's unpleasant to have wrong regulator setup defined in an underlying dtsi, and then trying to override it by removing/adding random properties in the board dts for the new boards based on that, so that it fits.
If we manage them properly by moving common things in dtsi and rest in dts, we may avoid these underlying issues.
Quoted 26 lines
The rest of the current HW descriptions in the
sun50i-h6-orangepi.dtsican be shared (as of now).My suggestion was this:
So to base Orange Pi 3 dts on top of existing
sun50i-h6-orangepi.dtsiI'd have to first move some things out of the base dtsi to the OrangePi Lite2 and One Plus board dts files, in order to havesun50i-h6-orangepi.dtsionly describe HW that is *really* shared by these 2 boards and Orange Pi 3.If I do that, I'd undefine all the axp805 regulator nodes and move the configurations to each of the 3 board files. That will probably end up being the least confusing and most maintainable. See
axp81x.dtsilines 86-144 for what I mean.You seem to be suggesting a solution where every time we add an OrangePi H6 based board, the person adding it will have to go through the base dtsi and all the other boards based on it, status disable or otherwise change regulators in the base dtsi, patch all the other boards to re-enable it.
It would be already unpleasant just adding a third board based on this approach. And when the fourth board is added, with another small differences in the regulator use/meanings, the person will be looking at patching 4 dts files
+ adding one for his own board. For what benefit, to save some bytes right now?
Quoted 4 lines
I think maintainability, ease of adding new boards is more important, than having a dtsi that tries to maximally cover all the commonalities between the existing boards right now, without regards for the future. That's why I suggested an approach like in
axp81x.dtsilines 86-144.
True, if the boards indeed are different but we can maintain easily if the boards are from same family of design based my experience and few boards do share common things in dtsi already.
Anyway, thanks for inputs. Seems like patch is applied already may be we can move into dtsi if require in future.
Thanks,
Jagan.
Re: [linux-sunxi] [PATCH v2 02/13] arm64: dts: allwinner: h6: Add Orange Pi 3 DTS
In reply to Ondřej JirmanHi Ondřej Jirman,
Quoted 15 lines · Ondřej Jirman
Hi Jagan,
Quoted 3 lines · Jagan Teki
Based on the conversation about using common dtsi from this thread[1], I'm commenting here to make show the diff directly on the nodes, giving comments on each node so-that we can see the diff globally.
Thanks for the suggestions below. It mostly repeats the differences and commonalities I already stated in the previous discussion.
I don't have much to add to what I already said previously, though, because you didn't address my concerns there. But I can restate and expand on those concerns.
Quoted 7 lines
Previously I already agreed it's possible to base
orangepi-3.dtsonorangepi.dtsi, and proposed a maintainable way forward, and why to follow it (to quote myself):Schematics allow for high amount of variability in the power tree (see all the NC (not connected) / 0R resistors) in the schematic around AXP805. Every board based on this Xunlong design can be subtly different.
Well, how about defining them in required dts file and group it common regulators in dtsi? The idea of all these 3 H6 OPI boards are evaluated in the same design consideration by adding new IP's in new boards design by keeping the core things common like lite2 has wifi, one plus has emac and 3 has PCIe etc. This is what I got from Steven(OrangePI).
Quoted 5 lines
I already suggested a maintainable solution, below. Where base dtsi has empty config for regulators and every board based on that just defines it completely for itself.
Quoted 7 lines
A few regulators (for CPU/GPU) will most probably have the same meaning on every derived board, so these can probably be kept in dtsi without causing too much annoyance.
It's unpleasant to have wrong regulator setup defined in an underlying dtsi, and then trying to override it by removing/adding random properties in the board dts for the new boards based on that, so that it fits.
If we manage them properly by moving common things in dtsi and rest in dts, we may avoid these underlying issues.
Quoted 26 lines
The rest of the current HW descriptions in the
sun50i-h6-orangepi.dtsican be shared (as of now).My suggestion was this:
So to base Orange Pi 3 dts on top of existing
sun50i-h6-orangepi.dtsiI'd have to first move some things out of the base dtsi to the OrangePi Lite2 and One Plus board dts files, in order to havesun50i-h6-orangepi.dtsionly describe HW that is *really* shared by these 2 boards and Orange Pi 3.If I do that, I'd undefine all the axp805 regulator nodes and move the configurations to each of the 3 board files. That will probably end up being the least confusing and most maintainable. See
axp81x.dtsilines 86-144 for what I mean.You seem to be suggesting a solution where every time we add an OrangePi H6 based board, the person adding it will have to go through the base dtsi and all the other boards based on it, status disable or otherwise change regulators in the base dtsi, patch all the other boards to re-enable it.
It would be already unpleasant just adding a third board based on this approach. And when the fourth board is added, with another small differences in the regulator use/meanings, the person will be looking at patching 4 dts files
+ adding one for his own board. For what benefit, to save some bytes right now?
Quoted 4 lines
I think maintainability, ease of adding new boards is more important, than having a dtsi that tries to maximally cover all the commonalities between the existing boards right now, without regards for the future. That's why I suggested an approach like in
axp81x.dtsilines 86-144.
True, if the boards indeed are different but we can maintain easily if the boards are from same family of design based my experience and few boards do share common things in dtsi already.
Anyway, thanks for inputs. Seems like patch is applied already may be we can move into dtsi if require in future.
Thanks,
Jagan.
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [linux-sunxi] [PATCH v2 02/13] arm64: dts: allwinner: h6: Add Orange Pi 3 DTS
In reply to Ondřej JirmanHi Ondřej Jirman,
Quoted 15 lines · Ondřej Jirman
Hi Jagan,
Quoted 3 lines · Jagan Teki
Based on the conversation about using common dtsi from this thread[1], I'm commenting here to make show the diff directly on the nodes, giving comments on each node so-that we can see the diff globally.
Thanks for the suggestions below. It mostly repeats the differences and commonalities I already stated in the previous discussion.
I don't have much to add to what I already said previously, though, because you didn't address my concerns there. But I can restate and expand on those concerns.
Quoted 7 lines
Previously I already agreed it's possible to base
orangepi-3.dtsonorangepi.dtsi, and proposed a maintainable way forward, and why to follow it (to quote myself):Schematics allow for high amount of variability in the power tree (see all the NC (not connected) / 0R resistors) in the schematic around AXP805. Every board based on this Xunlong design can be subtly different.
Well, how about defining them in required dts file and group it common regulators in dtsi? The idea of all these 3 H6 OPI boards are evaluated in the same design consideration by adding new IP's in new boards design by keeping the core things common like lite2 has wifi, one plus has emac and 3 has PCIe etc. This is what I got from Steven(OrangePI).
Quoted 5 lines
I already suggested a maintainable solution, below. Where base dtsi has empty config for regulators and every board based on that just defines it completely for itself.
Quoted 7 lines
A few regulators (for CPU/GPU) will most probably have the same meaning on every derived board, so these can probably be kept in dtsi without causing too much annoyance.
It's unpleasant to have wrong regulator setup defined in an underlying dtsi, and then trying to override it by removing/adding random properties in the board dts for the new boards based on that, so that it fits.
If we manage them properly by moving common things in dtsi and rest in dts, we may avoid these underlying issues.
Quoted 26 lines
The rest of the current HW descriptions in the
sun50i-h6-orangepi.dtsican be shared (as of now).My suggestion was this:
So to base Orange Pi 3 dts on top of existing
sun50i-h6-orangepi.dtsiI'd have to first move some things out of the base dtsi to the OrangePi Lite2 and One Plus board dts files, in order to havesun50i-h6-orangepi.dtsionly describe HW that is *really* shared by these 2 boards and Orange Pi 3.If I do that, I'd undefine all the axp805 regulator nodes and move the configurations to each of the 3 board files. That will probably end up being the least confusing and most maintainable. See
axp81x.dtsilines 86-144 for what I mean.You seem to be suggesting a solution where every time we add an OrangePi H6 based board, the person adding it will have to go through the base dtsi and all the other boards based on it, status disable or otherwise change regulators in the base dtsi, patch all the other boards to re-enable it.
It would be already unpleasant just adding a third board based on this approach. And when the fourth board is added, with another small differences in the regulator use/meanings, the person will be looking at patching 4 dts files
+ adding one for his own board. For what benefit, to save some bytes right now?
Quoted 4 lines
I think maintainability, ease of adding new boards is more important, than having a dtsi that tries to maximally cover all the commonalities between the existing boards right now, without regards for the future. That's why I suggested an approach like in
axp81x.dtsilines 86-144.
True, if the boards indeed are different but we can maintain easily if the boards are from same family of design based my experience and few boards do share common things in dtsi already.
Anyway, thanks for inputs. Seems like patch is applied already may be we can move into dtsi if require in future.
Thanks,
Jagan.
_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
PATCH v2 3/13 net: stmmac: sun8i: add support for Allwinner H6 EMAC
In reply to [email protected]From: Icenowy Zheng <[email protected]>
The EMAC on Allwinner H6 is just like the one on A64. The "internal PHY" on H6 is on a co-packaged AC200 chip, and it's not really internal (it's connected via RMII at PA GPIO bank).
Add support for the Allwinner H6 EMAC in the dwmac-sun8i driver.
--- .../net/ethernet/stmicro/stmmac/dwmac-sun8i.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+)
drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c +16 -0
@@ -147,6 +147,20 @@ static const struct emac_variant emac_variant_a64 = { .tx_delay_max = 7, }; +static const struct emac_variant emac_variant_h6 = { + .default_syscon_value =0x50000 , + .syscon_field = &sun8i_syscon_reg_field, +/* The "Internal PHY" of H6 is not on the die. It's on the +* co-packaged AC200 chip instead. +*/ + .soc_has_internal_phy = false, + .support_mii = true, + .support_rmii = true, + .support_rgmii = true, + .rx_delay_max =31 , + .tx_delay_max =7 , +}; +#define EMAC_BASIC_CTL0 0x00#define EMAC_BASIC_CTL1 0x04#define EMAC_INT_STA 0x08
@@ -1210,6 +1224,8 @@ static const struct of_device_id sun8i_dwmac_match[] = { .data = &emac_variant_r40 }, { .compatible = "allwinner,sun50i-a64-emac", .data = &emac_variant_a64 }, + { .compatible = "allwinner,sun50i-h6-emac", + .data = &emac_variant_h6 }, { } };MODULE_DEVICE_TABLE (of, sun8i_dwmac_match);
Signature · 1 line
2.21.0
PATCH v2 4/13 net: stmmac: sun8i: force select external PHY when no internal one
In reply to [email protected]From: Icenowy Zheng <[email protected]>
The PHY selection bit also exists on SoCs without an internal PHY; if it's set to 1 (internal PHY, default value) then the MAC will not make use of any PHY such SoCs.
This problem appears when adapting for H6, which has no real internal PHY (the "internal PHY" on H6 is not on-die, but on a co-packaged AC200 chip, connected via RMII interface at GPIO bank A).
Force the PHY selection bit to 0 when the SOC doesn't have an internal PHY, to address the problem of a wrong default value.
--- drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c | 5 +++++ 1 file changed, 5 insertions(+)
drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c +5 -0
@@ -907,6 +907,11 @@ static int sun8i_dwmac_set_syscon(struct stmmac_priv *priv)* address. No need to mask it again. */ reg |=1 <<H3_EPHY_ADDR_SHIFT ; + }else { +/* For SoCs without internal PHY the PHY selection bit should be +* set to 0 (external PHY). +*/ + reg &= ~H3_EPHY_SELECT ; }if (!of_property_read_u32 (node,"allwinner,tx-delay-ps" , &val)) {
Signature · 1 line
2.21.0
PATCH v2 5/13 pinctrl: sunxi: Prepare for alternative bias voltage setting methods
In reply to [email protected]From: Ondrej Jirman <megous-5qf/[email protected]>
H6 has a different I/O voltage bias setting method than A80. Prepare existing code for using alternative bias voltage setting methods.
--- drivers/pinctrl/sunxi/pinctrl-sun9i-a80.c | 2 +- drivers/pinctrl/sunxi/pinctrl-sunxi.c | 41 +++++++++++++---------- drivers/pinctrl/sunxi/pinctrl-sunxi.h | 5 ++- 3 files changed, 28 insertions(+), 20 deletions(-)
drivers/pinctrl/sunxi/pinctrl-sun9i-a80.c +1 -1
@@ -722,7 +722,7 @@ static const struct sunxi_pinctrl_desc sun9i_a80_pinctrl_data = { .npins = ARRAY_SIZE(sun9i_a80_pins), .irq_banks = 5, .disable_strict_mode = true, - .has_io_bias_cfg = true, + .io_bias_cfg_variant = IO_BIAS_CFG_V1, };static int sun9i_a80_pinctrl_probe (struct platform_device *pdev)
drivers/pinctrl/sunxi/pinctrl-sunxi.c +23 -18
53 lines not on this page · raw message
drivers/pinctrl/sunxi/pinctrl-sunxi.h +4 -1
@@ -95,6 +95,9 @@#define PINCTRL_SUN7I_A20 BIT(7)#define PINCTRL_SUN8I_R40 BIT(8) +/* Bias voltage configuration done via Pn_GRP_CONFIG registers. */ +#define IO_BIAS_CFG_V1 1 +struct sunxi_desc_function {unsigned long variant;const char *name;
@@ -117,7 +120,7 @@ struct sunxi_pinctrl_desc {const unsigned int *irq_bank_map;bool irq_read_needs_mux;bool disable_strict_mode; -bool has_io_bias_cfg; +int io_bias_cfg_variant; };struct sunxi_pinctrl_function {
Signature · 1 line
2.21.0
Re: [PATCH v2 05/13] pinctrl: sunxi: Prepare for alternative bias voltage setting methods
Hi,
Quoted 89 lines · On Tue, Apr 09, 2019 at 02:24:44AM +0200…
From: Ondrej Jirman <megous-5qf/[email protected]>
H6 has a different I/O voltage bias setting method than A80. Prepare existing code for using alternative bias voltage setting methods.
Signed-off-by Ondrej Jirman <megous-5qf/[email protected]>--- drivers/pinctrl/sunxi/pinctrl-sun9i-a80.c | 2 +- drivers/pinctrl/sunxi/pinctrl-sunxi.c | 41 +++++++++++++---------- drivers/pinctrl/sunxi/pinctrl-sunxi.h | 5 ++- 3 files changed, 28 insertions(+), 20 deletions(-)drivers/pinctrl/sunxi/pinctrl-sun9i-a80.c +1
-1@@ -722,7 +722,7 @@ static const struct sunxi_pinctrl_desc sun9i_a80_pinctrl_data = { .npins = ARRAY_SIZE(sun9i_a80_pins), .irq_banks = 5, .disable_strict_mode = true, - .has_io_bias_cfg = true, + .io_bias_cfg_variant = IO_BIAS_CFG_V1, };static int sun9i_a80_pinctrl_probe (struct platform_device *pdev)drivers/pinctrl/sunxi/pinctrl-sunxi.c +23
-18@@ -610,7 +610,7 @@ static int sunxi_pinctrl_set_io_bias_cfg(struct sunxi_pinctrl *pctl,u32 val, reg;int uV; -if (!pctl->desc->has_io_bias_cfg) +if (!pctl->desc->io_bias_cfg_variant)return 0 ; uV =regulator_get_voltage (supply);@@ -621,23 +621,28 @@ static int sunxi_pinctrl_set_io_bias_cfg(struct sunxi_pinctrl *pctl,if (uV ==0 )return 0 ; -/* Configured value must be equal or greater to actual voltage */ -if (uV <=1800000 ) - val =0x0 ;/* 1.8V */ -else if (uV <=2500000 ) - val =0x6 ;/* 2.5V */ -else if (uV <=2800000 ) - val =0x9 ;/* 2.8V */ -else if (uV <=3000000 ) - val =0xA ;/* 3.0V */ -else - val =0xD ;/* 3.3V */ - - pin -= pctl->desc->pin_base; - - reg =readl (pctl->membase +sunxi_grp_config_reg (pin)); - reg &= ~IO_BIAS_MASK ; -writel (reg | val, pctl->membase +sunxi_grp_config_reg (pin)); +if (pctl->desc->io_bias_cfg_variant ==IO_BIAS_CFG_V1 ) { +/* +* Configured value must be equal or greater to actual +* voltage. +*/ +if (uV <=1800000 ) + val =0x0 ;/* 1.8V */ +else if (uV <=2500000 ) + val =0x6 ;/* 2.5V */ +else if (uV <=2800000 ) + val =0x9 ;/* 2.8V */ +else if (uV <=3000000 ) + val =0xA ;/* 3.0V */ +else + val =0xD ;/* 3.3V */ + + pin -= pctl->desc->pin_base; + + reg =readl (pctl->membase +sunxi_grp_config_reg (pin)); + reg &= ~IO_BIAS_MASK ; +writel (reg | val, pctl->membase +sunxi_grp_config_reg (pin)); + }return 0 ; }drivers/pinctrl/sunxi/pinctrl-sunxi.h +0
-0
drivers/pinctrl/sunxi/pinctrl-sunxi.h line 100
Quoted 6 lines
drivers/pinctrl/sunxi/pinctrl-sunxi.h +3
-0@@ -95,6 +95,9 @@#define PINCTRL_SUN7I_A20 BIT(7)#define PINCTRL_SUN8I_R40 BIT(8) +/* Bias voltage configuration done via Pn_GRP_CONFIG registers. */ +#define IO_BIAS_CFG_V1 1 +
Can we turn this into an enum, and give them proper name? Mentionning an example in the commit would be great too.
Something like:
enum sunxi_desc_bias_voltage {
/* Bias Voltage configuration is done through Pn_GRP_CONFIG registers, as seen on the A83t */
BIAS_VOLTAGE_GRP_CONFIG,
};etc.
Thanks!
Maxime
--
Maxime Ripard, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
PATCH v2 6/13 pinctrl: sunxi: Support I/O bias voltage setting on H6
In reply to [email protected]From: Ondrej Jirman <megous-5qf/[email protected]>
H6 SoC has a "pio group withstand voltage mode" register (datasheet description), that needs to be used to select either 1.8V or 3.3V I/O mode, based on what voltage is powering the respective pin banks and is thus used for I/O signals.
Add support for configuring this register according to the voltage of the pin bank regulator (if enabled).
This is similar to the support for I/O bias voltage setting patch for A80 and the same concerns apply. See:
commit 402bfb3c1352 ("Support I/O bias voltage setting on A80")
--- drivers/pinctrl/sunxi/pinctrl-sun50i-h6.c | 1 + drivers/pinctrl/sunxi/pinctrl-sunxi.c | 10 ++++++++++ drivers/pinctrl/sunxi/pinctrl-sunxi.h | 4 ++++ 3 files changed, 15 insertions(+)
drivers/pinctrl/sunxi/pinctrl-sun50i-h6.c +1 -0
@@ -591,6 +591,7 @@ static const struct sunxi_pinctrl_desc h6_pinctrl_data = { .irq_banks = 4, .irq_bank_map = h6_irq_bank_map, .irq_read_needs_mux = true, + .io_bias_cfg_variant = IO_BIAS_CFG_V2, };static int h6_pinctrl_probe (struct platform_device *pdev)
drivers/pinctrl/sunxi/pinctrl-sunxi.c +10 -0
@@ -607,6 +607,8 @@ static int sunxi_pinctrl_set_io_bias_cfg(struct sunxi_pinctrl *pctl,unsigned pin, struct regulator *supply) { + unsigned short bank = pin / PINS_PER_BANK; +unsigned long flags;u32 val, reg;int uV;
@@ -642,6 +644,14 @@ static int sunxi_pinctrl_set_io_bias_cfg(struct sunxi_pinctrl *pctl, reg =readl (pctl->membase +sunxi_grp_config_reg (pin)); reg &= ~IO_BIAS_MASK ;writel (reg | val, pctl->membase +sunxi_grp_config_reg (pin)); + }else if (pctl->desc->io_bias_cfg_variant ==IO_BIAS_CFG_V2 ) { + val = uV <=1800000 ?1 :0 ; + +raw_spin_lock_irqsave (&pctl->lock, flags); + reg =readl (pctl->membase +PIO_POW_MOD_SEL_REG ); + reg &= ~(1 << bank); +writel (reg | val << bank, pctl->membase +PIO_POW_MOD_SEL_REG ); +raw_spin_unlock_irqrestore (&pctl->lock, flags); }return 0 ;
drivers/pinctrl/sunxi/pinctrl-sunxi.h +4 -0
@@ -95,8 +95,12 @@#define PINCTRL_SUN7I_A20 BIT(7)#define PINCTRL_SUN8I_R40 BIT(8) +#define PIO_POW_MOD_SEL_REG 0x340 +/* Bias voltage configuration done via Pn_GRP_CONFIG registers. */ #define IO_BIAS_CFG_V1 1 +/* Bias voltage set in the PIO_POW_MOD_SEL_REG register. */ +#define IO_BIAS_CFG_V2 2struct sunxi_desc_function {unsigned long variant;
Signature · 1 line
2.21.0
PATCH v2 7/13 arm64: dts: allwinner: orange-pi-3: Enable ethernet
In reply to [email protected]From: Ondrej Jirman <megous-5qf/[email protected]>
Orange Pi 3 has two regulators that power the Realtek RTL8211E. According to the phy datasheet, both regulators need to be enabled at the same time, but we can only specify a single phy-supply in the DT.
This can be achieved by making one regulator depedning on the other via vin-supply. While it's not a technically correct description of the hardware, it achieves the purpose.
All values of RX/TX delay were tested exhaustively and a middle one of the working values was chosen.
--- .../dts/allwinner/sun50i-h6-orangepi-3.dts | 44 +++++++++++++++++++ 1 file changed, 44 insertions(+)
arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi-3.dts +44 -0
@@ -15,6 +15,7 @@ aliases { serial0 = &uart0; + ethernet0 = &emac; }; chosen {
@@ -44,6 +45,27 @@ regulator-max-microvolt = <5000000>; regulator-always-on; }; + + /* + * The board uses 2.5V RGMII signalling. Power sequence to enable + * the phy is to enable GMAC-2V5 and GMAC-3V3 (aldo2) power rails + * at the same time and to wait 100ms. + */ + reg_gmac_2v5: gmac-2v5 { + compatible = "regulator-fixed"; + regulator-name = "gmac-2v5"; + regulator-min-microvolt = <2500000>; + regulator-max-microvolt = <2500000>; + startup-delay-us = <100000>; + enable-active-high; + gpio = <&pio 3 6 GPIO_ACTIVE_HIGH>; /* PD6 */ + + /* The real parent of gmac-2v5 is reg_vcc5v, but we need to + * enable two regulators to power the phy. This is one way + * to achieve that. + */ + vin-supply = <®_aldo2>; /* GMAC-3V3 */ + }; }; &cpu0 {
@@ -58,6 +80,28 @@ status = "okay"; }; +&emac { + pinctrl-names = "default"; + pinctrl-0 = <&ext_rgmii_pins>; + phy-mode = "rgmii"; + phy-handle = <&ext_rgmii_phy>; + phy-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 { pinctrl-names = "default"; pinctrl-0 = <&mmc0_pins>;
Signature · 1 line
2.21.0
PATCH v2 8/13 drm: sun4i: Add support for enabling DDC I2C bus to dw_hdmi glue
In reply to [email protected]From: Ondrej Jirman <megous-5qf/[email protected]>
Orange Pi 3 board requires enabling DDC I2C bus via some GPIO connected transistors, before it can be used. Model this as a power supply for DDC (via regulator framework).
--- drivers/gpu/drm/sun4i/sun8i_dw_hdmi.c | 17 ++++++++++++++++- drivers/gpu/drm/sun4i/sun8i_dw_hdmi.h | 1 + 2 files changed, 17 insertions(+), 1 deletion(-)
drivers/gpu/drm/sun4i/sun8i_dw_hdmi.c +16 -1
@@ -146,16 +146,28 @@ static int sun8i_dw_hdmi_bind(struct device *dev, struct device *master,return PTR_ERR (hdmi->regulator); } + hdmi->ddc_regulator =devm_regulator_get (dev,"ddc" ); +if (IS_ERR (hdmi->ddc_regulator)) { +dev_err (dev,"Couldn't get ddc regulator\n" ); +return PTR_ERR (hdmi->ddc_regulator); + } + ret =regulator_enable (hdmi->regulator);if (ret) {dev_err (dev,"Failed to enable regulator\n" );return ret; } + ret =regulator_enable (hdmi->ddc_regulator); +if (ret) { +dev_err (dev,"Failed to enable ddc regulator\n" ); + goto err_disable_regulator; + } + ret =reset_control_deassert (hdmi->rst_ctrl);if (ret) {dev_err (dev,"Could not deassert ctrl reset control\n" ); - goto err_disable_regulator; + goto err_disable_ddc_regulator; } ret =clk_prepare_enable (hdmi->clk_tmds);
@@ -208,6 +220,8 @@ static int sun8i_dw_hdmi_bind(struct device *dev, struct device *master,clk_disable_unprepare (hdmi->clk_tmds); err_assert_ctrl_reset:reset_control_assert (hdmi->rst_ctrl); +err_disable_ddc_regulator: +regulator_disable (hdmi->ddc_regulator); err_disable_regulator:regulator_disable (hdmi->regulator);
@@ -223,6 +237,7 @@ static void sun8i_dw_hdmi_unbind(struct device *dev, struct device *master,sun8i_hdmi_phy_remove (hdmi);clk_disable_unprepare (hdmi->clk_tmds);reset_control_assert (hdmi->rst_ctrl); +regulator_disable (hdmi->ddc_regulator);regulator_disable (hdmi->regulator); }
drivers/gpu/drm/sun4i/sun8i_dw_hdmi.h +1 -0
@@ -188,6 +188,7 @@ struct sun8i_dw_hdmi {struct sun8i_hdmi_phy *phy;struct dw_hdmi_plat_data plat_data;struct regulator *regulator; +struct regulator *ddc_regulator;const struct sun8i_dw_hdmi_quirks *quirks;struct reset_control *rst_ctrl; };
Signature · 1 line
2.21.0
PATCH v2 9/13 dt-bindings: display: sun4i-drm: Add DDC power supply
In reply to [email protected]From: Ondrej Jirman <megous-5qf/[email protected]>
Some Allwinner SoC using boards need to enable a regulator for the DDC bus to be usable.
Add binding documentation for it.
--- Documentation/devicetree/bindings/display/sunxi/sun4i-drm.txt | 1 + 1 file changed, 1 insertion(+)
Documentation/devicetree/bindings/display/sunxi/sun4i-drm.txt +1 -0
@@ -104,6 +104,7 @@ Required properties: output, usually to an HDMI connector. Optional properties: + - ddc-supply: the VCC power supply for the DDC bus - hvcc-supply: the VCC power supply of the controller DWC HDMI PHY
Signature · 1 line
2.21.0
PATCH v2 10/13 arm64: dts: allwinner: orange-pi-3: Enable HDMI output
In reply to [email protected]From: Ondrej Jirman <megous-5qf/[email protected]>
Orange Pi 3 has a DDC_CEC_EN signal connected to PH2, that enables the DDC I2C bus voltage shifter. Before EDID can be read, we need to pull PH2 high.
--- .../dts/allwinner/sun50i-h6-orangepi-3.dts | 35 +++++++++++++++++++ 1 file changed, 35 insertions(+)
arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi-3.dts +35 -0
@@ -22,6 +22,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";
@@ -37,6 +48,15 @@ }; }; + reg_ddc: ddc-io { + compatible = "regulator-fixed"; + regulator-name = "ddc-io"; + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>; + enable-active-high; + gpio = <&pio 7 2 GPIO_ACTIVE_HIGH>; /* PH2 */ + }; + reg_vcc5v: vcc5v { /* board wide 5V supply directly from the DC jack */ compatible = "regulator-fixed";
@@ -72,6 +92,10 @@ cpu-supply = <®_dcdca>; }; +&de { + status = "okay"; +}; + &ehci0 { status = "okay"; };
@@ -91,6 +115,17 @@ status = "okay"; }; +&hdmi { + ddc-supply = <®_ddc>; + status = "okay"; +}; + +&hdmi_out { + hdmi_out_con: endpoint { + remote-endpoint = <&hdmi_con_in>; + }; +}; + &mdio { ext_rgmii_phy: ethernet-phy@1 { compatible = "ethernet-phy-ieee802.3-c22";
Signature · 1 line
2.21.0
PATCH v2 11/13 brcmfmac: Loading the correct firmware for brcm43456
In reply to [email protected]From: Ondrej Jirman <megous-5qf/[email protected]>
SDIO based brcm43456 is currently misdetected as brcm43455 and the wrong firmware name is used. Correct the detection and load the correct firmware file. Chiprev for brcm43456 is "9".
--- drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c +3 -1
@@ -622,6 +622,7 @@ BRCMF_FW_DEF(43430A0, "brcmfmac43430a0-sdio");/* Note the names are not postfixed with a1 for backward compatibility */ BRCMF_FW_DEF(43430A1, "brcmfmac43430-sdio");BRCMF_FW_DEF (43455 ,"brcmfmac43455-sdio" ); +BRCMF_FW_DEF (43456 ,"brcmfmac43456-sdio" );BRCMF_FW_DEF (4354 ,"brcmfmac4354-sdio" );BRCMF_FW_DEF (4356 ,"brcmfmac4356-sdio" );BRCMF_FW_DEF (4373 ,"brcmfmac4373-sdio" );
@@ -642,7 +643,8 @@ static const struct brcmf_firmware_mapping brcmf_sdio_fwnames[] = {BRCMF_FW_ENTRY (BRCM_CC_4339_CHIP_ID ,0xFFFFFFFF ,4339 ), BRCMF_FW_ENTRY(BRCM_CC_43430_CHIP_ID, 0x00000001, 43430A0), BRCMF_FW_ENTRY(BRCM_CC_43430_CHIP_ID, 0xFFFFFFFE, 43430A1), -BRCMF_FW_ENTRY (BRCM_CC_4345_CHIP_ID ,0xFFFFFFC0 ,43455 ), +BRCMF_FW_ENTRY (BRCM_CC_4345_CHIP_ID ,0x00000200 ,43456 ), +BRCMF_FW_ENTRY (BRCM_CC_4345_CHIP_ID ,0xFFFFFDC0 ,43455 ),BRCMF_FW_ENTRY (BRCM_CC_4354_CHIP_ID ,0xFFFFFFFF ,4354 ),BRCMF_FW_ENTRY (BRCM_CC_4356_CHIP_ID ,0xFFFFFFFF ,4356 ), BRCMF_FW_ENTRY(CY_CC_4373_CHIP_ID, 0xFFFFFFFF, 4373),
Signature · 1 line
2.21.0
PATCH v2 12/13 arm64: dts: allwinner: h6: Add MMC1 pins
In reply to [email protected]From: Ondrej Jirman <megous-5qf/[email protected]>
MMC1 is used on some H6 boards we want to support. Typical use is 4-bit SDIO interface with a WiFi chip. Add pin definitions for this use case.
--- arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi | 8 ++++++++ 1 file changed, 8 insertions(+)
arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi +8 -0
@@ -238,6 +238,14 @@ bias-pull-up; }; + mmc1_pins: mmc1-pins { + pins = "PG0", "PG1", "PG2", "PG3", + "PG4", "PG5"; + function = "mmc1"; + drive-strength = <30>; + bias-pull-up; + }; + mmc2_pins: mmc2-pins { pins = "PC1", "PC4", "PC5", "PC6", "PC7", "PC8", "PC9", "PC10",
Signature · 1 line
2.21.0
PATCH v2 13/13 arm64: dts: allwinner: orange-pi-3: Enable WiFi
In reply to [email protected]From: Ondrej Jirman <megous-5qf/[email protected]>
Orange Pi 3 has AP6256 WiFi/BT module. WiFi part of the module is called bcm43356 and can be used with the brcmfmac driver. The module is powered by the two always on regulators (not AXP805).
WiFi uses a PG port with 1.8V voltage level signals. SoC needs to be configured so that it sets up an 1.8V input bias on this port. This is done by the pio driver by reading the vcc-pg-supply voltage.
You'll need a fw_bcm43456c5_ag.bin firmware file and nvram.txt configuration that can be found in the Xulongs's repository for H6:
https://github.com/orangepi-xunlong/OrangePiH6_external/tree/master/ap6256
Mainline brcmfmac driver expects the firmware and nvram at the following paths relative to the firmware directory:
brcm/brcmfmac43456-sdio.bin
brcm/brcmfmac43456-sdio.txt
--- .../dts/allwinner/sun50i-h6-orangepi-3.dts | 48 +++++++++++++++++++ 1 file changed, 48 insertions(+)
arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi-3.dts +48 -0
@@ -66,6 +66,26 @@ regulator-always-on; }; + reg_vcc33_wifi: vcc33-wifi { + /* Always on 3.3V regulator for WiFi and BT */ + compatible = "regulator-fixed"; + regulator-name = "vcc33-wifi"; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + regulator-always-on; + vin-supply = <®_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>; + }; + /* * The board uses 2.5V RGMII signalling. Power sequence to enable * the phy is to enable GMAC-2V5 and GMAC-3V3 (aldo2) power rails
@@ -86,6 +106,14 @@ */ vin-supply = <®_aldo2>; /* GMAC-3V3 */ }; + + wifi_pwrseq: wifi_pwrseq { + compatible = "mmc-pwrseq-simple"; + clocks = <&rtc 1>; + clock-names = "ext_clock"; + reset-gpios = <&r_pio 1 3 GPIO_ACTIVE_LOW>; /* PM3 */ + post-power-on-delay-ms = <200>; + }; }; &cpu0 {
@@ -146,6 +174,25 @@ status = "okay"; }; +&mmc1 { + pinctrl-names = "default"; + pinctrl-0 = <&mmc1_pins>; + vmmc-supply = <®_vcc33_wifi>; + vqmmc-supply = <®_vcc_wifi_io>; + mmc-pwrseq = <&wifi_pwrseq>; + bus-width = <4>; + non-removable; + status = "okay"; + + brcm: sdio-wifi@1 { + reg = <1>; + compatible = "brcm,bcm4329-fmac"; + interrupt-parent = <&r_pio>; + interrupts = <1 0 IRQ_TYPE_LEVEL_LOW>; /* PM0 */ + interrupt-names = "host-wake"; + }; +}; + &ohci0 { status = "okay"; };
@@ -157,6 +204,7 @@ &pio { vcc-pc-supply = <®_bldo2>; vcc-pd-supply = <®_cldo1>; + vcc-pg-supply = <®_vcc_wifi_io>; }; &r_i2c {
Signature · 1 line
2.21.0