Skip to contentSkip to conversation

net: broadcom: Imply BROADCOM_PHY for BCMGENET

PATCH Superseded Florian Fainelli 3 participants 7 messages May 8, 2020 – May 12, 2020

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net: broadcom: Imply BROADCOM_PHY for BCMGENET

The GENET controller on the Raspberry Pi 4 (2711) is typically interfaced with an external Broadcom PHY via a RGMII electrical interface. To make sure that delays are properly configured at the PHY side, ensure that we get a chance to have the dedicated Broadcom PHY driver (CONFIG_BROADCOM_PHY) enabled for this to happen.

Fixes 402482a6a78e ("net: bcmgenet: Clear ID_MODE_DIS in EXT_RGMII_OOB_CTRL when not needed")

---
David,

I would like Marek to indicate whether he is okay or not with this change. Thanks!

 drivers/net/ethernet/broadcom/Kconfig | 1 +
 1 file changed, 1 insertion(+)
drivers/net/ethernet/broadcom/Kconfig +1 -0
index 53055ce5dfd6..8a70b9152f7c 100644
@@ -69,6 +69,7 @@ config BCMGENET
 	select BCM7XXX_PHY
 	select MDIO_BCM_UNIMAC
 	select DIMLIB
+	imply BROADCOM_PHY if ARCH_BCM2835
 	help
 	  This driver supports the built-in Ethernet MACs found in the
 	  Broadcom BCM7xxx Set Top Box family chipset.
Signature · 1 line
2.17.1
#1 lore raw

Hi Florian,

Thanks for your patch!

Quoted 5 lines · Florian Fainelli

The GENET controller on the Raspberry Pi 4 (2711) is typically interfaced with an external Broadcom PHY via a RGMII electrical interface. To make sure that delays are properly configured at the PHY side, ensure that we get a chance to have the dedicated Broadcom PHY driver (CONFIG_BROADCOM_PHY) enabled for this to happen.

I guess it can be interfaced to a different external PHY, too?

drivers/net/ethernet/broadcom/Kconfig config BCMGENET · line 72

Quoted 11 lines
Fixes 402482a6a78e ("net: bcmgenet: Clear ID_MODE_DIS in EXT_RGMII_OOB_CTRL when not needed")
drivers/net/ethernet/broadcom/Kconfig +1 -0
@@ -69,6 +69,7 @@ config BCMGENET
        select BCM7XXX_PHY
        select MDIO_BCM_UNIMAC
        select DIMLIB
+       imply BROADCOM_PHY if ARCH_BCM2835

Which means support for the BROADCOM_PHY is always included on ARCH_BCM2835, even if a different PHY is used?

drivers/net/ethernet/broadcom/Kconfig config BCMGENET · line 75

Quoted 3 lines
drivers/net/ethernet/broadcom/Kconfig +0 -0
        help
          This driver supports the built-in Ethernet MACs found in the
          Broadcom BCM7xxx Set Top Box family chipset.

Gr{oetje,eeting}s,

Geert

Signature · 5 lines
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds
#2 lore raw
Quoted 4 lines · Geert Uytterhoeven

Hi Florian,

Thanks for your patch!

Quoted 8 lines
Quoted 5 lines · Florian Fainelli

The GENET controller on the Raspberry Pi 4 (2711) is typically interfaced with an external Broadcom PHY via a RGMII electrical interface. To make sure that delays are properly configured at the PHY side, ensure that we get a chance to have the dedicated Broadcom PHY driver (CONFIG_BROADCOM_PHY) enabled for this to happen.

I guess it can be interfaced to a different external PHY, too?

Yes, although this has not happened yet to the best of my knowledge.

Quoted 5 lines
Quoted 4 lines
Fixes 402482a6a78e ("net: bcmgenet: Clear ID_MODE_DIS in EXT_RGMII_OOB_CTRL when not needed")
Quoted 10 lines

drivers/net/ethernet/broadcom/Kconfig config BCMGENET · line 72

