]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
kirkwood/km_arm: read the IVM eeprom earlier
authorValentin Longchamp <valentin.longchamp@keymile.com>
Tue, 10 Feb 2015 16:10:14 +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/km_arm/km_arm.c

index 1c7c108cb5acd7536e0081a7d2a7f40a7eb23a74..6eb6712b39e4dd8ba65d95e8999b0083a2ac9172 100644 (file)
@@ -102,6 +102,8 @@ static const u32 kwmpp_config[] = {
        0
 };
 
+static uchar ivm_content[CONFIG_SYS_IVM_EEPROM_MAX_LEN];
+
 #if defined(CONFIG_KM_MGCOGE3UN)
 /*
  * Wait for startup OK from mgcoge3ne
@@ -210,6 +212,8 @@ int misc_init_r(void)
        }
 #endif
 
+       ivm_simple_read_eeprom(ivm_content, CONFIG_SYS_IVM_EEPROM_MAX_LEN);
+
        initialize_unit_leds();
        set_km_env();
        set_bootcount_addr();
@@ -419,7 +423,7 @@ void reset_phy(void)
 #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