Patchwork [U-Boot,v3,3/6] net: fec_mxc: Add support for Vybrid MVF600

login
register
mail settings
Submitter Alison Wang
Date May 21, 2013, 9:02 a.m.
Message ID <1369126981-13970-4-git-send-email-b18965@freescale.com>
Download mbox | patch
Permalink /patch/245239/
State Changes Requested
Delegated to: Albert ARIBAUD
Headers show

Comments

Alison Wang - May 21, 2013, 9:02 a.m.
This patch adds FEC support for Vybrid MVF600 platform.

In function fec_open(), RCR register is only set as RGMII mode. But RCR
register should be set as RMII mode for MVF600 platform.
This configuration is already done in fec_reg_setup(), so this piece of
code could just leave untouched the FEC_RCNTRL_RGMII / FEC_RCNTRL_RMII /
FEC_RCNTRL_MII_MODE bits.

Signed-off-by: Alison Wang <b18965@freescale.com>
---
Changes in v3:
- Remove the changes for FEC_RCNTRL_RGMII / FEC_RCNTRL_RMII / FEC_RCNTRL_MII_MODE bits, as they are already set in fec_reg_setup() 

Changes in v2:
- Use common FEC driver fec_mxc.c

 drivers/net/fec_mxc.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
Benoît Thébaudeau - May 21, 2013, 5:15 p.m.
Hi Alison,

On Tuesday, May 21, 2013 11:02:58 AM, Alison Wang wrote:
> This patch adds FEC support for Vybrid MVF600 platform.
> 
> In function fec_open(), RCR register is only set as RGMII mode. But RCR
> register should be set as RMII mode for MVF600 platform.
> This configuration is already done in fec_reg_setup(), so this piece of
> code could just leave untouched the FEC_RCNTRL_RGMII / FEC_RCNTRL_RMII /
> FEC_RCNTRL_MII_MODE bits.
> 
> Signed-off-by: Alison Wang <b18965@freescale.com>
> ---
> Changes in v3:
> - Remove the changes for FEC_RCNTRL_RGMII / FEC_RCNTRL_RMII /
> FEC_RCNTRL_MII_MODE bits, as they are already set in fec_reg_setup()
> 
> Changes in v2:
> - Use common FEC driver fec_mxc.c
> 
>  drivers/net/fec_mxc.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/drivers/net/fec_mxc.c b/drivers/net/fec_mxc.c
> index 4dbcdca..da95e28 100644
> --- a/drivers/net/fec_mxc.c
> +++ b/drivers/net/fec_mxc.c
> @@ -516,9 +516,7 @@ static int fec_open(struct eth_device *edev)
>  #ifdef FEC_QUIRK_ENET_MAC
>  	{
>  		u32 ecr = readl(&fec->eth->ecntrl) & ~FEC_ECNTRL_SPEED;
> -		u32 rcr = (readl(&fec->eth->r_cntrl) &
> -				~(FEC_RCNTRL_RMII | FEC_RCNTRL_RMII_10T)) |
> -				FEC_RCNTRL_RGMII | FEC_RCNTRL_MII_MODE;
> +		u32 rcr = readl(&fec->eth->r_cntrl) & ~FEC_RCNTRL_RMII_10T;
>  		if (speed == _1000BASET)
>  			ecr |= FEC_ECNTRL_SPEED;
>  		else if (speed != _100BASET)

Reviewed-by: Benoît Thébaudeau <benoit.thebaudeau@advansee.com>

Best regards,
Benoît

Patch

diff --git a/drivers/net/fec_mxc.c b/drivers/net/fec_mxc.c
index 4dbcdca..da95e28 100644
--- a/drivers/net/fec_mxc.c
+++ b/drivers/net/fec_mxc.c
@@ -516,9 +516,7 @@  static int fec_open(struct eth_device *edev)
 #ifdef FEC_QUIRK_ENET_MAC
 	{
 		u32 ecr = readl(&fec->eth->ecntrl) & ~FEC_ECNTRL_SPEED;
-		u32 rcr = (readl(&fec->eth->r_cntrl) &
-				~(FEC_RCNTRL_RMII | FEC_RCNTRL_RMII_10T)) |
-				FEC_RCNTRL_RGMII | FEC_RCNTRL_MII_MODE;
+		u32 rcr = readl(&fec->eth->r_cntrl) & ~FEC_RCNTRL_RMII_10T;
 		if (speed == _1000BASET)
 			ecr |= FEC_ECNTRL_SPEED;
 		else if (speed != _100BASET)