diff options
author | Markus Koch <markus@notsyncing.net> | 2022-01-11 21:22:54 +0300 |
---|---|---|
committer | Ramon Fried <ramon@neureality.ai> | 2022-01-15 19:53:16 +0300 |
commit | eab18b3b06bd914f623c3e8e9d2a905b8cea7366 (patch) | |
tree | 6744f462766d64a8e15e73464699831d1949bdbe /drivers/net | |
parent | 766ba7837506a4414ce71f84ee8fd2584f45bc06 (diff) | |
download | u-boot-eab18b3b06bd914f623c3e8e9d2a905b8cea7366.tar.xz |
net: fsl: Fix busy flag polling register
NXP's mEMAC reference manual, Chapter 6.5.5 "MDIO Ethernet Management
Interface usage", specifies to poll the BSY (0) bit in the CFG/STAT
register to wait until a transaction has finished, not bit 31 in the
data register.
In the Linux kernel, this has already been fixed in commit 26eee0210ad7
("net/fsl: fix a bug in xgmac_mdio").
This patch changes the register in the fman_mdio and fsl_ls_mdio
drivers.
As the MDIO_DATA_BSY define is no longer in use, this patch also removes
its definition from the fsl_memac header.
Signed-off-by: Markus Koch <markus@notsyncing.net>
Reviewed-by: Camelia Groza <camelia.groza@nxp.com>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/fm/memac_phy.c | 2 | ||||
-rw-r--r-- | drivers/net/fsl_ls_mdio.c | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/drivers/net/fm/memac_phy.c b/drivers/net/fm/memac_phy.c index 72b500a6d1..3ddae97e09 100644 --- a/drivers/net/fm/memac_phy.c +++ b/drivers/net/fm/memac_phy.c @@ -64,7 +64,7 @@ static int memac_wait_until_done(struct memac_mdio_controller *regs) { unsigned int timeout = MAX_NUM_RETRIES; - while ((memac_in_32(®s->mdio_data) & MDIO_DATA_BSY) && timeout--) + while ((memac_in_32(®s->mdio_stat) & MDIO_STAT_BSY) && timeout--) ; if (!timeout) { diff --git a/drivers/net/fsl_ls_mdio.c b/drivers/net/fsl_ls_mdio.c index 6d4e682fdf..f213e0dd85 100644 --- a/drivers/net/fsl_ls_mdio.c +++ b/drivers/net/fsl_ls_mdio.c @@ -84,7 +84,7 @@ static int dm_fsl_ls_mdio_read(struct udevice *dev, int addr, memac_out_32(®s->mdio_ctl, mdio_ctl); /* Wait till the MDIO write is complete */ - while ((memac_in_32(®s->mdio_data)) & MDIO_DATA_BSY) + while ((memac_in_32(®s->mdio_stat)) & MDIO_STAT_BSY) ; /* Return all Fs if nothing was there */ @@ -107,7 +107,7 @@ static int dm_fsl_ls_mdio_write(struct udevice *dev, int addr, int devad, memac_out_32(®s->mdio_data, MDIO_DATA(val)); /* Wait till the MDIO write is complete */ - while ((memac_in_32(®s->mdio_data)) & MDIO_DATA_BSY) + while ((memac_in_32(®s->mdio_stat)) & MDIO_STAT_BSY) ; return 0; |