bcm63xx: add linux v5.15 support
[openwrt/openwrt.git] / target / linux / bcm63xx / patches-5.15 / 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 @@ -63,6 +63,7 @@ static struct board_info __initdata boar
22
23 .has_pci = 1,
24 .has_uart0 = 1,
25 + .use_fallback_sprom = 1,
26
27 .has_usbd = 0,
28 .usbd = {
29 @@ -213,6 +214,7 @@ static struct board_info __initdata boar
30
31 .has_pci = 1,
32 .has_uart0 = 1,
33 + .use_fallback_sprom = 1,
34
35 .has_enet0 = 1,
36 .enet0 = {
37 @@ -259,6 +261,7 @@ static struct board_info __initdata boar
38 .has_pccard = 1,
39 .has_pci = 1,
40 .has_uart0 = 1,
41 + .use_fallback_sprom = 1,
42
43 .has_enet0 = 1,
44 .enet0 = {
45 @@ -310,6 +313,7 @@ static struct board_info __initdata boar
46 .has_pccard = 1,
47 .has_pci = 1,
48 .has_uart0 = 1,
49 + .use_fallback_sprom = 1,
50
51 .has_enet0 = 1,
52 .enet0 = {
53 @@ -360,6 +364,7 @@ static struct board_info __initdata boar
54 .has_ohci0 = 1,
55 .has_pci = 1,
56 .has_uart0 = 1,
57 + .use_fallback_sprom = 1,
58
59 .has_enet0 = 1,
60 .enet0 = {
61 @@ -411,6 +416,7 @@ static struct board_info __initdata boar
62 .has_pccard = 1,
63 .has_pci = 1,
64 .has_uart0 = 1,
65 + .use_fallback_sprom = 1,
66
67 .has_enet0 = 1,
68 .enet0 = {
69 @@ -430,6 +436,7 @@ static struct board_info __initdata boar
70 .expected_cpu_id = 0x6348,
71
72 .has_pci = 1,
73 + .use_fallback_sprom = 1,
74
75 .has_enet0 = 1,
76 .enet0 = {
77 @@ -451,6 +458,7 @@ static struct board_info __initdata boar
78 .has_ohci0 = 1,
79 .has_pci = 1,
80 .has_uart0 = 1,
81 + .use_fallback_sprom = 1,
82
83 .has_enet0 = 1,
84 .enet0 = {
85 @@ -472,6 +480,7 @@ static struct board_info __initdata boar
86 .has_ohci0 = 1,
87 .has_pci = 1,
88 .has_uart0 = 1,
89 + .use_fallback_sprom = 1,
90
91 .has_enet0 = 1,
92 .enet0 = {
93 @@ -500,6 +509,7 @@ static struct board_info __initdata boar
94 .has_pccard = 1,
95 .has_pci = 1,
96 .has_uart0 = 1,
97 + .use_fallback_sprom = 1,
98
99 .has_enet0 = 1,
100 .enet0 = {
101 @@ -551,6 +561,7 @@ static struct board_info __initdata boar
102 .has_pccard = 1,
103 .has_pci = 1,
104 .has_uart0 = 1,
105 + .use_fallback_sprom = 1,
106
107 .has_enet0 = 1,
108 .enet0 = {
109 @@ -617,6 +628,7 @@ static struct board_info __initdata boar
110 .has_ehci0 = 1,
111 .has_ohci0 = 1,
112 .has_pci = 1,
113 + .use_fallback_sprom = 1,
114
115 .has_enet0 = 1,
116 .enet0 = {
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 @@ -33,6 +33,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;