[U-Boot] smc911x runtime detection (was: TI: OMAP3: Overo Tobi ethernet support)

Mike Frysinger vapier at gentoo.org
Sat Sep 26 13:21:01 CEST 2009


On Saturday 26 September 2009 02:13:52 Dirk Behme wrote:
> Olof Johansson wrote:
> > Add setup for ethernet on Tobi, allowing kernel/ramdisk to be loaded
> > over tftp.
> >
> > Based on the omap3 evm code. I added a new highlevel define for Tobi
> > to avoid having it dependent on CMD_NET (which would seem backward in
> > this case).
> 
> First: This is only a request for comment for possible future
> improvement. It doesn't ask for any changes in this patch or is any
> nack. Now to the content ;)
> 
> It seems that Steve found a way for runtime detection of smc911x
> making CONFIG_OMAP3_OVERO_TOBI more or less obsolete (from [1]) :
> 
> -- cut --
> --- git/include/configs/omap3_overo.h-orig	2009-09-17
> 13:06:08.000000000 -0700
> +++ git/include/configs/omap3_overo.h	2009-09-17 13:06:49.000000000 -0700
> @@ -29,7 +29,7 @@
>   #define CONFIG_OMAP34XX		1	/* which is a 34XX */
>   #define CONFIG_OMAP3430		1	/* which is in a 3430 */
>   #define CONFIG_OMAP3_OVERO	1	/* working with overo */
> -//#define CONFIG_OMAP3_OVERO_TOBI	1	/* overo mounted on tobi */
> +#define CONFIG_OMAP3_OVERO_TOBI	1	/* overo mounted on tobi */
> 
>   #include <asm/arch/cpu.h>	/* get chip and board defs */
>   #include <asm/arch/omap3.h>
> --- git/drivers/net/smc911x.c-orig	2009-09-21 13:28:25.000000000 -0700
> +++ git/drivers/net/smc911x.c	2009-09-21 13:29:53.000000000 -0700
> @@ -253,6 +253,12 @@ int smc911x_initialize(u8 dev_num, int b
> 
>   	dev->iobase = base_addr;
> 
> +	/* test to see if chip is present (-1 if not) */
> +	if (smc911x_reg_read(dev, MAC_CSR_CMD) == -1) {
> +		free(dev);
> +		return 0;
> +	}

i dont think returning 0 is correct.  let the higher layers (i.e. your board) 
handle the error dynamically.
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
Url : http://lists.denx.de/pipermail/u-boot/attachments/20090926/f619c500/attachment.pgp 


More information about the U-Boot mailing list