diff options
author | Eric Sun <jian.sun@freescale.com> | 2012-02-20 15:24:44 +0800 |
---|---|---|
committer | Lily Zhang <r58066@freescale.com> | 2012-02-27 13:01:09 +0800 |
commit | 39320e8b20031f7a5f670cf5bd8eeb1a0954eb98 (patch) | |
tree | c0c7aaffd5415c67e63d0e757817aa27763fdced /include | |
parent | 1f94eca51ded562db2aae2d1d75e3c7a2a1ba71c (diff) | |
download | u-boot-imx-39320e8b20031f7a5f670cf5bd8eeb1a0954eb98.zip u-boot-imx-39320e8b20031f7a5f670cf5bd8eeb1a0954eb98.tar.gz u-boot-imx-39320e8b20031f7a5f670cf5bd8eeb1a0954eb98.tar.bz2 |
ENGR00174841 [U-Boot]Add a command to erase any pre-saved environment
A "destroyenv" command is provided to erase any pre-save environment in the
boot storage. The command simply add 1 to the CRC section and write it back
to the storage. Per the logic of U-Boot, this means after a reset, the
software will recognize the stored environment settings as "damaged" and turn
to use the default one, which is defined in "default_environment"
With this command, platform bring up owner can maintain a "ready-to-use"
environment settings in software which others can use very conviniently.
U-boot users can also use it to do a environment restore if they want.
-----------------------------------
Usage Example:
> destroyenv
invalidate the CRC
write invalidate enviroment data to storage
Erasing SPI flash...Erasing SPI NOR flash 0xc0000 [0x2000 bytes]
..SUCCESS
Writing to SPI flash...Writing SPI NOR flash
0xc0000 [0x2000 bytes] <- ram 0x276009b8
SUCCESS
done
>
-----------------------------------
Signed-off-by: Eric Sun <jian.sun@freescale.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/configs/mx6q_sabrelite.h | 62 | ||||
-rw-r--r-- | include/environment.h | 4 |
2 files changed, 38 insertions, 28 deletions
diff --git a/include/configs/mx6q_sabrelite.h b/include/configs/mx6q_sabrelite.h index 362d1fe..7859a15 100644 --- a/include/configs/mx6q_sabrelite.h +++ b/include/configs/mx6q_sabrelite.h @@ -114,34 +114,37 @@ #define CONFIG_LOADADDR 0x10800000 /* loadaddr env var */ #define CONFIG_RD_LOADADDR 0x11000000 -#define CONFIG_EXTRA_ENV_SETTINGS \ - "netdev=eth0\0" \ - "ethprime=FEC0\0" \ - "uboot=u-boot.bin\0" \ - "kernel=uImage\0" \ - "nfsroot=/opt/eldk/arm\0" \ - "bootargs=console=ttymxc1,115200\0" \ - "bootargs_nfs=setenv bootargs ${bootargs} root=/dev/nfs "\ - "ip=dhcp nfsroot=${serverip}:${nfsroot},v3,tcp\0"\ - "bootcmd_net=run bootargs_nfs;" \ - "tftpboot ${loadaddr} ${kernel}; bootm\0" \ - "bootcmd_mmc= for disk in 0 1 ; do mmc dev ${disk} ;" \ - "for fs in fat ext2 ; do " \ +#define CONFIG_EXTRA_ENV_SETTINGS \ + "netdev=eth0\0" \ + "ethprime=FEC0\0" \ + "ethaddr=00:01:02:03:04:05\0" \ + "uboot=u-boot.bin\0" \ + "kernel=uImage\0" \ + "bootargs=console=ttymxc1,115200\0" \ + "bootargs_base=setenv bootargs console=ttymxc1,115200\0" \ + "bootargs_nfs=setenv bootargs ${bootargs} root=/dev/nfs " \ + "ip=dhcp nfsroot=${serverip}:${nfsroot},v3,tcp " \ + "video=mxcfb0:dev=ldb,LDB-XGA,if=RGB666 " \ + "enable_wait_mode=off\0" \ + "bootcmd_net=dhcp; run bootargs_base bootargs_nfs;bootm\0" \ + "bootargs_mmc=setenv bootargs ${bootargs} " \ + "root=/dev/mmcblk0p1 rootwait rw " \ + "video=mxcfb0:dev=ldb,LDB-XGA,if=RGB666 " \ + "video=mxcfb0:dev=hdmi,1920x1080M@60,if=RGB24\0" \ + "bootcmd_mmc=run bootargs_base bootargs_mmc;mmc dev 1;" \ + "mmc read ${loadaddr} 0x800 0x2000;bootm\0" \ + "bootcmd=run bootcmd_mmc\0" \ + "clearenv=sf probe 1 && sf erase 0xc0000 0x2000 && " \ + "echo restored environment to factory default\0" \ + "upgradeu=for disk in 0 1 ; do mmc dev ${disk} ;" \ + "for fs in fat ext2 ; do " \ "${fs}load mmc ${disk}:1 10008000 " \ - "/6q_bootscript && " \ - "source 10008000 ; " \ - "done ; " \ - "done\0" \ - "bootcmd=run bootcmd_mmc\0" \ - "clearenv=sf probe 1 && sf erase 0xc0000 0x2000 && " \ - "echo restored environment to factory default\0"\ - "upgradeu=for disk in 0 1 ; do mmc dev ${disk} ;" \ - "for fs in fat ext2 ; do " \ - "${fs}load mmc ${disk}:1 10008000 " \ - "/6q_upgrade && " \ - "source 10008000 ; " \ - "done ; " \ - "done\0" \ + "/6q_upgrade && " \ + "source 10008000 ; " \ + "done ; " \ + "done\0" \ + "bootfile=_BOOT_FILE_PATH_IN_TFTP_\0" \ + "nfsroot=_ROOTFS_PATH_IN_NFS_\0" #define CONFIG_ARP_TIMEOUT 200UL @@ -186,7 +189,10 @@ #define CONFIG_CMD_DHCP #define CONFIG_CMD_PING #define CONFIG_IPADDR 192.168.1.103 -#define CONFIG_SERVERIP 192.168.1.101 + +/*The IP ADDRESS of SERVERIP*/ +#define CONFIG_SERVERIP _SERVER_IP_ADDR_ + #define CONFIG_NETMASK 255.255.255.0 /* diff --git a/include/environment.h b/include/environment.h index e0759ae..1ab9312 100644 --- a/include/environment.h +++ b/include/environment.h @@ -2,6 +2,8 @@ * (C) Copyright 2002 * Wolfgang Denk, DENX Software Engineering, wd@denx.de. * + * Copyright (C) 2012 Freescale Semiconductor, Inc. + * * See file CREDITS for list of people who contributed to this * project. * @@ -147,6 +149,8 @@ unsigned char env_get_char_memory (int index); /* Function that updates CRC of the enironment */ void env_crc_update (void); +/* Function that destroys CRC of the environment */ +void env_crc_destroy(void); /* [re]set to the default environment */ void set_default_env(void); |