From 0ed64e49e556096972e0a85e8f4db287b4ed9bdc Mon Sep 17 00:00:00 2001 From: Oleksii Bidnichenko Date: Wed, 27 Oct 2021 11:34:47 +0300 Subject: apalis-imx6: add usage of KSZ9XX1 Backport usage of a new KSZ9XX1 PHY by Apalis iMX6, the old driver located in micrel.c still used by other boards. If a board wants to use a new PHY the old one must be disabled. Backported from: commit f72e48ba4d98 ("board: apalis_imx6: Add KSZ9131 phy skew settings") Related-to: ELB-4181 Signed-off-by: Oleksii Bidnichenko --- include/configs/apalis_imx6.h | 3 +-- include/micrel.h | 13 +++++++++++++ 2 files changed, 14 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/configs/apalis_imx6.h b/include/configs/apalis_imx6.h index 4b2e519ab9..0058b6ad35 100644 --- a/include/configs/apalis_imx6.h +++ b/include/configs/apalis_imx6.h @@ -103,8 +103,7 @@ #define CONFIG_ETHPRIME "FEC" #define CONFIG_FEC_MXC_PHYADDR 6 #define CONFIG_PHYLIB -#define CONFIG_PHY_MICREL -#define CONFIG_PHY_MICREL_KSZ9031 +#define CONFIG_PHY_MICREL_KSZ90X1 #define CONFIG_IP_DEFRAG #define CONFIG_TFTP_BLOCKSIZE 4096 #define CONFIG_TFTP_TSIZE diff --git a/include/micrel.h b/include/micrel.h index 783dc634e2..a03b8dd7b9 100644 --- a/include/micrel.h +++ b/include/micrel.h @@ -23,6 +23,16 @@ #define MII_KSZ9031_FLP_BURST_TX_LO 0x3 #define MII_KSZ9031_FLP_BURST_TX_HI 0x4 +#define MII_KSZ9x31_SILICON_REV_MASK 0xfffff0 + +#define MII_KSZ9131_RXTXDLL_BYPASS BIT(12) +#define MII_KSZ9131_EXT_RGMII_2NS_SKEW_RXDLL 0x4c +#define MII_KSZ9131_EXT_RGMII_2NS_SKEW_TXDLL 0x4d + +#define PHY_ID_KSZ9031 0x00221620 +#define PHY_ID_KSZ9131 0x00221640 + + /* Registers */ #define MMD_ACCESS_CONTROL 0xd #define MMD_ACCESS_REG_DATA 0xe @@ -35,6 +45,9 @@ int ksz9031_phy_extended_write(struct phy_device *phydev, int devaddr, int regnum, u16 mode, u16 val); int ksz9031_phy_extended_read(struct phy_device *phydev, int devaddr, int regnum, u16 mode); +int ksz9xx1_phy_get_id(struct phy_device *phydev); +#ifndef CONFIG_PHY_MICREL_KSZ90X1 int ksz9031_center_flp_timing(struct phy_device *phydev); +#endif #endif -- cgit v1.2.3