diff mbox

[U-Boot,v4,04/18] net: mdio: Add private MDIO read/write function

Message ID 1407998707-9632-5-git-send-email-b18965@freescale.com
State Superseded
Headers show

Commit Message

Alison Wang Aug. 14, 2014, 6:44 a.m. UTC
As extra FPGA settings is needed for MDIO read/write
on LS1021AQDS, private MDIO read/write functions are
created.

Signed-off-by: Alison Wang <alison.wang@freescale.com>
---
Change log:
 v4: No change.
 v3: 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 | 9 +++++++--
 include/fsl_mdio.h     | 4 ++++
 2 files changed, 11 insertions(+), 2 deletions(-)

Comments

York Sun Aug. 14, 2014, 4:57 p.m. UTC | #1
On 08/13/2014 11:44 PM, Alison Wang wrote:
> As extra FPGA settings is needed for MDIO read/write
> on LS1021AQDS, private MDIO read/write functions are
> created.
> 
> Signed-off-by: Alison Wang <alison.wang@freescale.com>
> ---
> Change log:
>  v4: No change.
>  v3: 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 | 9 +++++++--
>  include/fsl_mdio.h     | 4 ++++
>  2 files changed, 11 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/fsl_mdio.c b/drivers/net/fsl_mdio.c
> index 8d09f5d..6eae78f 100644
> --- a/drivers/net/fsl_mdio.c
> +++ b/drivers/net/fsl_mdio.c
> @@ -98,8 +98,13 @@ int fsl_pq_mdio_init(bd_t *bis, struct fsl_pq_mdio_info *info)
>  		return -1;
>  	}
>  
> -	bus->read = tsec_phy_read;
> -	bus->write = tsec_phy_write;
> +	if (info->priv_mdio_read) {
> +		bus->read = info->priv_mdio_read;
> +		bus->write = info->priv_mdio_write;
> +	} else {
> +		bus->read = tsec_phy_read;
> +		bus->write = tsec_phy_write;
> +	}
>  	bus->reset = fsl_pq_mdio_reset;
>  	sprintf(bus->name, info->name);
>  
> diff --git a/include/fsl_mdio.h b/include/fsl_mdio.h
> index a531edf..633123c 100644
> --- a/include/fsl_mdio.h
> +++ b/include/fsl_mdio.h
> @@ -57,6 +57,10 @@ int memac_mdio_read(struct mii_dev *bus, int port_addr, int dev_addr,
>  struct fsl_pq_mdio_info {
>  	struct tsec_mii_mng __iomem *regs;
>  	char *name;
> +	int (*priv_mdio_read)(struct mii_dev *bus, int addr,
> +			      int devad, int reg);
> +	int (*priv_mdio_write)(struct mii_dev *bus, int addr, int devad,
> +			       int reg, u16 val);
>  };
>  int fsl_pq_mdio_init(bd_t *bis, struct fsl_pq_mdio_info *info);
>  
> 

Alison,

Please check if Shaohui's comment on your v3 patch is valid. He suggested you
don't need to add a new private functions.

York
alison wang Aug. 15, 2014, 2:29 p.m. UTC | #2
On 08/13/2014 11:44 PM, Alison Wang wrote:

> As extra FPGA settings is needed for MDIO read/write 
> on LS1021AQDS, private MDIO read/write functions are 
> created. 
> 
> Signed-off-by: Alison Wang <[hidden email]> 
> --- 
> Change log: 
>  v4: No change. 
>  v3: 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 | 9 +++++++-- 
>  include/fsl_mdio.h     | 4 ++++ 
>  2 files changed, 11 insertions(+), 2 deletions(-) 
> 
> diff --git a/drivers/net/fsl_mdio.c b/drivers/net/fsl_mdio.c 
> index 8d09f5d..6eae78f 100644 
> --- a/drivers/net/fsl_mdio.c 
> +++ b/drivers/net/fsl_mdio.c 
> @@ -98,8 +98,13 @@ int fsl_pq_mdio_init(bd_t *bis, struct fsl_pq_mdio_info
> *info) 
>  	return -1; 
>  	} 
>   
> -	bus->read = tsec_phy_read; 
> -	bus->write = tsec_phy_write; 
> +	if (info->priv_mdio_read) { 
> +	bus->read = info->priv_mdio_read; 
> +	bus->write = info->priv_mdio_write; 
> +	} else { 
> +	bus->read = tsec_phy_read; 
> +	bus->write = tsec_phy_write; 
> +	} 
>  	bus->reset = fsl_pq_mdio_reset; 
>  	sprintf(bus->name, info->name); 
>   
> diff --git a/include/fsl_mdio.h b/include/fsl_mdio.h 
> index a531edf..633123c 100644 
> --- a/include/fsl_mdio.h 
> +++ b/include/fsl_mdio.h 
> @@ -57,6 +57,10 @@ int memac_mdio_read(struct mii_dev *bus, int port_addr,
> int dev_addr, 
>  struct fsl_pq_mdio_info { 
>  	struct tsec_mii_mng __iomem *regs; 
>  	char *name; 
> +	int (*priv_mdio_read)(struct mii_dev *bus, int addr, 
> +	     int devad, int reg); 
> +	int (*priv_mdio_write)(struct mii_dev *bus, int addr, int devad, 
> +	      int reg, u16 val); 
>  }; 
>  int fsl_pq_mdio_init(bd_t *bis, struct fsl_pq_mdio_info *info); 
>   
>

Alison, 

Please check if Shaohui's comment on your v3 patch is valid. He suggested
you 
don't need to add a new private functions. 

[Alison Wang] His comment is valid. I will change in v5.

Best Regards,
Alison Wang



--
View this message in context: http://u-boot.10912.n7.nabble.com/PATCH-v4-0-18-arm-ls102xa-Add-Freescale-LS102xA-SoC-and-LS1021AQDS-TWR-board-support-tp186703p186808.html
Sent from the U-Boot mailing list archive at Nabble.com.
diff mbox

Patch

diff --git a/drivers/net/fsl_mdio.c b/drivers/net/fsl_mdio.c
index 8d09f5d..6eae78f 100644
--- a/drivers/net/fsl_mdio.c
+++ b/drivers/net/fsl_mdio.c
@@ -98,8 +98,13 @@  int fsl_pq_mdio_init(bd_t *bis, struct fsl_pq_mdio_info *info)
 		return -1;
 	}
 
-	bus->read = tsec_phy_read;
-	bus->write = tsec_phy_write;
+	if (info->priv_mdio_read) {
+		bus->read = info->priv_mdio_read;
+		bus->write = info->priv_mdio_write;
+	} else {
+		bus->read = tsec_phy_read;
+		bus->write = tsec_phy_write;
+	}
 	bus->reset = fsl_pq_mdio_reset;
 	sprintf(bus->name, info->name);
 
diff --git a/include/fsl_mdio.h b/include/fsl_mdio.h
index a531edf..633123c 100644
--- a/include/fsl_mdio.h
+++ b/include/fsl_mdio.h
@@ -57,6 +57,10 @@  int memac_mdio_read(struct mii_dev *bus, int port_addr, int dev_addr,
 struct fsl_pq_mdio_info {
 	struct tsec_mii_mng __iomem *regs;
 	char *name;
+	int (*priv_mdio_read)(struct mii_dev *bus, int addr,
+			      int devad, int reg);
+	int (*priv_mdio_write)(struct mii_dev *bus, int addr, int devad,
+			       int reg, u16 val);
 };
 int fsl_pq_mdio_init(bd_t *bis, struct fsl_pq_mdio_info *info);