[U-Boot] [PATCH 0/2] This series implements the Ethernet PHY for the Broadcom Cygnus boards.

Jiandong Zheng (2): net: phy: broadcom: Add BCM Cygnus PHY arm: bcmcygnus: Enable Ethernet support
arch/arm/include/asm/arch-bcmcygnus/configs.h | 11 ++++++++++ board/broadcom/bcm_ep/board.c | 11 ++++++++++ drivers/net/phy/broadcom.c | 29 +++++++++++++++++++++++++++ 3 files changed, 51 insertions(+)

From: Jiandong Zheng jdzheng@broadcom.com
Add Ethernet PHY for BCM Cygnus SoC
Signed-off-by: Jiandong Zheng jdzheng@broadcom.com Signed-off-by: Steve Rae srae@broadcom.com ---
drivers/net/phy/broadcom.c | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+)
diff --git a/drivers/net/phy/broadcom.c b/drivers/net/phy/broadcom.c index 4512763..4b2808e 100644 --- a/drivers/net/phy/broadcom.c +++ b/drivers/net/phy/broadcom.c @@ -137,6 +137,24 @@ static int bcm5482_config(struct phy_device *phydev) return 0; }
+static int bcm_cygnus_startup(struct phy_device *phydev) +{ + /* Read the Status (2x to make sure link is right) */ + genphy_update_link(phydev); + genphy_parse_link(phydev); + + return 0; +} + +static int bcm_cygnus_config(struct phy_device *phydev) +{ + genphy_config_aneg(phydev); + + phy_reset(phydev); + + return 0; +} + /* * Find out if PHY is in copper or serdes mode by looking at Expansion Reg * 0x42 - "Operating Mode Status Register" @@ -264,11 +282,22 @@ static struct phy_driver BCM5482S_driver = { .shutdown = &genphy_shutdown, };
+static struct phy_driver BCM_CYGNUS_driver = { + .name = "Broadcom CYGNUS GPHY", + .uid = 0xae025200, + .mask = 0xfffff0, + .features = PHY_GBIT_FEATURES, + .config = &bcm_cygnus_config, + .startup = &bcm_cygnus_startup, + .shutdown = &genphy_shutdown, +}; + int phy_broadcom_init(void) { phy_register(&BCM5482S_driver); phy_register(&BCM5464S_driver); phy_register(&BCM5461S_driver); + phy_register(&BCM_CYGNUS_driver);
return 0; }

Hello Steve,
On Wed, 15 Jul 2015 16:28:13 -0700, Steve Rae srae@broadcom.com wrote:
From: Jiandong Zheng jdzheng@broadcom.com
Add Ethernet PHY for BCM Cygnus SoC
Signed-off-by: Jiandong Zheng jdzheng@broadcom.com Signed-off-by: Steve Rae srae@broadcom.com
drivers/net/phy/broadcom.c | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+)
This patch does not add the PHY in drivers/net/phy/Makefile. How does the object file ever get built?
Amicalement,

On Thu, 16 Jul 2015 16:29:45 +0200, Albert ARIBAUD albert.u.boot@aribaud.net wrote:
Hello Steve,
On Wed, 15 Jul 2015 16:28:13 -0700, Steve Rae srae@broadcom.com wrote:
From: Jiandong Zheng jdzheng@broadcom.com
Add Ethernet PHY for BCM Cygnus SoC
Signed-off-by: Jiandong Zheng jdzheng@broadcom.com Signed-off-by: Steve Rae srae@broadcom.com
drivers/net/phy/broadcom.c | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+)
This patch does not add the PHY in drivers/net/phy/Makefile. How does the object file ever get built?
Scratch that, I misread this as an addition. Time for a coffee break.
Amicalement,

Hi Steve,
On Wed, Jul 15, 2015 at 6:28 PM, Steve Rae srae@broadcom.com wrote:
From: Jiandong Zheng jdzheng@broadcom.com
Add Ethernet PHY for BCM Cygnus SoC
Signed-off-by: Jiandong Zheng jdzheng@broadcom.com Signed-off-by: Steve Rae srae@broadcom.com
Acked-by: Joe Hershberger joe.hershberger@ni.com

Hi Steve,
On Wed, Jul 15, 2015 at 6:28 PM, Steve Rae srae@broadcom.com wrote:
From: Jiandong Zheng jdzheng@broadcom.com
Add Ethernet PHY for BCM Cygnus SoC
Signed-off-by: Jiandong Zheng jdzheng@broadcom.com Signed-off-by: Steve Rae srae@broadcom.com
Applied to u-boot-net, thanks! -Joe

From: Jiandong Zheng jdzheng@broadcom.com
Enable BCM SF2 ethernet and PHY for BCM Cygnus SoC
Signed-off-by: Jiandong Zheng jdzheng@broadcom.com Signed-off-by: Steve Rae srae@broadcom.com ---
arch/arm/include/asm/arch-bcmcygnus/configs.h | 11 +++++++++++ board/broadcom/bcm_ep/board.c | 11 +++++++++++ 2 files changed, 22 insertions(+)
diff --git a/arch/arm/include/asm/arch-bcmcygnus/configs.h b/arch/arm/include/asm/arch-bcmcygnus/configs.h index 5354637..3c07160 100644 --- a/arch/arm/include/asm/arch-bcmcygnus/configs.h +++ b/arch/arm/include/asm/arch-bcmcygnus/configs.h @@ -22,4 +22,15 @@ #define CONFIG_CONS_INDEX 3 #define CONFIG_SYS_NS16550_COM3 0x18023000
+/* Ethernet */ +#define CONFIG_BCM_SF2_ETH +#define CONFIG_BCM_SF2_ETH_GMAC + +#define CONFIG_PHYLIB +#define CONFIG_PHY_BROADCOM +#define CONFIG_PHY_RESET_DELAY 10000 /* PHY reset delay in us*/ + +#define CONFIG_CMD_PING +#define CONFIG_CMD_MII + #endif /* __ARCH_CONFIGS_H */ diff --git a/board/broadcom/bcm_ep/board.c b/board/broadcom/bcm_ep/board.c index eaad0b3..c28b203 100644 --- a/board/broadcom/bcm_ep/board.c +++ b/board/broadcom/bcm_ep/board.c @@ -7,6 +7,7 @@ #include <common.h> #include <asm/io.h> #include <config.h> +#include <netdev.h> #include <asm/system.h> #include <asm/iproc-common/armpll.h>
@@ -67,3 +68,13 @@ void smp_waitloop(unsigned previous_address) { } #endif + +#ifdef CONFIG_BCM_SF2_ETH +int board_eth_init(bd_t *bis) +{ + int rc = -1; + printf("Registering BCM sf2 eth\n"); + rc = bcm_sf2_eth_register(bis, 0); + return rc; +} +#endif

Hi Steve,
On Wed, Jul 15, 2015 at 6:28 PM, Steve Rae srae@broadcom.com wrote:
From: Jiandong Zheng jdzheng@broadcom.com
Enable BCM SF2 ethernet and PHY for BCM Cygnus SoC
Signed-off-by: Jiandong Zheng jdzheng@broadcom.com Signed-off-by: Steve Rae srae@broadcom.com
Acked-by: Joe Hershberger joe.hershberger@ni.com

On Wed, Jul 15, 2015 at 04:28:14PM -0700, Steve Rae wrote:
From: Jiandong Zheng jdzheng@broadcom.com
Enable BCM SF2 ethernet and PHY for BCM Cygnus SoC
Signed-off-by: Jiandong Zheng jdzheng@broadcom.com Signed-off-by: Steve Rae srae@broadcom.com Acked-by: Joe Hershberger joe.hershberger@ni.com
Applied to u-boot/master, thanks!
participants (4)
-
Albert ARIBAUD
-
Joe Hershberger
-
Steve Rae
-
Tom Rini