diff mbox

[U-Boot,v3,3/6] 85xx/kmp204x: read the IVM eeprom earlier

Message ID 1423584618-19677-4-git-send-email-valentin.longchamp@keymile.com
State Accepted
Delegated to: Tom Rini
Headers show

Commit Message

Valentin Longchamp Feb. 10, 2015, 4:10 p.m. UTC
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>
---

Changes in v3: None
Changes in v2: None

 board/keymile/kmp204x/kmp204x.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

Comments

Tom Rini Feb. 17, 2015, 8:23 p.m. UTC | #1
On Tue, Feb 10, 2015 at 05:10:15PM +0100, Valentin Longchamp wrote:

> 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>

Applied to u-boot/master, thanks!
Tom Rini Feb. 17, 2015, 8:23 p.m. UTC | #2
On Tue, Feb 10, 2015 at 05:10:15PM +0100, Valentin Longchamp wrote:

> 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>

Applied to u-boot/master, thanks!
diff mbox

Patch

diff --git a/board/keymile/kmp204x/kmp204x.c b/board/keymile/kmp204x/kmp204x.c
index a74f75b..0f544fb 100644
--- a/board/keymile/kmp204x/kmp204x.c
+++ b/board/keymile/kmp204x/kmp204x.c
@@ -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