[U-Boot] [PATCH v2 04/10] arm: ls102xa: Add etsec support for LS102xA

York Sun yorksun at freescale.com
Thu Aug 7 00:12:44 CEST 2014


On 07/03/2014 12:24 AM, Alison Wang wrote:

Missing commit message here.

> Signed-off-by: Alison Wang <alison.wang at freescale.com>
> ---
> Change log:
>  v2: Add private mdio read and write support. 
> 
>  drivers/net/fsl_mdio.c | 24 +++++++++++++++++++-----
>  drivers/net/tsec.c     |  7 +++++++
>  include/fsl_mdio.h     |  3 +++
>  include/tsec.h         |  7 ++++++-
>  4 files changed, 35 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/net/fsl_mdio.c b/drivers/net/fsl_mdio.c
> index 8d09f5d..3081228 100644
> --- a/drivers/net/fsl_mdio.c
> +++ b/drivers/net/fsl_mdio.c
> @@ -12,6 +12,15 @@
>  #include <asm/io.h>
>  #include <asm/errno.h>
>  
> +void tsec_mdio_sync(void)
> +{
> +#if defined(CONFIG_PPC)
> +	asm("sync");
> +#elif defined(CONFIG_ARM)
> +	asm("dsb");
> +#endif
> +}
> +
>  void tsec_local_mdio_write(struct tsec_mii_mng __iomem *phyregs, int port_addr,
>  		int dev_addr, int regnum, int value)
>  {
> @@ -19,7 +28,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");
> +	tsec_mdio_sync();
>  

Don't reinvent the wheel. You can use mb() where you use tsec_mdio_sync();

York



More information about the U-Boot mailing list