Quoted 7 lines
drivers/net/ethernet/broadcom/Kconfig +1 -0
@@ -69,6 +69,7 @@ config BCMGENET
         select BCM7XXX_PHY
         select MDIO_BCM_UNIMAC
         select DIMLIB
+       imply BROADCOM_PHY if ARCH_BCM2835

Which means support for the BROADCOM_PHY is always included on ARCH_BCM2835, even if a different PHY is used?

It is included by default on and can be deselected if needed, which is exactly what we want here, a sane default, but without the inflexibility of "select".

Quoted 9 lines

drivers/net/ethernet/broadcom/Kconfig config BCMGENET · line 75

Quoted 4 lines
drivers/net/ethernet/broadcom/Kconfig +0 -0
         help
           This driver supports the built-in Ethernet MACs found in the
           Broadcom BCM7xxx Set Top Box family chipset.

Gr{oetje,eeting}s,

Geert

Signature · 1 line
Florian
#3 lore raw

Hi Florian,

Quoted 28 lines · Florian Fainelli
Quoted 8 lines · Geert Uytterhoeven
Quoted 5 lines · Florian Fainelli

The GENET controller on the Raspberry Pi 4 (2711) is typically interfaced with an external Broadcom PHY via a RGMII electrical interface. To make sure that delays are properly configured at the PHY side, ensure that we get a chance to have the dedicated Broadcom PHY driver (CONFIG_BROADCOM_PHY) enabled for this to happen.

I guess it can be interfaced to a different external PHY, too?

Yes, although this has not happened yet to the best of my knowledge.

Quoted 5 lines
Quoted 4 lines
Fixes 402482a6a78e ("net: bcmgenet: Clear ID_MODE_DIS in EXT_RGMII_OOB_CTRL when not needed")
Quoted 10 lines

drivers/net/ethernet/broadcom/Kconfig config BCMGENET · line 72

Quoted 7 lines
drivers/net/ethernet/broadcom/Kconfig +1 -0
@@ -69,6 +69,7 @@ config BCMGENET
         select BCM7XXX_PHY
         select MDIO_BCM_UNIMAC
         select DIMLIB
+       imply BROADCOM_PHY if ARCH_BCM2835

Which means support for the BROADCOM_PHY is always included on ARCH_BCM2835, even if a different PHY is used?

Quoted 3 lines

It is included by default on and can be deselected if needed, which is exactly what we want here, a sane default, but without the inflexibility of "select".

I stand corrected: I can confirm the "imply" no longer selects the target symbol, but merely changes the default.

Gr{oetje,eeting}s,

Geert

Signature · 5 lines
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds
Tested-by on v1 1/1
#4 lore raw
In reply to Florian Fainelli

Hi Florian,

Quoted 6 lines · Florian Fainelli

The GENET controller on the Raspberry Pi 4 (2711) is typically interfaced with an external Broadcom PHY via a RGMII electrical interface. To make sure that delays are properly configured at the PHY side, ensure that we get a chance to have the dedicated Broadcom PHY driver (CONFIG_BROADCOM_PHY) enabled for this to happen.

Quoted 8 lines
Fixes 402482a6a78e ("net: bcmgenet: Clear ID_MODE_DIS in EXT_RGMII_OOB_CTRL when not needed")

---
David,

I would like Marek to indicate whether he is okay or not with this change. Thanks!

It is better. It fixes the default values for ARM 32bit bcm2835_defconfig and ARM 64bit defconfig, so you can add:

There is still an issue there. In case of ARM 64bit, when Genet driver is configured as a module, BROADCOM_PHY is also set to module. When I changed Genet to be built-in, BROADCOM_PHY stayed selected as module. This case doesn't work, as Genet driver is loaded much earlier than the rootfs/initrd/etc is available, thus broadcom phy driver is not loaded at all. It looks that some kind of deferred probe is missing there.

Best regards

