aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRyan Harkin <ryan.harkin@linaro.org>2015-10-28 14:51:41 +0000
committerRyan Harkin <ryan.harkin@linaro.org>2016-12-02 14:10:46 +0000
commitdaf3423ea5565b37ee27d0723de1492c8b9ea216 (patch)
tree994e6e6d9e924b235deeb1548f358b9ee8ab4972
parent9ae0e14350758e6447c90615ff4df530549a45e2 (diff)
HACK: vexpress64: juno: set bootargs_sky2 mac address
If the MAC address is set in the motherboard's config area (addresses 0x1c010074 and 78) then set the bootargs_sky2 envinroment variable so we can pass the MAC address to the kernel. Unfortunately, the sky2 boot arg is implemented using an out-of-tree kernel patch, hosted in the ARM Landing Team tree. Signed-off-by: Ryan Harkin <ryan.harkin@linaro.org>
-rw-r--r--board/armltd/vexpress64/vexpress64.c24
-rw-r--r--include/configs/vexpress_aemv8a.h3
2 files changed, 27 insertions, 0 deletions
diff --git a/board/armltd/vexpress64/vexpress64.c b/board/armltd/vexpress64/vexpress64.c
index e34af6c4d9..c9e319bbca 100644
--- a/board/armltd/vexpress64/vexpress64.c
+++ b/board/armltd/vexpress64/vexpress64.c
@@ -93,6 +93,30 @@ void reset_cpu(ulong addr)
int board_eth_init(bd_t *bis)
{
int rc = 0;
+#ifdef CONFIG_TARGET_VEXPRESS64_JUNO
+ char *bootargs_sky2 = getenv("bootargs_sky2");
+
+ if (!bootargs_sky2){
+ char macstr[255];
+ u8 mac[6];
+ u32 macl, mach;
+
+ macl = readl(V2M_SYS_CFGMACL);
+ mach = readl(V2M_SYS_CFGMACH);
+
+ if (mach && macl){
+ mac[0] = (mach >> 8) & 0xff;
+ mac[1] = mach & 0xff;
+ mac[2] = (macl >> 24) & 0xff;
+ mac[3] = (macl >> 16) & 0xff;
+ mac[4] = (macl >> 8) & 0xff;
+ mac[5] = macl & 0xff;
+
+ sprintf(macstr, "sky2.mac_address=0x%2.2x,0x%2.2x,0x%2.2x,0x%2.2x,0x%2.2x,0x%2.2x", mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]);
+ setenv("bootargs_sky2", macstr);
+ }
+ }
+#endif
#ifdef CONFIG_SMC91111
rc = smc91111_initialize(0, CONFIG_SMC91111_BASE);
#endif
diff --git a/include/configs/vexpress_aemv8a.h b/include/configs/vexpress_aemv8a.h
index 48834c2fae..076249b78a 100644
--- a/include/configs/vexpress_aemv8a.h
+++ b/include/configs/vexpress_aemv8a.h
@@ -76,6 +76,8 @@
#define V2M_CLCD (V2M_PA_CS3 + V2M_PERIPH_OFFSET(31))
/* System register offsets. */
+#define V2M_SYS_CFGMACL (V2M_SYSREGS + 0x074)
+#define V2M_SYS_CFGMACH (V2M_SYSREGS + 0x078)
#define V2M_SYS_CFGDATA (V2M_SYSREGS + 0x0a0)
#define V2M_SYS_CFGCTRL (V2M_SYSREGS + 0x0a4)
#define V2M_SYS_CFGSTAT (V2M_SYSREGS + 0x0a8)
@@ -208,6 +210,7 @@
" setenv initrd_param ${initrd_addr}; "\
" else setenv initrd_param -; "\
"fi ; " \
+ "setenv bootargs ${bootargs} ${bootargs_sky2}; "\
"booti ${kernel_addr} ${initrd_param} ${fdt_addr}"