82xx/km82xx: read the IVM eeprom earlier
authorValentin Longchamp <valentin.longchamp@keymile.com>
Tue, 10 Feb 2015 16:10:17 +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/km82xx/km82xx.c
include/configs/km82xx.h

index bf84676b9bd900accc072148bbb70e4a0259f4a0..c3a113172c07fb9f43be2a2a9798aa6449890bd2 100644 (file)
@@ -18,6 +18,8 @@
 #include <i2c.h>
 #include "../common/common.h"
 
+static uchar ivm_content[CONFIG_SYS_IVM_EEPROM_MAX_LEN];
+
 /*
  * I/O Port configuration table
  *
@@ -393,9 +395,15 @@ int board_early_init_r(void)
        return 0;
 }
 
+int misc_init_r(void)
+{
+       ivm_simple_read_eeprom(ivm_content, CONFIG_SYS_IVM_EEPROM_MAX_LEN);
+       return 0;
+}
+
 int hush_init_var(void)
 {
-       ivm_read_eeprom();
+       ivm_analyze_eeprom(ivm_content, CONFIG_SYS_IVM_EEPROM_MAX_LEN);
        return 0;
 }
 
index 14fd290be1f3c7a7da01acbcd559fc5852b3fb21..12f9d424cb10639ab133cbc2900300c2a4e7b8f0 100644 (file)
@@ -34,6 +34,8 @@
 
 #define        CONFIG_SYS_TEXT_BASE    0xFE000000
 
+#define CONFIG_MISC_INIT_R
+
 /* include common defines/options for all Keymile boards */
 #include "km/keymile-common.h"
 #include "km/km-powerpc.h"