Commit 0bb95a68fc92bce3cc044ae3c006f6e33431617d

Authored by Valentin Longchamp
Committed by Tom Rini
1 parent 16ac90c7ee

kirkwood/km_arm: 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 1 changed file with 5 additions and 1 deletions Side-by-side Diff

board/keymile/km_arm/km_arm.c
... ... @@ -102,6 +102,8 @@
102 102 0
103 103 };
104 104  
  105 +static uchar ivm_content[CONFIG_SYS_IVM_EEPROM_MAX_LEN];
  106 +
105 107 #if defined(CONFIG_KM_MGCOGE3UN)
106 108 /*
107 109 * Wait for startup OK from mgcoge3ne
... ... @@ -210,6 +212,8 @@
210 212 }
211 213 #endif
212 214  
  215 + ivm_simple_read_eeprom(ivm_content, CONFIG_SYS_IVM_EEPROM_MAX_LEN);
  216 +
213 217 initialize_unit_leds();
214 218 set_km_env();
215 219 set_bootcount_addr();
... ... @@ -419,7 +423,7 @@
419 423 #if defined(CONFIG_HUSH_INIT_VAR)
420 424 int hush_init_var(void)
421 425 {
422   - ivm_read_eeprom();
  426 + ivm_analyze_eeprom(ivm_content, CONFIG_SYS_IVM_EEPROM_MAX_LEN);
423 427 return 0;
424 428 }
425 429 #endif