Commit f89a8b6a7653e66f6685563fe8da1265338ea4a7

Authored by Stefano Babic
Committed by Albert ARIBAUD
1 parent aeadeaaf17

OMAP3: mcx: updated default environment

Patch drops also not used CFI setup in the
configuration file.

Signed-off-by: Stefano Babic <sbabic@denx.de>
CC: Tom Rini <trini@ti.com>

Showing 1 changed file with 91 additions and 37 deletions Side-by-side Diff

include/configs/mcx.h
... ... @@ -183,38 +183,95 @@
183 183  
184 184 #define CONFIG_BOOTFILE "uImage"
185 185  
  186 +#define xstr(s) str(s)
  187 +#define str(s) #s
  188 +
  189 +/* Setup MTD for NAND on the SOM */
  190 +#define MTDIDS_DEFAULT "nand0=omap2-nand.0"
  191 +#define MTDPARTS_DEFAULT "mtdparts=omap2-nand.0:512k(MLO)," \
  192 + "1m(u-boot),256k(env1)," \
  193 + "256k(env2),6m(kernel),6m(k_recovery)," \
  194 + "8m(fs_recovery),-(common_data)"
  195 +
  196 +#define CONFIG_HOSTNAME mcx
186 197 #define CONFIG_EXTRA_ENV_SETTINGS \
187   - "loadaddr=0x82000000\0" \
188   - "console=ttyO2,115200n8\0" \
189   - "mmcargs=setenv bootargs console=${console} " \
190   - "root=/dev/mmcblk0p2 rw " \
191   - "rootfstype=ext3 rootwait\0" \
192   - "nandargs=setenv bootargs console=${console} " \
193   - "root=/dev/mtdblock4 rw " \
194   - "rootfstype=jffs2\0" \
195   - "loadbootscript=fatload mmc 0 ${loadaddr} boot.scr\0" \
196   - "bootscript=echo Running bootscript from mmc ...; " \
197   - "source ${loadaddr}\0" \
198   - "loaduimage=fatload mmc 0 ${loadaddr} uImage\0" \
199   - "mmcboot=echo Booting from mmc ...; " \
200   - "run mmcargs; " \
201   - "bootm ${loadaddr}\0" \
202   - "nandboot=echo Booting from nand ...; " \
203   - "run nandargs; " \
204   - "nand read ${loadaddr} 280000 400000; " \
205   - "bootm ${loadaddr}\0" \
  198 + "adddbg=setenv bootargs ${bootargs} trace_buf_size=64M\0" \
  199 + "adddebug=setenv bootargs ${bootargs} earlyprintk=serial\0" \
  200 + "addeth=setenv bootargs ${bootargs} ethaddr=${ethaddr}\0" \
  201 + "addfb=setenv bootargs ${bootargs} vram=6M " \
  202 + "omapfb.vram=1:2M,2:2M,3:2M omapdss.def_disp=lcd\0" \
  203 + "addip_sta=setenv bootargs ${bootargs} " \
  204 + "ip=${ipaddr}:${serverip}:${gatewayip}:" \
  205 + "${netmask}:${hostname}:eth0:off\0" \
  206 + "addip_dyn=setenv bootargs ${bootargs} ip=dhcp\0" \
  207 + "addip=if test -n ${ipdyn};then run addip_dyn;" \
  208 + "else run addip_sta;fi\0" \
  209 + "addmisc=setenv bootargs ${bootargs} ${misc}\0" \
  210 + "addtty=setenv bootargs ${bootargs} " \
  211 + "console=${consoledev},${baudrate}\0" \
  212 + "addmtd=setenv bootargs ${bootargs} ${mtdparts}\0" \
  213 + "baudrate=115200\0" \
  214 + "consoledev=ttyO2\0" \
  215 + "hostname=" xstr(CONFIG_HOSTNAME) "\0" \
  216 + "loadaddr=0x82000000\0" \
  217 + "load=tftp ${loadaddr} ${u-boot}\0" \
  218 + "load_k=tftp ${loadaddr} ${bootfile}\0" \
  219 + "loaduimage=fatload mmc 0 ${loadaddr} uImage\0" \
  220 + "loadmlo=tftp ${loadaddr} ${mlo}\0" \
  221 + "mlo=" xstr(CONFIG_HOSTNAME) "/MLO\0" \
  222 + "mmcargs=root=/dev/mmcblk0p2 rw " \
  223 + "rootfstype=ext3 rootwait\0" \
  224 + "mmcboot=echo Booting from mmc ...; " \
  225 + "run mmcargs; " \
  226 + "run addip addtty addmtd addfb addeth addmisc;" \
  227 + "run loaduimage; " \
  228 + "bootm ${loadaddr}\0" \
  229 + "net_nfs=run load_k; " \
  230 + "run nfsargs; " \
  231 + "run addip addtty addmtd addfb addeth addmisc;" \
  232 + "bootm ${loadaddr}\0" \
  233 + "nfsargs=setenv bootargs root=/dev/nfs rw " \
  234 + "nfsroot=${serverip}:${rootpath}\0" \
  235 + "u-boot=" xstr(CONFIG_HOSTNAME) "/u-boot.img\0" \
  236 + "uboot_addr=0x80000\0" \
  237 + "update=nandecc sw;nand erase ${uboot_addr} 100000;" \
  238 + "nand write ${loadaddr} ${uboot_addr} 80000\0" \
  239 + "updatemlo=nandecc hw;nand erase 0 20000;" \
  240 + "nand write ${loadaddr} 0 20000\0" \
  241 + "upd=if run load;then echo Updating u-boot;if run update;" \
  242 + "then echo U-Boot updated;" \
  243 + "else echo Error updating u-boot !;" \
  244 + "echo Board without bootloader !!;" \
  245 + "fi;" \
  246 + "else echo U-Boot not downloaded..exiting;fi\0" \
  247 + "loadbootscript=fatload mmc 0 ${loadaddr} boot.scr\0" \
  248 + "bootscript=echo Running bootscript from mmc ...; " \
  249 + "source ${loadaddr}\0" \
  250 + "nandargs=setenv bootargs ubi.mtd=7 " \
  251 + "root=ubi0:rootfs rootfstype=ubifs\0" \
  252 + "nandboot=echo Booting from nand ...; " \
  253 + "run nandargs; " \
  254 + "ubi part nand0,4;" \
  255 + "ubi readvol ${loadaddr} kernel;" \
  256 + "run addip addtty addmtd addfb addeth addmisc;" \
  257 + "bootm ${loadaddr}\0" \
  258 + "swupdate_args=setenv bootargs ubi.mtd=6 root=ubi0:fs_recovery "\
  259 + "rootfstype=ubifs quiet loglevel=1 " \
  260 + "consoleblank=0 ${swupdate_misc}\0" \
  261 + "swupdate=echo Running Sw-Update...;" \
  262 + "if printenv mtdparts;then echo Starting SwUpdate...; " \
  263 + "else mtdparts default;fi; " \
  264 + "ubi part nand0,5;" \
  265 + "ubi readvol 0x82000000 kernel_recovery;" \
  266 + "run swupdate_args; " \
  267 + "setenv bootargs ${bootargs} " \
  268 + "${mtdparts} " \
  269 + "vram=6M omapfb.vram=1:2M,2:2M,3:2M " \
  270 + "omapdss.def_disp=lcd;" \
  271 + "bootm ${loadaddr}\0"
