brcm63xx: remove broken DSP platform device code
[openwrt/openwrt.git] / target / linux / brcm63xx / patches-4.9 / 358-MIPS-BCM63XX-make-fallback-sprom-optional.patch
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
5
6 Some devices do not provide enough mac addresses to populate wifi in
7 addition to ethernet.
8
9 Use having pci enabled as a rough heuristic which boards should have it
10 enabled.
11
12 Signed-off-by: Jonas Gorski <jogo@openwrt.org>
13 ---
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(-)
18
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
22 .has_uart0 = 1,
23 .has_pci = 1,
24 .has_usbd = 0,
25 + .use_fallback_sprom = 1,
26
27 .usbd = {
28 .use_fullspeed = 0,
29 @@ -219,6 +220,7 @@ static struct board_info __initdata boar
30 .has_uart0 = 1,
31 .has_enet0 = 1,
32 .has_pci = 1,
33 + .use_fallback_sprom = 1,
34
35 .enet0 = {
36 .has_phy = 1,
37 @@ -264,6 +266,7 @@ static struct board_info __initdata boar
38 .has_enet0 = 1,
39 .has_enet1 = 1,
40 .has_pci = 1,
41 + .use_fallback_sprom = 1,
42
43 .enet0 = {
44 .has_phy = 1,
45 @@ -316,6 +319,7 @@ static struct board_info __initdata boar
46 .has_enet0 = 1,
47 .has_enet1 = 1,
48 .has_pci = 1,
49 + .use_fallback_sprom = 1,
50
51 .enet0 = {
52 .has_phy = 1,
53 @@ -370,6 +374,7 @@ static struct board_info __initdata boar
54 .has_enet0 = 1,
55 .has_enet1 = 1,
56 .has_pci = 1,
57 + .use_fallback_sprom = 1,
58
59 .enet0 = {
60 .has_phy = 1,
61 @@ -420,6 +425,7 @@ static struct board_info __initdata boar
62 .has_enet0 = 1,
63 .has_enet1 = 1,
64 .has_pci = 1,
65 + .use_fallback_sprom = 1,
66
67 .enet0 = {
68 .has_phy = 1,
69 @@ -443,6 +449,7 @@ static struct board_info __initdata boar
70 .has_enet0 = 1,
71 .has_enet1 = 1,
72 .has_pci = 1,
73 + .use_fallback_sprom = 1,
74
75 .enet0 = {
76 .has_phy = 1,
77 @@ -461,6 +468,7 @@ static struct board_info __initdata boar
78
79 .has_uart0 = 1,
80 .has_pci = 1,
81 + .use_fallback_sprom = 1,
82 .has_ohci0 = 1,
83
84 .has_enet0 = 1,
85 @@ -483,6 +491,7 @@ static struct board_info __initdata boar
86 .has_enet0 = 1,
87 .has_enet1 = 1,
88 .has_pci = 1,
89 + .use_fallback_sprom = 1,
90
91 .enet0 = {
92 .has_phy = 1,
93 @@ -509,6 +518,7 @@ static struct board_info __initdata boar
94 .has_enet0 = 1,
95 .has_enet1 = 1,
96 .has_pci = 1,
97 + .use_fallback_sprom = 1,
98
99 .enet0 = {
100 .has_phy = 1,
101 @@ -561,6 +571,7 @@ static struct board_info __initdata boar
102 .has_enet0 = 1,
103 .has_enet1 = 1,
104 .has_pci = 1,
105 + .use_fallback_sprom = 1,
106
107 .enet0 = {
108 .has_phy = 1,
109 @@ -632,6 +643,7 @@ static struct board_info __initdata boar
110 .has_enet0 = 1,
111 .has_enet1 = 1,
112 .has_pci = 1,
113 + .use_fallback_sprom = 1,
114
115 .enet0 = {
116 .has_phy = 1,
117 --- a/arch/mips/bcm63xx/boards/board_common.c
118 +++ b/arch/mips/bcm63xx/boards/board_common.c
119 @@ -183,8 +183,9 @@ int __init board_register_devices(void)
120 * do this after registering enet devices
121 */
122
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");
129
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 @@ -32,6 +32,7 @@ struct board_info {
134 unsigned int has_usbd:1;
135 unsigned int has_uart0:1;
136 unsigned int has_uart1:1;
137 + unsigned int use_fallback_sprom:1;
138
139 /* ethernet config */
140 struct bcm63xx_enet_platform_data enet0;