Skip to contentSkip to conversation

arm64: dts: meson-sm1-odroid: various fixes for C4/HC4

PATCH Applied Neil Armstrong 2 participants 11 messages Jun 7, 2021 – Jun 14, 2021

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

v2 cover arm64: dts: meson-sm1-odroid: various fixes for C4/HC4

Here is a collection of fixes/small additions to Odroid-C4 & Odroid-HC4 concerning regulators handling, USB and SPI NOR Flash of HC4.

Changes from v1 at [1]:
- added review tags from martin
- removed invalid patch about hub_5v
- added proper vcc_5v gpio control
- removed invalid hub_5v regulator already controlled by a gpio hog

[1] https://lore.kernel.org/r/[email protected]

Christian Hewitt (1):
arm64: dts: meson-sm1-odroid-hc4: add spifc node to ODROID-HC4

Neil Armstrong (6):
arm64: dts: meson-sm1-odroid: add missing enable gpio and supply for
tf_io regulator
arm64: dts: meson-sm1-odroid: set tf_io regulator gpio as open source
arm64: dts: meson-sm1-odroid: add 5v regulator gpio
arm64: dts: meson-sm1-odroid-hc4: disable unused USB PHY0
arm64: dts: meson-sm1-odroid-hc4: add regulators controlled by GPIOH_8
arm64: dts: meson-sm1-odroid-c4: remove invalid hub_5v regulator

 .../boot/dts/amlogic/meson-sm1-odroid-c4.dts  | 17 -------
 .../boot/dts/amlogic/meson-sm1-odroid-hc4.dts | 48 ++++++++++++++++++-
 .../boot/dts/amlogic/meson-sm1-odroid.dtsi    |  9 +++-
 3 files changed, 54 insertions(+), 20 deletions(-)
Signature · 1 line
2.25.1
#1 lore raw

PATCH v2 1/7 arm64: dts: meson-sm1-odroid: add missing enable gpio and supply for tf_io regulator

As described in the schematics of Odroid-C4 and Odroid-HC4, the TF_IO regulator is enabled by the GPIOE_2 GPIO and gets it's supply from VCC_5V.

---
 arch/arm64/boot/dts/amlogic/meson-sm1-odroid.dtsi | 5 +++++
 1 file changed, 5 insertions(+)
