net: phy: micrel: Allow KSZ8xxx and KSZ90x1 to be used together
authorJames Byrne <james.byrne@origamienergy.com>
Wed, 6 Mar 2019 12:48:27 +0000 (12:48 +0000)
committerJoe Hershberger <joe.hershberger@ni.com>
Tue, 14 May 2019 19:43:33 +0000 (14:43 -0500)
Commit d397f7c45b0b ("net: phy: micrel: Separate KSZ9000 drivers from
KSZ8000 drivers") separated the KSZ8xxx and KSZ90x1 drivers and warns
that you shouldn't select both of them due to a device ID clash between
the KSZ9021 and the KS8721, asserting that "it is highly unlikely for a
system to contain both a KSZ8000 and a KSZ9000 PHY". Unfortunately
boards like the SAMA5D3xEK do contain both types of PHY, but fortunately
the Linux Micrel PHY driver provides a solution by using different PHY
ID and mask values to distinguish these chips.

This commit contains the following changes:

- The PHY ID and mask values for the KSZ9021 and the KS8721 now match
those used by the Linux driver.
- The warnings about not enabling both drivers have been removed.
- The description for PHY_MICREL_KSZ8XXX has been corrected (these are
10/100 PHYs, not GbE PHYs).
- PHY_MICREL_KSZ9021 and PHY_MICREL_KSZ9031 no longer select PHY_GIGE
since this is selected by PHY_MICREL_KSZ90X1.
- All of the relevant defconfig files have been updated now that
PHY_MICREL_KSZ8XXX does not default to 'Y'.

Signed-off-by: James Byrne <james.byrne@origamienergy.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
36 files changed:
configs/alt_defconfig
configs/aristainetos_defconfig
configs/bk4r1_defconfig
configs/colibri_imx6_defconfig
configs/colibri_imx7_defconfig
configs/colibri_imx7_emmc_defconfig
configs/colibri_vf_defconfig
configs/flea3_defconfig
configs/gose_defconfig
configs/imx6dl_mamoj_defconfig
configs/imx6qdl_icore_rqs_defconfig
configs/k2g_evm_defconfig
configs/k2g_hs_evm_defconfig
configs/koelsch_defconfig
configs/lager_defconfig
configs/m53menlo_defconfig
configs/mx6ul_14x14_evk_defconfig
configs/mx6ul_9x9_evk_defconfig
configs/opos6uldev_defconfig
configs/pcm052_defconfig
configs/phycore_pcl063_defconfig
configs/pico-hobbit-imx6ul_defconfig
configs/pico-imx6ul_defconfig
configs/pico-pi-imx6ul_defconfig
configs/porter_defconfig
configs/silk_defconfig
configs/stout_defconfig
configs/stv0991_defconfig
configs/udoo_neo_defconfig
configs/vf610twr_defconfig
configs/vf610twr_nand_defconfig
configs/woodburn_defconfig
configs/woodburn_sd_defconfig
drivers/net/phy/Kconfig
drivers/net/phy/micrel_ksz8xxx.c
drivers/net/phy/micrel_ksz90x1.c

index a51c0d6..a86ff90 100644 (file)
@@ -70,6 +70,7 @@ CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_SPANSION=y
 CONFIG_SPI_FLASH_MTD=y
 CONFIG_PHY_MICREL=y
+CONFIG_PHY_MICREL_KSZ8XXX=y
 CONFIG_DM_ETH=y
 CONFIG_SH_ETHER=y
 CONFIG_PCI=y
index 0e63174..44b30e3 100644 (file)
@@ -47,6 +47,7 @@ CONFIG_MTD_UBI_FASTMAP=y
 CONFIG_MTD_UBI_FASTMAP_AUTOCONVERT=1
 CONFIG_PHYLIB=y
 CONFIG_PHY_MICREL=y
+CONFIG_PHY_MICREL_KSZ8XXX=y
 CONFIG_MII=y
 CONFIG_SPI=y
 CONFIG_MXC_SPI=y
index 3dac2fd..98423f2 100644 (file)
@@ -67,6 +67,7 @@ CONFIG_SPI_FLASH_STMICRO=y
 CONFIG_SPI_FLASH_MTD=y
 CONFIG_PHYLIB=y
 CONFIG_PHY_MICREL=y
+CONFIG_PHY_MICREL_KSZ8XXX=y
 CONFIG_DM_ETH=y
 CONFIG_FEC_MXC=y
 CONFIG_MII=y
index ba17ec0..af74f35 100644 (file)
@@ -61,6 +61,7 @@ CONFIG_SUPPORT_EMMC_BOOT=y
 CONFIG_FSL_ESDHC=y
 CONFIG_PHYLIB=y
 CONFIG_PHY_MICREL=y
+CONFIG_PHY_MICREL_KSZ8XXX=y
 CONFIG_MII=y
 CONFIG_PINCTRL=y
 CONFIG_PINCTRL_IMX6=y
index 58620ea..bfb84ec 100644 (file)
@@ -57,6 +57,7 @@ CONFIG_NAND_MXS_DT=y
 CONFIG_MTD_UBI_FASTMAP=y
 CONFIG_PHYLIB=y
 CONFIG_PHY_MICREL=y
+CONFIG_PHY_MICREL_KSZ8XXX=y
 CONFIG_MII=y
 CONFIG_PINCTRL=y
 CONFIG_PINCTRL_IMX7=y
index 0617b12..af3cf93 100644 (file)
@@ -49,6 +49,7 @@ CONFIG_SUPPORT_EMMC_BOOT=y
 CONFIG_FSL_ESDHC=y
 CONFIG_PHYLIB=y
 CONFIG_PHY_MICREL=y
+CONFIG_PHY_MICREL_KSZ8XXX=y
 CONFIG_MII=y
 CONFIG_PINCTRL=y
 CONFIG_PINCTRL_IMX7=y
index d214a79..7334002 100644 (file)
@@ -66,6 +66,7 @@ CONFIG_SYS_NAND_VF610_NFC_60_ECC_BYTES=y
 CONFIG_MTD_UBI_FASTMAP=y
 CONFIG_PHYLIB=y
 CONFIG_PHY_MICREL=y
+CONFIG_PHY_MICREL_KSZ8XXX=y
 CONFIG_DM_ETH=y
 CONFIG_FEC_MXC=y
 CONFIG_MII=y
index 19c9676..f6e8048 100644 (file)
@@ -33,6 +33,7 @@ CONFIG_NAND=y
 CONFIG_NAND_MXC=y
 CONFIG_PHYLIB=y
 CONFIG_PHY_MICREL=y
+CONFIG_PHY_MICREL_KSZ8XXX=y
 CONFIG_MII=y
 CONFIG_SPI=y
 CONFIG_MXC_SPI=y
index 428eab3..f591bd8 100644 (file)
@@ -67,6 +67,7 @@ CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_SPANSION=y
 CONFIG_SPI_FLASH_MTD=y
 CONFIG_PHY_MICREL=y
+CONFIG_PHY_MICREL_KSZ8XXX=y
 CONFIG_DM_ETH=y
 CONFIG_SH_ETHER=y
 CONFIG_PCI=y
index 09f3375..5ad49b3 100644 (file)
@@ -36,6 +36,7 @@ CONFIG_SUPPORT_EMMC_BOOT=y
 CONFIG_FSL_ESDHC=y
 CONFIG_PHYLIB=y
 CONFIG_PHY_MICREL=y
+CONFIG_PHY_MICREL_KSZ8XXX=y
 CONFIG_FEC_MXC=y
 CONFIG_MII=y
 CONFIG_PINCTRL_IMX6=y
index 45fddbe..83b926b 100644 (file)
@@ -45,6 +45,7 @@ CONFIG_SYS_I2C_MXC=y
 CONFIG_FSL_ESDHC=y
 CONFIG_PHYLIB=y
 CONFIG_PHY_MICREL=y
+CONFIG_PHY_MICREL_KSZ8XXX=y
 CONFIG_FEC_MXC=y
 CONFIG_MII=y
 CONFIG_PINCTRL=y
index 0c554df..13cf9c9 100644 (file)
@@ -51,6 +51,7 @@ CONFIG_SPI_FLASH_STMICRO=y
 CONFIG_PHYLIB=y
 CONFIG_PHY_MARVELL=y
 CONFIG_PHY_MICREL=y
+CONFIG_PHY_MICREL_KSZ8XXX=y
 CONFIG_PHY_TI=y
 CONFIG_DM_ETH=y
 CONFIG_MII=y
index 00138c0..e93fc00 100644 (file)
@@ -45,6 +45,7 @@ CONFIG_SPI_FLASH_STMICRO=y
 CONFIG_PHYLIB=y
 CONFIG_PHY_MARVELL=y
 CONFIG_PHY_MICREL=y
+CONFIG_PHY_MICREL_KSZ8XXX=y
 CONFIG_DM_ETH=y
 CONFIG_MII=y
 CONFIG_DRIVER_TI_KEYSTONE_NET=y
index 3484a17..23d11df 100644 (file)
@@ -67,6 +67,7 @@ CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_SPANSION=y
 CONFIG_SPI_FLASH_MTD=y
 CONFIG_PHY_MICREL=y
+CONFIG_PHY_MICREL_KSZ8XXX=y
 CONFIG_DM_ETH=y
 CONFIG_SH_ETHER=y
 CONFIG_PCI=y
index f158473..c056054 100644 (file)
@@ -69,6 +69,7 @@ CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_SPANSION=y
 CONFIG_SPI_FLASH_MTD=y
 CONFIG_PHY_MICREL=y
+CONFIG_PHY_MICREL_KSZ8XXX=y
 CONFIG_DM_ETH=y
 CONFIG_SH_ETHER=y
 CONFIG_PCI=y
index fe1a94e..e5f8c9e 100644 (file)
@@ -57,6 +57,7 @@ CONFIG_NAND=y
 CONFIG_NAND_MXC=y
 CONFIG_PHYLIB=y
 CONFIG_PHY_MICREL=y
+CONFIG_PHY_MICREL_KSZ8XXX=y
 CONFIG_RTC_M41T62=y
 CONFIG_USB=y
 CONFIG_USB_EHCI_MX5=y
index 62563b9..2fc7119 100644 (file)
@@ -52,6 +52,7 @@ CONFIG_SF_DEFAULT_SPEED=40000000
 CONFIG_SPI_FLASH_STMICRO=y
 CONFIG_PHYLIB=y
 CONFIG_PHY_MICREL=y
+CONFIG_PHY_MICREL_KSZ8XXX=y
 CONFIG_DM_ETH=y
 CONFIG_MII=y
 CONFIG_PINCTRL=y
index e8df625..8816f6a 100644 (file)
@@ -52,6 +52,7 @@ CONFIG_SF_DEFAULT_SPEED=40000000
 CONFIG_SPI_FLASH_STMICRO=y
 CONFIG_PHYLIB=y
 CONFIG_PHY_MICREL=y
+CONFIG_PHY_MICREL_KSZ8XXX=y
 CONFIG_DM_ETH=y
 CONFIG_MII=y
 CONFIG_PINCTRL=y
index 409bea8..badc4b0 100644 (file)
@@ -72,6 +72,7 @@ CONFIG_SUPPORT_EMMC_BOOT=y
 CONFIG_FSL_ESDHC=y
 CONFIG_PHYLIB=y
 CONFIG_PHY_MICREL=y
+CONFIG_PHY_MICREL_KSZ8XXX=y
 CONFIG_FEC_MXC=y
 CONFIG_MII=y
 CONFIG_PINCTRL=y
index 87597f0..4002dba 100644 (file)
@@ -54,6 +54,7 @@ CONFIG_SPI_FLASH_STMICRO=y
 CONFIG_SPI_FLASH_MTD=y
 CONFIG_PHYLIB=y
 CONFIG_PHY_MICREL=y
+CONFIG_PHY_MICREL_KSZ8XXX=y
 CONFIG_DM_ETH=y
 CONFIG_FEC_MXC=y
 CONFIG_MII=y
index 95f6d54..a051a8d 100644 (file)
@@ -42,6 +42,7 @@ CONFIG_NAND_MXS=y
 CONFIG_NAND_MXS_DT=y
 CONFIG_PHYLIB=y
 CONFIG_PHY_MICREL=y
+CONFIG_PHY_MICREL_KSZ8XXX=y
 CONFIG_FEC_MXC=y
 CONFIG_MII=y
 CONFIG_PINCTRL=y
index 5481fff..bb6a9e4 100644 (file)
@@ -49,6 +49,7 @@ CONFIG_SUPPORT_EMMC_BOOT=y
 CONFIG_FSL_ESDHC=y
 CONFIG_PHYLIB=y
 CONFIG_PHY_MICREL=y
+CONFIG_PHY_MICREL_KSZ8XXX=y
 CONFIG_MII=y
 CONFIG_PINCTRL=y
 CONFIG_PINCTRL_IMX6=y
index af82677..3284680 100644 (file)
@@ -51,6 +51,7 @@ CONFIG_SUPPORT_EMMC_BOOT=y
 CONFIG_FSL_ESDHC=y
 CONFIG_PHYLIB=y
 CONFIG_PHY_MICREL=y
+CONFIG_PHY_MICREL_KSZ8XXX=y
 CONFIG_MII=y
 CONFIG_PINCTRL=y
 CONFIG_PINCTRL_IMX6=y
index 295c822..d52c09e 100644 (file)
@@ -49,6 +49,7 @@ CONFIG_SUPPORT_EMMC_BOOT=y
 CONFIG_FSL_ESDHC=y
 CONFIG_PHYLIB=y
 CONFIG_PHY_MICREL=y
+CONFIG_PHY_MICREL_KSZ8XXX=y
 CONFIG_MII=y
 CONFIG_PINCTRL=y
 CONFIG_PINCTRL_IMX6=y
index 4bfdc55..c42754b 100644 (file)
@@ -68,6 +68,7 @@ CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_SPANSION=y
 CONFIG_SPI_FLASH_MTD=y
 CONFIG_PHY_MICREL=y
+CONFIG_PHY_MICREL_KSZ8XXX=y
 CONFIG_DM_ETH=y
 CONFIG_SH_ETHER=y
 CONFIG_PCI=y
index 70500cf..e38f634 100644 (file)
@@ -70,6 +70,7 @@ CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_SPANSION=y
 CONFIG_SPI_FLASH_MTD=y
 CONFIG_PHY_MICREL=y
+CONFIG_PHY_MICREL_KSZ8XXX=y
 CONFIG_DM_ETH=y
 CONFIG_SH_ETHER=y
 CONFIG_PCI=y
index 1db3f76..d6d9e69 100644 (file)
@@ -68,6 +68,7 @@ CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_SPANSION=y
 CONFIG_SPI_FLASH_MTD=y
 CONFIG_PHY_MICREL=y
+CONFIG_PHY_MICREL_KSZ8XXX=y
 CONFIG_DM_ETH=y
 CONFIG_SH_ETHER=y
 CONFIG_PCI=y
index 7881052..834a75f 100644 (file)
@@ -26,6 +26,7 @@ CONFIG_ENV_IS_IN_SPI_FLASH=y
 CONFIG_SPI_FLASH_STMICRO=y
 CONFIG_SPI_FLASH_WINBOND=y
 CONFIG_PHY_MICREL=y
+CONFIG_PHY_MICREL_KSZ8XXX=y
 CONFIG_ETH_DESIGNWARE=y
 CONFIG_MII=y
 CONFIG_CADENCE_QSPI=y
index 603d367..e8df11d 100644 (file)
@@ -31,5 +31,6 @@ CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y
 CONFIG_FSL_ESDHC=y
 CONFIG_PHYLIB=y
 CONFIG_PHY_MICREL=y
+CONFIG_PHY_MICREL_KSZ8XXX=y
 CONFIG_MII=y
 CONFIG_OF_LIBFDT=y
index 24f8243..dc67ddc 100644 (file)
@@ -37,6 +37,7 @@ CONFIG_NAND_VF610_NFC=y
 CONFIG_SYS_NAND_BUSWIDTH_16BIT=y
 CONFIG_PHYLIB=y
 CONFIG_PHY_MICREL=y
+CONFIG_PHY_MICREL_KSZ8XXX=y
 CONFIG_MII=y
 CONFIG_DM_SERIAL=y
 CONFIG_FSL_LPUART=y
index 4dc8b82..7fcb630 100644 (file)
@@ -37,6 +37,7 @@ CONFIG_NAND_VF610_NFC=y
 CONFIG_SYS_NAND_BUSWIDTH_16BIT=y
 CONFIG_PHYLIB=y
 CONFIG_PHY_MICREL=y
+CONFIG_PHY_MICREL_KSZ8XXX=y
 CONFIG_MII=y
 CONFIG_DM_SERIAL=y
 CONFIG_FSL_LPUART=y
index a5cc579..bb74542 100644 (file)
@@ -38,6 +38,7 @@ CONFIG_NAND=y
 CONFIG_NAND_MXC=y
 CONFIG_PHYLIB=y
 CONFIG_PHY_MICREL=y
+CONFIG_PHY_MICREL_KSZ8XXX=y
 CONFIG_MII=y
 CONFIG_SPI=y
 CONFIG_MXC_SPI=y
index 087c83a..4976a70 100644 (file)
@@ -50,6 +50,7 @@ CONFIG_NAND=y
 CONFIG_NAND_MXC=y
 CONFIG_PHYLIB=y
 CONFIG_PHY_MICREL=y
+CONFIG_PHY_MICREL_KSZ8XXX=y
 CONFIG_MII=y
 CONFIG_SPI=y
 CONFIG_MXC_SPI=y
index 631b52b..2a3da06 100644 (file)
@@ -119,21 +119,19 @@ config PHY_MICREL
        bool "Micrel Ethernet PHYs support"
        help
          Enable support for the GbE PHYs manufactured by Micrel (now
-         a part of Microchip). This includes drivers for the KSZ804,
-         KSZ8031, KSZ8051, KSZ8081, KSZ8895, KSZ886x, KSZ8721
-         either/or KSZ9021 (see the "Micrel KSZ9021 family support"
-         config option for details), and KSZ9031 (if configured).
+         a part of Microchip). This includes drivers for the KSZ804, KSZ8031,
+         KSZ8051, KSZ8081, KSZ8895, KSZ886x and KSZ8721 (if "Micrel KSZ8xxx
+         family support" is selected) and the KSZ9021 and KSZ9031 (if "Micrel
+         KSZ90x1 family support" is selected).
 
 if PHY_MICREL
 
 config PHY_MICREL_KSZ9021
        bool
-       select PHY_GIGE
        select PHY_MICREL_KSZ90X1
 
 config PHY_MICREL_KSZ9031
        bool
-       select PHY_GIGE
        select PHY_MICREL_KSZ90X1
 
 config PHY_MICREL_KSZ90X1
@@ -146,20 +144,13 @@ config PHY_MICREL_KSZ90X1
          delays configured in the device tree will be applied to the
          PHY during initialization.
 
-         This should not be enabled at the same time with PHY_MICREL_KSZ8XXX
-         as the KSZ9021 and KS8721 share the same ID.
-
 config PHY_MICREL_KSZ8XXX
        bool "Micrel KSZ8xxx family support"
-       default y if !PHY_MICREL_KSZ90X1
        help
-         Enable support for the 8000 series GbE PHYs manufactured by Micrel
+         Enable support for the 8000 series 10/100 PHYs manufactured by Micrel
          (now a part of Microchip). This includes drivers for the KSZ804,
          KSZ8031, KSZ8051, KSZ8081, KSZ8895, KSZ886x, and KSZ8721.
 
-         This should not be enabled at the same time with PHY_MICREL_KSZ90X1
-         as the KSZ9021 and KS8721 share the same ID.
-
 endif # PHY_MICREL
 
 config PHY_MSCC
index 3411150..daa57ce 100644 (file)
@@ -147,11 +147,13 @@ static struct phy_driver ksz8895_driver = {
        .shutdown = &genphy_shutdown,
 };
 
-/* Micrel used the exact same part number for the KSZ9021. */
+/* Micrel used the exact same model number for the KSZ9021,
+ * so the revision number is used to distinguish them.
+ */
 static struct phy_driver KS8721_driver = {
        .name = "Micrel KS8721BL",
-       .uid = 0x221610,
-       .mask = 0xfffff0,
+       .uid = 0x221618,
+       .mask = 0xfffffc,
        .features = PHY_BASIC_FEATURES,
        .config = &genphy_config,
        .startup = &genphy_startup,
index 8dec9f2..f18e40a 100644 (file)
@@ -285,7 +285,7 @@ static int ksz9021_config(struct phy_device *phydev)
 static struct phy_driver ksz9021_driver = {
        .name = "Micrel ksz9021",
        .uid  = 0x221610,
-       .mask = 0xfffff0,
+       .mask = 0xfffffe,
        .features = PHY_GBIT_FEATURES,
        .config = &ksz9021_config,
        .startup = &ksz90xx_startup,