OpenWrt – Blame information for rev 2
?pathlinks?
Rev | Author | Line No. | Line |
---|---|---|---|
1 | office | 1 | From badf28957b6dc400dff27bd23ba2ae75d9514be5 Mon Sep 17 00:00:00 2001 |
2 | From: John Crispin <john@phrozen.org> |
||
3 | Date: Sat, 23 Jun 2018 15:04:09 +0200 |
||
4 | Subject: [PATCH 28/33] MIPS: ath79: drop machfiles |
||
5 | |||
6 | With the target now being fully OF based, we can drop the legacy mach |
||
7 | files. Boards can now boot fully of devicetree files. |
||
8 | |||
9 | Signed-off-by: John Crispin <john@phrozen.org> |
||
10 | --- |
||
11 | arch/mips/Kconfig | 1 - |
||
12 | arch/mips/ath79/Kconfig | 73 ------------------- |
||
13 | arch/mips/ath79/Makefile | 10 --- |
||
14 | arch/mips/ath79/clock.c | 1 - |
||
15 | arch/mips/ath79/mach-ap121.c | 92 ------------------------ |
||
16 | arch/mips/ath79/mach-ap136.c | 156 ----------------------------------------- |
||
17 | arch/mips/ath79/mach-ap81.c | 100 -------------------------- |
||
18 | arch/mips/ath79/mach-db120.c | 136 ----------------------------------- |
||
19 | arch/mips/ath79/mach-pb44.c | 128 --------------------------------- |
||
20 | arch/mips/ath79/mach-ubnt-xm.c | 126 --------------------------------- |
||
21 | arch/mips/ath79/machtypes.h | 28 -------- |
||
22 | arch/mips/ath79/setup.c | 77 +++----------------- |
||
23 | 12 files changed, 9 insertions(+), 919 deletions(-) |
||
24 | delete mode 100644 arch/mips/ath79/mach-ap121.c |
||
25 | delete mode 100644 arch/mips/ath79/mach-ap136.c |
||
26 | delete mode 100644 arch/mips/ath79/mach-ap81.c |
||
27 | delete mode 100644 arch/mips/ath79/mach-db120.c |
||
28 | delete mode 100644 arch/mips/ath79/mach-pb44.c |
||
29 | delete mode 100644 arch/mips/ath79/mach-ubnt-xm.c |
||
30 | delete mode 100644 arch/mips/ath79/machtypes.h |
||
31 | |||
32 | --- a/arch/mips/Kconfig |
||
33 | +++ b/arch/mips/Kconfig |
||
34 | @@ -197,7 +197,6 @@ config ATH79 |
||
35 | select COMMON_CLK |
||
36 | select CLKDEV_LOOKUP |
||
37 | select IRQ_MIPS_CPU |
||
38 | - select MIPS_MACHINE |
||
39 | select SYS_HAS_CPU_MIPS32_R2 |
||
40 | select SYS_HAS_EARLY_PRINTK |
||
41 | select SYS_SUPPORTS_32BIT_KERNEL |
||
42 | --- a/arch/mips/ath79/Kconfig |
||
43 | +++ b/arch/mips/ath79/Kconfig |
||
44 | @@ -1,79 +1,6 @@ |
||
45 | # SPDX-License-Identifier: GPL-2.0 |
||
46 | if ATH79 |
||
47 | |||
48 | -menu "Atheros AR71XX/AR724X/AR913X machine selection" |
||
49 | - |
||
50 | -config ATH79_MACH_AP121 |
||
51 | - bool "Atheros AP121 reference board" |
||
52 | - select SOC_AR933X |
||
53 | - select ATH79_DEV_GPIO_BUTTONS |
||
54 | - select ATH79_DEV_LEDS_GPIO |
||
55 | - select ATH79_DEV_SPI |
||
56 | - select ATH79_DEV_USB |
||
57 | - select ATH79_DEV_WMAC |
||
58 | - help |
||
59 | - Say 'Y' here if you want your kernel to support the |
||
60 | - Atheros AP121 reference board. |
||
61 | - |
||
62 | -config ATH79_MACH_AP136 |
||
63 | - bool "Atheros AP136 reference board" |
||
64 | - select SOC_QCA955X |
||
65 | - select ATH79_DEV_GPIO_BUTTONS |
||
66 | - select ATH79_DEV_LEDS_GPIO |
||
67 | - select ATH79_DEV_SPI |
||
68 | - select ATH79_DEV_USB |
||
69 | - select ATH79_DEV_WMAC |
||
70 | - help |
||
71 | - Say 'Y' here if you want your kernel to support the |
||
72 | - Atheros AP136 reference board. |
||
73 | - |
||
74 | -config ATH79_MACH_AP81 |
||
75 | - bool "Atheros AP81 reference board" |
||
76 | - select SOC_AR913X |
||
77 | - select ATH79_DEV_GPIO_BUTTONS |
||
78 | - select ATH79_DEV_LEDS_GPIO |
||
79 | - select ATH79_DEV_SPI |
||
80 | - select ATH79_DEV_USB |
||
81 | - select ATH79_DEV_WMAC |
||
82 | - help |
||
83 | - Say 'Y' here if you want your kernel to support the |
||
84 | - Atheros AP81 reference board. |
||
85 | - |
||
86 | -config ATH79_MACH_DB120 |
||
87 | - bool "Atheros DB120 reference board" |
||
88 | - select SOC_AR934X |
||
89 | - select ATH79_DEV_GPIO_BUTTONS |
||
90 | - select ATH79_DEV_LEDS_GPIO |
||
91 | - select ATH79_DEV_SPI |
||
92 | - select ATH79_DEV_USB |
||
93 | - select ATH79_DEV_WMAC |
||
94 | - help |
||
95 | - Say 'Y' here if you want your kernel to support the |
||
96 | - Atheros DB120 reference board. |
||
97 | - |
||
98 | -config ATH79_MACH_PB44 |
||
99 | - bool "Atheros PB44 reference board" |
||
100 | - select SOC_AR71XX |
||
101 | - select ATH79_DEV_GPIO_BUTTONS |
||
102 | - select ATH79_DEV_LEDS_GPIO |
||
103 | - select ATH79_DEV_SPI |
||
104 | - select ATH79_DEV_USB |
||
105 | - help |
||
106 | - Say 'Y' here if you want your kernel to support the |
||
107 | - Atheros PB44 reference board. |
||
108 | - |
||
109 | -config ATH79_MACH_UBNT_XM |
||
110 | - bool "Ubiquiti Networks XM (rev 1.0) board" |
||
111 | - select SOC_AR724X |
||
112 | - select ATH79_DEV_GPIO_BUTTONS |
||
113 | - select ATH79_DEV_LEDS_GPIO |
||
114 | - select ATH79_DEV_SPI |
||
115 | - help |
||
116 | - Say 'Y' here if you want your kernel to support the |
||
117 | - Ubiquiti Networks XM (rev 1.0) board. |
||
118 | - |
||
119 | -endmenu |
||
120 | - |
||
121 | config SOC_AR71XX |
||
122 | select HW_HAS_PCI |
||
123 | def_bool n |
||
124 | --- a/arch/mips/ath79/Makefile |
||
125 | +++ b/arch/mips/ath79/Makefile |
||
126 | @@ -22,13 +22,3 @@ obj-$(CONFIG_ATH79_DEV_LEDS_GPIO) += dev |
||
127 | obj-$(CONFIG_ATH79_DEV_SPI) += dev-spi.o |
||
128 | obj-$(CONFIG_ATH79_DEV_USB) += dev-usb.o |
||
129 | obj-$(CONFIG_ATH79_DEV_WMAC) += dev-wmac.o |
||
130 | - |
||
131 | -# |
||
132 | -# Machines |
||
133 | -# |
||
134 | -obj-$(CONFIG_ATH79_MACH_AP121) += mach-ap121.o |
||
135 | -obj-$(CONFIG_ATH79_MACH_AP136) += mach-ap136.o |
||
136 | -obj-$(CONFIG_ATH79_MACH_AP81) += mach-ap81.o |
||
137 | -obj-$(CONFIG_ATH79_MACH_DB120) += mach-db120.o |
||
138 | -obj-$(CONFIG_ATH79_MACH_PB44) += mach-pb44.o |
||
139 | -obj-$(CONFIG_ATH79_MACH_UBNT_XM) += mach-ubnt-xm.o |
||
140 | --- a/arch/mips/ath79/clock.c |
||
141 | +++ b/arch/mips/ath79/clock.c |
||
142 | @@ -26,7 +26,6 @@ |
||
143 | #include <asm/mach-ath79/ath79.h> |
||
144 | #include <asm/mach-ath79/ar71xx_regs.h> |
||
145 | #include "common.h" |
||
146 | -#include "machtypes.h" |
||
147 | |||
148 | #define AR71XX_BASE_FREQ 40000000 |
||
149 | #define AR724X_BASE_FREQ 40000000 |
||
150 | --- a/arch/mips/ath79/mach-ap121.c |
||
151 | +++ /dev/null |
||
152 | @@ -1,92 +0,0 @@ |
||
153 | -/* |
||
154 | - * Atheros AP121 board support |
||
155 | - * |
||
156 | - * Copyright (C) 2011 Gabor Juhos <juhosg@openwrt.org> |
||
157 | - * |
||
158 | - * This program is free software; you can redistribute it and/or modify it |
||
159 | - * under the terms of the GNU General Public License version 2 as published |
||
160 | - * by the Free Software Foundation. |
||
161 | - */ |
||
162 | - |
||
163 | -#include "machtypes.h" |
||
164 | -#include "dev-gpio-buttons.h" |
||
165 | -#include "dev-leds-gpio.h" |
||
166 | -#include "dev-spi.h" |
||
167 | -#include "dev-usb.h" |
||
168 | -#include "dev-wmac.h" |
||
169 | - |
||
170 | -#define AP121_GPIO_LED_WLAN 0 |
||
171 | -#define AP121_GPIO_LED_USB 1 |
||
172 | - |
||
173 | -#define AP121_GPIO_BTN_JUMPSTART 11 |
||
174 | -#define AP121_GPIO_BTN_RESET 12 |
||
175 | - |
||
176 | -#define AP121_KEYS_POLL_INTERVAL 20 /* msecs */ |
||
177 | -#define AP121_KEYS_DEBOUNCE_INTERVAL (3 * AP121_KEYS_POLL_INTERVAL) |
||
178 | - |
||
179 | -#define AP121_CAL_DATA_ADDR 0x1fff1000 |
||
180 | - |
||
181 | -static struct gpio_led ap121_leds_gpio[] __initdata = { |
||
182 | - { |
||
183 | - .name = "ap121:green:usb", |
||
184 | - .gpio = AP121_GPIO_LED_USB, |
||
185 | - .active_low = 0, |
||
186 | - }, |
||
187 | - { |
||
188 | - .name = "ap121:green:wlan", |
||
189 | - .gpio = AP121_GPIO_LED_WLAN, |
||
190 | - .active_low = 0, |
||
191 | - }, |
||
192 | -}; |
||
193 | - |
||
194 | -static struct gpio_keys_button ap121_gpio_keys[] __initdata = { |
||
195 | - { |
||
196 | - .desc = "jumpstart button", |
||
197 | - .type = EV_KEY, |
||
198 | - .code = KEY_WPS_BUTTON, |
||
199 | - .debounce_interval = AP121_KEYS_DEBOUNCE_INTERVAL, |
||
200 | - .gpio = AP121_GPIO_BTN_JUMPSTART, |
||
201 | - .active_low = 1, |
||
202 | - }, |
||
203 | - { |
||
204 | - .desc = "reset button", |
||
205 | - .type = EV_KEY, |
||
206 | - .code = KEY_RESTART, |
||
207 | - .debounce_interval = AP121_KEYS_DEBOUNCE_INTERVAL, |
||
208 | - .gpio = AP121_GPIO_BTN_RESET, |
||
209 | - .active_low = 1, |
||
210 | - } |
||
211 | -}; |
||
212 | - |
||
213 | -static struct spi_board_info ap121_spi_info[] = { |
||
214 | - { |
||
215 | - .bus_num = 0, |
||
216 | - .chip_select = 0, |
||
217 | - .max_speed_hz = 25000000, |
||
218 | - .modalias = "mx25l1606e", |
||
219 | - } |
||
220 | -}; |
||
221 | - |
||
222 | -static struct ath79_spi_platform_data ap121_spi_data = { |
||
223 | - .bus_num = 0, |
||
224 | - .num_chipselect = 1, |
||
225 | -}; |
||
226 | - |
||
227 | -static void __init ap121_setup(void) |
||
228 | -{ |
||
229 | - u8 *cal_data = (u8 *) KSEG1ADDR(AP121_CAL_DATA_ADDR); |
||
230 | - |
||
231 | - ath79_register_leds_gpio(-1, ARRAY_SIZE(ap121_leds_gpio), |
||
232 | - ap121_leds_gpio); |
||
233 | - ath79_register_gpio_keys_polled(-1, AP121_KEYS_POLL_INTERVAL, |
||
234 | - ARRAY_SIZE(ap121_gpio_keys), |
||
235 | - ap121_gpio_keys); |
||
236 | - |
||
237 | - ath79_register_spi(&ap121_spi_data, ap121_spi_info, |
||
238 | - ARRAY_SIZE(ap121_spi_info)); |
||
239 | - ath79_register_usb(); |
||
240 | - ath79_register_wmac(cal_data); |
||
241 | -} |
||
242 | - |
||
243 | -MIPS_MACHINE(ATH79_MACH_AP121, "AP121", "Atheros AP121 reference board", |
||
244 | - ap121_setup); |
||
245 | --- a/arch/mips/ath79/mach-ap136.c |
||
246 | +++ /dev/null |
||
247 | @@ -1,156 +0,0 @@ |
||
248 | -/* |
||
249 | - * Qualcomm Atheros AP136 reference board support |
||
250 | - * |
||
251 | - * Copyright (c) 2012 Qualcomm Atheros |
||
252 | - * Copyright (c) 2012-2013 Gabor Juhos <juhosg@openwrt.org> |
||
253 | - * |
||
254 | - * Permission to use, copy, modify, and/or distribute this software for any |
||
255 | - * purpose with or without fee is hereby granted, provided that the above |
||
256 | - * copyright notice and this permission notice appear in all copies. |
||
257 | - * |
||
258 | - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES |
||
259 | - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF |
||
260 | - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR |
||
261 | - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES |
||
262 | - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN |
||
263 | - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF |
||
264 | - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
||
265 | - * |
||
266 | - */ |
||
267 | - |
||
268 | -#include <linux/pci.h> |
||
269 | -#include <linux/ath9k_platform.h> |
||
270 | - |
||
271 | -#include "machtypes.h" |
||
272 | -#include "dev-gpio-buttons.h" |
||
273 | -#include "dev-leds-gpio.h" |
||
274 | -#include "dev-spi.h" |
||
275 | -#include "dev-usb.h" |
||
276 | -#include "dev-wmac.h" |
||
277 | -#include "pci.h" |
||
278 | - |
||
279 | -#define AP136_GPIO_LED_STATUS_RED 14 |
||
280 | -#define AP136_GPIO_LED_STATUS_GREEN 19 |
||
281 | -#define AP136_GPIO_LED_USB 4 |
||
282 | -#define AP136_GPIO_LED_WLAN_2G 13 |
||
283 | -#define AP136_GPIO_LED_WLAN_5G 12 |
||
284 | -#define AP136_GPIO_LED_WPS_RED 15 |
||
285 | -#define AP136_GPIO_LED_WPS_GREEN 20 |
||
286 | - |
||
287 | -#define AP136_GPIO_BTN_WPS 16 |
||
288 | -#define AP136_GPIO_BTN_RFKILL 21 |
||
289 | - |
||
290 | -#define AP136_KEYS_POLL_INTERVAL 20 /* msecs */ |
||
291 | -#define AP136_KEYS_DEBOUNCE_INTERVAL (3 * AP136_KEYS_POLL_INTERVAL) |
||
292 | - |
||
293 | -#define AP136_WMAC_CALDATA_OFFSET 0x1000 |
||
294 | -#define AP136_PCIE_CALDATA_OFFSET 0x5000 |
||
295 | - |
||
296 | -static struct gpio_led ap136_leds_gpio[] __initdata = { |
||
297 | - { |
||
298 | - .name = "qca:green:status", |
||
299 | - .gpio = AP136_GPIO_LED_STATUS_GREEN, |
||
300 | - .active_low = 1, |
||
301 | - }, |
||
302 | - { |
||
303 | - .name = "qca:red:status", |
||
304 | - .gpio = AP136_GPIO_LED_STATUS_RED, |
||
305 | - .active_low = 1, |
||
306 | - }, |
||
307 | - { |
||
308 | - .name = "qca:green:wps", |
||
309 | - .gpio = AP136_GPIO_LED_WPS_GREEN, |
||
310 | - .active_low = 1, |
||
311 | - }, |
||
312 | - { |
||
313 | - .name = "qca:red:wps", |
||
314 | - .gpio = AP136_GPIO_LED_WPS_RED, |
||
315 | - .active_low = 1, |
||
316 | - }, |
||
317 | - { |
||
318 | - .name = "qca:red:wlan-2g", |
||
319 | - .gpio = AP136_GPIO_LED_WLAN_2G, |
||
320 | - .active_low = 1, |
||
321 | - }, |
||
322 | - { |
||
323 | - .name = "qca:red:usb", |
||
324 | - .gpio = AP136_GPIO_LED_USB, |
||
325 | - .active_low = 1, |
||
326 | - } |
||
327 | -}; |
||
328 | - |
||
329 | -static struct gpio_keys_button ap136_gpio_keys[] __initdata = { |
||
330 | - { |
||
331 | - .desc = "WPS button", |
||
332 | - .type = EV_KEY, |
||
333 | - .code = KEY_WPS_BUTTON, |
||
334 | - .debounce_interval = AP136_KEYS_DEBOUNCE_INTERVAL, |
||
335 | - .gpio = AP136_GPIO_BTN_WPS, |
||
336 | - .active_low = 1, |
||
337 | - }, |
||
338 | - { |
||
339 | - .desc = "RFKILL button", |
||
340 | - .type = EV_KEY, |
||
341 | - .code = KEY_RFKILL, |
||
342 | - .debounce_interval = AP136_KEYS_DEBOUNCE_INTERVAL, |
||
343 | - .gpio = AP136_GPIO_BTN_RFKILL, |
||
344 | - .active_low = 1, |
||
345 | - }, |
||
346 | -}; |
||
347 | - |
||
348 | -static struct spi_board_info ap136_spi_info[] = { |
||
349 | - { |
||
350 | - .bus_num = 0, |
||
351 | - .chip_select = 0, |
||
352 | - .max_speed_hz = 25000000, |
||
353 | - .modalias = "mx25l6405d", |
||
354 | - } |
||
355 | -}; |
||
356 | - |
||
357 | -static struct ath79_spi_platform_data ap136_spi_data = { |
||
358 | - .bus_num = 0, |
||
359 | - .num_chipselect = 1, |
||
360 | -}; |
||
361 | - |
||
362 | -#ifdef CONFIG_PCI |
||
363 | -static struct ath9k_platform_data ap136_ath9k_data; |
||
364 | - |
||
365 | -static int ap136_pci_plat_dev_init(struct pci_dev *dev) |
||
366 | -{ |
||
367 | - if (dev->bus->number == 1 && (PCI_SLOT(dev->devfn)) == 0) |
||
368 | - dev->dev.platform_data = &ap136_ath9k_data; |
||
369 | - |
||
370 | - return 0; |
||
371 | -} |
||
372 | - |
||
373 | -static void __init ap136_pci_init(u8 *eeprom) |
||
374 | -{ |
||
375 | - memcpy(ap136_ath9k_data.eeprom_data, eeprom, |
||
376 | - sizeof(ap136_ath9k_data.eeprom_data)); |
||
377 | - |
||
378 | - ath79_pci_set_plat_dev_init(ap136_pci_plat_dev_init); |
||
379 | - ath79_register_pci(); |
||
380 | -} |
||
381 | -#else |
||
382 | -static inline void ap136_pci_init(u8 *eeprom) {} |
||
383 | -#endif /* CONFIG_PCI */ |
||
384 | - |
||
385 | -static void __init ap136_setup(void) |
||
386 | -{ |
||
387 | - u8 *art = (u8 *) KSEG1ADDR(0x1fff0000); |
||
388 | - |
||
389 | - ath79_register_leds_gpio(-1, ARRAY_SIZE(ap136_leds_gpio), |
||
390 | - ap136_leds_gpio); |
||
391 | - ath79_register_gpio_keys_polled(-1, AP136_KEYS_POLL_INTERVAL, |
||
392 | - ARRAY_SIZE(ap136_gpio_keys), |
||
393 | - ap136_gpio_keys); |
||
394 | - ath79_register_spi(&ap136_spi_data, ap136_spi_info, |
||
395 | - ARRAY_SIZE(ap136_spi_info)); |
||
396 | - ath79_register_usb(); |
||
397 | - ath79_register_wmac(art + AP136_WMAC_CALDATA_OFFSET); |
||
398 | - ap136_pci_init(art + AP136_PCIE_CALDATA_OFFSET); |
||
399 | -} |
||
400 | - |
||
401 | -MIPS_MACHINE(ATH79_MACH_AP136_010, "AP136-010", |
||
402 | - "Atheros AP136-010 reference board", |
||
403 | - ap136_setup); |
||
404 | --- a/arch/mips/ath79/mach-ap81.c |
||
405 | +++ /dev/null |
||
406 | @@ -1,100 +0,0 @@ |
||
407 | -/* |
||
408 | - * Atheros AP81 board support |
||
409 | - * |
||
410 | - * Copyright (C) 2009-2010 Gabor Juhos <juhosg@openwrt.org> |
||
411 | - * Copyright (C) 2009 Imre Kaloz <kaloz@openwrt.org> |
||
412 | - * |
||
413 | - * This program is free software; you can redistribute it and/or modify it |
||
414 | - * under the terms of the GNU General Public License version 2 as published |
||
415 | - * by the Free Software Foundation. |
||
416 | - */ |
||
417 | - |
||
418 | -#include "machtypes.h" |
||
419 | -#include "dev-wmac.h" |
||
420 | -#include "dev-gpio-buttons.h" |
||
421 | -#include "dev-leds-gpio.h" |
||
422 | -#include "dev-spi.h" |
||
423 | -#include "dev-usb.h" |
||
424 | - |
||
425 | -#define AP81_GPIO_LED_STATUS 1 |
||
426 | -#define AP81_GPIO_LED_AOSS 3 |
||
427 | -#define AP81_GPIO_LED_WLAN 6 |
||
428 | -#define AP81_GPIO_LED_POWER 14 |
||
429 | - |
||
430 | -#define AP81_GPIO_BTN_SW4 12 |
||
431 | -#define AP81_GPIO_BTN_SW1 21 |
||
432 | - |
||
433 | -#define AP81_KEYS_POLL_INTERVAL 20 /* msecs */ |
||
434 | -#define AP81_KEYS_DEBOUNCE_INTERVAL (3 * AP81_KEYS_POLL_INTERVAL) |
||
435 | - |
||
436 | -#define AP81_CAL_DATA_ADDR 0x1fff1000 |
||
437 | - |
||
438 | -static struct gpio_led ap81_leds_gpio[] __initdata = { |
||
439 | - { |
||
440 | - .name = "ap81:green:status", |
||
441 | - .gpio = AP81_GPIO_LED_STATUS, |
||
442 | - .active_low = 1, |
||
443 | - }, { |
||
444 | - .name = "ap81:amber:aoss", |
||
445 | - .gpio = AP81_GPIO_LED_AOSS, |
||
446 | - .active_low = 1, |
||
447 | - }, { |
||
448 | - .name = "ap81:green:wlan", |
||
449 | - .gpio = AP81_GPIO_LED_WLAN, |
||
450 | - .active_low = 1, |
||
451 | - }, { |
||
452 | - .name = "ap81:green:power", |
||
453 | - .gpio = AP81_GPIO_LED_POWER, |
||
454 | - .active_low = 1, |
||
455 | - } |
||
456 | -}; |
||
457 | - |
||
458 | -static struct gpio_keys_button ap81_gpio_keys[] __initdata = { |
||
459 | - { |
||
460 | - .desc = "sw1", |
||
461 | - .type = EV_KEY, |
||
462 | - .code = BTN_0, |
||
463 | - .debounce_interval = AP81_KEYS_DEBOUNCE_INTERVAL, |
||
464 | - .gpio = AP81_GPIO_BTN_SW1, |
||
465 | - .active_low = 1, |
||
466 | - } , { |
||
467 | - .desc = "sw4", |
||
468 | - .type = EV_KEY, |
||
469 | - .code = BTN_1, |
||
470 | - .debounce_interval = AP81_KEYS_DEBOUNCE_INTERVAL, |
||
471 | - .gpio = AP81_GPIO_BTN_SW4, |
||
472 | - .active_low = 1, |
||
473 | - } |
||
474 | -}; |
||
475 | - |
||
476 | -static struct spi_board_info ap81_spi_info[] = { |
||
477 | - { |
||
478 | - .bus_num = 0, |
||
479 | - .chip_select = 0, |
||
480 | - .max_speed_hz = 25000000, |
||
481 | - .modalias = "m25p64", |
||
482 | - } |
||
483 | -}; |
||
484 | - |
||
485 | -static struct ath79_spi_platform_data ap81_spi_data = { |
||
486 | - .bus_num = 0, |
||
487 | - .num_chipselect = 1, |
||
488 | -}; |
||
489 | - |
||
490 | -static void __init ap81_setup(void) |
||
491 | -{ |
||
492 | - u8 *cal_data = (u8 *) KSEG1ADDR(AP81_CAL_DATA_ADDR); |
||
493 | - |
||
494 | - ath79_register_leds_gpio(-1, ARRAY_SIZE(ap81_leds_gpio), |
||
495 | - ap81_leds_gpio); |
||
496 | - ath79_register_gpio_keys_polled(-1, AP81_KEYS_POLL_INTERVAL, |
||
497 | - ARRAY_SIZE(ap81_gpio_keys), |
||
498 | - ap81_gpio_keys); |
||
499 | - ath79_register_spi(&ap81_spi_data, ap81_spi_info, |
||
500 | - ARRAY_SIZE(ap81_spi_info)); |
||
501 | - ath79_register_wmac(cal_data); |
||
502 | - ath79_register_usb(); |
||
503 | -} |
||
504 | - |
||
505 | -MIPS_MACHINE(ATH79_MACH_AP81, "AP81", "Atheros AP81 reference board", |
||
506 | - ap81_setup); |
||
507 | --- a/arch/mips/ath79/mach-db120.c |
||
508 | +++ /dev/null |
||
509 | @@ -1,136 +0,0 @@ |
||
510 | -/* |
||
511 | - * Atheros DB120 reference board support |
||
512 | - * |
||
513 | - * Copyright (c) 2011 Qualcomm Atheros |
||
514 | - * Copyright (c) 2011 Gabor Juhos <juhosg@openwrt.org> |
||
515 | - * |
||
516 | - * Permission to use, copy, modify, and/or distribute this software for any |
||
517 | - * purpose with or without fee is hereby granted, provided that the above |
||
518 | - * copyright notice and this permission notice appear in all copies. |
||
519 | - * |
||
520 | - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES |
||
521 | - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF |
||
522 | - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR |
||
523 | - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES |
||
524 | - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN |
||
525 | - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF |
||
526 | - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
||
527 | - * |
||
528 | - */ |
||
529 | - |
||
530 | -#include <linux/pci.h> |
||
531 | -#include <linux/ath9k_platform.h> |
||
532 | - |
||
533 | -#include "machtypes.h" |
||
534 | -#include "dev-gpio-buttons.h" |
||
535 | -#include "dev-leds-gpio.h" |
||
536 | -#include "dev-spi.h" |
||
537 | -#include "dev-usb.h" |
||
538 | -#include "dev-wmac.h" |
||
539 | -#include "pci.h" |
||
540 | - |
||
541 | -#define DB120_GPIO_LED_WLAN_5G 12 |
||
542 | -#define DB120_GPIO_LED_WLAN_2G 13 |
||
543 | -#define DB120_GPIO_LED_STATUS 14 |
||
544 | -#define DB120_GPIO_LED_WPS 15 |
||
545 | - |
||
546 | -#define DB120_GPIO_BTN_WPS 16 |
||
547 | - |
||
548 | -#define DB120_KEYS_POLL_INTERVAL 20 /* msecs */ |
||
549 | -#define DB120_KEYS_DEBOUNCE_INTERVAL (3 * DB120_KEYS_POLL_INTERVAL) |
||
550 | - |
||
551 | -#define DB120_WMAC_CALDATA_OFFSET 0x1000 |
||
552 | -#define DB120_PCIE_CALDATA_OFFSET 0x5000 |
||
553 | - |
||
554 | -static struct gpio_led db120_leds_gpio[] __initdata = { |
||
555 | - { |
||
556 | - .name = "db120:green:status", |
||
557 | - .gpio = DB120_GPIO_LED_STATUS, |
||
558 | - .active_low = 1, |
||
559 | - }, |
||
560 | - { |
||
561 | - .name = "db120:green:wps", |
||
562 | - .gpio = DB120_GPIO_LED_WPS, |
||
563 | - .active_low = 1, |
||
564 | - }, |
||
565 | - { |
||
566 | - .name = "db120:green:wlan-5g", |
||
567 | - .gpio = DB120_GPIO_LED_WLAN_5G, |
||
568 | - .active_low = 1, |
||
569 | - }, |
||
570 | - { |
||
571 | - .name = "db120:green:wlan-2g", |
||
572 | - .gpio = DB120_GPIO_LED_WLAN_2G, |
||
573 | - .active_low = 1, |
||
574 | - }, |
||
575 | -}; |
||
576 | - |
||
577 | -static struct gpio_keys_button db120_gpio_keys[] __initdata = { |
||
578 | - { |
||
579 | - .desc = "WPS button", |
||
580 | - .type = EV_KEY, |
||
581 | - .code = KEY_WPS_BUTTON, |
||
582 | - .debounce_interval = DB120_KEYS_DEBOUNCE_INTERVAL, |
||
583 | - .gpio = DB120_GPIO_BTN_WPS, |
||
584 | - .active_low = 1, |
||
585 | - }, |
||
586 | -}; |
||
587 | - |
||
588 | -static struct spi_board_info db120_spi_info[] = { |
||
589 | - { |
||
590 | - .bus_num = 0, |
||
591 | - .chip_select = 0, |
||
592 | - .max_speed_hz = 25000000, |
||
593 | - .modalias = "s25sl064a", |
||
594 | - } |
||
595 | -}; |
||
596 | - |
||
597 | -static struct ath79_spi_platform_data db120_spi_data = { |
||
598 | - .bus_num = 0, |
||
599 | - .num_chipselect = 1, |
||
600 | -}; |
||
601 | - |
||
602 | -#ifdef CONFIG_PCI |
||
603 | -static struct ath9k_platform_data db120_ath9k_data; |
||
604 | - |
||
605 | -static int db120_pci_plat_dev_init(struct pci_dev *dev) |
||
606 | -{ |
||
607 | - switch (PCI_SLOT(dev->devfn)) { |
||
608 | - case 0: |
||
609 | - dev->dev.platform_data = &db120_ath9k_data; |
||
610 | - break; |
||
611 | - } |
||
612 | - |
||
613 | - return 0; |
||
614 | -} |
||
615 | - |
||
616 | -static void __init db120_pci_init(u8 *eeprom) |
||
617 | -{ |
||
618 | - memcpy(db120_ath9k_data.eeprom_data, eeprom, |
||
619 | - sizeof(db120_ath9k_data.eeprom_data)); |
||
620 | - |
||
621 | - ath79_pci_set_plat_dev_init(db120_pci_plat_dev_init); |
||
622 | - ath79_register_pci(); |
||
623 | -} |
||
624 | -#else |
||
625 | -static inline void db120_pci_init(u8 *eeprom) {} |
||
626 | -#endif /* CONFIG_PCI */ |
||
627 | - |
||
628 | -static void __init db120_setup(void) |
||
629 | -{ |
||
630 | - u8 *art = (u8 *) KSEG1ADDR(0x1fff0000); |
||
631 | - |
||
632 | - ath79_register_leds_gpio(-1, ARRAY_SIZE(db120_leds_gpio), |
||
633 | - db120_leds_gpio); |
||
634 | - ath79_register_gpio_keys_polled(-1, DB120_KEYS_POLL_INTERVAL, |
||
635 | - ARRAY_SIZE(db120_gpio_keys), |
||
636 | - db120_gpio_keys); |
||
637 | - ath79_register_spi(&db120_spi_data, db120_spi_info, |
||
638 | - ARRAY_SIZE(db120_spi_info)); |
||
639 | - ath79_register_usb(); |
||
640 | - ath79_register_wmac(art + DB120_WMAC_CALDATA_OFFSET); |
||
641 | - db120_pci_init(art + DB120_PCIE_CALDATA_OFFSET); |
||
642 | -} |
||
643 | - |
||
644 | -MIPS_MACHINE(ATH79_MACH_DB120, "DB120", "Atheros DB120 reference board", |
||
645 | - db120_setup); |
||
646 | --- a/arch/mips/ath79/mach-pb44.c |
||
647 | +++ /dev/null |
||
648 | @@ -1,122 +0,0 @@ |
||
649 | -/* |
||
650 | - * Atheros PB44 reference board support |
||
651 | - * |
||
652 | - * Copyright (C) 2009-2010 Gabor Juhos <juhosg@openwrt.org> |
||
653 | - * |
||
654 | - * This program is free software; you can redistribute it and/or modify it |
||
655 | - * under the terms of the GNU General Public License version 2 as published |
||
656 | - * by the Free Software Foundation. |
||
657 | - */ |
||
658 | - |
||
659 | -#include <linux/init.h> |
||
660 | -#include <linux/platform_device.h> |
||
661 | -#include <linux/i2c.h> |
||
662 | -#include <linux/i2c-gpio.h> |
||
663 | -#include <linux/platform_data/pcf857x.h> |
||
664 | - |
||
665 | -#include "machtypes.h" |
||
666 | -#include "dev-gpio-buttons.h" |
||
667 | -#include "dev-leds-gpio.h" |
||
668 | -#include "dev-spi.h" |
||
669 | -#include "dev-usb.h" |
||
670 | -#include "pci.h" |
||
671 | - |
||
672 | -#define PB44_GPIO_I2C_SCL 0 |
||
673 | -#define PB44_GPIO_I2C_SDA 1 |
||
674 | - |
||
675 | -#define PB44_GPIO_EXP_BASE 16 |
||
676 | -#define PB44_GPIO_SW_RESET (PB44_GPIO_EXP_BASE + 6) |
||
677 | -#define PB44_GPIO_SW_JUMP (PB44_GPIO_EXP_BASE + 8) |
||
678 | -#define PB44_GPIO_LED_JUMP1 (PB44_GPIO_EXP_BASE + 9) |
||
679 | -#define PB44_GPIO_LED_JUMP2 (PB44_GPIO_EXP_BASE + 10) |
||
680 | - |
||
681 | -#define PB44_KEYS_POLL_INTERVAL 20 /* msecs */ |
||
682 | -#define PB44_KEYS_DEBOUNCE_INTERVAL (3 * PB44_KEYS_POLL_INTERVAL) |
||
683 | - |
||
684 | -static struct i2c_gpio_platform_data pb44_i2c_gpio_data = { |
||
685 | - .sda_pin = PB44_GPIO_I2C_SDA, |
||
686 | - .scl_pin = PB44_GPIO_I2C_SCL, |
||
687 | -}; |
||
688 | - |
||
689 | -static struct platform_device pb44_i2c_gpio_device = { |
||
690 | - .name = "i2c-gpio", |
||
691 | - .id = 0, |
||
692 | - .dev = { |
||
693 | - .platform_data = &pb44_i2c_gpio_data, |
||
694 | - } |
||
695 | -}; |
||
696 | - |
||
697 | -static struct pcf857x_platform_data pb44_pcf857x_data = { |
||
698 | - .gpio_base = PB44_GPIO_EXP_BASE, |
||
699 | -}; |
||
700 | - |
||
701 | -static struct i2c_board_info pb44_i2c_board_info[] __initdata = { |
||
702 | - { |
||
703 | - I2C_BOARD_INFO("pcf8575", 0x20), |
||
704 | - .platform_data = &pb44_pcf857x_data, |
||
705 | - }, |
||
706 | -}; |
||
707 | - |
||
708 | -static struct gpio_led pb44_leds_gpio[] __initdata = { |
||
709 | - { |
||
710 | - .name = "pb44:amber:jump1", |
||
711 | - .gpio = PB44_GPIO_LED_JUMP1, |
||
712 | - .active_low = 1, |
||
713 | - }, { |
||
714 | - .name = "pb44:green:jump2", |
||
715 | - .gpio = PB44_GPIO_LED_JUMP2, |
||
716 | - .active_low = 1, |
||
717 | - }, |
||
718 | -}; |
||
719 | - |
||
720 | -static struct gpio_keys_button pb44_gpio_keys[] __initdata = { |
||
721 | - { |
||
722 | - .desc = "soft_reset", |
||
723 | - .type = EV_KEY, |
||
724 | - .code = KEY_RESTART, |
||
725 | - .debounce_interval = PB44_KEYS_DEBOUNCE_INTERVAL, |
||
726 | - .gpio = PB44_GPIO_SW_RESET, |
||
727 | - .active_low = 1, |
||
728 | - } , { |
||
729 | - .desc = "jumpstart", |
||
730 | - .type = EV_KEY, |
||
731 | - .code = KEY_WPS_BUTTON, |
||
732 | - .debounce_interval = PB44_KEYS_DEBOUNCE_INTERVAL, |
||
733 | - .gpio = PB44_GPIO_SW_JUMP, |
||
734 | - .active_low = 1, |
||
735 | - } |
||
736 | -}; |
||
737 | - |
||
738 | -static struct spi_board_info pb44_spi_info[] = { |
||
739 | - { |
||
740 | - .bus_num = 0, |
||
741 | - .chip_select = 0, |
||
742 | - .max_speed_hz = 25000000, |
||
743 | - .modalias = "m25p64", |
||
744 | - }, |
||
745 | -}; |
||
746 | - |
||
747 | -static struct ath79_spi_platform_data pb44_spi_data = { |
||
748 | - .bus_num = 0, |
||
749 | - .num_chipselect = 1, |
||
750 | -}; |
||
751 | - |
||
752 | -static void __init pb44_init(void) |
||
753 | -{ |
||
754 | - i2c_register_board_info(0, pb44_i2c_board_info, |
||
755 | - ARRAY_SIZE(pb44_i2c_board_info)); |
||
756 | - platform_device_register(&pb44_i2c_gpio_device); |
||
757 | - |
||
758 | - ath79_register_leds_gpio(-1, ARRAY_SIZE(pb44_leds_gpio), |
||
759 | - pb44_leds_gpio); |
||
760 | - ath79_register_gpio_keys_polled(-1, PB44_KEYS_POLL_INTERVAL, |
||
761 | - ARRAY_SIZE(pb44_gpio_keys), |
||
762 | - pb44_gpio_keys); |
||
763 | - ath79_register_spi(&pb44_spi_data, pb44_spi_info, |
||
764 | - ARRAY_SIZE(pb44_spi_info)); |
||
765 | - ath79_register_usb(); |
||
766 | - ath79_register_pci(); |
||
767 | -} |
||
768 | - |
||
769 | -MIPS_MACHINE(ATH79_MACH_PB44, "PB44", "Atheros PB44 reference board", |
||
770 | - pb44_init); |
||
771 | --- a/arch/mips/ath79/mach-ubnt-xm.c |
||
772 | +++ /dev/null |
||
773 | @@ -1,126 +0,0 @@ |
||
774 | -/* |
||
775 | - * Ubiquiti Networks XM (rev 1.0) board support |
||
776 | - * |
||
777 | - * Copyright (C) 2011 René Bolldorf <xsecute@googlemail.com> |
||
778 | - * |
||
779 | - * Derived from: mach-pb44.c |
||
780 | - * |
||
781 | - * This program is free software; you can redistribute it and/or modify it |
||
782 | - * under the terms of the GNU General Public License version 2 as published |
||
783 | - * by the Free Software Foundation. |
||
784 | - */ |
||
785 | - |
||
786 | -#include <linux/init.h> |
||
787 | -#include <linux/pci.h> |
||
788 | -#include <linux/ath9k_platform.h> |
||
789 | - |
||
790 | -#include <asm/mach-ath79/irq.h> |
||
791 | - |
||
792 | -#include "machtypes.h" |
||
793 | -#include "dev-gpio-buttons.h" |
||
794 | -#include "dev-leds-gpio.h" |
||
795 | -#include "dev-spi.h" |
||
796 | -#include "pci.h" |
||
797 | - |
||
798 | -#define UBNT_XM_GPIO_LED_L1 0 |
||
799 | -#define UBNT_XM_GPIO_LED_L2 1 |
||
800 | -#define UBNT_XM_GPIO_LED_L3 11 |
||
801 | -#define UBNT_XM_GPIO_LED_L4 7 |
||
802 | - |
||
803 | -#define UBNT_XM_GPIO_BTN_RESET 12 |
||
804 | - |
||
805 | -#define UBNT_XM_KEYS_POLL_INTERVAL 20 |
||
806 | -#define UBNT_XM_KEYS_DEBOUNCE_INTERVAL (3 * UBNT_XM_KEYS_POLL_INTERVAL) |
||
807 | - |
||
808 | -#define UBNT_XM_EEPROM_ADDR (u8 *) KSEG1ADDR(0x1fff1000) |
||
809 | - |
||
810 | -static struct gpio_led ubnt_xm_leds_gpio[] __initdata = { |
||
811 | - { |
||
812 | - .name = "ubnt-xm:red:link1", |
||
813 | - .gpio = UBNT_XM_GPIO_LED_L1, |
||
814 | - .active_low = 0, |
||
815 | - }, { |
||
816 | - .name = "ubnt-xm:orange:link2", |
||
817 | - .gpio = UBNT_XM_GPIO_LED_L2, |
||
818 | - .active_low = 0, |
||
819 | - }, { |
||
820 | - .name = "ubnt-xm:green:link3", |
||
821 | - .gpio = UBNT_XM_GPIO_LED_L3, |
||
822 | - .active_low = 0, |
||
823 | - }, { |
||
824 | - .name = "ubnt-xm:green:link4", |
||
825 | - .gpio = UBNT_XM_GPIO_LED_L4, |
||
826 | - .active_low = 0, |
||
827 | - }, |
||
828 | -}; |
||
829 | - |
||
830 | -static struct gpio_keys_button ubnt_xm_gpio_keys[] __initdata = { |
||
831 | - { |
||
832 | - .desc = "reset", |
||
833 | - .type = EV_KEY, |
||
834 | - .code = KEY_RESTART, |
||
835 | - .debounce_interval = UBNT_XM_KEYS_DEBOUNCE_INTERVAL, |
||
836 | - .gpio = UBNT_XM_GPIO_BTN_RESET, |
||
837 | - .active_low = 1, |
||
838 | - } |
||
839 | -}; |
||
840 | - |
||
841 | -static struct spi_board_info ubnt_xm_spi_info[] = { |
||
842 | - { |
||
843 | - .bus_num = 0, |
||
844 | - .chip_select = 0, |
||
845 | - .max_speed_hz = 25000000, |
||
846 | - .modalias = "mx25l6405d", |
||
847 | - } |
||
848 | -}; |
||
849 | - |
||
850 | -static struct ath79_spi_platform_data ubnt_xm_spi_data = { |
||
851 | - .bus_num = 0, |
||
852 | - .num_chipselect = 1, |
||
853 | -}; |
||
854 | - |
||
855 | -#ifdef CONFIG_PCI |
||
856 | -static struct ath9k_platform_data ubnt_xm_eeprom_data; |
||
857 | - |
||
858 | -static int ubnt_xm_pci_plat_dev_init(struct pci_dev *dev) |
||
859 | -{ |
||
860 | - switch (PCI_SLOT(dev->devfn)) { |
||
861 | - case 0: |
||
862 | - dev->dev.platform_data = &ubnt_xm_eeprom_data; |
||
863 | - break; |
||
864 | - } |
||
865 | - |
||
866 | - return 0; |
||
867 | -} |
||
868 | - |
||
869 | -static void __init ubnt_xm_pci_init(void) |
||
870 | -{ |
||
871 | - memcpy(ubnt_xm_eeprom_data.eeprom_data, UBNT_XM_EEPROM_ADDR, |
||
872 | - sizeof(ubnt_xm_eeprom_data.eeprom_data)); |
||
873 | - |
||
874 | - ath79_pci_set_plat_dev_init(ubnt_xm_pci_plat_dev_init); |
||
875 | - ath79_register_pci(); |
||
876 | -} |
||
877 | -#else |
||
878 | -static inline void ubnt_xm_pci_init(void) {} |
||
879 | -#endif /* CONFIG_PCI */ |
||
880 | - |
||
881 | -static void __init ubnt_xm_init(void) |
||
882 | -{ |
||
883 | - ath79_register_leds_gpio(-1, ARRAY_SIZE(ubnt_xm_leds_gpio), |
||
884 | - ubnt_xm_leds_gpio); |
||
885 | - |
||
886 | - ath79_register_gpio_keys_polled(-1, UBNT_XM_KEYS_POLL_INTERVAL, |
||
887 | - ARRAY_SIZE(ubnt_xm_gpio_keys), |
||
888 | - ubnt_xm_gpio_keys); |
||
889 | - |
||
890 | - ath79_register_spi(&ubnt_xm_spi_data, ubnt_xm_spi_info, |
||
891 | - ARRAY_SIZE(ubnt_xm_spi_info)); |
||
892 | - |
||
893 | - ubnt_xm_pci_init(); |
||
894 | -} |
||
895 | - |
||
896 | -MIPS_MACHINE(ATH79_MACH_UBNT_XM, |
||
897 | - "UBNT-XM", |
||
898 | - "Ubiquiti Networks XM (rev 1.0) board", |
||
899 | - ubnt_xm_init); |
||
900 | --- a/arch/mips/ath79/machtypes.h |
||
901 | +++ /dev/null |
||
902 | @@ -1,28 +0,0 @@ |
||
903 | -/* |
||
904 | - * Atheros AR71XX/AR724X/AR913X machine type definitions |
||
905 | - * |
||
906 | - * Copyright (C) 2008-2010 Gabor Juhos <juhosg@openwrt.org> |
||
907 | - * Copyright (C) 2008 Imre Kaloz <kaloz@openwrt.org> |
||
908 | - * |
||
909 | - * This program is free software; you can redistribute it and/or modify it |
||
910 | - * under the terms of the GNU General Public License version 2 as published |
||
911 | - * by the Free Software Foundation. |
||
912 | - */ |
||
913 | - |
||
914 | -#ifndef _ATH79_MACHTYPE_H |
||
915 | -#define _ATH79_MACHTYPE_H |
||
916 | - |
||
917 | -#include <asm/mips_machine.h> |
||
918 | - |
||
919 | -enum ath79_mach_type { |
||
920 | - ATH79_MACH_GENERIC_OF = -1, /* Device tree board */ |
||
921 | - ATH79_MACH_GENERIC = 0, |
||
922 | - ATH79_MACH_AP121, /* Atheros AP121 reference board */ |
||
923 | - ATH79_MACH_AP136_010, /* Atheros AP136-010 reference board */ |
||
924 | - ATH79_MACH_AP81, /* Atheros AP81 reference board */ |
||
925 | - ATH79_MACH_DB120, /* Atheros DB120 reference board */ |
||
926 | - ATH79_MACH_PB44, /* Atheros PB44 reference board */ |
||
927 | - ATH79_MACH_UBNT_XM, /* Ubiquiti Networks XM board rev 1.0 */ |
||
928 | -}; |
||
929 | - |
||
930 | -#endif /* _ATH79_MACHTYPE_H */ |
||
931 | --- a/arch/mips/ath79/setup.c |
||
932 | +++ b/arch/mips/ath79/setup.c |
||
933 | @@ -33,7 +33,6 @@ |
||
934 | #include <asm/mach-ath79/ar71xx_regs.h> |
||
935 | #include "common.h" |
||
936 | #include "dev-common.h" |
||
937 | -#include "machtypes.h" |
||
938 | |||
939 | #define ATH79_SYS_TYPE_LEN 64 |
||
940 | |||
941 | @@ -236,25 +235,21 @@ void __init plat_mem_setup(void) |
||
942 | else if (fw_passed_dtb) |
||
943 | __dt_setup_arch((void *)KSEG0ADDR(fw_passed_dtb)); |
||
944 | |||
945 | - if (mips_machtype != ATH79_MACH_GENERIC_OF) { |
||
946 | - ath79_reset_base = ioremap_nocache(AR71XX_RESET_BASE, |
||
947 | - AR71XX_RESET_SIZE); |
||
948 | - ath79_pll_base = ioremap_nocache(AR71XX_PLL_BASE, |
||
949 | - AR71XX_PLL_SIZE); |
||
950 | - ath79_detect_sys_type(); |
||
951 | - ath79_ddr_ctrl_init(); |
||
952 | + ath79_reset_base = ioremap_nocache(AR71XX_RESET_BASE, |
||
953 | + AR71XX_RESET_SIZE); |
||
954 | + ath79_pll_base = ioremap_nocache(AR71XX_PLL_BASE, |
||
955 | + AR71XX_PLL_SIZE); |
||
956 | + ath79_detect_sys_type(); |
||
957 | + ath79_ddr_ctrl_init(); |
||
958 | |||
959 | - detect_memory_region(0, ATH79_MEM_SIZE_MIN, ATH79_MEM_SIZE_MAX); |
||
960 | - |
||
961 | - /* OF machines should use the reset driver */ |
||
962 | - _machine_restart = ath79_restart; |
||
963 | - } |
||
964 | + detect_memory_region(0, ATH79_MEM_SIZE_MIN, ATH79_MEM_SIZE_MAX); |
||
965 | |||
966 | + _machine_restart = ath79_restart; |
||
967 | _machine_halt = ath79_halt; |
||
968 | pm_power_off = ath79_halt; |
||
969 | } |
||
970 | |||
971 | -static void __init ath79_of_plat_time_init(void) |
||
972 | +void __init plat_time_init(void) |
||
973 | { |
||
974 | struct device_node *np; |
||
975 | struct clk *clk; |
||
976 | @@ -284,66 +279,12 @@ static void __init ath79_of_plat_time_in |
||
977 | clk_put(clk); |
||
978 | } |
||
979 | |||
980 | -void __init plat_time_init(void) |
||
981 | -{ |
||
982 | - unsigned long cpu_clk_rate; |
||
983 | - unsigned long ahb_clk_rate; |
||
984 | - unsigned long ddr_clk_rate; |
||
985 | - unsigned long ref_clk_rate; |
||
986 | - |
||
987 | - if (IS_ENABLED(CONFIG_OF) && mips_machtype == ATH79_MACH_GENERIC_OF) { |
||
988 | - ath79_of_plat_time_init(); |
||
989 | - return; |
||
990 | - } |
||
991 | - |
||
992 | - ath79_clocks_init(); |
||
993 | - |
||
994 | - cpu_clk_rate = ath79_get_sys_clk_rate("cpu"); |
||
995 | - ahb_clk_rate = ath79_get_sys_clk_rate("ahb"); |
||
996 | - ddr_clk_rate = ath79_get_sys_clk_rate("ddr"); |
||
997 | - ref_clk_rate = ath79_get_sys_clk_rate("ref"); |
||
998 | - |
||
999 | - pr_info("Clocks: CPU:%lu.%03luMHz, DDR:%lu.%03luMHz, AHB:%lu.%03luMHz, Ref:%lu.%03luMHz\n", |
||
1000 | - cpu_clk_rate / 1000000, (cpu_clk_rate / 1000) % 1000, |
||
1001 | - ddr_clk_rate / 1000000, (ddr_clk_rate / 1000) % 1000, |
||
1002 | - ahb_clk_rate / 1000000, (ahb_clk_rate / 1000) % 1000, |
||
1003 | - ref_clk_rate / 1000000, (ref_clk_rate / 1000) % 1000); |
||
1004 | - |
||
1005 | - mips_hpt_frequency = cpu_clk_rate / 2; |
||
1006 | -} |
||
1007 | - |
||
1008 | void __init arch_init_irq(void) |
||
1009 | { |
||
1010 | irqchip_init(); |
||
1011 | } |
||
1012 | |||
1013 | -static int __init ath79_setup(void) |
||
1014 | -{ |
||
1015 | - if (mips_machtype == ATH79_MACH_GENERIC_OF) |
||
1016 | - return 0; |
||
1017 | - |
||
1018 | - ath79_gpio_init(); |
||
1019 | - ath79_register_uart(); |
||
1020 | - ath79_register_wdt(); |
||
1021 | - |
||
1022 | - mips_machine_setup(); |
||
1023 | - |
||
1024 | - return 0; |
||
1025 | -} |
||
1026 | - |
||
1027 | -arch_initcall(ath79_setup); |
||
1028 | - |
||
1029 | void __init device_tree_init(void) |
||
1030 | { |
||
1031 | unflatten_and_copy_device_tree(); |
||
1032 | } |
||
1033 | - |
||
1034 | -MIPS_MACHINE(ATH79_MACH_GENERIC, |
||
1035 | - "Generic", |
||
1036 | - "Generic AR71XX/AR724X/AR913X based board", |
||
1037 | - NULL); |
||
1038 | - |
||
1039 | -MIPS_MACHINE(ATH79_MACH_GENERIC_OF, |
||
1040 | - "DTB", |
||
1041 | - "Generic AR71XX/AR724X/AR913X based board (DT)", |
||
1042 | - NULL); |