From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alison Wang Date: Tue, 19 Aug 2014 10:54:53 +0800 Subject: [U-Boot] [PATCH v5 04/16] net: mdio: Use mb() to be compatible for both ARM and PowerPC In-Reply-To: <1408416905-19771-1-git-send-email-b18965@freescale.com> References: <1408416905-19771-1-git-send-email-b18965@freescale.com> Message-ID: <1408416905-19771-5-git-send-email-b18965@freescale.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Use mb() instead of sync assembly instruction to be compatible for both ARM and PowerPC. Signed-off-by: Alison Wang --- Change log: v5: No change. v4: No change. v3: Use mb() to be compatible for both ARM and PowerPC. Split from the 0004-arm-ls102xa-Add-etsec-support-for-LS102xA patch. v2: Add private mdio read and write support. drivers/net/fsl_mdio.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/net/fsl_mdio.c b/drivers/net/fsl_mdio.c index 8d09f5d..69ffd63 100644 --- a/drivers/net/fsl_mdio.c +++ b/drivers/net/fsl_mdio.c @@ -19,7 +19,7 @@ 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"); + mb(); while ((in_be32(&phyregs->miimind) & MIIMIND_BUSY) && timeout--) ; @@ -37,11 +37,11 @@ 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"); + mb(); /* Initiate a read command, and wait */ out_be32(&phyregs->miimcom, MIIMCOM_READ_CYCLE); - asm("sync"); + mb(); /* Wait for the the indication that the read is done */ while ((in_be32(&phyregs->miimind) & (MIIMIND_NOTVALID | MIIMIND_BUSY)) -- 1.8.0