* [RFC PATCH 1/4] dts: phy: fix missing mdio device and probe failure of vsc8541-01 device
2020-04-28 11:16 [RFC PATCH 0/4] fix macb phy probe failure if phy-reset is not handled Sagar Shrikant Kadam
@ 2020-04-28 11:16 ` Sagar Shrikant Kadam
2020-04-28 11:16 ` [RFC PATCH 2/4] dts: phy: add GPIO number and active state used for phy reset Sagar Shrikant Kadam
` (2 subsequent siblings)
3 siblings, 0 replies; 7+ messages in thread
From: Sagar Shrikant Kadam @ 2020-04-28 11:16 UTC (permalink / raw)
To: linux-kernel, linux-riscv, robh+dt
Cc: palmer, paul.walmsley, atish.patra, devicetree,
Sagar Shrikant Kadam
HiFive unleashed A00 board has VSC8541-01 ethernet phy, this device is
identified as a Revision B device as described in device identification
registers. In order to use this phy in the unmanaged mode, it requires
a specific reset sequence of logical 0-1-0-1 transition on the NRESET pin
as documented here [1].
Currently, the bootloader (fsbl) takes care of the phy reset. If due to
some reason the phy device hasn't received the reset by the prior stages
before the linux macb driver comes into the picture, the MACB mii bus gets
probed but the mdio scan fails and is not even able to read the phy ID
registers. It gives an error message:
"libphy: MACB_mii_bus: probed
mdio_bus 10090000.ethernet-ffffffff: MDIO device at address 0 is missing."
Thus adding the device OUI (Organizationally Unique Identifier) to the phy
device node helps to probe the phy device.
[1]: VSC8541-01 datasheet:
https://www.mouser.com/ds/2/523/Microsemi_VSC8541-01_Datasheet_10496_V40-1148034.pdf
Signed-off-by: Sagar Shrikant Kadam <sagar.kadam@sifive.com>
---
arch/riscv/boot/dts/sifive/hifive-unleashed-a00.dts | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/riscv/boot/dts/sifive/hifive-unleashed-a00.dts b/arch/riscv/boot/dts/sifive/hifive-unleashed-a00.dts
index 4a2729f..60846e8 100644
--- a/arch/riscv/boot/dts/sifive/hifive-unleashed-a00.dts
+++ b/arch/riscv/boot/dts/sifive/hifive-unleashed-a00.dts
@@ -88,6 +88,7 @@
phy-mode = "gmii";
phy-handle = <&phy0>;
phy0: ethernet-phy@0 {
+ compatible = "ethernet-phy-id0007.0771";
reg = <0>;
};
};
--
2.7.4
^ permalink raw reply related [flat|nested] 7+ messages in thread* [RFC PATCH 2/4] dts: phy: add GPIO number and active state used for phy reset
2020-04-28 11:16 [RFC PATCH 0/4] fix macb phy probe failure if phy-reset is not handled Sagar Shrikant Kadam
2020-04-28 11:16 ` [RFC PATCH 1/4] dts: phy: fix missing mdio device and probe failure of vsc8541-01 device Sagar Shrikant Kadam
@ 2020-04-28 11:16 ` Sagar Shrikant Kadam
2020-04-28 11:16 ` [RFC PATCH 3/4] riscv: defconfig: enable gpio support for HiFive Unleashed Sagar Shrikant Kadam
2020-04-28 11:16 ` [RFC PATCH 4/4] dt-bindings: net: phy: extend dt binding for VSC8541 ethernet-phy Sagar Shrikant Kadam
3 siblings, 0 replies; 7+ messages in thread
From: Sagar Shrikant Kadam @ 2020-04-28 11:16 UTC (permalink / raw)
To: linux-kernel, linux-riscv, robh+dt
Cc: palmer, paul.walmsley, atish.patra, devicetree,
Sagar Shrikant Kadam
The GEMGXL_RST line on HiFive Unleashed is pulled low and is
using GPIO number 12. Add these reset-gpio details to dt-node
using which the linux phylib can reset the phy.
Signed-off-by: Sagar Shrikant Kadam <sagar.kadam@sifive.com>
---
arch/riscv/boot/dts/sifive/hifive-unleashed-a00.dts | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/riscv/boot/dts/sifive/hifive-unleashed-a00.dts b/arch/riscv/boot/dts/sifive/hifive-unleashed-a00.dts
index 60846e8..24d75a1 100644
--- a/arch/riscv/boot/dts/sifive/hifive-unleashed-a00.dts
+++ b/arch/riscv/boot/dts/sifive/hifive-unleashed-a00.dts
@@ -90,6 +90,7 @@
phy0: ethernet-phy@0 {
compatible = "ethernet-phy-id0007.0771";
reg = <0>;
+ reset-gpios = <&gpio 12 GPIO_ACTIVE_LOW>;
};
};
--
2.7.4
^ permalink raw reply related [flat|nested] 7+ messages in thread* [RFC PATCH 3/4] riscv: defconfig: enable gpio support for HiFive Unleashed
2020-04-28 11:16 [RFC PATCH 0/4] fix macb phy probe failure if phy-reset is not handled Sagar Shrikant Kadam
2020-04-28 11:16 ` [RFC PATCH 1/4] dts: phy: fix missing mdio device and probe failure of vsc8541-01 device Sagar Shrikant Kadam
2020-04-28 11:16 ` [RFC PATCH 2/4] dts: phy: add GPIO number and active state used for phy reset Sagar Shrikant Kadam
@ 2020-04-28 11:16 ` Sagar Shrikant Kadam
2020-04-28 11:16 ` [RFC PATCH 4/4] dt-bindings: net: phy: extend dt binding for VSC8541 ethernet-phy Sagar Shrikant Kadam
3 siblings, 0 replies; 7+ messages in thread
From: Sagar Shrikant Kadam @ 2020-04-28 11:16 UTC (permalink / raw)
To: linux-kernel, linux-riscv, robh+dt
Cc: palmer, paul.walmsley, atish.patra, devicetree,
Sagar Shrikant Kadam
Ethernet phy VSC8541-01 on HiFive Unleashed has its reset line
connected to a gpio, so enable GPIO driver's required to reset
the phy.
Signed-off-by: Sagar Shrikant Kadam <sagar.kadam@sifive.com>
---
arch/riscv/configs/defconfig | 2 ++
1 file changed, 2 insertions(+)
diff --git a/arch/riscv/configs/defconfig b/arch/riscv/configs/defconfig
index 4da4886..20c38b59 100644
--- a/arch/riscv/configs/defconfig
+++ b/arch/riscv/configs/defconfig
@@ -63,6 +63,8 @@ CONFIG_HW_RANDOM=y
CONFIG_HW_RANDOM_VIRTIO=y
CONFIG_SPI=y
CONFIG_SPI_SIFIVE=y
+CONFIG_GPIOLIB=y
+CONFIG_GPIO_SIFIVE=y
# CONFIG_PTP_1588_CLOCK is not set
CONFIG_POWER_RESET=y
CONFIG_DRM=y
--
2.7.4
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [RFC PATCH 4/4] dt-bindings: net: phy: extend dt binding for VSC8541 ethernet-phy
2020-04-28 11:16 [RFC PATCH 0/4] fix macb phy probe failure if phy-reset is not handled Sagar Shrikant Kadam
` (2 preceding siblings ...)
2020-04-28 11:16 ` [RFC PATCH 3/4] riscv: defconfig: enable gpio support for HiFive Unleashed Sagar Shrikant Kadam
@ 2020-04-28 11:16 ` Sagar Shrikant Kadam
2020-05-12 2:12 ` Rob Herring
3 siblings, 1 reply; 7+ messages in thread
From: Sagar Shrikant Kadam @ 2020-04-28 11:16 UTC (permalink / raw)
To: linux-kernel, linux-riscv, robh+dt
Cc: palmer, paul.walmsley, atish.patra, devicetree,
Sagar Shrikant Kadam
Adding a OUI (Organizationally Unique Identifier) for VSC8541-01
device to dt node requires a corresponding dt-binding entry as well
so that checkpatch doesn't complain with a warning:
DT compatible string "ethernet-phy-id0007.0771" appears un-documented
Here extend the existing dt binding of VSC8531 device to include
VSC8541 device example.
Signed-off-by: Sagar Shrikant Kadam <sagar.kadam@sifive.com>
---
Documentation/devicetree/bindings/net/mscc-phy-vsc8531.txt | 3 +++
1 file changed, 3 insertions(+)
diff --git a/Documentation/devicetree/bindings/net/mscc-phy-vsc8531.txt b/Documentation/devicetree/bindings/net/mscc-phy-vsc8531.txt
index 5ff37c6..774448a 100644
--- a/Documentation/devicetree/bindings/net/mscc-phy-vsc8531.txt
+++ b/Documentation/devicetree/bindings/net/mscc-phy-vsc8531.txt
@@ -68,3 +68,6 @@ Example:
vsc8531,led-0-mode = <LINK_1000_ACTIVITY>;
vsc8531,led-1-mode = <LINK_100_ACTIVITY>;
};
+ vsc8541_0: ethernet-phy@0 {
+ compatible = "ethernet-phy-id0007.0771";
+ };
--
2.7.4
^ permalink raw reply related [flat|nested] 7+ messages in thread* Re: [RFC PATCH 4/4] dt-bindings: net: phy: extend dt binding for VSC8541 ethernet-phy
2020-04-28 11:16 ` [RFC PATCH 4/4] dt-bindings: net: phy: extend dt binding for VSC8541 ethernet-phy Sagar Shrikant Kadam
@ 2020-05-12 2:12 ` Rob Herring
2020-05-12 7:14 ` Sagar Kadam
0 siblings, 1 reply; 7+ messages in thread
From: Rob Herring @ 2020-05-12 2:12 UTC (permalink / raw)
To: Sagar Shrikant Kadam
Cc: linux-kernel, linux-riscv, palmer, paul.walmsley, atish.patra,
devicetree
On Tue, Apr 28, 2020 at 04:16:48AM -0700, Sagar Shrikant Kadam wrote:
> Adding a OUI (Organizationally Unique Identifier) for VSC8541-01
> device to dt node requires a corresponding dt-binding entry as well
> so that checkpatch doesn't complain with a warning:
>
> DT compatible string "ethernet-phy-id0007.0771" appears un-documented
>
> Here extend the existing dt binding of VSC8531 device to include
> VSC8541 device example.
Checkpatch.pl is just dumb here and can be ignored. We have the regex
that documents this compatible. We don't need every VID/PID listed.
>
> Signed-off-by: Sagar Shrikant Kadam <sagar.kadam@sifive.com>
> ---
> Documentation/devicetree/bindings/net/mscc-phy-vsc8531.txt | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/Documentation/devicetree/bindings/net/mscc-phy-vsc8531.txt b/Documentation/devicetree/bindings/net/mscc-phy-vsc8531.txt
> index 5ff37c6..774448a 100644
> --- a/Documentation/devicetree/bindings/net/mscc-phy-vsc8531.txt
> +++ b/Documentation/devicetree/bindings/net/mscc-phy-vsc8531.txt
> @@ -68,3 +68,6 @@ Example:
> vsc8531,led-0-mode = <LINK_1000_ACTIVITY>;
> vsc8531,led-1-mode = <LINK_100_ACTIVITY>;
> };
> + vsc8541_0: ethernet-phy@0 {
> + compatible = "ethernet-phy-id0007.0771";
> + };
> --
> 2.7.4
>
^ permalink raw reply [flat|nested] 7+ messages in thread* RE: [RFC PATCH 4/4] dt-bindings: net: phy: extend dt binding for VSC8541 ethernet-phy
2020-05-12 2:12 ` Rob Herring
@ 2020-05-12 7:14 ` Sagar Kadam
0 siblings, 0 replies; 7+ messages in thread
From: Sagar Kadam @ 2020-05-12 7:14 UTC (permalink / raw)
To: Rob Herring
Cc: linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org,
palmer@dabbelt.com, Paul Walmsley, atish.patra@wdc.com,
devicetree@vger.kernel.org
Hello Rob,
> -----Original Message-----
> From: Rob Herring <robh@kernel.org>
> Sent: Tuesday, May 12, 2020 7:42 AM
> To: Sagar Kadam <sagar.kadam@sifive.com>
> Cc: linux-kernel@vger.kernel.org; linux-riscv@lists.infradead.org;
> palmer@dabbelt.com; Paul Walmsley <paul.walmsley@sifive.com>;
> atish.patra@wdc.com; devicetree@vger.kernel.org
> Subject: Re: [RFC PATCH 4/4] dt-bindings: net: phy: extend dt binding for
> VSC8541 ethernet-phy
>
> [External Email] Do not click links or attachments unless you recognize the
> sender and know the content is safe
>
> On Tue, Apr 28, 2020 at 04:16:48AM -0700, Sagar Shrikant Kadam wrote:
> > Adding a OUI (Organizationally Unique Identifier) for VSC8541-01
> > device to dt node requires a corresponding dt-binding entry as well
> > so that checkpatch doesn't complain with a warning:
> >
> > DT compatible string "ethernet-phy-id0007.0771" appears un-documented
> >
> > Here extend the existing dt binding of VSC8531 device to include
> > VSC8541 device example.
>
> Checkpatch.pl is just dumb here and can be ignored. We have the regex
> that documents this compatible. We don't need every VID/PID listed.
>
Thank you for the information.
We can then drop this patch to handle un-documented warning.
BR,
Sagar Kadam
> >
> > Signed-off-by: Sagar Shrikant Kadam <sagar.kadam@sifive.com>
> > ---
> > Documentation/devicetree/bindings/net/mscc-phy-vsc8531.txt | 3 +++
> > 1 file changed, 3 insertions(+)
> >
> > diff --git a/Documentation/devicetree/bindings/net/mscc-phy-vsc8531.txt
> b/Documentation/devicetree/bindings/net/mscc-phy-vsc8531.txt
> > index 5ff37c6..774448a 100644
> > --- a/Documentation/devicetree/bindings/net/mscc-phy-vsc8531.txt
> > +++ b/Documentation/devicetree/bindings/net/mscc-phy-vsc8531.txt
> > @@ -68,3 +68,6 @@ Example:
> > vsc8531,led-0-mode = <LINK_1000_ACTIVITY>;
> > vsc8531,led-1-mode = <LINK_100_ACTIVITY>;
> > };
> > + vsc8541_0: ethernet-phy@0 {
> > + compatible = "ethernet-phy-id0007.0771";
> > + };
> > --
> > 2.7.4
> >
^ permalink raw reply [flat|nested] 7+ messages in thread