Signature · 2 lines
Marek Szyprowski, PhD
Samsung R&D Institute Poland
#5 lore raw
Quoted 18 lines · Marek Szyprowski

Hi Florian,

Quoted 6 lines · Florian Fainelli

The GENET controller on the Raspberry Pi 4 (2711) is typically interfaced with an external Broadcom PHY via a RGMII electrical interface. To make sure that delays are properly configured at the PHY side, ensure that we get a chance to have the dedicated Broadcom PHY driver (CONFIG_BROADCOM_PHY) enabled for this to happen.

Quoted 8 lines
Fixes 402482a6a78e ("net: bcmgenet: Clear ID_MODE_DIS in EXT_RGMII_OOB_CTRL when not needed")

---
David,

I would like Marek to indicate whether he is okay or not with this change. Thanks!

Quoted 8 lines

It is better. It fixes the default values for ARM 32bit bcm2835_defconfig and ARM 64bit defconfig, so you can add:

There is still an issue there. In case of ARM 64bit, when Genet driver is configured as a module, BROADCOM_PHY is also set to module. When I changed Genet to be built-in, BROADCOM_PHY stayed selected as module.

OK.

Quoted 3 lines

This case doesn't work, as Genet driver is loaded much earlier than the rootfs/initrd/etc is available, thus broadcom phy driver is not loaded at all. It looks that some kind of deferred probe is missing there.

In the absence of a specific PHY driver the Generic PHY driver gets used instead. This is a valid situation as I described in my other email because the boot loader/firmware could have left the PHY properly configured with the expected RGMII delays and configuration such that Linux does not need to be aware of anything. I suppose we could change the GENET driver when running on the 2711 platform to reject the PHY driver being "Generic PHY" on the premise that a specialized driver should be used instead, but that seems a bit too restrictive IMHO.

Do you prefer a "select BROADCOM_PHY if ARCH_BCM2835" then?

Signature · 1 line
Florian
#6 lore raw

Hi Florian,

Quoted 38 lines · Florian Fainelli
Quoted 15 lines · Marek Szyprowski
Quoted 6 lines · Florian Fainelli

The GENET controller on the Raspberry Pi 4 (2711) is typically interfaced with an external Broadcom PHY via a RGMII electrical interface. To make sure that delays are properly configured at the PHY side, ensure that we get a chance to have the dedicated Broadcom PHY driver (CONFIG_BROADCOM_PHY) enabled for this to happen.

Quoted 8 lines
Fixes 402482a6a78e ("net: bcmgenet: Clear ID_MODE_DIS in EXT_RGMII_OOB_CTRL when not needed")

---
David,

I would like Marek to indicate whether he is okay or not with this change. Thanks!

Quoted 8 lines

It is better. It fixes the default values for ARM 32bit bcm2835_defconfig and ARM 64bit defconfig, so you can add:

There is still an issue there. In case of ARM 64bit, when Genet driver is configured as a module, BROADCOM_PHY is also set to module. When I changed Genet to be built-in, BROADCOM_PHY stayed selected as module.

OK.

Quoted 3 lines

This case doesn't work, as Genet driver is loaded much earlier than the rootfs/initrd/etc is available, thus broadcom phy driver is not loaded at all. It looks that some kind of deferred probe is missing there.

In the absence of a specific PHY driver the Generic PHY driver gets used instead. This is a valid situation as I described in my other email because the boot loader/firmware could have left the PHY properly configured with the expected RGMII delays and configuration such that Linux does not need to be aware of anything. I suppose we could change the GENET driver when running on the 2711 platform to reject the PHY driver being "Generic PHY" on the premise that a specialized driver should be used instead, but that seems a bit too restrictive IMHO.

Quoted 1 line

Do you prefer a "select BROADCOM_PHY if ARCH_BCM2835" then?

Yes. It solves the issue after switching Genet to be built-in without the need to change the CONFIG_BROADCOM_PHY.

Best regards

Signature · 2 lines
Marek Szyprowski, PhD
Samsung R&D Institute Poland