net: phy: micrel: make ksz9021 phy accessible
Subsystems (2)
PATCH 1/1 net: phy: micrel: make ksz9021 phy accessible
Micrel accidentally used the same part number
for the KS8721 and KSZ9021. So, both cannot be
in the same build of u-boot. Add a config option
to handle this.
Signed-off-by Troy Kisky <[email protected]>
--- drivers/net/phy/micrel.c | 15 +++++++++++++-- include/configs/mx6qsabrelite.h | 1 + 2 files changed, 14 insertions(+), 2 deletions(-)
drivers/net/phy/micrel.c +13 -2
@@ -35,6 +35,12 @@ static struct phy_driver KSZ804_driver = { .shutdown = &genphy_shutdown, }; +#ifndef CONFIG_PHY_MICREL_KSZ9021 +/* +* I can't believe Micrel used the exact same part number +* for the KSZ9021 +* Shame Micrel, Shame!!!!! +*/ static struct phy_driver KS8721_driver = { .name ="Micrel KS8721BL" , .uid = 0x221610,
@@ -44,7 +50,9 @@ static struct phy_driver KS8721_driver = { .startup = &genphy_startup, .shutdown = &genphy_shutdown, }; +#endif +#ifdef CONFIG_PHY_MICREL_KSZ9021 /* ksz9021 PHY Registers */ #define MII_KSZ9021_EXTENDED_CTRL 0x0b#define MII_KSZ9021_EXTENDED_DATAW 0x0c
@@ -127,12 +135,15 @@ static struct phy_driver ksz9021_driver = { .startup = &ksz9021_startup, .shutdown = &genphy_shutdown, }; +#endif int phy_micrel_init (void ) {phy_register (&KSZ804_driver); -phy_register (&KS8721_driver); +#ifdef CONFIG_PHY_MICREL_KSZ9021 phy_register (&ksz9021_driver); - +#else +phy_register (&KS8721_driver); +#endif return 0 ; }
include/configs/mx6qsabrelite.h +1 -0
@@ -97,6 +97,7 @@#define CONFIG_FEC_MXC_PHYADDR 6#define CONFIG_PHYLIB #define CONFIG_PHY_MICREL +#define CONFIG_PHY_MICREL_KSZ9021 /* USB Configs */ #define CONFIG_CMD_USB
Signature · 1 line
1.7.9.5
PATCH 1/1 net: phy: micrel: make ksz9021 phy accessible
Quoted 29 lines · Troy Kisky
Micrel accidentally used the same part number
for the KS8721 and KSZ9021. So, both cannot be
in the same build of u-boot. Add a config option
to handle this.Signed-off-by Troy Kisky<[email protected]>--- drivers/net/phy/micrel.c | 15 +++++++++++++-- include/configs/mx6qsabrelite.h | 1 + 2 files changed, 14 insertions(+), 2 deletions(-)drivers/net/phy/micrel.c +6
-0@@ -35,6 +35,12 @@ static struct phy_driver KSZ804_driver = { .shutdown =&genphy_shutdown, }; +#ifndef CONFIG_PHY_MICREL_KSZ9021 +/* +* I can't believe Micrel used the exact same part number +* for the KSZ9021 +* Shame Micrel, Shame!!!!! +*/ static struct phy_driver KS8721_driver = { .name ="Micrel KS8721BL" , .uid = 0x221610,
drivers/net/phy/micrel.c static struct phy_driver KS8721_driver = { · line 53
Quoted 4 lines
drivers/net/phy/micrel.c +1
-0@@ -44,7 +50,9 @@ static struct phy_driver KS8721_driver = { .startup =&genphy_startup, .shutdown =&genphy_shutdown, }; +#endif
Quoted 28 lines
drivers/net/phy/micrel.c +6
-2+#ifdef CONFIG_PHY_MICREL_KSZ9021 /* ksz9021 PHY Registers */ #define MII_KSZ9021_EXTENDED_CTRL 0x0b#define MII_KSZ9021_EXTENDED_DATAW 0x0c@@ -127,12 +135,15 @@ static struct phy_driver ksz9021_driver = { .startup =&ksz9021_startup, .shutdown =&genphy_shutdown, }; +#endif int phy_micrel_init (void ) {phy_register (&KSZ804_driver); -phy_register (&KS8721_driver); +#ifdef CONFIG_PHY_MICREL_KSZ9021 phy_register (&ksz9021_driver); - +#else +phy_register (&KS8721_driver); +#endif return 0 ; }include/configs/mx6qsabrelite.h +0
-0
include/configs/mx6qsabrelite.h line 103
Quoted 7 lines
include/configs/mx6qsabrelite.h +1
-0@@ -97,6 +97,7 @@#define CONFIG_FEC_MXC_PHYADDR 6#define CONFIG_PHYLIB #define CONFIG_PHY_MICREL +#define CONFIG_PHY_MICREL_KSZ9021 /* USB Configs */ #define CONFIG_CMD_USB
Best wishes,
Vladimir