diff options
author | Tom Rini <trini@konsulko.com> | 2020-05-04 09:29:42 -0400 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2020-05-04 09:29:42 -0400 |
commit | 143414c03fa72468fa8ce0d1ded21a4a616400f9 (patch) | |
tree | 823d7657534ae619e6e937e2f7d303e64885fbab /drivers/net | |
parent | 8510580f2e85a8687b40fe5fc3d8c060e5278505 (diff) | |
parent | ea0f768e2c835d2b77bdc1db7d4ab1416e45e432 (diff) | |
download | u-boot-143414c03fa72468fa8ce0d1ded21a4a616400f9.tar.gz u-boot-143414c03fa72468fa8ce0d1ded21a4a616400f9.tar.xz u-boot-143414c03fa72468fa8ce0d1ded21a4a616400f9.zip |
Merge tag 'u-boot-imx-20200502' of https://gitlab.denx.de/u-boot/custodians/u-boot-imx
i.MX for 2020.07
----------------
- imxrt: fix LCD clock, fix doc
- new board: Coral Dev
- imx8: enable Cache in SPL. SNVS, update SCFW API
- imx8MM: fix reset, 8MQ quand and QuadLite, CPU speed grading
- MX6ULL : is_imx6ull to include i.MX6ULZ
- Net: add config to enable TXC delay
Travis: https://travis-ci.org/github/sbabic/u-boot-imx/builds/682033914
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/fec_mxc.c | 10 | ||||
-rw-r--r-- | drivers/net/fec_mxc.h | 2 | ||||
-rw-r--r-- | drivers/net/phy/micrel_ksz90x1.c | 62 |
3 files changed, 72 insertions, 2 deletions
diff --git a/drivers/net/fec_mxc.c b/drivers/net/fec_mxc.c index bc5b63d788..345d37be4e 100644 --- a/drivers/net/fec_mxc.c +++ b/drivers/net/fec_mxc.c @@ -503,6 +503,16 @@ static int fec_open(struct eth_device *edev) writel(readl(&fec->eth->ecntrl) | FEC_ECNTRL_ETHER_EN, &fec->eth->ecntrl); +#ifdef FEC_ENET_ENABLE_TXC_DELAY + writel(readl(&fec->eth->ecntrl) | FEC_ECNTRL_TXC_DLY, + &fec->eth->ecntrl); +#endif + +#ifdef FEC_ENET_ENABLE_RXC_DELAY + writel(readl(&fec->eth->ecntrl) | FEC_ECNTRL_RXC_DLY, + &fec->eth->ecntrl); +#endif + #if defined(CONFIG_MX25) || defined(CONFIG_MX53) || defined(CONFIG_MX6SL) udelay(100); diff --git a/drivers/net/fec_mxc.h b/drivers/net/fec_mxc.h index 159aec8967..3c8fdda263 100644 --- a/drivers/net/fec_mxc.h +++ b/drivers/net/fec_mxc.h @@ -188,6 +188,8 @@ struct ethernet_regs { #define FEC_ECNTRL_ETHER_EN 0x00000002 /* enable the FEC */ #define FEC_ECNTRL_SPEED 0x00000020 #define FEC_ECNTRL_DBSWAP 0x00000100 +#define FEC_ECNTRL_TXC_DLY 0x00010000 /* TXC delayed */ +#define FEC_ECNTRL_RXC_DLY 0x00020000 /* RXC delayed */ #define FEC_X_WMRK_STRFWD 0x00000100 diff --git a/drivers/net/phy/micrel_ksz90x1.c b/drivers/net/phy/micrel_ksz90x1.c index 0105fc5af1..f0032e8ce1 100644 --- a/drivers/net/phy/micrel_ksz90x1.c +++ b/drivers/net/phy/micrel_ksz90x1.c @@ -383,8 +383,8 @@ static int ksz9031_config(struct phy_device *phydev) static struct phy_driver ksz9031_driver = { .name = "Micrel ksz9031", - .uid = 0x221620, - .mask = 0xfffff0, + .uid = PHY_ID_KSZ9031, + .mask = MII_KSZ9x31_SILICON_REV_MASK, .features = PHY_GBIT_FEATURES, .config = &ksz9031_config, .startup = &ksz90xx_startup, @@ -393,9 +393,67 @@ static struct phy_driver ksz9031_driver = { .readext = &ksz9031_phy_extread, }; +/* + * KSZ9131 + */ +static int ksz9131_config(struct phy_device *phydev) +{ + /* TBD: Implement Skew values for dts */ + + /* add an option to disable the gigabit feature of this PHY */ + if (env_get("disable_giga")) { + unsigned features; + unsigned bmcr; + + /* disable speed 1000 in features supported by the PHY */ + features = phydev->drv->features; + features &= ~(SUPPORTED_1000baseT_Half | + SUPPORTED_1000baseT_Full); + phydev->advertising = phydev->supported = features; + + /* disable speed 1000 in Basic Control Register */ + bmcr = phy_read(phydev, MDIO_DEVAD_NONE, MII_BMCR); + bmcr &= ~(1 << 6); + phy_write(phydev, MDIO_DEVAD_NONE, MII_BMCR, bmcr); + + /* disable speed 1000 in 1000Base-T Control Register */ + phy_write(phydev, MDIO_DEVAD_NONE, MII_CTRL1000, 0); + + /* start autoneg */ + genphy_config_aneg(phydev); + genphy_restart_aneg(phydev); + + return 0; + } + + return genphy_config(phydev); +} + +static struct phy_driver ksz9131_driver = { + .name = "Micrel ksz9031", + .uid = PHY_ID_KSZ9131, + .mask = MII_KSZ9x31_SILICON_REV_MASK, + .features = PHY_GBIT_FEATURES, + .config = &ksz9131_config, + .startup = &ksz90xx_startup, + .shutdown = &genphy_shutdown, + .writeext = &ksz9031_phy_extwrite, + .readext = &ksz9031_phy_extread, +}; + +int ksz9xx1_phy_get_id(struct phy_device *phydev) +{ + unsigned int phyid; + + get_phy_id(phydev->bus, phydev->addr, MDIO_DEVAD_NONE, &phyid); + + return phyid; +} + int phy_micrel_ksz90x1_init(void) { phy_register(&ksz9021_driver); phy_register(&ksz9031_driver); + phy_register(&ksz9131_driver); return 0; } |