mbox series

[0/5] net: mdio-uclass: probe generic Ethernet PHY driver & Fix Beagleplay Ethernet

Message ID 20240305-for-2024-07-beagleplay-eth-v1-0-e1294a575cc1@kernel.org
Headers show
Series net: mdio-uclass: probe generic Ethernet PHY driver & Fix Beagleplay Ethernet | expand

Message

Roger Quadros March 5, 2024, 1:24 p.m. UTC
Currently, the GPIO Reset Device Tree properties of the
PHY node are ignored when the PHY is probed via mdio-uclass driver [1].

To resolve this, for each child of the MDIO bus node, bind and probe
the generic Ethernet PHY driver if CONFIG_DM_ETH_PHY is enabled.

This should now show the generic_phy_driver in "dm tree"
and also apply the GPIO reset before the MDIO bus driver scans the bus
for the PHYs.

 ethernet      0  [ + ]   am65_cpsw_nuss_port       |   |-- ethernet@8000000port@1
 bootdev       3  [   ]   eth_bootdev               |   |   `-- port@1.bootdev
 mdio          0  [ + ]   cpsw_mdio                 |   `-- mdio@f00
 eth_phy_ge    0  [ + ]   eth_phy_generic_drv       |       |-- ethernet-phy@0
 eth_phy_ge    1  [ + ]   eth_phy_generic_drv       |       `-- ethernet-phy@1

To test this on Beagleplay, the following series is required

[1] Switch am65-cpsw to DM MDIO
 https://lore.kernel.org/all/20240228-for-2024-07-am65-cpsw-mdio-v2-0-f74f972eafeb@kernel.org/

The last 3 patches are marked [not-for-merge]. They are to show how the
whole solution can work to fix Ethernet on Beagleplay, which has been broken
so far. Those DT patches will be sent once the device tree changes are merged
into Linux tree.

Signed-off-by: Roger Quadros <rogerq@kernel.org>
---
Roger Quadros (5):
      net: mdio-uclass: Bind and probe generic Ethernet PHY driver
      configs/am62x_beagleplay_a53_defconfig: enable DM_ETH_PHY
      [not-for-merge] arm: dts: k3-am62*: sync with linux-next-20240229
      [not-for-merge] k3-am625-beagleplay-u-boot: get CPSW Ethernet to work
      [not-for-merge] arm: dts: k3-am625-beagleplay: Fix Ethernet PHY reset GPIO

 arch/arm/dts/k3-am62-main.dtsi               | 126 ++++++++++++++---
 arch/arm/dts/k3-am62-mcu.dtsi                |   4 +-
 arch/arm/dts/k3-am62-phycore-som.dtsi        |   5 +-
 arch/arm/dts/k3-am62-thermal.dtsi            |   5 +-
 arch/arm/dts/k3-am62-verdin-dev.dtsi         |   4 +-
 arch/arm/dts/k3-am62-verdin-wifi.dtsi        |   1 -
 arch/arm/dts/k3-am62-verdin.dtsi             |  76 +++++++---
 arch/arm/dts/k3-am62-wakeup.dtsi             |  38 +++--
 arch/arm/dts/k3-am62.dtsi                    |   4 +-
 arch/arm/dts/k3-am625-beagleplay-u-boot.dtsi |  63 +++++++++
 arch/arm/dts/k3-am625-beagleplay.dts         |  66 ++++-----
 arch/arm/dts/k3-am625-phyboard-lyra-rdk.dts  | 104 +++++++++++++-
 arch/arm/dts/k3-am625-sk.dts                 |   4 +-
 arch/arm/dts/k3-am625.dtsi                   |   4 +-
 arch/arm/dts/k3-am62a-main.dtsi              | 201 +++++++++++++++++++++++++--
 arch/arm/dts/k3-am62a-mcu.dtsi               |   4 +-
 arch/arm/dts/k3-am62a-thermal.dtsi           |   5 +-
 arch/arm/dts/k3-am62a-wakeup.dtsi            |   4 +-
 arch/arm/dts/k3-am62a.dtsi                   |   4 +-
 arch/arm/dts/k3-am62a7-sk.dts                | 162 ++++++++++++++++++++-
 arch/arm/dts/k3-am62a7.dtsi                  |   4 +-
 arch/arm/dts/k3-am62x-sk-common.dtsi         |  24 +++-
 configs/am62x_beagleplay_a53_defconfig       |   2 +-
 net/mdio-uclass.c                            |  41 ++++++
 24 files changed, 825 insertions(+), 130 deletions(-)
---
base-commit: 84f5bb0be0ec9fbf98f8f3317b578dfc114cf44e
change-id: 20240305-for-2024-07-beagleplay-eth-f82a51197937

Best regards,

Comments

Roger Quadros March 8, 2024, 8:22 a.m. UTC | #1
On 05/03/2024 15:24, Roger Quadros wrote:
> Currently, the GPIO Reset Device Tree properties of the
> PHY node are ignored when the PHY is probed via mdio-uclass driver [1].
> 
> To resolve this, for each child of the MDIO bus node, bind and probe
> the generic Ethernet PHY driver if CONFIG_DM_ETH_PHY is enabled.
> 
> This should now show the generic_phy_driver in "dm tree"
> and also apply the GPIO reset before the MDIO bus driver scans the bus
> for the PHYs.
> 
>  ethernet      0  [ + ]   am65_cpsw_nuss_port       |   |-- ethernet@8000000port@1
>  bootdev       3  [   ]   eth_bootdev               |   |   `-- port@1.bootdev
>  mdio          0  [ + ]   cpsw_mdio                 |   `-- mdio@f00
>  eth_phy_ge    0  [ + ]   eth_phy_generic_drv       |       |-- ethernet-phy@0
>  eth_phy_ge    1  [ + ]   eth_phy_generic_drv       |       `-- ethernet-phy@1
> 
> To test this on Beagleplay, the following series is required
> 
> [1] Switch am65-cpsw to DM MDIO
>  https://lore.kernel.org/all/20240228-for-2024-07-am65-cpsw-mdio-v2-0-f74f972eafeb@kernel.org/
> 
> The last 3 patches are marked [not-for-merge]. They are to show how the
> whole solution can work to fix Ethernet on Beagleplay, which has been broken
> so far. Those DT patches will be sent once the device tree changes are merged
> into Linux tree.
> 
> Signed-off-by: Roger Quadros <rogerq@kernel.org>

