[U-Boot] [PATCH v2 3/6] arm: mvf600: Add FEC support for Vybrid MVF600
Benoît Thébaudeau
benoit.thebaudeau at advansee.com
Wed May 15 16:19:30 CEST 2013
Hi Stefano, Alison,
On Wednesday, May 15, 2013 10:15:35 AM, Stefano Babic wrote:
> On 14/05/2013 11:51, Alison Wang wrote:
> > This patch adds FEC support for Vybrid MVF600 platform.
> > Add code to use RMII for MVF600.
> >
> > Signed-off-by: Alison Wang <b18965 at freescale.com>
> > ---
> > Changes in v2:
> > - Use common FEC driver fec_mxc.c
> >
> > drivers/net/fec_mxc.c | 6 +++++-
> > 1 file changed, 5 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/net/fec_mxc.c b/drivers/net/fec_mxc.c
> > index 4dbcdca..21e58f4 100644
> > --- a/drivers/net/fec_mxc.c
> > +++ b/drivers/net/fec_mxc.c
> > @@ -518,7 +518,11 @@ static int fec_open(struct eth_device *edev)
> > 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;
> > + FEC_RCNTRL_MII_MODE;
> > + if (fec->xcv_type == RGMII)
> > + rcr |= FEC_RCNTRL_RGMII;
> > + else if (fec->xcv_type == RMII)
> > + rcr |= FEC_RCNTRL_RMII;
> > if (speed == _1000BASET)
> > ecr |= FEC_ECNTRL_SPEED;
> > else if (speed != _100BASET)
> >
>
> This can generally be applied, it is not only related to the new SOC.
>
> Acked-by: Stefano Babic <sbabic at denx.de>
This is already done in fec_reg_setup(), so the piece of code above could
perhaps just leave untouched the FEC_RCNTRL_RGMII / FEC_RCNTRL_RMII /
FEC_RCNTRL_MII_MODE bits, i.e.:
---
#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)
---
Best regards,
Benoît
More information about the U-Boot
mailing list