From 1f80a5cf74a60997b92d2cde772edec093bec4d9 Mon Sep 17 00:00:00 2001 From: Neil Armstrong Date: Mon, 7 Jun 2021 08:54:29 +0200 Subject: [PATCH 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. Signed-off-by: Neil Armstrong Acked-by: Martin Blumenstingl Link: https://lore.kernel.org/r/20210607065435.577334-2-narmstrong@baylibre.com --- arch/arm64/boot/dts/amlogic/meson-sm1-odroid.dtsi | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/arch/arm64/boot/dts/amlogic/meson-sm1-odroid.dtsi b/arch/arm64/boot/dts/amlogic/meson-sm1-odroid.dtsi index d14716b3d0f1ea..af40ba461074ad 100644 --- a/arch/arm64/boot/dts/amlogic/meson-sm1-odroid.dtsi +++ b/arch/arm64/boot/dts/amlogic/meson-sm1-odroid.dtsi @@ -46,6 +46,11 @@ 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>; From 7881df51368027b2d3fed3dcd43b480f45157d81 Mon Sep 17 00:00:00 2001 From: Neil Armstrong Date: Mon, 7 Jun 2021 08:54:30 +0200 Subject: [PATCH 2/7] arm64: dts: meson-sm1-odroid: set tf_io regulator gpio as open source 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. Signed-off-by: Neil Armstrong Acked-by: Martin Blumenstingl Link: https://lore.kernel.org/r/20210607065435.577334-3-narmstrong@baylibre.com --- arch/arm64/boot/dts/amlogic/meson-sm1-odroid.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm64/boot/dts/amlogic/meson-sm1-odroid.dtsi b/arch/arm64/boot/dts/amlogic/meson-sm1-odroid.dtsi index af40ba461074ad..e643591633318f 100644 --- a/arch/arm64/boot/dts/amlogic/meson-sm1-odroid.dtsi +++ b/arch/arm64/boot/dts/amlogic/meson-sm1-odroid.dtsi @@ -52,7 +52,7 @@ 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>, From 45d736ab17b44257e15e75e0dba364139fdb0983 Mon Sep 17 00:00:00 2001 From: Neil Armstrong Date: Mon, 7 Jun 2021 08:54:31 +0200 Subject: [PATCH 3/7] arm64: dts: meson-sm1-odroid: add 5v regulator gpio 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. Signed-off-by: Neil Armstrong Acked-by: Martin Blumenstingl Link: https://lore.kernel.org/r/20210607065435.577334-4-narmstrong@baylibre.com --- arch/arm64/boot/dts/amlogic/meson-sm1-odroid.dtsi | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/arm64/boot/dts/amlogic/meson-sm1-odroid.dtsi b/arch/arm64/boot/dts/amlogic/meson-sm1-odroid.dtsi index e643591633318f..fd0ad85c165bad 100644 --- a/arch/arm64/boot/dts/amlogic/meson-sm1-odroid.dtsi +++ b/arch/arm64/boot/dts/amlogic/meson-sm1-odroid.dtsi @@ -83,6 +83,8 @@ 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 { From 703e84d6615a4a95fb504c8f2e4c9426b86f3930 Mon Sep 17 00:00:00 2001 From: Neil Armstrong Date: Mon, 7 Jun 2021 08:54:32 +0200 Subject: [PATCH 4/7] arm64: dts: meson-sm1-odroid-hc4: disable unused USB PHY0 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. Signed-off-by: Neil Armstrong Acked-by: Martin Blumenstingl Link: https://lore.kernel.org/r/20210607065435.577334-5-narmstrong@baylibre.com --- arch/arm64/boot/dts/amlogic/meson-sm1-odroid-hc4.dts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/arch/arm64/boot/dts/amlogic/meson-sm1-odroid-hc4.dts b/arch/arm64/boot/dts/amlogic/meson-sm1-odroid-hc4.dts index bf15700c4b153d..0a34b658f9944b 100644 --- a/arch/arm64/boot/dts/amlogic/meson-sm1-odroid-hc4.dts +++ b/arch/arm64/boot/dts/amlogic/meson-sm1-odroid-hc4.dts @@ -91,6 +91,10 @@ }; &usb { - phys = <&usb2_phy0>, <&usb2_phy1>; - phy-names = "usb2-phy0", "usb2-phy1"; + phys = <&usb2_phy1>; + phy-names = "usb2-phy1"; +}; + +&usb2_phy0 { + status = "disabled"; }; From 164147f094ec5d0fc2c2098a888f4b50cf3096a7 Mon Sep 17 00:00:00 2001 From: Neil Armstrong Date: Mon, 7 Jun 2021 08:54:33 +0200 Subject: [PATCH 5/7] arm64: dts: meson-sm1-odroid-hc4: add regulators controlled by GPIOH_8 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. Signed-off-by: Neil Armstrong Acked-by: Martin Blumenstingl Link: https://lore.kernel.org/r/20210607065435.577334-6-narmstrong@baylibre.com --- .../boot/dts/amlogic/meson-sm1-odroid-hc4.dts | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/arch/arm64/boot/dts/amlogic/meson-sm1-odroid-hc4.dts b/arch/arm64/boot/dts/amlogic/meson-sm1-odroid-hc4.dts index 0a34b658f9944b..fdad6b994c8894 100644 --- a/arch/arm64/boot/dts/amlogic/meson-sm1-odroid-hc4.dts +++ b/arch/arm64/boot/dts/amlogic/meson-sm1-odroid-hc4.dts @@ -44,6 +44,32 @@ }; }; + /* 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"; }; From 7178f340e9299dc886e6ddf6e938f09967902109 Mon Sep 17 00:00:00 2001 From: Christian Hewitt Date: Mon, 7 Jun 2021 08:54:34 +0200 Subject: [PATCH 6/7] arm64: dts: meson-sm1-odroid-hc4: add spifc node to ODROID-HC4 Add a node for the XT25F128B SPI-NOR flash to make it accessible from Linux. Signed-off-by: Christian Hewitt Signed-off-by: Neil Armstrong Acked-by: Martin Blumenstingl Link: https://lore.kernel.org/r/20210607065435.577334-7-narmstrong@baylibre.com --- .../boot/dts/amlogic/meson-sm1-odroid-hc4.dts | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/arch/arm64/boot/dts/amlogic/meson-sm1-odroid-hc4.dts b/arch/arm64/boot/dts/amlogic/meson-sm1-odroid-hc4.dts index fdad6b994c8894..f3f953225bf5ba 100644 --- a/arch/arm64/boot/dts/amlogic/meson-sm1-odroid-hc4.dts +++ b/arch/arm64/boot/dts/amlogic/meson-sm1-odroid-hc4.dts @@ -116,6 +116,20 @@ 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"; From 303d2af21aedeaebe824411fbff912dfcdb48de5 Mon Sep 17 00:00:00 2001 From: Neil Armstrong Date: Mon, 7 Jun 2021 08:54:35 +0200 Subject: [PATCH 7/7] arm64: dts: meson-sm1-odroid-c4: remove invalid hub_5v regulator 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. Signed-off-by: Neil Armstrong Acked-by: Martin Blumenstingl Link: https://lore.kernel.org/r/20210607065435.577334-8-narmstrong@baylibre.com --- .../boot/dts/amlogic/meson-sm1-odroid-c4.dts | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/arch/arm64/boot/dts/amlogic/meson-sm1-odroid-c4.dts b/arch/arm64/boot/dts/amlogic/meson-sm1-odroid-c4.dts index 8c327c03d84503..8c30ce63686e33 100644 --- a/arch/arm64/boot/dts/amlogic/meson-sm1-odroid-c4.dts +++ b/arch/arm64/boot/dts/amlogic/meson-sm1-odroid-c4.dts @@ -23,18 +23,6 @@ }; }; - 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 @@ &ir { linux,rc-map-name = "rc-odroid"; }; - -&usb2_phy1 { - /* Enable the hub which is connected to this port */ - phy-supply = <&hub_5v>; -};