ath79: add new OF only target for QCA MIPS silicon
[openwrt/staging/hauke.git] / target / linux / ath79 / patches-4.14 / 0023-MIPS-ath79-drop-mach-files.patch
1 From 6e38a86d50dba5cc1da9bfd07969d76dd3ac2dda Mon Sep 17 00:00:00 2001
2 From: John Crispin <john@phrozen.org>
3 Date: Tue, 6 Mar 2018 09:28:13 +0100
4 Subject: [PATCH 23/27] MIPS: ath79: drop mach files
5
6 Signed-off-by: John Crispin <john@phrozen.org>
7 ---
8 arch/mips/ath79/Kconfig | 73 -------------------
9 arch/mips/ath79/Makefile | 10 ---
10 arch/mips/ath79/mach-ap121.c | 92 ------------------------
11 arch/mips/ath79/mach-ap136.c | 156 -----------------------------------------
12 arch/mips/ath79/mach-ap81.c | 100 --------------------------
13 arch/mips/ath79/mach-db120.c | 136 -----------------------------------
14 arch/mips/ath79/mach-pb44.c | 128 ---------------------------------
15 arch/mips/ath79/mach-ubnt-xm.c | 126 ---------------------------------
16 8 files changed, 821 deletions(-)
17 delete mode 100644 arch/mips/ath79/mach-ap121.c
18 delete mode 100644 arch/mips/ath79/mach-ap136.c
19 delete mode 100644 arch/mips/ath79/mach-ap81.c
20 delete mode 100644 arch/mips/ath79/mach-db120.c
21 delete mode 100644 arch/mips/ath79/mach-pb44.c
22 delete mode 100644 arch/mips/ath79/mach-ubnt-xm.c
23
24 Index: linux-4.14.25/arch/mips/ath79/Kconfig
25 ===================================================================
26 --- linux-4.14.25.orig/arch/mips/ath79/Kconfig
27 +++ linux-4.14.25/arch/mips/ath79/Kconfig
28 @@ -1,79 +1,6 @@
29 # SPDX-License-Identifier: GPL-2.0
30 if ATH79
31
32 -menu "Atheros AR71XX/AR724X/AR913X machine selection"
33 -
34 -config ATH79_MACH_AP121
35 - bool "Atheros AP121 reference board"
36 - select SOC_AR933X
37 - select ATH79_DEV_GPIO_BUTTONS
38 - select ATH79_DEV_LEDS_GPIO
39 - select ATH79_DEV_SPI
40 - select ATH79_DEV_USB
41 - select ATH79_DEV_WMAC
42 - help
43 - Say 'Y' here if you want your kernel to support the
44 - Atheros AP121 reference board.
45 -
46 -config ATH79_MACH_AP136
47 - bool "Atheros AP136 reference board"
48 - select SOC_QCA955X
49 - select ATH79_DEV_GPIO_BUTTONS
50 - select ATH79_DEV_LEDS_GPIO
51 - select ATH79_DEV_SPI
52 - select ATH79_DEV_USB
53 - select ATH79_DEV_WMAC
54 - help
55 - Say 'Y' here if you want your kernel to support the
56 - Atheros AP136 reference board.
57 -
58 -config ATH79_MACH_AP81
59 - bool "Atheros AP81 reference board"
60 - select SOC_AR913X
61 - select ATH79_DEV_GPIO_BUTTONS
62 - select ATH79_DEV_LEDS_GPIO
63 - select ATH79_DEV_SPI
64 - select ATH79_DEV_USB
65 - select ATH79_DEV_WMAC
66 - help
67 - Say 'Y' here if you want your kernel to support the
68 - Atheros AP81 reference board.
69 -
70 -config ATH79_MACH_DB120
71 - bool "Atheros DB120 reference board"
72 - select SOC_AR934X
73 - select ATH79_DEV_GPIO_BUTTONS
74 - select ATH79_DEV_LEDS_GPIO
75 - select ATH79_DEV_SPI
76 - select ATH79_DEV_USB
77 - select ATH79_DEV_WMAC
78 - help
79 - Say 'Y' here if you want your kernel to support the
80 - Atheros DB120 reference board.
81 -
82 -config ATH79_MACH_PB44
83 - bool "Atheros PB44 reference board"
84 - select SOC_AR71XX
85 - select ATH79_DEV_GPIO_BUTTONS
86 - select ATH79_DEV_LEDS_GPIO
87 - select ATH79_DEV_SPI
88 - select ATH79_DEV_USB
89 - help
90 - Say 'Y' here if you want your kernel to support the
91 - Atheros PB44 reference board.
92 -
93 -config ATH79_MACH_UBNT_XM
94 - bool "Ubiquiti Networks XM (rev 1.0) board"
95 - select SOC_AR724X
96 - select ATH79_DEV_GPIO_BUTTONS
97 - select ATH79_DEV_LEDS_GPIO
98 - select ATH79_DEV_SPI
99 - help
100 - Say 'Y' here if you want your kernel to support the
101 - Ubiquiti Networks XM (rev 1.0) board.
102 -
103 -endmenu
104 -
105 config SOC_AR71XX
106 select HW_HAS_PCI
107 def_bool n
108 Index: linux-4.14.25/arch/mips/ath79/Makefile
109 ===================================================================
110 --- linux-4.14.25.orig/arch/mips/ath79/Makefile
111 +++ linux-4.14.25/arch/mips/ath79/Makefile
112 @@ -21,13 +21,3 @@ obj-$(CONFIG_ATH79_DEV_LEDS_GPIO) += dev
113 obj-$(CONFIG_ATH79_DEV_SPI) += dev-spi.o
114 obj-$(CONFIG_ATH79_DEV_USB) += dev-usb.o
115 obj-$(CONFIG_ATH79_DEV_WMAC) += dev-wmac.o
116 -
117 -#
118 -# Machines
119 -#
120 -obj-$(CONFIG_ATH79_MACH_AP121) += mach-ap121.o
121 -obj-$(CONFIG_ATH79_MACH_AP136) += mach-ap136.o
122 -obj-$(CONFIG_ATH79_MACH_AP81) += mach-ap81.o
123 -obj-$(CONFIG_ATH79_MACH_DB120) += mach-db120.o
124 -obj-$(CONFIG_ATH79_MACH_PB44) += mach-pb44.o
125 -obj-$(CONFIG_ATH79_MACH_UBNT_XM) += mach-ubnt-xm.o
126 Index: linux-4.14.25/arch/mips/ath79/mach-ap121.c
127 ===================================================================
128 --- linux-4.14.25.orig/arch/mips/ath79/mach-ap121.c
129 +++ /dev/null
130 @@ -1,92 +0,0 @@
131 -/*
132 - * Atheros AP121 board support
133 - *
134 - * Copyright (C) 2011 Gabor Juhos <juhosg@openwrt.org>
135 - *
136 - * This program is free software; you can redistribute it and/or modify it
137 - * under the terms of the GNU General Public License version 2 as published
138 - * by the Free Software Foundation.
139 - */
140 -
141 -#include "machtypes.h"
142 -#include "dev-gpio-buttons.h"
143 -#include "dev-leds-gpio.h"
144 -#include "dev-spi.h"
145 -#include "dev-usb.h"
146 -#include "dev-wmac.h"
147 -
148 -#define AP121_GPIO_LED_WLAN 0
149 -#define AP121_GPIO_LED_USB 1
150 -
151 -#define AP121_GPIO_BTN_JUMPSTART 11
152 -#define AP121_GPIO_BTN_RESET 12
153 -
154 -#define AP121_KEYS_POLL_INTERVAL 20 /* msecs */
155 -#define AP121_KEYS_DEBOUNCE_INTERVAL (3 * AP121_KEYS_POLL_INTERVAL)
156 -
157 -#define AP121_CAL_DATA_ADDR 0x1fff1000
158 -
159 -static struct gpio_led ap121_leds_gpio[] __initdata = {
160 - {
161 - .name = "ap121:green:usb",
162 - .gpio = AP121_GPIO_LED_USB,
163 - .active_low = 0,
164 - },
165 - {
166 - .name = "ap121:green:wlan",
167 - .gpio = AP121_GPIO_LED_WLAN,
168 - .active_low = 0,
169 - },
170 -};
171 -
172 -static struct gpio_keys_button ap121_gpio_keys[] __initdata = {
173 - {
174 - .desc = "jumpstart button",
175 - .type = EV_KEY,
176 - .code = KEY_WPS_BUTTON,
177 - .debounce_interval = AP121_KEYS_DEBOUNCE_INTERVAL,
178 - .gpio = AP121_GPIO_BTN_JUMPSTART,
179 - .active_low = 1,
180 - },
181 - {
182 - .desc = "reset button",
183 - .type = EV_KEY,
184 - .code = KEY_RESTART,
185 - .debounce_interval = AP121_KEYS_DEBOUNCE_INTERVAL,
186 - .gpio = AP121_GPIO_BTN_RESET,
187 - .active_low = 1,
188 - }
189 -};
190 -
191 -static struct spi_board_info ap121_spi_info[] = {
192 - {
193 - .bus_num = 0,
194 - .chip_select = 0,
195 - .max_speed_hz = 25000000,
196 - .modalias = "mx25l1606e",
197 - }
198 -};
199 -
200 -static struct ath79_spi_platform_data ap121_spi_data = {
201 - .bus_num = 0,
202 - .num_chipselect = 1,
203 -};
204 -
205 -static void __init ap121_setup(void)
206 -{
207 - u8 *cal_data = (u8 *) KSEG1ADDR(AP121_CAL_DATA_ADDR);
208 -
209 - ath79_register_leds_gpio(-1, ARRAY_SIZE(ap121_leds_gpio),
210 - ap121_leds_gpio);
211 - ath79_register_gpio_keys_polled(-1, AP121_KEYS_POLL_INTERVAL,
212 - ARRAY_SIZE(ap121_gpio_keys),
213 - ap121_gpio_keys);
214 -
215 - ath79_register_spi(&ap121_spi_data, ap121_spi_info,
216 - ARRAY_SIZE(ap121_spi_info));
217 - ath79_register_usb();
218 - ath79_register_wmac(cal_data);
219 -}
220 -
221 -MIPS_MACHINE(ATH79_MACH_AP121, "AP121", "Atheros AP121 reference board",
222 - ap121_setup);
223 Index: linux-4.14.25/arch/mips/ath79/mach-ap136.c
224 ===================================================================
225 --- linux-4.14.25.orig/arch/mips/ath79/mach-ap136.c
226 +++ /dev/null
227 @@ -1,156 +0,0 @@
228 -/*
229 - * Qualcomm Atheros AP136 reference board support
230 - *
231 - * Copyright (c) 2012 Qualcomm Atheros
232 - * Copyright (c) 2012-2013 Gabor Juhos <juhosg@openwrt.org>
233 - *
234 - * Permission to use, copy, modify, and/or distribute this software for any
235 - * purpose with or without fee is hereby granted, provided that the above
236 - * copyright notice and this permission notice appear in all copies.
237 - *
238 - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
239 - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
240 - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
241 - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
242 - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
243 - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
244 - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
245 - *
246 - */
247 -
248 -#include <linux/pci.h>
249 -#include <linux/ath9k_platform.h>
250 -
251 -#include "machtypes.h"
252 -#include "dev-gpio-buttons.h"
253 -#include "dev-leds-gpio.h"
254 -#include "dev-spi.h"
255 -#include "dev-usb.h"
256 -#include "dev-wmac.h"
257 -#include "pci.h"
258 -
259 -#define AP136_GPIO_LED_STATUS_RED 14
260 -#define AP136_GPIO_LED_STATUS_GREEN 19
261 -#define AP136_GPIO_LED_USB 4
262 -#define AP136_GPIO_LED_WLAN_2G 13
263 -#define AP136_GPIO_LED_WLAN_5G 12
264 -#define AP136_GPIO_LED_WPS_RED 15
265 -#define AP136_GPIO_LED_WPS_GREEN 20
266 -
267 -#define AP136_GPIO_BTN_WPS 16
268 -#define AP136_GPIO_BTN_RFKILL 21
269 -
270 -#define AP136_KEYS_POLL_INTERVAL 20 /* msecs */
271 -#define AP136_KEYS_DEBOUNCE_INTERVAL (3 * AP136_KEYS_POLL_INTERVAL)
272 -
273 -#define AP136_WMAC_CALDATA_OFFSET 0x1000
274 -#define AP136_PCIE_CALDATA_OFFSET 0x5000
275 -
276 -static struct gpio_led ap136_leds_gpio[] __initdata = {
277 - {
278 - .name = "qca:green:status",
279 - .gpio = AP136_GPIO_LED_STATUS_GREEN,
280 - .active_low = 1,
281 - },
282 - {
283 - .name = "qca:red:status",
284 - .gpio = AP136_GPIO_LED_STATUS_RED,
285 - .active_low = 1,
286 - },
287 - {
288 - .name = "qca:green:wps",
289 - .gpio = AP136_GPIO_LED_WPS_GREEN,
290 - .active_low = 1,
291 - },
292 - {
293 - .name = "qca:red:wps",
294 - .gpio = AP136_GPIO_LED_WPS_RED,
295 - .active_low = 1,
296 - },
297 - {
298 - .name = "qca:red:wlan-2g",
299 - .gpio = AP136_GPIO_LED_WLAN_2G,
300 - .active_low = 1,
301 - },
302 - {
303 - .name = "qca:red:usb",
304 - .gpio = AP136_GPIO_LED_USB,
305 - .active_low = 1,
306 - }
307 -};
308 -
309 -static struct gpio_keys_button ap136_gpio_keys[] __initdata = {
310 - {
311 - .desc = "WPS button",
312 - .type = EV_KEY,
313 - .code = KEY_WPS_BUTTON,
314 - .debounce_interval = AP136_KEYS_DEBOUNCE_INTERVAL,
315 - .gpio = AP136_GPIO_BTN_WPS,
316 - .active_low = 1,
317 - },
318 - {
319 - .desc = "RFKILL button",
320 - .type = EV_KEY,
321 - .code = KEY_RFKILL,
322 - .debounce_interval = AP136_KEYS_DEBOUNCE_INTERVAL,
323 - .gpio = AP136_GPIO_BTN_RFKILL,
324 - .active_low = 1,
325 - },
326 -};
327 -
328 -static struct spi_board_info ap136_spi_info[] = {
329 - {
330 - .bus_num = 0,
331 - .chip_select = 0,
332 - .max_speed_hz = 25000000,
333 - .modalias = "mx25l6405d",
334 - }
335 -};
336 -
337 -static struct ath79_spi_platform_data ap136_spi_data = {
338 - .bus_num = 0,
339 - .num_chipselect = 1,
340 -};
341 -
342 -#ifdef CONFIG_PCI
343 -static struct ath9k_platform_data ap136_ath9k_data;
344 -
345 -static int ap136_pci_plat_dev_init(struct pci_dev *dev)
346 -{
347 - if (dev->bus->number == 1 && (PCI_SLOT(dev->devfn)) == 0)
348 - dev->dev.platform_data = &ap136_ath9k_data;
349 -
350 - return 0;
351 -}
352 -
353 -static void __init ap136_pci_init(u8 *eeprom)
354 -{
355 - memcpy(ap136_ath9k_data.eeprom_data, eeprom,
356 - sizeof(ap136_ath9k_data.eeprom_data));
357 -
358 - ath79_pci_set_plat_dev_init(ap136_pci_plat_dev_init);
359 - ath79_register_pci();
360 -}
361 -#else
362 -static inline void ap136_pci_init(u8 *eeprom) {}
363 -#endif /* CONFIG_PCI */
364 -
365 -static void __init ap136_setup(void)
366 -{
367 - u8 *art = (u8 *) KSEG1ADDR(0x1fff0000);
368 -
369 - ath79_register_leds_gpio(-1, ARRAY_SIZE(ap136_leds_gpio),
370 - ap136_leds_gpio);
371 - ath79_register_gpio_keys_polled(-1, AP136_KEYS_POLL_INTERVAL,
372 - ARRAY_SIZE(ap136_gpio_keys),
373 - ap136_gpio_keys);
374 - ath79_register_spi(&ap136_spi_data, ap136_spi_info,
375 - ARRAY_SIZE(ap136_spi_info));
376 - ath79_register_usb();
377 - ath79_register_wmac(art + AP136_WMAC_CALDATA_OFFSET);
378 - ap136_pci_init(art + AP136_PCIE_CALDATA_OFFSET);
379 -}
380 -
381 -MIPS_MACHINE(ATH79_MACH_AP136_010, "AP136-010",
382 - "Atheros AP136-010 reference board",
383 - ap136_setup);
384 Index: linux-4.14.25/arch/mips/ath79/mach-ap81.c
385 ===================================================================
386 --- linux-4.14.25.orig/arch/mips/ath79/mach-ap81.c
387 +++ /dev/null
388 @@ -1,100 +0,0 @@
389 -/*
390 - * Atheros AP81 board support
391 - *
392 - * Copyright (C) 2009-2010 Gabor Juhos <juhosg@openwrt.org>
393 - * Copyright (C) 2009 Imre Kaloz <kaloz@openwrt.org>
394 - *
395 - * This program is free software; you can redistribute it and/or modify it
396 - * under the terms of the GNU General Public License version 2 as published
397 - * by the Free Software Foundation.
398 - */
399 -
400 -#include "machtypes.h"
401 -#include "dev-wmac.h"
402 -#include "dev-gpio-buttons.h"
403 -#include "dev-leds-gpio.h"
404 -#include "dev-spi.h"
405 -#include "dev-usb.h"
406 -
407 -#define AP81_GPIO_LED_STATUS 1
408 -#define AP81_GPIO_LED_AOSS 3
409 -#define AP81_GPIO_LED_WLAN 6
410 -#define AP81_GPIO_LED_POWER 14
411 -
412 -#define AP81_GPIO_BTN_SW4 12
413 -#define AP81_GPIO_BTN_SW1 21
414 -
415 -#define AP81_KEYS_POLL_INTERVAL 20 /* msecs */
416 -#define AP81_KEYS_DEBOUNCE_INTERVAL (3 * AP81_KEYS_POLL_INTERVAL)
417 -
418 -#define AP81_CAL_DATA_ADDR 0x1fff1000
419 -
420 -static struct gpio_led ap81_leds_gpio[] __initdata = {
421 - {
422 - .name = "ap81:green:status",
423 - .gpio = AP81_GPIO_LED_STATUS,
424 - .active_low = 1,
425 - }, {
426 - .name = "ap81:amber:aoss",
427 - .gpio = AP81_GPIO_LED_AOSS,
428 - .active_low = 1,
429 - }, {
430 - .name = "ap81:green:wlan",
431 - .gpio = AP81_GPIO_LED_WLAN,
432 - .active_low = 1,
433 - }, {
434 - .name = "ap81:green:power",
435 - .gpio = AP81_GPIO_LED_POWER,
436 - .active_low = 1,
437 - }
438 -};
439 -
440 -static struct gpio_keys_button ap81_gpio_keys[] __initdata = {
441 - {
442 - .desc = "sw1",
443 - .type = EV_KEY,
444 - .code = BTN_0,
445 - .debounce_interval = AP81_KEYS_DEBOUNCE_INTERVAL,
446 - .gpio = AP81_GPIO_BTN_SW1,
447 - .active_low = 1,
448 - } , {
449 - .desc = "sw4",
450 - .type = EV_KEY,
451 - .code = BTN_1,
452 - .debounce_interval = AP81_KEYS_DEBOUNCE_INTERVAL,
453 - .gpio = AP81_GPIO_BTN_SW4,
454 - .active_low = 1,
455 - }
456 -};
457 -
458 -static struct spi_board_info ap81_spi_info[] = {
459 - {
460 - .bus_num = 0,
461 - .chip_select = 0,
462 - .max_speed_hz = 25000000,
463 - .modalias = "m25p64",
464 - }
465 -};
466 -
467 -static struct ath79_spi_platform_data ap81_spi_data = {
468 - .bus_num = 0,
469 - .num_chipselect = 1,
470 -};
471 -
472 -static void __init ap81_setup(void)
473 -{
474 - u8 *cal_data = (u8 *) KSEG1ADDR(AP81_CAL_DATA_ADDR);
475 -
476 - ath79_register_leds_gpio(-1, ARRAY_SIZE(ap81_leds_gpio),
477 - ap81_leds_gpio);
478 - ath79_register_gpio_keys_polled(-1, AP81_KEYS_POLL_INTERVAL,
479 - ARRAY_SIZE(ap81_gpio_keys),
480 - ap81_gpio_keys);
481 - ath79_register_spi(&ap81_spi_data, ap81_spi_info,
482 - ARRAY_SIZE(ap81_spi_info));
483 - ath79_register_wmac(cal_data);
484 - ath79_register_usb();
485 -}
486 -
487 -MIPS_MACHINE(ATH79_MACH_AP81, "AP81", "Atheros AP81 reference board",
488 - ap81_setup);
489 Index: linux-4.14.25/arch/mips/ath79/mach-db120.c
490 ===================================================================
491 --- linux-4.14.25.orig/arch/mips/ath79/mach-db120.c
492 +++ /dev/null
493 @@ -1,136 +0,0 @@
494 -/*
495 - * Atheros DB120 reference board support
496 - *
497 - * Copyright (c) 2011 Qualcomm Atheros
498 - * Copyright (c) 2011 Gabor Juhos <juhosg@openwrt.org>
499 - *
500 - * Permission to use, copy, modify, and/or distribute this software for any
501 - * purpose with or without fee is hereby granted, provided that the above
502 - * copyright notice and this permission notice appear in all copies.
503 - *
504 - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
505 - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
506 - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
507 - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
508 - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
509 - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
510 - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
511 - *
512 - */
513 -
514 -#include <linux/pci.h>
515 -#include <linux/ath9k_platform.h>
516 -
517 -#include "machtypes.h"
518 -#include "dev-gpio-buttons.h"
519 -#include "dev-leds-gpio.h"
520 -#include "dev-spi.h"
521 -#include "dev-usb.h"
522 -#include "dev-wmac.h"
523 -#include "pci.h"
524 -
525 -#define DB120_GPIO_LED_WLAN_5G 12
526 -#define DB120_GPIO_LED_WLAN_2G 13
527 -#define DB120_GPIO_LED_STATUS 14
528 -#define DB120_GPIO_LED_WPS 15
529 -
530 -#define DB120_GPIO_BTN_WPS 16
531 -
532 -#define DB120_KEYS_POLL_INTERVAL 20 /* msecs */
533 -#define DB120_KEYS_DEBOUNCE_INTERVAL (3 * DB120_KEYS_POLL_INTERVAL)
534 -
535 -#define DB120_WMAC_CALDATA_OFFSET 0x1000
536 -#define DB120_PCIE_CALDATA_OFFSET 0x5000
537 -
538 -static struct gpio_led db120_leds_gpio[] __initdata = {
539 - {
540 - .name = "db120:green:status",
541 - .gpio = DB120_GPIO_LED_STATUS,
542 - .active_low = 1,
543 - },
544 - {
545 - .name = "db120:green:wps",
546 - .gpio = DB120_GPIO_LED_WPS,
547 - .active_low = 1,
548 - },
549 - {
550 - .name = "db120:green:wlan-5g",
551 - .gpio = DB120_GPIO_LED_WLAN_5G,
552 - .active_low = 1,
553 - },
554 - {
555 - .name = "db120:green:wlan-2g",
556 - .gpio = DB120_GPIO_LED_WLAN_2G,
557 - .active_low = 1,
558 - },
559 -};
560 -
561 -static struct gpio_keys_button db120_gpio_keys[] __initdata = {
562 - {
563 - .desc = "WPS button",
564 - .type = EV_KEY,
565 - .code = KEY_WPS_BUTTON,
566 - .debounce_interval = DB120_KEYS_DEBOUNCE_INTERVAL,
567 - .gpio = DB120_GPIO_BTN_WPS,
568 - .active_low = 1,
569 - },
570 -};
571 -
572 -static struct spi_board_info db120_spi_info[] = {
573 - {
574 - .bus_num = 0,
575 - .chip_select = 0,
576 - .max_speed_hz = 25000000,
577 - .modalias = "s25sl064a",
578 - }
579 -};
580 -
581 -static struct ath79_spi_platform_data db120_spi_data = {
582 - .bus_num = 0,
583 - .num_chipselect = 1,
584 -};
585 -
586 -#ifdef CONFIG_PCI
587 -static struct ath9k_platform_data db120_ath9k_data;
588 -
589 -static int db120_pci_plat_dev_init(struct pci_dev *dev)
590 -{
591 - switch (PCI_SLOT(dev->devfn)) {
592 - case 0:
593 - dev->dev.platform_data = &db120_ath9k_data;
594 - break;
595 - }
596 -
597 - return 0;
598 -}
599 -
600 -static void __init db120_pci_init(u8 *eeprom)
601 -{
602 - memcpy(db120_ath9k_data.eeprom_data, eeprom,
603 - sizeof(db120_ath9k_data.eeprom_data));
604 -
605 - ath79_pci_set_plat_dev_init(db120_pci_plat_dev_init);
606 - ath79_register_pci();
607 -}
608 -#else
609 -static inline void db120_pci_init(u8 *eeprom) {}
610 -#endif /* CONFIG_PCI */
611 -
612 -static void __init db120_setup(void)
613 -{
614 - u8 *art = (u8 *) KSEG1ADDR(0x1fff0000);
615 -
616 - ath79_register_leds_gpio(-1, ARRAY_SIZE(db120_leds_gpio),
617 - db120_leds_gpio);
618 - ath79_register_gpio_keys_polled(-1, DB120_KEYS_POLL_INTERVAL,
619 - ARRAY_SIZE(db120_gpio_keys),
620 - db120_gpio_keys);
621 - ath79_register_spi(&db120_spi_data, db120_spi_info,
622 - ARRAY_SIZE(db120_spi_info));
623 - ath79_register_usb();
624 - ath79_register_wmac(art + DB120_WMAC_CALDATA_OFFSET);
625 - db120_pci_init(art + DB120_PCIE_CALDATA_OFFSET);
626 -}
627 -
628 -MIPS_MACHINE(ATH79_MACH_DB120, "DB120", "Atheros DB120 reference board",
629 - db120_setup);
630 Index: linux-4.14.25/arch/mips/ath79/mach-pb44.c
631 ===================================================================
632 --- linux-4.14.25.orig/arch/mips/ath79/mach-pb44.c
633 +++ /dev/null
634 @@ -1,122 +0,0 @@
635 -/*
636 - * Atheros PB44 reference board support
637 - *
638 - * Copyright (C) 2009-2010 Gabor Juhos <juhosg@openwrt.org>
639 - *
640 - * This program is free software; you can redistribute it and/or modify it
641 - * under the terms of the GNU General Public License version 2 as published
642 - * by the Free Software Foundation.
643 - */
644 -
645 -#include <linux/init.h>
646 -#include <linux/platform_device.h>
647 -#include <linux/i2c.h>
648 -#include <linux/i2c-gpio.h>
649 -#include <linux/platform_data/pcf857x.h>
650 -
651 -#include "machtypes.h"
652 -#include "dev-gpio-buttons.h"
653 -#include "dev-leds-gpio.h"
654 -#include "dev-spi.h"
655 -#include "dev-usb.h"
656 -#include "pci.h"
657 -
658 -#define PB44_GPIO_I2C_SCL 0
659 -#define PB44_GPIO_I2C_SDA 1
660 -
661 -#define PB44_GPIO_EXP_BASE 16
662 -#define PB44_GPIO_SW_RESET (PB44_GPIO_EXP_BASE + 6)
663 -#define PB44_GPIO_SW_JUMP (PB44_GPIO_EXP_BASE + 8)
664 -#define PB44_GPIO_LED_JUMP1 (PB44_GPIO_EXP_BASE + 9)
665 -#define PB44_GPIO_LED_JUMP2 (PB44_GPIO_EXP_BASE + 10)
666 -
667 -#define PB44_KEYS_POLL_INTERVAL 20 /* msecs */
668 -#define PB44_KEYS_DEBOUNCE_INTERVAL (3 * PB44_KEYS_POLL_INTERVAL)
669 -
670 -static struct i2c_gpio_platform_data pb44_i2c_gpio_data = {
671 - .sda_pin = PB44_GPIO_I2C_SDA,
672 - .scl_pin = PB44_GPIO_I2C_SCL,
673 -};
674 -
675 -static struct platform_device pb44_i2c_gpio_device = {
676 - .name = "i2c-gpio",
677 - .id = 0,
678 - .dev = {
679 - .platform_data = &pb44_i2c_gpio_data,
680 - }
681 -};
682 -
683 -static struct pcf857x_platform_data pb44_pcf857x_data = {
684 - .gpio_base = PB44_GPIO_EXP_BASE,
685 -};
686 -
687 -static struct i2c_board_info pb44_i2c_board_info[] __initdata = {
688 - {
689 - I2C_BOARD_INFO("pcf8575", 0x20),
690 - .platform_data = &pb44_pcf857x_data,
691 - },
692 -};
693 -
694 -static struct gpio_led pb44_leds_gpio[] __initdata = {
695 - {
696 - .name = "pb44:amber:jump1",
697 - .gpio = PB44_GPIO_LED_JUMP1,
698 - .active_low = 1,
699 - }, {
700 - .name = "pb44:green:jump2",
701 - .gpio = PB44_GPIO_LED_JUMP2,
702 - .active_low = 1,
703 - },
704 -};
705 -
706 -static struct gpio_keys_button pb44_gpio_keys[] __initdata = {
707 - {
708 - .desc = "soft_reset",
709 - .type = EV_KEY,
710 - .code = KEY_RESTART,
711 - .debounce_interval = PB44_KEYS_DEBOUNCE_INTERVAL,
712 - .gpio = PB44_GPIO_SW_RESET,
713 - .active_low = 1,
714 - } , {
715 - .desc = "jumpstart",
716 - .type = EV_KEY,
717 - .code = KEY_WPS_BUTTON,
718 - .debounce_interval = PB44_KEYS_DEBOUNCE_INTERVAL,
719 - .gpio = PB44_GPIO_SW_JUMP,
720 - .active_low = 1,
721 - }
722 -};
723 -
724 -static struct spi_board_info pb44_spi_info[] = {
725 - {
726 - .bus_num = 0,
727 - .chip_select = 0,
728 - .max_speed_hz = 25000000,
729 - .modalias = "m25p64",
730 - },
731 -};
732 -
733 -static struct ath79_spi_platform_data pb44_spi_data = {
734 - .bus_num = 0,
735 - .num_chipselect = 1,
736 -};
737 -
738 -static void __init pb44_init(void)
739 -{
740 - i2c_register_board_info(0, pb44_i2c_board_info,
741 - ARRAY_SIZE(pb44_i2c_board_info));
742 - platform_device_register(&pb44_i2c_gpio_device);
743 -
744 - ath79_register_leds_gpio(-1, ARRAY_SIZE(pb44_leds_gpio),
745 - pb44_leds_gpio);
746 - ath79_register_gpio_keys_polled(-1, PB44_KEYS_POLL_INTERVAL,
747 - ARRAY_SIZE(pb44_gpio_keys),
748 - pb44_gpio_keys);
749 - ath79_register_spi(&pb44_spi_data, pb44_spi_info,
750 - ARRAY_SIZE(pb44_spi_info));
751 - ath79_register_usb();
752 - ath79_register_pci();
753 -}
754 -
755 -MIPS_MACHINE(ATH79_MACH_PB44, "PB44", "Atheros PB44 reference board",
756 - pb44_init);