Re: [PATCH 6/7] MIPS: bcm63xx: call board_register_device from device_initcall()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Maxime,

On Saturday 30 January 2010 18:34:57 Maxime Bizon wrote:
> Some device registration (eg leds), expect subsystem initcall to be
> run first, so move board device registration to device_initcall().
> 
> Signed-off-by: Maxime Bizon <mbizon@xxxxxxxxxx>
> ---
>  arch/mips/bcm63xx/setup.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/arch/mips/bcm63xx/setup.c b/arch/mips/bcm63xx/setup.c
> index d005659..04a3499 100644
> --- a/arch/mips/bcm63xx/setup.c
> +++ b/arch/mips/bcm63xx/setup.c
> @@ -124,4 +124,4 @@ int __init bcm63xx_register_devices(void)
>  	return board_register_devices();
>  }
> 
> -arch_initcall(bcm63xx_register_devices);
> +device_initcall(bcm63xx_register_devices);

This breaks the fallback SPROM registration, that one needs to be set before
the PCI subsystem is intialized, otherwise b43 gets an empty WLAN MAC
address. This was the reason to move bcm63xx_register_devices to
the arch_initcall level in the first place.

Let's use the first stage board callback which also has to be called prior to
PCI initialization.

From: Florian Fainelli <ffainelli@xxxxxxxxxx>
Subject: [PATCH] bcm63xx: register SSB SPROM fallback in board's first stage callback

Signed-off-by: Florian Fainelli <ffainelli@xxxxxxxxxx>
---
diff --git a/arch/mips/bcm63xx/boards/board_bcm963xx.c b/arch/mips/bcm63xx/boards/board_bcm963xx.c
index 90faa37..f7e0be1 100644
--- a/arch/mips/bcm63xx/boards/board_bcm963xx.c
+++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c
@@ -676,6 +676,17 @@ void __init board_prom_init(void)
 	}
 
 	bcm_gpio_writel(val, GPIO_MODE_REG);
+
+	/* Generate MAC address for WLAN and
+	 * register our SPROM */
+#ifdef CONFIG_SSB_PCIHOST
+	if (!board_get_mac_address(bcm63xx_sprom.il0mac)) {
+		memcpy(bcm63xx_sprom.et0mac, bcm63xx_sprom.il0mac, ETH_ALEN);
+		memcpy(bcm63xx_sprom.et1mac, bcm63xx_sprom.il0mac, ETH_ALEN);
+		if (ssb_arch_set_fallback_sprom(&bcm63xx_sprom) < 0)
+			printk(KERN_ERR "failed to register fallback SPROM\n");
+	}
+#endif
 }
 
 /*
@@ -835,17 +846,6 @@ int __init board_register_devices(void)
 	if (board.has_dsp)
 		bcm63xx_dsp_register(&board.dsp);
 
-	/* Generate MAC address for WLAN and
-	 * register our SPROM */
-#ifdef CONFIG_SSB_PCIHOST
-	if (!board_get_mac_address(bcm63xx_sprom.il0mac)) {
-		memcpy(bcm63xx_sprom.et0mac, bcm63xx_sprom.il0mac, ETH_ALEN);
-		memcpy(bcm63xx_sprom.et1mac, bcm63xx_sprom.il0mac, ETH_ALEN);
-		if (ssb_arch_set_fallback_sprom(&bcm63xx_sprom) < 0)
-			printk(KERN_ERR "failed to register fallback SPROM\n");
-	}
-#endif
-
 	/* read base address of boot chip select (0) */
 	if (BCMCPU_IS_6345())
 		val = 0x1fc00000;



[Index of Archives]     [Linux MIPS Home]     [LKML Archive]     [Linux ARM Kernel]     [Linux ARM]     [Linux]     [Git]     [Yosemite News]     [Linux SCSI]     [Linux Hams]

  Powered by Linux