diff options
author | Andy Green <andy.green@linaro.org> | 2012-12-12 01:40:55 +0000 |
---|---|---|
committer | Andy Green <andy.green@linaro.org> | 2012-12-12 01:40:55 +0000 |
commit | edb2dff2ab14d66f123d43a18b2b27cecf598cdf (patch) | |
tree | 8f6816e457f1e1eea6693ae7c4abd4527a2c19e1 | |
parent | 35f13701a5c5717c2240df4d2280eef18a961500 (diff) |
allow cpuid macaddr overridetracking-tilt-3.4-llt-20130130.0tracking-tilt-3.4-llt-20121213.0
If your synthesized MAC base is not what you need, you can force it by
id.cpuidmac=xx:xx:xx:xx:xx:xx
from the kernel commandline. Notice that the top 2 bits of byte 1
are used to elaborate up to 4 network devices and are zeroed to
start with.
Signed-off-by: Andy Green <andy.green@linaro.org>
-rw-r--r-- | arch/arm/mach-omap2/id.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/arch/arm/mach-omap2/id.c b/arch/arm/mach-omap2/id.c index 4e95378dc173..181c667e62ab 100644 --- a/arch/arm/mach-omap2/id.c +++ b/arch/arm/mach-omap2/id.c @@ -18,6 +18,7 @@ #include <linux/kernel.h> #include <linux/init.h> #include <linux/io.h> +#include <linux/etherdevice.h> #include <asm/cputype.h> @@ -34,6 +35,9 @@ u32 omap_features; static void __init omap3_cpuinfo(void); +static char *cpuidmac; +module_param(cpuidmac, charp, 0644); + unsigned int omap_rev(void) { return omap_revision; @@ -586,6 +590,15 @@ void omap2_die_id_to_ethernet_mac(u8 *mac, int subtype) pr_info(" ID: %08X %08X %08X %08X %08X\n", tap, odi.id_0, odi.id_1, odi.id_2, odi.id_3); + if (cpuidmac) + if (!eth_scan_mac(cpuidmac, mac)) { + mac[1] &= ~0xc0; + pr_info("cpuidmac <- %02x:%02x:%02x:%02x:%02x:%02x\n", + mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]); + return; + } else + pr_info("cpuidmac failed to parse mac %s\n", cpuidmac); + mac[0] = odi.id_2; mac[1] = odi.id_2 >> 8; mac[2] = odi.id_1; |