summaryrefslogtreecommitdiff
path: root/drivers/net/fsl_mdio.c
diff options
context:
space:
mode:
authorTom Rini <trini@ti.com>2014-09-09 20:01:59 -0400
committerTom Rini <trini@ti.com>2014-09-09 20:01:59 -0400
commit8c9c74e4c69b43cd50a1f04b34cfc141ed21654c (patch)
tree180763abe35a9465d2dc4d46202ac604e7b7baac /drivers/net/fsl_mdio.c
parent0b703dbcee7103f07804d0a4328d1593355c4324 (diff)
parentb4ecc8c6f8c85d25f72933af23531728069a5b0f (diff)
Merge branch 'master' of git://git.denx.de/u-boot-fsl-qoriq
Diffstat (limited to 'drivers/net/fsl_mdio.c')
-rw-r--r--drivers/net/fsl_mdio.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/net/fsl_mdio.c b/drivers/net/fsl_mdio.c
index 1d88e6504bc..d6b181b3860 100644
--- a/drivers/net/fsl_mdio.c
+++ b/drivers/net/fsl_mdio.c
@@ -11,7 +11,6 @@
#include <fsl_mdio.h>
#include <asm/io.h>
#include <asm/errno.h>
-#include <asm/fsl_enet.h>
void tsec_local_mdio_write(struct tsec_mii_mng __iomem *phyregs, int port_addr,
int dev_addr, int regnum, int value)
@@ -20,7 +19,8 @@ void tsec_local_mdio_write(struct tsec_mii_mng __iomem *phyregs, int port_addr,
out_be32(&phyregs->miimadd, (port_addr << 8) | (regnum & 0x1f));
out_be32(&phyregs->miimcon, value);
- asm("sync");
+ /* Memory barrier */
+ mb();
while ((in_be32(&phyregs->miimind) & MIIMIND_BUSY) && timeout--)
;
@@ -38,11 +38,13 @@ int tsec_local_mdio_read(struct tsec_mii_mng __iomem *phyregs, int port_addr,
/* Clear the command register, and wait */
out_be32(&phyregs->miimcom, 0);
- asm("sync");
+ /* Memory barrier */
+ mb();
/* Initiate a read command, and wait */
out_be32(&phyregs->miimcom, MIIMCOM_READ_CYCLE);
- asm("sync");
+ /* Memory barrier */
+ mb();
/* Wait for the the indication that the read is done */
while ((in_be32(&phyregs->miimind) & (MIIMIND_NOTVALID | MIIMIND_BUSY))