diff options
author | Tushar Behera <tushar.behera@linaro.org> | 2013-02-06 13:55:42 +0530 |
---|---|---|
committer | John Rigby <john.rigby@linaro.org> | 2013-02-07 15:58:18 -0700 |
commit | b4eb22a60d15240d280785df7948448824d86fe5 (patch) | |
tree | 5c7d49a81cc5b54b0b838b83f2883ce187c8ff01 | |
parent | d49088eaddbfc24abab8a8e2ca86786cce44fad0 (diff) |
board: samsung: Update MAC address for Arndale board through GUID2013.02.2
There are a couple of GUID (Global Unique Identifier) registers within
EXYNOS5250 SoC. The values of these GUID registers are set as board
MAC address.
Signed-off-by: Tushar Behera <tushar.behera@linaro.org>
-rw-r--r-- | arch/arm/include/asm/arch-exynos/cpu.h | 2 | ||||
-rw-r--r-- | board/samsung/smdk5250/smdk5250.c | 18 |
2 files changed, 19 insertions, 1 deletions
diff --git a/arch/arm/include/asm/arch-exynos/cpu.h b/arch/arm/include/asm/arch-exynos/cpu.h index 206df2189..a6a7f9acc 100644 --- a/arch/arm/include/asm/arch-exynos/cpu.h +++ b/arch/arm/include/asm/arch-exynos/cpu.h @@ -67,6 +67,8 @@ #define EXYNOS5_GPIO_PART4_BASE 0x03860000 #define EXYNOS5_PRO_ID 0x10000000 +#define EXYNOS5_GUID_LOW 0x10000014 +#define EXYNOS5_GUID_HIGH 0x10000018 #define EXYNOS5_CLOCK_BASE 0x10010000 #define EXYNOS5_POWER_BASE 0x10040000 #define EXYNOS5_SWRESET 0x10040400 diff --git a/board/samsung/smdk5250/smdk5250.c b/board/samsung/smdk5250/smdk5250.c index d70976db1..28cf0afaf 100644 --- a/board/samsung/smdk5250/smdk5250.c +++ b/board/samsung/smdk5250/smdk5250.c @@ -224,9 +224,25 @@ static int board_i2c_init(void) #ifdef CONFIG_BOARD_LATE_INIT int board_late_init(void) { + int i; + uchar mac[6]; + unsigned int guid_high = readl(EXYNOS5_GUID_HIGH); + unsigned int guid_low = readl(EXYNOS5_GUID_LOW); + + for (i = 0; i < 2; i++) + mac[i] = (guid_high >> (8 * (1 - i))) & 0xFF; + + for (i = 0; i < 4; i++) + mac[i+2] = (guid_low >> (8 * (3 - i))) & 0xFF; + + /* mark it as not multicast and outside official 80211 MAC namespace */ + mac[0] = (mac[0] & ~0x1) | 0x2; + + eth_setenv_enetaddr("ethaddr", mac); + eth_setenv_enetaddr("usbethaddr", mac); + #ifdef CONFIG_PREBOOT setenv("preboot", CONFIG_PREBOOT); - setenv("usbethaddr", "00:40:5c:26:0a:5b"); #endif } #endif |