]> git.sur5r.net Git - u-boot/commitdiff
85xx/kmp204x: read the IVM eeprom earlier
authorValentin Longchamp <valentin.longchamp@keymile.com>
Tue, 10 Feb 2015 16:10:15 +0000 (17:10 +0100)
committerTom Rini <trini@ti.com>
Mon, 16 Feb 2015 20:48:35 +0000 (15:48 -0500)
This allows to define the ethaddr env variable according to the the IVM
content by reading the IVM in misc_init_r.

Later, when HUSH is available the content read earlier is analyzed to
populate some non env variables.

Signed-off-by: Valentin Longchamp <valentin.longchamp@keymile.com>
board/keymile/kmp204x/kmp204x.c

index a74f75bad41dc09af5d9caf680f6f1bf08bb2a3e..0f544fb979e1ab90abde59f04f5b5ff68e959ccc 100644 (file)
@@ -26,6 +26,8 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
+static uchar ivm_content[CONFIG_SYS_IVM_EEPROM_MAX_LEN];
+
 int checkboard(void)
 {
        printf("Board: Keymile %s\n", CONFIG_KM_BOARD_NAME);
@@ -195,13 +197,14 @@ int misc_init_r(void)
                }
        }
 
+       ivm_simple_read_eeprom(ivm_content, CONFIG_SYS_IVM_EEPROM_MAX_LEN);
        return 0;
 }
 
 #if defined(CONFIG_HUSH_INIT_VAR)
 int hush_init_var(void)
 {
-       ivm_read_eeprom();
+       ivm_analyze_eeprom(ivm_content, CONFIG_SYS_IVM_EEPROM_MAX_LEN);
        return 0;
 }
 #endif