2021-09-27 15:43:22

by Robert Marko

[permalink] [raw]
Subject: [PATCH 1/4] arm64: dts: marvell: espressobin-ultra: enable UART output by default

Since Espressobin Ultra board has a microUSB port
with the onboard USB to UART connected to it to be
used as a debug UART it makes no sense to require
the bootloader to pass console args to the kernel in
order to get console working.

So, use the "stdout-path" property to enable the UART
output on the microUSB port by default.

Signed-off-by: Robert Marko <[email protected]>
---
arch/arm64/boot/dts/marvell/armada-3720-espressobin-ultra.dts | 4 ++++
1 file changed, 4 insertions(+)

diff --git a/arch/arm64/boot/dts/marvell/armada-3720-espressobin-ultra.dts b/arch/arm64/boot/dts/marvell/armada-3720-espressobin-ultra.dts
index c5eb3604dd5b..c1770ceff3c1 100644
--- a/arch/arm64/boot/dts/marvell/armada-3720-espressobin-ultra.dts
+++ b/arch/arm64/boot/dts/marvell/armada-3720-espressobin-ultra.dts
@@ -15,6 +15,10 @@ / {
compatible = "globalscale,espressobin-ultra", "marvell,armada3720",
"marvell,armada3710";

+ chosen {
+ stdout-path = "serial0:115200n8";
+ };
+
aliases {
/* ethernet1 is WAN port */
ethernet1 = &switch0port5;
--
2.31.1


2021-09-27 15:43:31

by Robert Marko

[permalink] [raw]
Subject: [PATCH 2/4] arm64: dts: marvell: espressobin-ultra: fix SPI-NOR config

SPI config for the SPI-NOR is incorrect and completely breaking
reading/writing to the onboard SPI-NOR.

SPI-NOR is connected in the single(x1) IO mode and not in the quad
(x4) mode.
Also, there is no need to override the max frequency from the DTSI
as the mx25u3235f that is used supports 104Mhz.

Signed-off-by: Robert Marko <[email protected]>
---
arch/arm64/boot/dts/marvell/armada-3720-espressobin-ultra.dts | 4 ----
1 file changed, 4 deletions(-)

diff --git a/arch/arm64/boot/dts/marvell/armada-3720-espressobin-ultra.dts b/arch/arm64/boot/dts/marvell/armada-3720-espressobin-ultra.dts
index c1770ceff3c1..8a700afd0570 100644
--- a/arch/arm64/boot/dts/marvell/armada-3720-espressobin-ultra.dts
+++ b/arch/arm64/boot/dts/marvell/armada-3720-espressobin-ultra.dts
@@ -75,10 +75,6 @@ &sdhci1 {

&spi0 {
flash@0 {
- spi-max-frequency = <108000000>;
- spi-rx-bus-width = <4>;
- spi-tx-bus-width = <4>;
-
partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
--
2.31.1

2021-09-27 15:44:58

by Robert Marko

[permalink] [raw]
Subject: [PATCH 4/4] arm64: dts: marvell: espressobin-ultra: enable front USB3 port

Espressobin Ultra has a front panel USB3.0 Type-A port which works
just fine so enable it.
I dont see a reason why it was disabled in the first place anyway.

Signed-off-by: Robert Marko <[email protected]>
---
arch/arm64/boot/dts/marvell/armada-3720-espressobin-ultra.dts | 1 -
1 file changed, 1 deletion(-)

diff --git a/arch/arm64/boot/dts/marvell/armada-3720-espressobin-ultra.dts b/arch/arm64/boot/dts/marvell/armada-3720-espressobin-ultra.dts
index 96855a10b4a0..aada43fa236c 100644
--- a/arch/arm64/boot/dts/marvell/armada-3720-espressobin-ultra.dts
+++ b/arch/arm64/boot/dts/marvell/armada-3720-espressobin-ultra.dts
@@ -112,7 +112,6 @@ rtc@51 {

&usb3 {
usb-phy = <&usb3_phy>;
- status = "disabled";
};

&mdio {
--
2.31.1

2021-09-27 15:44:58

by Robert Marko

[permalink] [raw]
Subject: [PATCH 3/4] arm64: dts: marvell: espressobin-ultra: add PHY and switch reset pins

Both the Topaz switch and 88E1512 PHY have their reset and interrupts
connected to the SoC.

So, define the Topaz and 88E1512 reset pins in the DTS.

Defining the interrupt pins wont work as both the 88E1512 and the
Topaz switch uses active LOW IRQ signals but the A37xx GPIO controller
only supports edge triggers.
88E1512 would require special setup anyway as its INT pin is shared with
the LED2 and you first need to configure it as INT.

Signed-off-by: Robert Marko <[email protected]>
---
arch/arm64/boot/dts/marvell/armada-3720-espressobin-ultra.dts | 4 ++++
1 file changed, 4 insertions(+)

diff --git a/arch/arm64/boot/dts/marvell/armada-3720-espressobin-ultra.dts b/arch/arm64/boot/dts/marvell/armada-3720-espressobin-ultra.dts
index 8a700afd0570..96855a10b4a0 100644
--- a/arch/arm64/boot/dts/marvell/armada-3720-espressobin-ultra.dts
+++ b/arch/arm64/boot/dts/marvell/armada-3720-espressobin-ultra.dts
@@ -118,12 +118,16 @@ &usb3 {
&mdio {
extphy: ethernet-phy@1 {
reg = <1>;
+
+ reset-gpios = <&gpionb 2 GPIO_ACTIVE_LOW>;
};
};

&switch0 {
reg = <3>;

+ reset-gpios = <&gpiosb 23 GPIO_ACTIVE_LOW>;
+
ports {
switch0port1: port@1 {
reg = <1>;
--
2.31.1

2021-09-27 16:39:09

by Andrew Lunn

[permalink] [raw]
Subject: Re: [PATCH 1/4] arm64: dts: marvell: espressobin-ultra: enable UART output by default

On Mon, Sep 27, 2021 at 05:41:56PM +0200, Robert Marko wrote:
> Since Espressobin Ultra board has a microUSB port
> with the onboard USB to UART connected to it to be
> used as a debug UART it makes no sense to require
> the bootloader to pass console args to the kernel in
> order to get console working.
>
> So, use the "stdout-path" property to enable the UART
> output on the microUSB port by default.
>
> Signed-off-by: Robert Marko <[email protected]>

Reviewed-by: Andrew Lunn <[email protected]>

Andrew

2021-09-27 16:39:13

by Andrew Lunn

[permalink] [raw]
Subject: Re: [PATCH 3/4] arm64: dts: marvell: espressobin-ultra: add PHY and switch reset pins

On Mon, Sep 27, 2021 at 05:41:58PM +0200, Robert Marko wrote:
> Both the Topaz switch and 88E1512 PHY have their reset and interrupts
> connected to the SoC.
>
> So, define the Topaz and 88E1512 reset pins in the DTS.
>
> Defining the interrupt pins wont work as both the 88E1512 and the
> Topaz switch uses active LOW IRQ signals but the A37xx GPIO controller
> only supports edge triggers.
> 88E1512 would require special setup anyway as its INT pin is shared with
> the LED2 and you first need to configure it as INT.
>
> Signed-off-by: Robert Marko <[email protected]>

Reviewed-by: Andrew Lunn <[email protected]>

Andrew

2021-09-28 15:16:58

by Pali Rohár

[permalink] [raw]
Subject: Re: [PATCH 1/4] arm64: dts: marvell: espressobin-ultra: enable UART output by default

On Monday 27 September 2021 17:41:56 Robert Marko wrote:
> Since Espressobin Ultra board has a microUSB port
> with the onboard USB to UART connected to it to be
> used as a debug UART it makes no sense to require
> the bootloader to pass console args to the kernel in
> order to get console working.
>
> So, use the "stdout-path" property to enable the UART
> output on the microUSB port by default.
>
> Signed-off-by: Robert Marko <[email protected]>
> ---
> arch/arm64/boot/dts/marvell/armada-3720-espressobin-ultra.dts | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/arch/arm64/boot/dts/marvell/armada-3720-espressobin-ultra.dts b/arch/arm64/boot/dts/marvell/armada-3720-espressobin-ultra.dts
> index c5eb3604dd5b..c1770ceff3c1 100644
> --- a/arch/arm64/boot/dts/marvell/armada-3720-espressobin-ultra.dts
> +++ b/arch/arm64/boot/dts/marvell/armada-3720-espressobin-ultra.dts
> @@ -15,6 +15,10 @@ / {
> compatible = "globalscale,espressobin-ultra", "marvell,armada3720",
> "marvell,armada3710";
>
> + chosen {
> + stdout-path = "serial0:115200n8";
> + };
> +

This code is duplication of common espressobin code from
armada-3720-espressobin.dtsi file:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/arm64/boot/dts/marvell/armada-3720-espressobin.dtsi

> aliases {
> /* ethernet1 is WAN port */
> ethernet1 = &switch0port5;
> --
> 2.31.1
>

2021-09-28 15:35:42

by Pali Rohár

[permalink] [raw]
Subject: Re: [PATCH 3/4] arm64: dts: marvell: espressobin-ultra: add PHY and switch reset pins

On Monday 27 September 2021 17:41:58 Robert Marko wrote:
> Both the Topaz switch and 88E1512 PHY have their reset and interrupts
> connected to the SoC.
>
> So, define the Topaz and 88E1512 reset pins in the DTS.

Are reset pins connected only on ultra variant? Or on all espressobin
variants? Because if they are on all variants then definitions should go
into common dtsi file.

I see that "gpionb 2" is on v7 variant connected to LED2. So I'm not
sure if this one gpio is also shared or not.

> Defining the interrupt pins wont work as both the 88E1512 and the
> Topaz switch uses active LOW IRQ signals but the A37xx GPIO controller
> only supports edge triggers.
> 88E1512 would require special setup anyway as its INT pin is shared with
> the LED2 and you first need to configure it as INT.

Do you plan to finish also this additional setup?

> Signed-off-by: Robert Marko <[email protected]>
> ---
> arch/arm64/boot/dts/marvell/armada-3720-espressobin-ultra.dts | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/arch/arm64/boot/dts/marvell/armada-3720-espressobin-ultra.dts b/arch/arm64/boot/dts/marvell/armada-3720-espressobin-ultra.dts
> index 8a700afd0570..96855a10b4a0 100644
> --- a/arch/arm64/boot/dts/marvell/armada-3720-espressobin-ultra.dts
> +++ b/arch/arm64/boot/dts/marvell/armada-3720-espressobin-ultra.dts
> @@ -118,12 +118,16 @@ &usb3 {
> &mdio {
> extphy: ethernet-phy@1 {
> reg = <1>;
> +
> + reset-gpios = <&gpionb 2 GPIO_ACTIVE_LOW>;
> };
> };
>
> &switch0 {
> reg = <3>;
>
> + reset-gpios = <&gpiosb 23 GPIO_ACTIVE_LOW>;
> +
> ports {
> switch0port1: port@1 {
> reg = <1>;
> --
> 2.31.1
>

2021-09-28 15:39:26

by Pali Rohár

[permalink] [raw]
Subject: Re: [PATCH 4/4] arm64: dts: marvell: espressobin-ultra: enable front USB3 port

On Monday 27 September 2021 17:41:59 Robert Marko wrote:
> Espressobin Ultra has a front panel USB3.0 Type-A port which works
> just fine so enable it.
> I dont see a reason why it was disabled in the first place anyway.

If USB 3.0 port is was tested and is working fine, then what about
adding Fixes: tag into commit message?

> Signed-off-by: Robert Marko <[email protected]>
> ---
> arch/arm64/boot/dts/marvell/armada-3720-espressobin-ultra.dts | 1 -
> 1 file changed, 1 deletion(-)
>
> diff --git a/arch/arm64/boot/dts/marvell/armada-3720-espressobin-ultra.dts b/arch/arm64/boot/dts/marvell/armada-3720-espressobin-ultra.dts
> index 96855a10b4a0..aada43fa236c 100644
> --- a/arch/arm64/boot/dts/marvell/armada-3720-espressobin-ultra.dts
> +++ b/arch/arm64/boot/dts/marvell/armada-3720-espressobin-ultra.dts
> @@ -112,7 +112,6 @@ rtc@51 {
>
> &usb3 {
> usb-phy = <&usb3_phy>;
> - status = "disabled";
> };
>
> &mdio {
> --
> 2.31.1
>

2021-09-28 15:54:31

by Robert Marko

[permalink] [raw]
Subject: Re: [PATCH 1/4] arm64: dts: marvell: espressobin-ultra: enable UART output by default

On Tue, Sep 28, 2021 at 5:13 PM Pali Rohár <[email protected]> wrote:
>
> On Monday 27 September 2021 17:41:56 Robert Marko wrote:
> > Since Espressobin Ultra board has a microUSB port
> > with the onboard USB to UART connected to it to be
> > used as a debug UART it makes no sense to require
> > the bootloader to pass console args to the kernel in
> > order to get console working.
> >
> > So, use the "stdout-path" property to enable the UART
> > output on the microUSB port by default.
> >
> > Signed-off-by: Robert Marko <[email protected]>
> > ---
> > arch/arm64/boot/dts/marvell/armada-3720-espressobin-ultra.dts | 4 ++++
> > 1 file changed, 4 insertions(+)
> >
> > diff --git a/arch/arm64/boot/dts/marvell/armada-3720-espressobin-ultra.dts b/arch/arm64/boot/dts/marvell/armada-3720-espressobin-ultra.dts
> > index c5eb3604dd5b..c1770ceff3c1 100644
> > --- a/arch/arm64/boot/dts/marvell/armada-3720-espressobin-ultra.dts
> > +++ b/arch/arm64/boot/dts/marvell/armada-3720-espressobin-ultra.dts
> > @@ -15,6 +15,10 @@ / {
> > compatible = "globalscale,espressobin-ultra", "marvell,armada3720",
> > "marvell,armada3710";
> >
> > + chosen {
> > + stdout-path = "serial0:115200n8";
> > + };
> > +
>
> This code is duplication of common espressobin code from
> armada-3720-espressobin.dtsi file:
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/arm64/boot/dts/marvell/armada-3720-espressobin.dtsi

Ahh yes, I don't know why was it not working by default then.
Sorry for the noise, I will drop this patch.

Regards,
Robert
>
> > aliases {
> > /* ethernet1 is WAN port */
> > ethernet1 = &switch0port5;
> > --
> > 2.31.1
> >



--
Robert Marko
Staff Embedded Linux Engineer
Sartura Ltd.
Lendavska ulica 16a
10000 Zagreb, Croatia
Email: [email protected]
Web: http://www.sartura.hr

2021-09-28 16:05:04

by Robert Marko

[permalink] [raw]
Subject: Re: [PATCH 3/4] arm64: dts: marvell: espressobin-ultra: add PHY and switch reset pins

On Tue, Sep 28, 2021 at 5:32 PM Pali Rohár <[email protected]> wrote:
>
> On Monday 27 September 2021 17:41:58 Robert Marko wrote:
> > Both the Topaz switch and 88E1512 PHY have their reset and interrupts
> > connected to the SoC.
> >
> > So, define the Topaz and 88E1512 reset pins in the DTS.
>
> Are reset pins connected only on ultra variant? Or on all espressobin
> variants? Because if they are on all variants then definitions should go
> into common dtsi file.
>
> I see that "gpionb 2" is on v7 variant connected to LED2. So I'm not
> sure if this one gpio is also shared or not.

As far as I know only Ultra has the reset pins connected, on the v5 and v7 Topaz
reset is tied to the system reset so it's not controllable.
I checked both the v5 and v7 schematics and it's like that.
>
> > Defining the interrupt pins wont work as both the 88E1512 and the
> > Topaz switch uses active LOW IRQ signals but the A37xx GPIO controller
> > only supports edge triggers.
> > 88E1512 would require special setup anyway as its INT pin is shared with
> > the LED2 and you first need to configure it as INT.
>
> Do you plan to finish also this additional setup?

Yes as the MOCHAbin board that I have sent the DTS for also has it connected
so I can use it as Armada 7040 supports level triggers, unlike the A3720.
It's in the queue but as a low priority, so I don't know when will I get to it.

Regards,
Robert
>
> > Signed-off-by: Robert Marko <[email protected]>
> > ---
> > arch/arm64/boot/dts/marvell/armada-3720-espressobin-ultra.dts | 4 ++++
> > 1 file changed, 4 insertions(+)
> >
> > diff --git a/arch/arm64/boot/dts/marvell/armada-3720-espressobin-ultra.dts b/arch/arm64/boot/dts/marvell/armada-3720-espressobin-ultra.dts
> > index 8a700afd0570..96855a10b4a0 100644
> > --- a/arch/arm64/boot/dts/marvell/armada-3720-espressobin-ultra.dts
> > +++ b/arch/arm64/boot/dts/marvell/armada-3720-espressobin-ultra.dts
> > @@ -118,12 +118,16 @@ &usb3 {
> > &mdio {
> > extphy: ethernet-phy@1 {
> > reg = <1>;
> > +
> > + reset-gpios = <&gpionb 2 GPIO_ACTIVE_LOW>;
> > };
> > };
> >
> > &switch0 {
> > reg = <3>;
> >
> > + reset-gpios = <&gpiosb 23 GPIO_ACTIVE_LOW>;
> > +
> > ports {
> > switch0port1: port@1 {
> > reg = <1>;
> > --
> > 2.31.1
> >



--
Robert Marko
Staff Embedded Linux Engineer
Sartura Ltd.
Lendavska ulica 16a
10000 Zagreb, Croatia
Email: [email protected]
Web: http://www.sartura.hr

2021-09-28 16:08:22

by Robert Marko

[permalink] [raw]
Subject: Re: [PATCH 4/4] arm64: dts: marvell: espressobin-ultra: enable front USB3 port

On Tue, Sep 28, 2021 at 5:37 PM Pali Rohár <[email protected]> wrote:
>
> On Monday 27 September 2021 17:41:59 Robert Marko wrote:
> > Espressobin Ultra has a front panel USB3.0 Type-A port which works
> > just fine so enable it.
> > I dont see a reason why it was disabled in the first place anyway.
>
> If USB 3.0 port is was tested and is working fine, then what about
> adding Fixes: tag into commit message?

Sure, gotta send a v4 anyway dropping the first patch.

Regards,
Robert
>
> > Signed-off-by: Robert Marko <[email protected]>
> > ---
> > arch/arm64/boot/dts/marvell/armada-3720-espressobin-ultra.dts | 1 -
> > 1 file changed, 1 deletion(-)
> >
> > diff --git a/arch/arm64/boot/dts/marvell/armada-3720-espressobin-ultra.dts b/arch/arm64/boot/dts/marvell/armada-3720-espressobin-ultra.dts
> > index 96855a10b4a0..aada43fa236c 100644
> > --- a/arch/arm64/boot/dts/marvell/armada-3720-espressobin-ultra.dts
> > +++ b/arch/arm64/boot/dts/marvell/armada-3720-espressobin-ultra.dts
> > @@ -112,7 +112,6 @@ rtc@51 {
> >
> > &usb3 {
> > usb-phy = <&usb3_phy>;
> > - status = "disabled";
> > };
> >
> > &mdio {
> > --
> > 2.31.1
> >



--
Robert Marko
Staff Embedded Linux Engineer
Sartura Ltd.
Lendavska ulica 16a
10000 Zagreb, Croatia
Email: [email protected]
Web: http://www.sartura.hr

2022-09-24 12:08:06

by Pali Rohár

[permalink] [raw]
Subject: Re: [PATCH 3/4] arm64: dts: marvell: espressobin-ultra: add PHY and switch reset pins

On Tuesday 28 September 2021 18:02:19 Robert Marko wrote:
> On Tue, Sep 28, 2021 at 5:32 PM Pali Rohár <[email protected]> wrote:
> >
> > On Monday 27 September 2021 17:41:58 Robert Marko wrote:
> > > Both the Topaz switch and 88E1512 PHY have their reset and interrupts
> > > connected to the SoC.
> > >
> > > So, define the Topaz and 88E1512 reset pins in the DTS.
> >
> > Are reset pins connected only on ultra variant? Or on all espressobin
> > variants? Because if they are on all variants then definitions should go
> > into common dtsi file.
> >
> > I see that "gpionb 2" is on v7 variant connected to LED2. So I'm not
> > sure if this one gpio is also shared or not.
>
> As far as I know only Ultra has the reset pins connected, on the v5 and v7 Topaz
> reset is tied to the system reset so it's not controllable.
> I checked both the v5 and v7 schematics and it's like that.
> >
> > > Defining the interrupt pins wont work as both the 88E1512 and the
> > > Topaz switch uses active LOW IRQ signals but the A37xx GPIO controller
> > > only supports edge triggers.
> > > 88E1512 would require special setup anyway as its INT pin is shared with
> > > the LED2 and you first need to configure it as INT.
> >
> > Do you plan to finish also this additional setup?
>
> Yes as the MOCHAbin board that I have sent the DTS for also has it connected
> so I can use it as Armada 7040 supports level triggers, unlike the A3720.
> It's in the queue but as a low priority, so I don't know when will I get to it.

I have WIP patch for A37xx gpio/pinctrl driver which adds support for
level interrupts. I think you would need it for testing...

> Regards,
> Robert
> >
> > > Signed-off-by: Robert Marko <[email protected]>
> > > ---
> > > arch/arm64/boot/dts/marvell/armada-3720-espressobin-ultra.dts | 4 ++++
> > > 1 file changed, 4 insertions(+)
> > >
> > > diff --git a/arch/arm64/boot/dts/marvell/armada-3720-espressobin-ultra.dts b/arch/arm64/boot/dts/marvell/armada-3720-espressobin-ultra.dts
> > > index 8a700afd0570..96855a10b4a0 100644
> > > --- a/arch/arm64/boot/dts/marvell/armada-3720-espressobin-ultra.dts
> > > +++ b/arch/arm64/boot/dts/marvell/armada-3720-espressobin-ultra.dts
> > > @@ -118,12 +118,16 @@ &usb3 {
> > > &mdio {
> > > extphy: ethernet-phy@1 {
> > > reg = <1>;
> > > +
> > > + reset-gpios = <&gpionb 2 GPIO_ACTIVE_LOW>;
> > > };
> > > };
> > >
> > > &switch0 {
> > > reg = <3>;
> > >
> > > + reset-gpios = <&gpiosb 23 GPIO_ACTIVE_LOW>;
> > > +
> > > ports {
> > > switch0port1: port@1 {
> > > reg = <1>;
> > > --
> > > 2.31.1
> > >
>
>
>
> --
> Robert Marko
> Staff Embedded Linux Engineer
> Sartura Ltd.
> Lendavska ulica 16a
> 10000 Zagreb, Croatia
> Email: [email protected]
> Web: http://www.sartura.hr