schmoogie: fix build error due to removal of forceenv()
authorWolfgang Denk <wd@denx.de>
Tue, 5 Oct 2010 19:17:28 +0000 (21:17 +0200)
committerWolfgang Denk <wd@denx.de>
Mon, 18 Oct 2010 19:46:37 +0000 (21:46 +0200)
commit 6d014adf dropped support for the forceenv() function, but failed
to remove references to it from board/davinci/schmoogie/schmoogie.c

Replace forceenv() by setenv() and set CONFIG_ENV_OVERWRITE instead in
the board config file to allow overwriting the serial number.

Signed-off-by: Wolfgang Denk <wd@denx.de>
Cc: Sergey Kubushyn <ksi@koi8.net>
Acked-by: Sergey Kubushyn <ksi@koi8.net>
board/davinci/schmoogie/schmoogie.c
include/configs/davinci_sonata.h

index 19c95809aa083d30f4ec73b548887c69cb4bc4ad..80a0f9fccc06b92c492d54483046abe7039c5292 100644 (file)
@@ -107,12 +107,12 @@ int misc_init_r(void)
        /* Set serial number from UID chip */
        if (i2c_read(CONFIG_SYS_UID_ADDR, 0, 1, buf, 8)) {
                printf("\nUID @ 0x%02x read FAILED!!!\n", CONFIG_SYS_UID_ADDR);
-               forceenv("serial#", "FAILED");
+               setenv("serial#", "FAILED");
        } else {
                if (buf[0] != 0x70) {
                        /* Device Family Code */
                        printf("\nUID @ 0x%02x read FAILED!!!\n", CONFIG_SYS_UID_ADDR);
-                       forceenv("serial#", "FAILED");
+                       setenv("serial#", "FAILED");
                }
        }
        /* Now check CRC */
@@ -122,12 +122,12 @@ int misc_init_r(void)
 
        if (tmp[0] != 0) {
                printf("\nUID @ 0x%02x - BAD CRC!!!\n", CONFIG_SYS_UID_ADDR);
-               forceenv("serial#", "FAILED");
+               setenv("serial#", "FAILED");
        } else {
                /* CRC OK, set "serial" env variable */
                sprintf((char *)&tmp[0], "%02x%02x%02x%02x%02x%02x",
                        buf[6], buf[5], buf[4], buf[3], buf[2], buf[1]);
-               forceenv("serial#", (char *)&tmp[0]);
+               setenv("serial#", (char *)&tmp[0]);
        }
 
        return(0);
index 4c0184415ffd4c588d321d9e3c9a639f053430a2..1746495e9a791478732369e8eb845f8f2d65ea24 100644 (file)
 #define CONFIG_SYS_NAND_CS             2
 #undef CONFIG_ENV_IS_IN_FLASH
 #define CONFIG_SYS_NO_FLASH
+#define CONFIG_ENV_OVERWRITE           /* instead if obsoleted forceenv() */
 #define CONFIG_ENV_IS_IN_NAND          /* U-Boot env in NAND Flash  */
 #define CONFIG_ENV_SECT_SIZE   512     /* Env sector Size */
 #define CONFIG_ENV_SIZE                (16 << 10)      /* 16 KiB */