1 From 83131acbfb59760a19f3711c09526e191c8aad54 Mon Sep 17 00:00:00 2001
2 From: Jonas Gorski <jogo@openwrt.org>
3 Date: Tue, 29 Jul 2014 21:52:56 +0200
4 Subject: [PATCH 03/10] MIPS: BCM63XX: make fallback sprom optional
6 Some devices do not provide enough mac addresses to populate wifi in
9 Use having pci enabled as a rough heuristic which boards should have it
12 Signed-off-by: Jonas Gorski <jogo@openwrt.org>
14 arch/mips/bcm63xx/boards/board_bcm963xx.c | 12 ++++++++++++
15 arch/mips/bcm63xx/boards/board_common.c | 5 +++--
16 arch/mips/include/asm/mach-bcm63xx/board_bcm963xx.h | 1 +
17 3 files changed, 16 insertions(+), 2 deletions(-)
19 --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c
20 +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c
21 @@ -70,6 +70,7 @@ static struct board_info __initdata boar
25 + .use_fallback_sprom = 1,
29 @@ -219,6 +220,7 @@ static struct board_info __initdata boar
33 + .use_fallback_sprom = 1,
37 @@ -264,6 +266,7 @@ static struct board_info __initdata boar
41 + .use_fallback_sprom = 1,
45 @@ -324,6 +327,7 @@ static struct board_info __initdata boar
49 + .use_fallback_sprom = 1,
53 @@ -378,6 +382,7 @@ static struct board_info __initdata boar
57 + .use_fallback_sprom = 1,
61 @@ -436,6 +441,7 @@ static struct board_info __initdata boar
65 + .use_fallback_sprom = 1,
69 @@ -459,6 +465,7 @@ static struct board_info __initdata boar
73 + .use_fallback_sprom = 1,
77 @@ -477,6 +484,7 @@ static struct board_info __initdata boar
81 + .use_fallback_sprom = 1,
85 @@ -499,6 +507,7 @@ static struct board_info __initdata boar
89 + .use_fallback_sprom = 1,
93 @@ -525,6 +534,7 @@ static struct board_info __initdata boar
97 + .use_fallback_sprom = 1,
101 @@ -577,6 +587,7 @@ static struct board_info __initdata boar
105 + .use_fallback_sprom = 1,
109 @@ -648,6 +659,7 @@ static struct board_info __initdata boar
113 + .use_fallback_sprom = 1,
117 --- a/arch/mips/bcm63xx/boards/board_common.c
118 +++ b/arch/mips/bcm63xx/boards/board_common.c
119 @@ -188,8 +188,9 @@ int __init board_register_devices(void)
120 * do this after registering enet devices
123 - if (board_get_mac_address(board.fallback_sprom.mac_addr) ||
124 - bcm63xx_register_fallback_sprom(&board.fallback_sprom))
125 + if (board.use_fallback_sprom &&
126 + (board_get_mac_address(board.fallback_sprom.mac_addr) ||
127 + bcm63xx_register_fallback_sprom(&board.fallback_sprom)))
128 pr_err(PFX "failed to register fallback SPROM\n");
130 bcm63xx_spi_register();
131 --- a/arch/mips/include/asm/mach-bcm63xx/board_bcm963xx.h
132 +++ b/arch/mips/include/asm/mach-bcm63xx/board_bcm963xx.h
133 @@ -34,6 +34,7 @@ struct board_info {
134 unsigned int has_dsp:1;
135 unsigned int has_uart0:1;
136 unsigned int has_uart1:1;
137 + unsigned int use_fallback_sprom:1;
139 /* ethernet config */
140 struct bcm63xx_enet_platform_data enet0;