diff mbox

[U-Boot,v3,5/6] 82xx/km82xx: read the IVM eeprom earlier

Message ID 1423584618-19677-6-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/km82xx/km82xx.c | 10 +++++++++-
 include/configs/km82xx.h      |  2 ++
 2 files changed, 11 insertions(+), 1 deletion(-)

Comments

Tom Rini Feb. 17, 2015, 8:23 p.m. UTC | #1
On Tue, Feb 10, 2015 at 05:10:17PM +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/km82xx/km82xx.c b/board/keymile/km82xx/km82xx.c
index bf84676..c3a1131 100644
--- a/board/keymile/km82xx/km82xx.c
+++ b/board/keymile/km82xx/km82xx.c
@@ -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;
 }
 
diff --git a/include/configs/km82xx.h b/include/configs/km82xx.h
index 14fd290..12f9d42 100644
--- a/include/configs/km82xx.h
+++ b/include/configs/km82xx.h
@@ -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"