2021-06-01 09:03:29

by Neil Armstrong

[permalink] [raw]
Subject: [PATCH 0/6] 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.

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

Neil Armstrong (5):
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-c4: fix hub_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

.../boot/dts/amlogic/meson-sm1-odroid-c4.dts | 2 +-
.../boot/dts/amlogic/meson-sm1-odroid-hc4.dts | 53 ++++++++++++++++++-
.../boot/dts/amlogic/meson-sm1-odroid.dtsi | 7 ++-
3 files changed, 58 insertions(+), 4 deletions(-)

--
2.25.1


2021-06-01 09:03:31

by Neil Armstrong

[permalink] [raw]
Subject: [PATCH 3/6] arm64: dts: meson-sm1-odroid-c4: fix hub_5v regulator gpio

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

Fixes: 326e57518b0d ("arm64: dts: meson-sm1: add support for Hardkernel ODROID-C4")
Signed-off-by: Neil Armstrong <[email protected]>
---
arch/arm64/boot/dts/amlogic/meson-sm1-odroid-c4.dts | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

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 8c327c03d845..63695ea21b1c 100644
--- a/arch/arm64/boot/dts/amlogic/meson-sm1-odroid-c4.dts
+++ b/arch/arm64/boot/dts/amlogic/meson-sm1-odroid-c4.dts
@@ -31,7 +31,7 @@ hub_5v: regulator-hub_5v {
vin-supply = <&vcc_5v>;

/* Connected to the Hub CHIPENABLE, LOW sets low power state */
- gpio = <&gpio GPIOH_4 GPIO_ACTIVE_HIGH>;
+ gpio = <&gpio GPIOH_8 GPIO_OPEN_DRAIN>;
enable-active-high;
};

--
2.25.1

2021-06-01 09:03:38

by Neil Armstrong

[permalink] [raw]
Subject: [PATCH 1/6] 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.

Fixes: 88d537bc92ca ("arm64: dts: meson: convert meson-sm1-odroid-c4 to dtsi")
Signed-off-by: Neil Armstrong <[email protected]>
---
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 d14716b3d0f1..af40ba461074 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 @@ 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>;
--
2.25.1

2021-06-01 09:04:11

by Neil Armstrong

[permalink] [raw]
Subject: [PATCH 6/6] arm64: dts: meson-sm1-odroid-hc4: add spifc node to ODROID-HC4

From: Christian Hewitt <[email protected]>

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

Signed-off-by: Christian Hewitt <[email protected]>
Signed-off-by: Neil Armstrong <[email protected]>
---
.../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 d36c25b5b690..3c2ebc7333a1 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 @@ &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";
--
2.25.1

2021-06-03 18:08:00

by Martin Blumenstingl

[permalink] [raw]
Subject: Re: [PATCH 1/6] arm64: dts: meson-sm1-odroid: add missing enable gpio and supply for tf_io regulator

On Tue, Jun 1, 2021 at 11:01 AM Neil Armstrong <[email protected]> wrote:
>
> 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.
>
> Fixes: 88d537bc92ca ("arm64: dts: meson: convert meson-sm1-odroid-c4 to dtsi")
> Signed-off-by: Neil Armstrong <[email protected]>
Acked-by: Martin Blumenstingl <[email protected]>

2021-06-03 18:10:34

by Martin Blumenstingl

[permalink] [raw]
Subject: Re: [PATCH 3/6] arm64: dts: meson-sm1-odroid-c4: fix hub_5v regulator gpio

Hi Neil,

On Tue, Jun 1, 2021 at 11:01 AM Neil Armstrong <[email protected]> wrote:
>
> As described in the Odroid-C4 schematics, the HUB_5V regulator is controlled
> by GPIOH_8 and in Open Drain since this GPIO doesn't support Push-Pull.
>
> Fixes: 326e57518b0d ("arm64: dts: meson-sm1: add support for Hardkernel ODROID-C4")
> Signed-off-by: Neil Armstrong <[email protected]>
my interpretation of page 32 of the schematics [0] is that GPIOH_8 manages VCC5V
GPIOH_4 is connected as RST_N to the RESET# pad of the USB hub -> this
seems to match the original regulator definition


[0] https://wiki.odroid.com/_media/odroid-c4/odroid-c4_rev1.0.pdf

