diff mbox

[3/3] OMAP4 PANDA register ethernet and wlan for automatic mac allocation

Message ID 20120629055524.11091.57217.stgit@build.warmcat.com
State New
Headers show

Commit Message

warmcat June 29, 2012, 5:55 a.m. UTC
From: Andy Green <andy@warmcat.com>

This provides the board-specific device paths needed to get
the panda boardfile working with the MAC address fixup api.

On Pandaboard / ES, neither the onboard Ethernet or onboard WLAN
module have onboard arrangements for MAC storage, without this
series yielding randomized MAC per-boot and consequent DHCP problems,
or in the case of wlan0 a MAC set by a firmware file in the rootfs
which unless customized yields a MAC of 00:00:00:00:00:00.  No
official MAC is reserved for either network device even if you do
take the approach to customize the firmware file.

This gets sane, consistent MAC addresses on both devices which
should stand a good probability of differing between PandaBoards.

Signed-off-by: Andy Green <andy.green@linaro.org>
---
 arch/arm/mach-omap2/board-omap4panda.c |   13 +++++++++++++
 1 file changed, 13 insertions(+)

Comments

Tony Lindgren June 29, 2012, 11:55 a.m. UTC | #1
* Andy Green <andy.green@linaro.org> [120628 23:00]:
> --- a/arch/arm/mach-omap2/board-omap4panda.c
> +++ b/arch/arm/mach-omap2/board-omap4panda.c
> @@ -486,6 +486,15 @@ static void omap4_panda_init_rev(void)
>  	}
>  }
>  
> +/*
> + * These device paths represent onboard network devices which have
> + * no MAC address set at boot, and need synthetic ones assigning
> + */
> +static const char * const panda_fixup_mac_device_paths[] = {
> +	"usb1/1-1/1-1.1/1-1.1:1.0",	/* smsc USB <-> Ethernet bridge */
> +	"wl12xx",			/* wlan0 module */
> +};

I suspect the "usb1/1-1/1-1.1/1-1.1:1.0" naming is not valid
if you change the order of loading of musb_hdrc and ehci modules?
Might be worth checking..

Tony
diff mbox

Patch

diff --git a/arch/arm/mach-omap2/board-omap4panda.c b/arch/arm/mach-omap2/board-omap4panda.c
index 982fb26..07a17b0 100644
--- a/arch/arm/mach-omap2/board-omap4panda.c
+++ b/arch/arm/mach-omap2/board-omap4panda.c
@@ -486,6 +486,15 @@  static void omap4_panda_init_rev(void)
 	}
 }
 
+/*
+ * These device paths represent onboard network devices which have
+ * no MAC address set at boot, and need synthetic ones assigning
+ */
+static const char * const panda_fixup_mac_device_paths[] = {
+	"usb1/1-1/1-1.1/1-1.1:1.0",	/* smsc USB <-> Ethernet bridge */
+	"wl12xx",			/* wlan0 module */
+};
+
 static void __init omap4_panda_init(void)
 {
 	int package = OMAP_PACKAGE_CBS;
@@ -496,6 +505,10 @@  static void __init omap4_panda_init(void)
 	omap4_mux_init(board_mux, NULL, package);
 
 	omap_panda_wlan_data.irq = gpio_to_irq(GPIO_WIFI_IRQ);
+
+	omap_register_mac_device_fixup_paths(panda_fixup_mac_device_paths,
+				     ARRAY_SIZE(panda_fixup_mac_device_paths));
+
 	ret = wl12xx_set_platform_data(&omap_panda_wlan_data);
 	if (ret)
 		pr_err("error setting wl12xx data: %d\n", ret);