summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKan-Ru Chen <kanru@0xlab.org>2010-08-02 14:21:41 +0300
committerTony Lindgren <tony@atomide.com>2010-08-02 14:21:41 +0300
commitf535daed925c2d3c1db06b06a63c4955f2c51988 (patch)
tree1b8726c9cc82c191dc9f0c130de7ecafd4cf870c
parentc46732bbf3477f319083161bfa2fba1fadae7a3e (diff)
downloadblackbird-op-linux-f535daed925c2d3c1db06b06a63c4955f2c51988.tar.gz
blackbird-op-linux-f535daed925c2d3c1db06b06a63c4955f2c51988.zip
omap: Devkit8000: Use DIE id to initialize dm9000 MAC address
The devkit8000 boards often come with empty EEPROM thus without valid ethernet MAC address. The DIE id to MAC formula is copied from u-boot. Signed-off-by: Kan-Ru Chen <kanru@0xlab.org> Signed-off-by: Tony Lindgren <tony@atomide.com>
-rw-r--r--arch/arm/mach-omap2/board-devkit8000.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/arch/arm/mach-omap2/board-devkit8000.c b/arch/arm/mach-omap2/board-devkit8000.c
index 77022b588816..128b9329ef25 100644
--- a/arch/arm/mach-omap2/board-devkit8000.c
+++ b/arch/arm/mach-omap2/board-devkit8000.c
@@ -33,6 +33,7 @@
#include <linux/i2c/twl.h>
#include <mach/hardware.h>
+#include <mach/id.h>
#include <asm/mach-types.h>
#include <asm/mach/arch.h>
#include <asm/mach/map.h>
@@ -560,6 +561,9 @@ static struct platform_device omap_dm9000_dev = {
static void __init omap_dm9000_init(void)
{
+ unsigned char *eth_addr = omap_dm9000_platdata.dev_addr;
+ struct omap_die_id odi;
+
if (gpio_request(OMAP_DM9000_GPIO_IRQ, "dm9000 irq") < 0) {
printk(KERN_ERR "Failed to request GPIO%d for dm9000 IRQ\n",
OMAP_DM9000_GPIO_IRQ);
@@ -567,6 +571,16 @@ static void __init omap_dm9000_init(void)
}
gpio_direction_input(OMAP_DM9000_GPIO_IRQ);
+
+ /* init the mac address using DIE id */
+ omap_get_die_id(&odi);
+
+ eth_addr[0] = 0x02; /* locally administered */
+ eth_addr[1] = odi.id_1 & 0xff;
+ eth_addr[2] = (odi.id_0 & 0xff000000) >> 24;
+ eth_addr[3] = (odi.id_0 & 0x00ff0000) >> 16;
+ eth_addr[4] = (odi.id_0 & 0x0000ff00) >> 8;
+ eth_addr[5] = (odi.id_0 & 0x000000ff);
}
static struct platform_device *devkit8000_devices[] __initdata = {
OpenPOWER on IntegriCloud