bcm63xx: switch to Kernel 5.15 by default
[openwrt/staging/dedeckeh.git] / target / linux / bcm63xx / patches-5.10 / 391-MIPS-BCM63XX-do-not-register-uart.patch
1 --- a/arch/mips/bcm63xx/Makefile
2 +++ b/arch/mips/bcm63xx/Makefile
3 @@ -1,7 +1,7 @@
4 # SPDX-License-Identifier: GPL-2.0
5 obj-y += clk.o cpu.o cs.o gpio.o irq.o nvram.o prom.o reset.o \
6 setup.o timer.o dev-enet.o dev-flash.o dev-pcmcia.o \
7 - dev-rng.o dev-uart.o dev-wdt.o \
8 + dev-rng.o dev-wdt.o \
9 dev-usb-ehci.o dev-usb-ohci.o dev-usb-usbd.o usb-common.o \
10 sprom.o
11 obj-$(CONFIG_EARLY_PRINTK) += early_printk.o
12 --- a/arch/mips/bcm63xx/dev-uart.c
13 +++ /dev/null
14 @@ -1,76 +0,0 @@
15 -/*
16 - * This file is subject to the terms and conditions of the GNU General Public
17 - * License. See the file "COPYING" in the main directory of this archive
18 - * for more details.
19 - *
20 - * Copyright (C) 2008 Maxime Bizon <mbizon@freebox.fr>
21 - */
22 -
23 -#include <linux/init.h>
24 -#include <linux/kernel.h>
25 -#include <linux/platform_device.h>
26 -#include <bcm63xx_cpu.h>
27 -
28 -static struct resource uart0_resources[] = {
29 - {
30 - /* start & end filled at runtime */
31 - .flags = IORESOURCE_MEM,
32 - },
33 - {
34 - /* start filled at runtime */
35 - .flags = IORESOURCE_IRQ,
36 - },
37 -};
38 -
39 -static struct resource uart1_resources[] = {
40 - {
41 - /* start & end filled at runtime */
42 - .flags = IORESOURCE_MEM,
43 - },
44 - {
45 - /* start filled at runtime */
46 - .flags = IORESOURCE_IRQ,
47 - },
48 -};
49 -
50 -static struct platform_device bcm63xx_uart_devices[] = {
51 - {
52 - .name = "bcm63xx_uart",
53 - .id = 0,
54 - .num_resources = ARRAY_SIZE(uart0_resources),
55 - .resource = uart0_resources,
56 - },
57 -
58 - {
59 - .name = "bcm63xx_uart",
60 - .id = 1,
61 - .num_resources = ARRAY_SIZE(uart1_resources),
62 - .resource = uart1_resources,
63 - }
64 -};
65 -
66 -int __init bcm63xx_uart_register(unsigned int id)
67 -{
68 - if (id >= ARRAY_SIZE(bcm63xx_uart_devices))
69 - return -ENODEV;
70 -
71 - if (id == 1 && (!BCMCPU_IS_3368() && !BCMCPU_IS_6358() &&
72 - !BCMCPU_IS_6368()))
73 - return -ENODEV;
74 -
75 - if (id == 0) {
76 - uart0_resources[0].start = bcm63xx_regset_address(RSET_UART0);
77 - uart0_resources[0].end = uart0_resources[0].start +
78 - RSET_UART_SIZE - 1;
79 - uart0_resources[1].start = bcm63xx_get_irq_number(IRQ_UART0);
80 - }
81 -
82 - if (id == 1) {
83 - uart1_resources[0].start = bcm63xx_regset_address(RSET_UART1);
84 - uart1_resources[0].end = uart1_resources[0].start +
85 - RSET_UART_SIZE - 1;
86 - uart1_resources[1].start = bcm63xx_get_irq_number(IRQ_UART1);
87 - }
88 -
89 - return platform_device_register(&bcm63xx_uart_devices[id]);
90 -}
91 --- a/arch/mips/include/asm/mach-bcm63xx/bcm63xx_dev_uart.h
92 +++ /dev/null
93 @@ -1,7 +0,0 @@
94 -/* SPDX-License-Identifier: GPL-2.0 */
95 -#ifndef BCM63XX_DEV_UART_H_
96 -#define BCM63XX_DEV_UART_H_
97 -
98 -int bcm63xx_uart_register(unsigned int id);
99 -
100 -#endif /* BCM63XX_DEV_UART_H_ */
101 --- a/arch/mips/include/asm/mach-bcm63xx/board_bcm963xx.h
102 +++ b/arch/mips/include/asm/mach-bcm63xx/board_bcm963xx.h
103 @@ -32,8 +32,6 @@ struct board_info {
104 unsigned int has_ohci0:1;
105 unsigned int has_ehci0:1;
106 unsigned int has_usbd:1;
107 - unsigned int has_uart0:1;
108 - unsigned int has_uart1:1;
109 unsigned int use_fallback_sprom:1;
110
111 /* ethernet config */
112 --- a/arch/mips/bcm63xx/boards/board_common.c
113 +++ b/arch/mips/bcm63xx/boards/board_common.c
114 @@ -20,7 +20,6 @@
115 #include <asm/prom.h>
116 #include <bcm63xx_board.h>
117 #include <bcm63xx_cpu.h>
118 -#include <bcm63xx_dev_uart.h>
119 #include <bcm63xx_regs.h>
120 #include <bcm63xx_io.h>
121 #include <bcm63xx_gpio.h>
122 @@ -188,12 +187,6 @@ int __init board_register_devices(void)
123
124 bcm63xx_gpio_init();
125
126 - if (board.has_uart0)
127 - bcm63xx_uart_register(0);
128 -
129 - if (board.has_uart1)
130 - bcm63xx_uart_register(1);
131 -
132 if (board.has_pccard)
133 bcm63xx_pcmcia_register();
134
135 --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c
136 +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c
137 @@ -34,8 +34,6 @@ static struct board_info __initdata boar
138 .ephy_reset_gpio = 36,
139 .ephy_reset_gpio_flags = GPIO_ACTIVE_LOW,
140 .has_pci = 1,
141 - .has_uart0 = 1,
142 - .has_uart1 = 1,
143
144 .has_enet0 = 1,
145 .enet0 = {
146 @@ -62,7 +60,6 @@ static struct board_info __initdata boar
147 .expected_cpu_id = 0x6328,
148
149 .has_pci = 1,
150 - .has_uart0 = 1,
151 .use_fallback_sprom = 1,
152
153 .has_usbd = 0,
154 @@ -111,7 +108,6 @@ static struct board_info __initdata boar
155 .expected_cpu_id = 0x6338,
156
157 .has_ohci0 = 1,
158 - .has_uart0 = 1,
159
160 .has_enet0 = 1,
161 .enet0 = {
162 @@ -153,8 +149,6 @@ static struct board_info __initdata boar
163 .name = "96338W",
164 .expected_cpu_id = 0x6338,
165
166 - .has_uart0 = 1,
167 -
168 .has_enet0 = 1,
169 .enet0 = {
170 .force_speed_100 = 1,
171 @@ -199,8 +193,6 @@ static struct board_info __initdata boar
172 static struct board_info __initdata board_96345gw2 = {
173 .name = "96345GW2",
174 .expected_cpu_id = 0x6345,
175 -
176 - .has_uart0 = 1,
177 };
178 #endif /* CONFIG_BCM63XX_CPU_6345 */
179
180 @@ -213,7 +205,6 @@ static struct board_info __initdata boar
181 .expected_cpu_id = 0x6348,
182
183 .has_pci = 1,
184 - .has_uart0 = 1,
185 .use_fallback_sprom = 1,
186
187 .has_enet0 = 1,
188 @@ -260,7 +251,6 @@ static struct board_info __initdata boar
189 .has_ohci0 = 1,
190 .has_pccard = 1,
191 .has_pci = 1,
192 - .has_uart0 = 1,
193 .use_fallback_sprom = 1,
194
195 .has_enet0 = 1,
196 @@ -312,7 +302,6 @@ static struct board_info __initdata boar
197 .has_ohci0 = 1,
198 .has_pccard = 1,
199 .has_pci = 1,
200 - .has_uart0 = 1,
201 .use_fallback_sprom = 1,
202
203 .has_enet0 = 1,
204 @@ -363,7 +352,6 @@ static struct board_info __initdata boar
205
206 .has_ohci0 = 1,
207 .has_pci = 1,
208 - .has_uart0 = 1,
209 .use_fallback_sprom = 1,
210
211 .has_enet0 = 1,
212 @@ -415,7 +403,6 @@ static struct board_info __initdata boar
213 .has_ohci0 = 1,
214 .has_pccard = 1,
215 .has_pci = 1,
216 - .has_uart0 = 1,
217 .use_fallback_sprom = 1,
218
219 .has_enet0 = 1,
220 @@ -457,7 +444,6 @@ static struct board_info __initdata boar
221
222 .has_ohci0 = 1,
223 .has_pci = 1,
224 - .has_uart0 = 1,
225 .use_fallback_sprom = 1,
226
227 .has_enet0 = 1,
228 @@ -479,7 +465,6 @@ static struct board_info __initdata boar
229
230 .has_ohci0 = 1,
231 .has_pci = 1,
232 - .has_uart0 = 1,
233 .use_fallback_sprom = 1,
234
235 .has_enet0 = 1,
236 @@ -508,7 +493,6 @@ static struct board_info __initdata boar
237 .has_ohci0 = 1,
238 .has_pccard = 1,
239 .has_pci = 1,
240 - .has_uart0 = 1,
241 .use_fallback_sprom = 1,
242
243 .has_enet0 = 1,
244 @@ -560,7 +544,6 @@ static struct board_info __initdata boar
245 .num_usbh_ports = 2,
246 .has_pccard = 1,
247 .has_pci = 1,
248 - .has_uart0 = 1,
249 .use_fallback_sprom = 1,
250
251 .has_enet0 = 1,
252 @@ -606,7 +589,6 @@ static struct board_info __initdata boar
253 .has_ehci0 = 1,
254 .has_ohci0 = 1,
255 .has_pci = 1,
256 - .has_uart0 = 1,
257
258 .has_enet0 = 1,
259 .enet0 = {