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