Some CI tests failed. I will fix and send v2.
https://github.com/u-boot/u-boot/pull/495

> ---
> Roger Quadros (5):
>       net: mdio-uclass: Bind and probe generic Ethernet PHY driver
>       configs/am62x_beagleplay_a53_defconfig: enable DM_ETH_PHY
>       [not-for-merge] arm: dts: k3-am62*: sync with linux-next-20240229
>       [not-for-merge] k3-am625-beagleplay-u-boot: get CPSW Ethernet to work
>       [not-for-merge] arm: dts: k3-am625-beagleplay: Fix Ethernet PHY reset GPIO
> 
>  arch/arm/dts/k3-am62-main.dtsi               | 126 ++++++++++++++---
>  arch/arm/dts/k3-am62-mcu.dtsi                |   4 +-
>  arch/arm/dts/k3-am62-phycore-som.dtsi        |   5 +-
>  arch/arm/dts/k3-am62-thermal.dtsi            |   5 +-
>  arch/arm/dts/k3-am62-verdin-dev.dtsi         |   4 +-
>  arch/arm/dts/k3-am62-verdin-wifi.dtsi        |   1 -
>  arch/arm/dts/k3-am62-verdin.dtsi             |  76 +++++++---
>  arch/arm/dts/k3-am62-wakeup.dtsi             |  38 +++--
>  arch/arm/dts/k3-am62.dtsi                    |   4 +-
>  arch/arm/dts/k3-am625-beagleplay-u-boot.dtsi |  63 +++++++++
>  arch/arm/dts/k3-am625-beagleplay.dts         |  66 ++++-----
>  arch/arm/dts/k3-am625-phyboard-lyra-rdk.dts  | 104 +++++++++++++-
>  arch/arm/dts/k3-am625-sk.dts                 |   4 +-
>  arch/arm/dts/k3-am625.dtsi                   |   4 +-
>  arch/arm/dts/k3-am62a-main.dtsi              | 201 +++++++++++++++++++++++++--
>  arch/arm/dts/k3-am62a-mcu.dtsi               |   4 +-
>  arch/arm/dts/k3-am62a-thermal.dtsi           |   5 +-
>  arch/arm/dts/k3-am62a-wakeup.dtsi            |   4 +-
>  arch/arm/dts/k3-am62a.dtsi                   |   4 +-
>  arch/arm/dts/k3-am62a7-sk.dts                | 162 ++++++++++++++++++++-
>  arch/arm/dts/k3-am62a7.dtsi                  |   4 +-
>  arch/arm/dts/k3-am62x-sk-common.dtsi         |  24 +++-
>  configs/am62x_beagleplay_a53_defconfig       |   2 +-
>  net/mdio-uclass.c                            |  41 ++++++
>  24 files changed, 825 insertions(+), 130 deletions(-)
> ---
> base-commit: 84f5bb0be0ec9fbf98f8f3317b578dfc114cf44e
> change-id: 20240305-for-2024-07-beagleplay-eth-f82a51197937
> 
> Best regards,
Roger Quadros March 8, 2024, 8:26 a.m. UTC | #2
On 08/03/2024 10:22, Roger Quadros wrote:
> 
> 
> On 05/03/2024 15:24, Roger Quadros wrote:
>> Currently, the GPIO Reset Device Tree properties of the
>> PHY node are ignored when the PHY is probed via mdio-uclass driver [1].
>>
>> To resolve this, for each child of the MDIO bus node, bind and probe
>> the generic Ethernet PHY driver if CONFIG_DM_ETH_PHY is enabled.
>>
>> This should now show the generic_phy_driver in "dm tree"
>> and also apply the GPIO reset before the MDIO bus driver scans the bus
>> for the PHYs.
>>
>>  ethernet      0  [ + ]   am65_cpsw_nuss_port       |   |-- ethernet@8000000port@1
>>  bootdev       3  [   ]   eth_bootdev               |   |   `-- port@1.bootdev
>>  mdio          0  [ + ]   cpsw_mdio                 |   `-- mdio@f00
>>  eth_phy_ge    0  [ + ]   eth_phy_generic_drv       |       |-- ethernet-phy@0
>>  eth_phy_ge    1  [ + ]   eth_phy_generic_drv       |       `-- ethernet-phy@1
>>
>> To test this on Beagleplay, the following series is required
>>
>> [1] Switch am65-cpsw to DM MDIO
>>  https://lore.kernel.org/all/20240228-for-2024-07-am65-cpsw-mdio-v2-0-f74f972eafeb@kernel.org/
>>
>> The last 3 patches are marked [not-for-merge]. They are to show how the
>> whole solution can work to fix Ethernet on Beagleplay, which has been broken
>> so far. Those DT patches will be sent once the device tree changes are merged
>> into Linux tree.
>>
>> Signed-off-by: Roger Quadros <rogerq@kernel.org>
> 
> Some CI tests failed. I will fix and send v2.
> https://github.com/u-boot/u-boot/pull/495

I'm unsure if the failure is due to this series or not.
https://dev.azure.com/u-boot/u-boot/_build/results?buildId=8023&view=logs&j=a1270dec-081b-5c65-5cd5-5e915a842596&t=69f6cf72-86f3-551a-807d-f28f62a1426f&l=530

Are these known issues?

=================================== FAILURES ===================================
_______________________ test_tpm2_sandbox_self_test_full _______________________
test/py/tests/test_tpm2.py:115: in test_tpm2_sandbox_self_test_full
    output = u_boot_console.run_command('echo $?')
test/py/u_boot_console_base.py:256: in run_command
    m = self.p.expect([chunk] + self.bad_patterns)
test/py/u_boot_spawn.py:193: in expect
    raise Timeout()
E   u_boot_spawn.Timeout
----------------------------- Captured stdout call -----------------------------
/u-boot
sandbox_serial serial: pinctrl_select_state_full: uclass_get_device_by_phandle_id: err=-19



________________ TestEfiSignedImage.test_efi_signed_image_auth5 ________________
test/py/tests/test_efi_secboot/test_signed.py:162: in test_efi_signed_image_auth5
    output = u_boot_console.run_command_list([
test/py/u_boot_console_base.py:297: in run_command_list
    output.append(self.run_command(cmd))
test/py/u_boot_console_base.py:256: in run_command
    m = self.p.expect([chunk] + self.bad_patterns)
test/py/u_boot_spawn.py:193: in expect
    raise Timeout()
E   u_boot_spawn.Timeout
----------------------------- Captured stdout call -----------------------------
/u-boot
sandbox_serial serial: pinctrl_select_state_full: uclass_get_device_by_phandle_id: err=-19

> 
>> ---
>> Roger Quadros (5):
>>       net: mdio-uclass: Bind and probe generic Ethernet PHY driver
>>       configs/am62x_beagleplay_a53_defconfig: enable DM_ETH_PHY
>>       [not-for-merge] arm: dts: k3-am62*: sync with linux-next-20240229
>>       [not-for-merge] k3-am625-beagleplay-u-boot: get CPSW Ethernet to work
>>       [not-for-merge] arm: dts: k3-am625-beagleplay: Fix Ethernet PHY reset GPIO
>>
>>  arch/arm/dts/k3-am62-main.dtsi               | 126 ++++++++++++++---
>>  arch/arm/dts/k3-am62-mcu.dtsi                |   4 +-
>>  arch/arm/dts/k3-am62-phycore-som.dtsi        |   5 +-
>>  arch/arm/dts/k3-am62-thermal.dtsi            |   5 +-
>>  arch/arm/dts/k3-am62-verdin-dev.dtsi         |   4 +-
>>  arch/arm/dts/k3-am62-verdin-wifi.dtsi        |   1 -
>>  arch/arm/dts/k3-am62-verdin.dtsi             |  76 +++++++---
>>  arch/arm/dts/k3-am62-wakeup.dtsi             |  38 +++--
>>  arch/arm/dts/k3-am62.dtsi                    |   4 +-
>>  arch/arm/dts/k3-am625-beagleplay-u-boot.dtsi |  63 +++++++++
>>  arch/arm/dts/k3-am625-beagleplay.dts         |  66 ++++-----
>>  arch/arm/dts/k3-am625-phyboard-lyra-rdk.dts  | 104 +++++++++++++-
>>  arch/arm/dts/k3-am625-sk.dts                 |   4 +-
>>  arch/arm/dts/k3-am625.dtsi                   |   4 +-
>>  arch/arm/dts/k3-am62a-main.dtsi              | 201 +++++++++++++++++++++++++--
>>  arch/arm/dts/k3-am62a-mcu.dtsi               |   4 +-
>>  arch/arm/dts/k3-am62a-thermal.dtsi           |   5 +-
>>  arch/arm/dts/k3-am62a-wakeup.dtsi            |   4 +-
>>  arch/arm/dts/k3-am62a.dtsi                   |   4 +-
>>  arch/arm/dts/k3-am62a7-sk.dts                | 162 ++++++++++++++++++++-
>>  arch/arm/dts/k3-am62a7.dtsi                  |   4 +-
>>  arch/arm/dts/k3-am62x-sk-common.dtsi         |  24 +++-
>>  configs/am62x_beagleplay_a53_defconfig       |   2 +-
>>  net/mdio-uclass.c                            |  41 ++++++
>>  24 files changed, 825 insertions(+), 130 deletions(-)
>> ---
>> base-commit: 84f5bb0be0ec9fbf98f8f3317b578dfc114cf44e
>> change-id: 20240305-for-2024-07-beagleplay-eth-f82a51197937
>>
>> Best regards,
>
Roger Quadros March 25, 2024, 12:16 p.m. UTC | #3
Hi Tom / Joe,

On 05/03/2024 15:24, Roger Quadros wrote:
> Currently, the GPIO Reset Device Tree properties of the
> PHY node are ignored when the PHY is probed via mdio-uclass driver [1].
> 
> To resolve this, for each child of the MDIO bus node, bind and probe
> the generic Ethernet PHY driver if CONFIG_DM_ETH_PHY is enabled.
> 
> This should now show the generic_phy_driver in "dm tree"
> and also apply the GPIO reset before the MDIO bus driver scans the bus
> for the PHYs.
> 
>  ethernet      0  [ + ]   am65_cpsw_nuss_port       |   |-- ethernet@8000000port@1
>  bootdev       3  [   ]   eth_bootdev               |   |   `-- port@1.bootdev
>  mdio          0  [ + ]   cpsw_mdio                 |   `-- mdio@f00
>  eth_phy_ge    0  [ + ]   eth_phy_generic_drv       |       |-- ethernet-phy@0
>  eth_phy_ge    1  [ + ]   eth_phy_generic_drv       |       `-- ethernet-phy@1
> 
> To test this on Beagleplay, the following series is required
> 
> [1] Switch am65-cpsw to DM MDIO
>  https://lore.kernel.org/all/20240228-for-2024-07-am65-cpsw-mdio-v2-0-f74f972eafeb@kernel.org/
> 
> The last 3 patches are marked [not-for-merge]. They are to show how the
> whole solution can work to fix Ethernet on Beagleplay, which has been broken
> so far. Those DT patches will be sent once the device tree changes are merged
> into Linux tree.
> 
> Signed-off-by: Roger Quadros <rogerq@kernel.org>
> ---
> Roger Quadros (5):
>       net: mdio-uclass: Bind and probe generic Ethernet PHY driver
>       configs/am62x_beagleplay_a53_defconfig: enable DM_ETH_PHY

