Patchwork [U-Boot,05/11] FEC: Allow selection of MII mode via CONFIG_FEC_XCV_TYPE

login
register
mail settings
Submitter Marek Vasut
Date Sept. 8, 2011, 8:37 p.m.
Message ID <1315514242-18998-6-git-send-email-marek.vasut@gmail.com>
Download mbox | patch
Permalink /patch/113940/
State Accepted
Commit 392b850233b7743af9711d576c22564fe5a1d0c3
Headers show

Comments

Marek Vasut - Sept. 8, 2011, 8:37 p.m.
The default is MII100, which was hardcoded previously in the driver.

Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
Cc: Ben Warren <biggerbadderben@gmail.com>
Cc: Stefano Babic <sbabic@denx.de>
Cc: Wolfgang Denk <wd@denx.de>
Cc: Detlev Zundel <dzu@denx.de>
---
 drivers/net/fec_mxc.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
Mike Frysinger - Sept. 9, 2011, 12:48 a.m.
On Thursday, September 08, 2011 16:37:16 Marek Vasut wrote:
> --- a/drivers/net/fec_mxc.c
> +++ b/drivers/net/fec_mxc.c
> @@ -38,6 +38,10 @@ DECLARE_GLOBAL_DATA_PTR;
>  #error "CONFIG_MII has to be defined!"
>  #endif
> 
> +#ifndef	CONFIG_FEC_XCV_TYPE
> +#define	CONFIG_FEC_XCV_TYPE	MII100
> +#endif
> +
>  #undef DEBUG
> 
>  struct nbuf {
> @@ -711,7 +715,7 @@ static int fec_probe(bd_t *bd)
>  	fec->eth = (struct ethernet_regs *)IMX_FEC_BASE;
>  	fec->bd = bd;
> 
> -	fec->xcv_type = MII100;
> +	fec->xcv_type = CONFIG_FEC_XCV_TYPE;

shouldnt this be a parameter to fec_probe() ?
-mike
Marek Vasut - Sept. 9, 2011, 9:13 a.m.
On Friday, September 09, 2011 02:48:46 AM Mike Frysinger wrote:
> On Thursday, September 08, 2011 16:37:16 Marek Vasut wrote:
> > --- a/drivers/net/fec_mxc.c
> > +++ b/drivers/net/fec_mxc.c
> > @@ -38,6 +38,10 @@ DECLARE_GLOBAL_DATA_PTR;
> > 
> >  #error "CONFIG_MII has to be defined!"
> >  #endif
> > 
> > +#ifndef	CONFIG_FEC_XCV_TYPE
> > +#define	CONFIG_FEC_XCV_TYPE	MII100
> > +#endif
> > +
> > 
> >  #undef DEBUG
> >  
> >  struct nbuf {
> > 
> > @@ -711,7 +715,7 @@ static int fec_probe(bd_t *bd)
> > 
> >  	fec->eth = (struct ethernet_regs *)IMX_FEC_BASE;
> >  	fec->bd = bd;
> > 
> > -	fec->xcv_type = MII100;
> > +	fec->xcv_type = CONFIG_FEC_XCV_TYPE;
> 
> shouldnt this be a parameter to fec_probe() ?
> -mike

We plan to add a driver model eventually. Until then, let's not polute this more 
than necessary.

Patch

diff --git a/drivers/net/fec_mxc.c b/drivers/net/fec_mxc.c
index 2b269d6..d75f40c 100644
--- a/drivers/net/fec_mxc.c
+++ b/drivers/net/fec_mxc.c
@@ -38,6 +38,10 @@  DECLARE_GLOBAL_DATA_PTR;
 #error "CONFIG_MII has to be defined!"
 #endif
 
+#ifndef	CONFIG_FEC_XCV_TYPE
+#define	CONFIG_FEC_XCV_TYPE	MII100
+#endif
+
 #undef DEBUG
 
 struct nbuf {
@@ -711,7 +715,7 @@  static int fec_probe(bd_t *bd)
 	fec->eth = (struct ethernet_regs *)IMX_FEC_BASE;
 	fec->bd = bd;
 
-	fec->xcv_type = MII100;
+	fec->xcv_type = CONFIG_FEC_XCV_TYPE;
 
 	/* Reset chip. */
 	writel(readl(&fec->eth->ecntrl) | FEC_ECNTRL_RESET, &fec->eth->ecntrl);