Commit 2973b098baf6fcb49d9fb7a2ed187e6a65532175

Authored by Valentin Longchamp
Committed by Tom Rini
1 parent f32b3d3fce

82xx/km82xx: read the IVM eeprom earlier

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>

Showing 2 changed files with 11 additions and 1 deletions Side-by-side Diff

board/keymile/km82xx/km82xx.c
... ... @@ -18,6 +18,8 @@
18 18 #include <i2c.h>
19 19 #include "../common/common.h"
20 20  
  21 +static uchar ivm_content[CONFIG_SYS_IVM_EEPROM_MAX_LEN];
  22 +
21 23 /*
22 24 * I/O Port configuration table
23 25 *
24 26  
... ... @@ -393,9 +395,15 @@
393 395 return 0;
394 396 }
395 397  
  398 +int misc_init_r(void)
  399 +{
  400 + ivm_simple_read_eeprom(ivm_content, CONFIG_SYS_IVM_EEPROM_MAX_LEN);
  401 + return 0;
  402 +}
  403 +
396 404 int hush_init_var(void)
397 405 {
398   - ivm_read_eeprom();
  406 + ivm_analyze_eeprom(ivm_content, CONFIG_SYS_IVM_EEPROM_MAX_LEN);
399 407 return 0;
400 408 }
401 409  
include/configs/km82xx.h
... ... @@ -34,6 +34,8 @@
34 34  
35 35 #define CONFIG_SYS_TEXT_BASE 0xFE000000
36 36  
  37 +#define CONFIG_MISC_INIT_R
  38 +
37 39 /* include common defines/options for all Keymile boards */
38 40 #include "km/keymile-common.h"
39 41 #include "km/km-powerpc.h"