2021-06-03 18:13:42

by Martin Blumenstingl

[permalink] [raw]
Subject: Re: [PATCH 6/6] arm64: dts: meson-sm1-odroid-hc4: add spifc node to ODROID-HC4

On Tue, Jun 1, 2021 at 11:01 AM Neil Armstrong <[email protected]> wrote:
>
> From: Christian Hewitt <[email protected]>
>
> Add a node for the XT25F128B SPI-NOR flash to make it accessible
> from Linux.
>
> Signed-off-by: Christian Hewitt <[email protected]>
> Signed-off-by: Neil Armstrong <[email protected]>
Acked-by: Martin Blumenstingl <[email protected]>

2021-06-04 09:46:26

by Neil Armstrong

[permalink] [raw]
Subject: Re: [PATCH 3/6] arm64: dts: meson-sm1-odroid-c4: fix hub_5v regulator gpio

Hi,

On 03/06/2021 20:07, Martin Blumenstingl wrote:
> Hi Neil,
>
> On Tue, Jun 1, 2021 at 11:01 AM Neil Armstrong <[email protected]> wrote:
>>
>> As described in the Odroid-C4 schematics, the HUB_5V regulator is controlled
>> by GPIOH_8 and in Open Drain since this GPIO doesn't support Push-Pull.
>>
>> Fixes: 326e57518b0d ("arm64: dts: meson-sm1: add support for Hardkernel ODROID-C4")
>> Signed-off-by: Neil Armstrong <[email protected]>
> my interpretation of page 32 of the schematics [0] is that GPIOH_8 manages VCC5V
> GPIOH_4 is connected as RST_N to the RESET# pad of the USB hub -> this
> seems to match the original regulator definition

You're right, but GPIOH_4 is already a GPIO HOG, so this regulator doesn't make any sense then,
and the GPIO for the VCC_5V regulator is missing, like in patch 5.

So I'll add:
+&vcc_5v {
+ gpio = <&gpio GPIOH_8 GPIO_OPEN_DRAIN>;
+ enable-active-high;
+};

in odroid.dtsi instead in this patch.

Not sure what to do about the regulator-hub_5v.

Neil

>
>
> [0] https://wiki.odroid.com/_media/odroid-c4/odroid-c4_rev1.0.pdf
>

2021-06-04 10:18:25

by Martin Blumenstingl

[permalink] [raw]
Subject: Re: [PATCH 3/6] arm64: dts: meson-sm1-odroid-c4: fix hub_5v regulator gpio

Hi Neil,

On Fri, Jun 4, 2021 at 11:43 AM Neil Armstrong <[email protected]> wrote:
[...]
> So I'll add:
> +&vcc_5v {
> + gpio = <&gpio GPIOH_8 GPIO_OPEN_DRAIN>;
> + enable-active-high;
> +};
>
> in odroid.dtsi instead in this patch.
that sounds good to me

> Not sure what to do about the regulator-hub_5v.
maybe dropping this regulator overall? we're using gpio-hogs elsewhere
for the USB hub's reset line
or dropping the gpio-hog and keeping this regulator to manage GPIOH_4


Best regards,
Martin

2021-06-04 10:23:15

by Neil Armstrong

[permalink] [raw]
Subject: Re: [PATCH 3/6] arm64: dts: meson-sm1-odroid-c4: fix hub_5v regulator gpio

On 04/06/2021 12:13, Martin Blumenstingl wrote:
> Hi Neil,
>
> On Fri, Jun 4, 2021 at 11:43 AM Neil Armstrong <[email protected]> wrote:
> [...]
>> So I'll add:
>> +&vcc_5v {
>> + gpio = <&gpio GPIOH_8 GPIO_OPEN_DRAIN>;
>> + enable-active-high;
>> +};
>>
>> in odroid.dtsi instead in this patch.
> that sounds good to me
>
>> Not sure what to do about the regulator-hub_5v.
> maybe dropping this regulator overall? we're using gpio-hogs elsewhere
> for the USB hub's reset line
> or dropping the gpio-hog and keeping this regulator to manage GPIOH_4

I'll drop it completely, it makes no sense to have a regulator for a HUB reset anyway.

Neil

>
>
> Best regards,
> Martin
>