Any comments to the first 2 patches in this series?

>       [not-for-merge] arm: dts: k3-am62*: sync with linux-next-20240229
>       [not-for-merge] k3-am625-beagleplay-u-boot: get CPSW Ethernet to work
>       [not-for-merge] arm: dts: k3-am625-beagleplay: Fix Ethernet PHY reset GPIO
> 
>  arch/arm/dts/k3-am62-main.dtsi               | 126 ++++++++++++++---
>  arch/arm/dts/k3-am62-mcu.dtsi                |   4 +-
>  arch/arm/dts/k3-am62-phycore-som.dtsi        |   5 +-
>  arch/arm/dts/k3-am62-thermal.dtsi            |   5 +-
>  arch/arm/dts/k3-am62-verdin-dev.dtsi         |   4 +-
>  arch/arm/dts/k3-am62-verdin-wifi.dtsi        |   1 -
>  arch/arm/dts/k3-am62-verdin.dtsi             |  76 +++++++---
>  arch/arm/dts/k3-am62-wakeup.dtsi             |  38 +++--
>  arch/arm/dts/k3-am62.dtsi                    |   4 +-
>  arch/arm/dts/k3-am625-beagleplay-u-boot.dtsi |  63 +++++++++
>  arch/arm/dts/k3-am625-beagleplay.dts         |  66 ++++-----
>  arch/arm/dts/k3-am625-phyboard-lyra-rdk.dts  | 104 +++++++++++++-
>  arch/arm/dts/k3-am625-sk.dts                 |   4 +-
>  arch/arm/dts/k3-am625.dtsi                   |   4 +-
>  arch/arm/dts/k3-am62a-main.dtsi              | 201 +++++++++++++++++++++++++--
>  arch/arm/dts/k3-am62a-mcu.dtsi               |   4 +-
>  arch/arm/dts/k3-am62a-thermal.dtsi           |   5 +-
>  arch/arm/dts/k3-am62a-wakeup.dtsi            |   4 +-
>  arch/arm/dts/k3-am62a.dtsi                   |   4 +-
>  arch/arm/dts/k3-am62a7-sk.dts                | 162 ++++++++++++++++++++-
>  arch/arm/dts/k3-am62a7.dtsi                  |   4 +-
>  arch/arm/dts/k3-am62x-sk-common.dtsi         |  24 +++-
>  configs/am62x_beagleplay_a53_defconfig       |   2 +-
>  net/mdio-uclass.c                            |  41 ++++++
>  24 files changed, 825 insertions(+), 130 deletions(-)
> ---
> base-commit: 84f5bb0be0ec9fbf98f8f3317b578dfc114cf44e
> change-id: 20240305-for-2024-07-beagleplay-eth-f82a51197937
> 
> Best regards,
Tom Rini March 26, 2024, 2 a.m. UTC | #4
On Mon, Mar 25, 2024 at 02:16:53PM +0200, Roger Quadros wrote:
> Hi Tom / Joe,
> 
> On 05/03/2024 15:24, Roger Quadros wrote:
> > Currently, the GPIO Reset Device Tree properties of the
> > PHY node are ignored when the PHY is probed via mdio-uclass driver [1].
> > 
> > To resolve this, for each child of the MDIO bus node, bind and probe
> > the generic Ethernet PHY driver if CONFIG_DM_ETH_PHY is enabled.
> > 
> > This should now show the generic_phy_driver in "dm tree"
> > and also apply the GPIO reset before the MDIO bus driver scans the bus
> > for the PHYs.
> > 
> >  ethernet      0  [ + ]   am65_cpsw_nuss_port       |   |-- ethernet@8000000port@1
> >  bootdev       3  [   ]   eth_bootdev               |   |   `-- port@1.bootdev
> >  mdio          0  [ + ]   cpsw_mdio                 |   `-- mdio@f00
> >  eth_phy_ge    0  [ + ]   eth_phy_generic_drv       |       |-- ethernet-phy@0
> >  eth_phy_ge    1  [ + ]   eth_phy_generic_drv       |       `-- ethernet-phy@1
> > 
> > To test this on Beagleplay, the following series is required
> > 
> > [1] Switch am65-cpsw to DM MDIO
> >  https://lore.kernel.org/all/20240228-for-2024-07-am65-cpsw-mdio-v2-0-f74f972eafeb@kernel.org/
> > 
> > The last 3 patches are marked [not-for-merge]. They are to show how the
> > whole solution can work to fix Ethernet on Beagleplay, which has been broken
> > so far. Those DT patches will be sent once the device tree changes are merged
> > into Linux tree.
> > 
> > Signed-off-by: Roger Quadros <rogerq@kernel.org>
> > ---
> > Roger Quadros (5):
> >       net: mdio-uclass: Bind and probe generic Ethernet PHY driver
> >       configs/am62x_beagleplay_a53_defconfig: enable DM_ETH_PHY
> 
> Any comments to the first 2 patches in this series?

Oh, so the CI failure, unfortunately, was because sometimes those tests
hit some resource-related race condition I believe. And I took your
comment at the time to mean you would v2 them. Yes, these patches seem
fine as is and I'll pick up assorted changes for -next soon. Thanks for
your patience.