206 272  
207 273 #define CONFIG_BOOTCOMMAND \
208   - "if mmc init; then " \
209   - "if run loadbootscript; then " \
210   - "run bootscript; " \
211   - "else " \
212   - "if run loaduimage; then " \
213   - "run mmcboot; " \
214   - "else run nandboot; " \
215   - "fi; " \
216   - "fi; " \
217   - "else run nandboot; fi"
  274 + "run nandboot"
218 275  
219 276 #define CONFIG_AUTO_COMPLETE
220 277 #define CONFIG_CMDLINE_EDITING
221 278  
222 279  
... ... @@ -279,18 +336,15 @@
279 336 #define CONFIG_NAND_OMAP_GPMC
280 337 #define GPMC_NAND_ECC_LP_x16_LAYOUT
281 338 #define CONFIG_ENV_IS_IN_NAND
282   -#define SMNAND_ENV_OFFSET 0x260000 /* environment starts here */
  339 +#define SMNAND_ENV_OFFSET 0x180000 /* environment starts here */
283 340  
  341 +/* Redundant Environment */
284 342 #define CONFIG_SYS_ENV_SECT_SIZE (128 << 10) /* 128 KiB */
285 343 #define CONFIG_ENV_OFFSET SMNAND_ENV_OFFSET
286 344 #define CONFIG_ENV_ADDR SMNAND_ENV_OFFSET
287   -
288   -/*
289   - * CFI FLASH driver setup
290   - */
291   -/* timeout values are in ticks */
292   -#define CONFIG_SYS_FLASH_ERASE_TOUT (100 * CONFIG_SYS_HZ)
293   -#define CONFIG_SYS_FLASH_WRITE_TOUT (100 * CONFIG_SYS_HZ)
  345 +#define CONFIG_ENV_OFFSET_REDUND (CONFIG_ENV_OFFSET + \
  346 + 2 * CONFIG_SYS_ENV_SECT_SIZE)
  347 +#define CONFIG_ENV_SIZE_REDUND CONFIG_ENV_SIZE
294 348  
295 349 /* Flash banks JFFS2 should use */
296 350 #define CONFIG_SYS_MAX_MTD_BANKS (CONFIG_SYS_MAX_FLASH_BANKS + \