[U-Boot] [PATCH v3] powerpc/p1022ds: Add sdcard and spi boot support to P1022DS

Eibach, Dirk Eibach at gdsys.de
Mon May 7 13:13:50 CEST 2012


 

> > @@ -403,11 +422,38 @@
> >  /*
> >   * Environment
> >   */
> > -#define CONFIG_ENV_IS_IN_FLASH
> > -#define CONFIG_ENV_OVERWRITE
> > -#define CONFIG_ENV_ADDR		
> (CONFIG_SYS_MONITOR_BASE - CONFIG_ENV_SECT_SIZE)
> > -#define CONFIG_ENV_SIZE		0x2000
> > -#define CONFIG_ENV_SECT_SIZE	0x20000
> > +#if defined(CONFIG_SYS_RAMBOOT)
> > +#if defined(CONFIG_RAMBOOT_NAND)
> > +#define CONFIG_ENV_IS_IN_NAND	1
> > +#define CONFIG_ENV_SIZE		CONFIG_SYS_NAND_BLOCK_SIZE
> > +#define CONFIG_ENV_OFFSET ((512 * 1024) + 
> CONFIG_SYS_NAND_BLOCK_SIZE)
> > +#define CONFIG_ENV_RANGE	(3 * CONFIG_ENV_SIZE)
> > +#elif defined(CONFIG_RAMBOOT_SPIFLASH) #define 
> > +CONFIG_ENV_IS_IN_SPI_FLASH
> > +#define CONFIG_ENV_SPI_BUS	0
> > +#define CONFIG_ENV_SPI_CS	0
> > +#define CONFIG_ENV_SPI_MAX_HZ	10000000
> > +#define CONFIG_ENV_SPI_MODE	0
> > +#define CONFIG_ENV_SIZE		0x2000	/* 8KB */
> > +#define CONFIG_ENV_OFFSET	0x100000
> > +#define CONFIG_ENV_SECT_SIZE	0x10000
> > +#elif defined(CONFIG_RAMBOOT_SDCARD)
> > +#define CONFIG_ENV_IS_IN_MMC
> > +#define CONFIG_FSL_FIXED_MMC_LOCATION
> > +#define CONFIG_ENV_SIZE			0x2000
> > +#define CONFIG_SYS_MMC_ENV_DEV		0
> > +#else
> > +	#define CONFIG_ENV_IS_NOWHERE	1	/* Store ENV in 
> memory only */
> > +	#define CONFIG_ENV_ADDR		
> (CONFIG_SYS_MONITOR_BASE - 0x1000)
> > +	#define CONFIG_ENV_SIZE		0x2000
> 
> Shouldn't this be
> 
> #define CONFIG_ENV_ADDR	(CONFIG_SYS_MONITOR_BASE - 
> CONFIG_ENV_SIZE)
> 
> Otherwise, the environment won't fit?

Probably you are right. Though these lines are inspired by other
Freescale boards.
git grep -3 "CONFIG_SYS_MONITOR_BASE - 0x1000" include/configs
gives lots of examples where it is set up this way and probably needs
fixing.
Maybe it was originally copied from one of the places where
CONFIG_ENV_SIZE is 0x200 and the 0x1000 value was not adjusted.

I will fix it for P1022DS in the v4 patch.

Cheers
Dirk




More information about the U-Boot mailing list