arch/arm64/boot/dts/amlogic/meson-sm1-odroid.dtsi +5 -0
index d14716b3d0f1..af40ba461074 100644
@@ -46,6 +46,11 @@ tf_io: gpio-regulator-tf_io {
 		regulator-name = "TF_IO";
 		regulator-min-microvolt = <1800000>;
 		regulator-max-microvolt = <3300000>;
+		vin-supply = <&vcc_5v>;
+
+		enable-gpio = <&gpio GPIOE_2 GPIO_ACTIVE_HIGH>;
+		enable-active-high;
+		regulator-always-on;
 
 		gpios = <&gpio_ao GPIOAO_6 GPIO_ACTIVE_HIGH>;
 		gpios-states = <0>;
Signature · 1 line
2.25.1
#2 lore raw

PATCH v2 2/7 arm64: dts: meson-sm1-odroid: set tf_io regulator gpio as open source

In reply to Neil Armstrong

According to Odroid-C4 & HC4 Schematics, the TF_3V3N_1V8_EN can be in Hi-Z for 3v3, and since it's the default GPIOAO_6 mode at reset, let switch this GPIO as Open-Source to drive for 1, and input for 0.

---
 arch/arm64/boot/dts/amlogic/meson-sm1-odroid.dtsi | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/boot/dts/amlogic/meson-sm1-odroid.dtsi +1 -1
index af40ba461074..e64359163331 100644
@@ -52,7 +52,7 @@ tf_io: gpio-regulator-tf_io {
 		enable-active-high;
 		regulator-always-on;
 
-		gpios = <&gpio_ao GPIOAO_6 GPIO_ACTIVE_HIGH>;
+		gpios = <&gpio_ao GPIOAO_6 GPIO_OPEN_SOURCE>;
 		gpios-states = <0>;
 
 		states = <3300000 0>,
Signature · 1 line
2.25.1
#3 lore raw

PATCH v2 3/7 arm64: dts: meson-sm1-odroid: add 5v regulator gpio

In reply to Neil Armstrong

As described in the Odroid-C4 & Odroid-HC4 schematics, the 5V regulator is controlled by GPIOH_8 and in Open Drain since this GPIO doesn't support Push-Pull.

---
 arch/arm64/boot/dts/amlogic/meson-sm1-odroid.dtsi | 2 ++
 1 file changed, 2 insertions(+)
arch/arm64/boot/dts/amlogic/meson-sm1-odroid.dtsi +2 -0
index e64359163331..fd0ad85c165b 100644
@@ -83,6 +83,8 @@ vcc_5v: regulator-vcc_5v {
 		regulator-max-microvolt = <5000000>;
 		regulator-always-on;
 		vin-supply = <&main_12v>;
+		gpio = <&gpio GPIOH_8 GPIO_OPEN_DRAIN>;
+		enable-active-high;
 	};
 
 	vcc_1v8: regulator-vcc_1v8 {
Signature · 7 lines
2.25.1


_______________________________________________
linux-amlogic mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-amlogic
reviewer Acked-by on v2 3/7
#4 lore raw

Re: [PATCH v2 3/7] arm64: dts: meson-sm1-odroid: add 5v regulator gpio

Quoted 5 lines · Neil Armstrong

As described in the Odroid-C4 & Odroid-HC4 schematics, the 5V regulator is controlled by GPIOH_8 and in Open Drain since this GPIO doesn't support Push-Pull.

_______________________________________________
linux-amlogic mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-amlogic

#5 lore raw

PATCH v2 4/7 arm64: dts: meson-sm1-odroid-hc4: disable unused USB PHY0

In reply to Neil Armstrong

As described in the HC4 schematics, only the USB port B is used, port A is left unconnected. Thus disable PHY0 and remove it from PHYs list.

---
 arch/arm64/boot/dts/amlogic/meson-sm1-odroid-hc4.dts | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
arch/arm64/boot/dts/amlogic/meson-sm1-odroid-hc4.dts +6 -2
index bf15700c4b15..0a34b658f994 100644
@@ -91,6 +91,10 @@ &sd_emmc_c {
 };
 
 &usb {
-	phys = <&usb2_phy0>, <&usb2_phy1>;
-	phy-names = "usb2-phy0", "usb2-phy1";
+	phys = <&usb2_phy1>;
+	phy-names = "usb2-phy1";
+};
+
+&usb2_phy0 {
+	status = "disabled";
 };
Signature · 1 line
2.25.1
#6 lore raw

PATCH v2 5/7 arm64: dts: meson-sm1-odroid-hc4: add regulators controlled by GPIOH_8

In reply to Neil Armstrong

As described in the HC4 schematics, GPIOH_8 controls the USB 5V and 12V regulators used to power the SATA drives.

And is set as Open Drain since this GPIO doesn't support Push-Pull.

---
 .../boot/dts/amlogic/meson-sm1-odroid-hc4.dts | 26 +++++++++++++++++++
 1 file changed, 26 insertions(+)
arch/arm64/boot/dts/amlogic/meson-sm1-odroid-hc4.dts +26 -0
index 0a34b658f994..fdad6b994c88 100644
@@ -44,6 +44,32 @@ led-red {
 		};
 	};
 
+	/* Powers the SATA Disk 0 regulator, which is enabled when a disk load is detected */
+	p12v_0: regulator-p12v_0 {
+		compatible = "regulator-fixed";
+		regulator-name = "P12V_0";
+		regulator-min-microvolt = <12000000>;
+		regulator-max-microvolt = <12000000>;
+		vin-supply = <&main_12v>;
+
+		gpio = <&gpio GPIOH_8 GPIO_OPEN_DRAIN>;
+		enable-active-high;
+		regulator-always-on;
+	};
+
+	/* Powers the SATA Disk 1 regulator, which is enabled when a disk load is detected */
+	p12v_1: regulator-p12v_1 {
+		compatible = "regulator-fixed";
+		regulator-name = "P12V_1";
+		regulator-min-microvolt = <12000000>;
+		regulator-max-microvolt = <12000000>;
+		vin-supply = <&main_12v>;
+
+		gpio = <&gpio GPIOH_8 GPIO_OPEN_DRAIN>;
+		enable-active-high;
+		regulator-always-on;
+	};
+
 	sound {
 		model = "ODROID-HC4";
 	};
Signature · 1 line
2.25.1
#7 lore raw

PATCH v2 6/7 arm64: dts: meson-sm1-odroid-hc4: add spifc node to ODROID-HC4

In reply to Neil Armstrong

From: Christian Hewitt <[email protected]>

Add a node for the XT25F128B SPI-NOR flash to make it accessible from Linux.

---
 .../boot/dts/amlogic/meson-sm1-odroid-hc4.dts      | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
arch/arm64/boot/dts/amlogic/meson-sm1-odroid-hc4.dts +14 -0
index fdad6b994c88..f3f953225bf5 100644
@@ -116,6 +116,20 @@ &sd_emmc_c {
 	status = "disabled";
 };
 
+&spifc {
+	status = "okay";
+	pinctrl-0 = <&nor_pins>;
+	pinctrl-names = "default";
+
+	spi-flash@0 {
+		#address-cells = <1>;
+		#size-cells = <1>;
+		compatible = "jedec,spi-nor";
+		reg = <0>;
+		spi-max-frequency = <104000000>;
+	};
+};
+
 &usb {
 	phys = <&usb2_phy1>;
 	phy-names = "usb2-phy1";
Signature · 1 line
2.25.1
#8 lore raw

PATCH v2 7/7 arm64: dts: meson-sm1-odroid-c4: remove invalid hub_5v regulator

In reply to Neil Armstrong

Drop the hub_5v regulator which controls the HUB Reset line with GPIOH_4 which is already controlled by a GPIO HOG.

Until we can properly describe how to control USB HUBs reset lines, keeping the GPIO HOG is an acceptable solution we use on multiple boards.

---
 .../boot/dts/amlogic/meson-sm1-odroid-c4.dts    | 17 -----------------
 1 file changed, 17 deletions(-)
arch/arm64/boot/dts/amlogic/meson-sm1-odroid-c4.dts +0 -17
index 8c327c03d845..8c30ce63686e 100644
@@ -23,18 +23,6 @@ led-blue {
 		};
 	};
 
-	hub_5v: regulator-hub_5v {
-		compatible = "regulator-fixed";
-		regulator-name = "HUB_5V";
-		regulator-min-microvolt = <5000000>;
-		regulator-max-microvolt = <5000000>;
-		vin-supply = <&vcc_5v>;
-
-		/* Connected to the Hub CHIPENABLE, LOW sets low power state */
-		gpio = <&gpio GPIOH_4 GPIO_ACTIVE_HIGH>;
-		enable-active-high;
-	};
-
 	sound {
 		model = "ODROID-C4";
 	};
@@ -58,8 +46,3 @@ hog-0 {
 &ir {
 	linux,rc-map-name = "rc-odroid";
 };
-
-&usb2_phy1 {
-	/* Enable the hub which is connected to this port */
-	phy-supply = <&hub_5v>;
-};
Signature · 1 line
2.25.1
reviewer Acked-by on v2 7/7
#9 lore raw

Re: [PATCH v2 7/7] arm64: dts: meson-sm1-odroid-c4: remove invalid hub_5v regulator

Quoted 8 lines · Neil Armstrong

Drop the hub_5v regulator which controls the HUB Reset line with GPIOH_4 which is already controlled by a GPIO HOG.

Until we can properly describe how to control USB HUBs reset lines, keeping the GPIO HOG is an acceptable solution we use on multiple boards.

_______________________________________________
linux-amlogic mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-amlogic

author Applied
#10 lore raw
In reply to Neil Armstrong

Hi,

Quoted 10 lines · Neil Armstrong

Here is a collection of fixes/small additions to Odroid-C4 & Odroid-HC4 concerning regulators handling, USB and SPI NOR Flash of HC4.

Changes from v1 at [1]:
- added review tags from martin
- removed invalid patch about hub_5v
- added proper vcc_5v gpio control
- removed invalid hub_5v regulator already controlled by a gpio hog

[...]

Thanks, Applied to https://git.kernel.org/pub/scm/linux/kernel/git/amlogic/linux.git (v5.14/dt64)

[1/7] arm64: dts: meson-sm1-odroid: add missing enable gpio and supply for tf_io regulator

      https://git.kernel.org/amlogic/c/1f80a5cf74a60997b92d2cde772edec093bec4d9
[2/7] arm64: dts: meson-sm1-odroid: set tf_io regulator gpio as open source
      https://git.kernel.org/amlogic/c/7881df51368027b2d3fed3dcd43b480f45157d81
[3/7] arm64: dts: meson-sm1-odroid: add 5v regulator gpio
      https://git.kernel.org/amlogic/c/45d736ab17b44257e15e75e0dba364139fdb0983
[4/7] arm64: dts: meson-sm1-odroid-hc4: disable unused USB PHY0
      https://git.kernel.org/amlogic/c/703e84d6615a4a95fb504c8f2e4c9426b86f3930
[5/7] arm64: dts: meson-sm1-odroid-hc4: add regulators controlled by GPIOH_8
      https://git.kernel.org/amlogic/c/164147f094ec5d0fc2c2098a888f4b50cf3096a7
[6/7] arm64: dts: meson-sm1-odroid-hc4: add spifc node to ODROID-HC4
      https://git.kernel.org/amlogic/c/7178f340e9299dc886e6ddf6e938f09967902109
[7/7] arm64: dts: meson-sm1-odroid-c4: remove invalid hub_5v regulator
      https://git.kernel.org/amlogic/c/303d2af21aedeaebe824411fbff912dfcdb48de5
Signature · 1 line
Neil