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
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.
9 Signed-off-by: John Crispin <john@phrozen.org>
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
32 --- a/arch/mips/Kconfig
33 +++ b/arch/mips/Kconfig
34 @@ -202,7 +202,6 @@ config ATH79
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
45 # SPDX-License-Identifier: GPL-2.0
48 -menu "Atheros AR71XX/AR724X/AR913X machine selection"
50 -config ATH79_MACH_AP121
51 - bool "Atheros AP121 reference board"
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
59 - Say 'Y' here if you want your kernel to support the
60 - Atheros AP121 reference board.
62 -config ATH79_MACH_AP136
63 - bool "Atheros AP136 reference board"
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
71 - Say 'Y' here if you want your kernel to support the
72 - Atheros AP136 reference board.
74 -config ATH79_MACH_AP81
75 - bool "Atheros AP81 reference board"
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
83 - Say 'Y' here if you want your kernel to support the
84 - Atheros AP81 reference board.
86 -config ATH79_MACH_DB120
87 - bool "Atheros DB120 reference board"
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
95 - Say 'Y' here if you want your kernel to support the
96 - Atheros DB120 reference board.
98 -config ATH79_MACH_PB44
99 - bool "Atheros PB44 reference board"
101 - select ATH79_DEV_GPIO_BUTTONS
102 - select ATH79_DEV_LEDS_GPIO
103 - select ATH79_DEV_SPI
104 - select ATH79_DEV_USB
106 - Say 'Y' here if you want your kernel to support the
107 - Atheros PB44 reference board.
109 -config ATH79_MACH_UBNT_XM
110 - bool "Ubiquiti Networks XM (rev 1.0) board"
112 - select ATH79_DEV_GPIO_BUTTONS
113 - select ATH79_DEV_LEDS_GPIO
114 - select ATH79_DEV_SPI
116 - Say 'Y' here if you want your kernel to support the
117 - Ubiquiti Networks XM (rev 1.0) board.
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
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
143 #include <asm/mach-ath79/ath79.h>
144 #include <asm/mach-ath79/ar71xx_regs.h>
146 -#include "machtypes.h"
148 #define AR71XX_BASE_FREQ 40000000
149 #define AR724X_BASE_FREQ 40000000
150 --- a/arch/mips/ath79/mach-ap121.c
154 - * Atheros AP121 board support
156 - * Copyright (C) 2011 Gabor Juhos <juhosg@openwrt.org>
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.
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"
170 -#define AP121_GPIO_LED_WLAN 0
171 -#define AP121_GPIO_LED_USB 1
173 -#define AP121_GPIO_BTN_JUMPSTART 11
174 -#define AP121_GPIO_BTN_RESET 12
176 -#define AP121_KEYS_POLL_INTERVAL 20 /* msecs */
177 -#define AP121_KEYS_DEBOUNCE_INTERVAL (3 * AP121_KEYS_POLL_INTERVAL)
179 -#define AP121_CAL_DATA_ADDR 0x1fff1000
181 -static struct gpio_led ap121_leds_gpio[] __initdata = {
183 - .name = "ap121:green:usb",
184 - .gpio = AP121_GPIO_LED_USB,
188 - .name = "ap121:green:wlan",
189 - .gpio = AP121_GPIO_LED_WLAN,
194 -static struct gpio_keys_button ap121_gpio_keys[] __initdata = {
196 - .desc = "jumpstart button",
198 - .code = KEY_WPS_BUTTON,
199 - .debounce_interval = AP121_KEYS_DEBOUNCE_INTERVAL,
200 - .gpio = AP121_GPIO_BTN_JUMPSTART,
204 - .desc = "reset button",
206 - .code = KEY_RESTART,
207 - .debounce_interval = AP121_KEYS_DEBOUNCE_INTERVAL,
208 - .gpio = AP121_GPIO_BTN_RESET,
213 -static struct spi_board_info ap121_spi_info[] = {
217 - .max_speed_hz = 25000000,
218 - .modalias = "mx25l1606e",
222 -static struct ath79_spi_platform_data ap121_spi_data = {
224 - .num_chipselect = 1,
227 -static void __init ap121_setup(void)
229 - u8 *cal_data = (u8 *) KSEG1ADDR(AP121_CAL_DATA_ADDR);
231 - ath79_register_leds_gpio(-1, ARRAY_SIZE(ap121_leds_gpio),
233 - ath79_register_gpio_keys_polled(-1, AP121_KEYS_POLL_INTERVAL,
234 - ARRAY_SIZE(ap121_gpio_keys),
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);
243 -MIPS_MACHINE(ATH79_MACH_AP121, "AP121", "Atheros AP121 reference board",
245 --- a/arch/mips/ath79/mach-ap136.c
249 - * Qualcomm Atheros AP136 reference board support
251 - * Copyright (c) 2012 Qualcomm Atheros
252 - * Copyright (c) 2012-2013 Gabor Juhos <juhosg@openwrt.org>
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.
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.
268 -#include <linux/pci.h>
269 -#include <linux/ath9k_platform.h>
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"
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
287 -#define AP136_GPIO_BTN_WPS 16
288 -#define AP136_GPIO_BTN_RFKILL 21
290 -#define AP136_KEYS_POLL_INTERVAL 20 /* msecs */
291 -#define AP136_KEYS_DEBOUNCE_INTERVAL (3 * AP136_KEYS_POLL_INTERVAL)
293 -#define AP136_WMAC_CALDATA_OFFSET 0x1000
294 -#define AP136_PCIE_CALDATA_OFFSET 0x5000
296 -static struct gpio_led ap136_leds_gpio[] __initdata = {
298 - .name = "qca:green:status",
299 - .gpio = AP136_GPIO_LED_STATUS_GREEN,
303 - .name = "qca:red:status",
304 - .gpio = AP136_GPIO_LED_STATUS_RED,
308 - .name = "qca:green:wps",
309 - .gpio = AP136_GPIO_LED_WPS_GREEN,
313 - .name = "qca:red:wps",
314 - .gpio = AP136_GPIO_LED_WPS_RED,
318 - .name = "qca:red:wlan-2g",
319 - .gpio = AP136_GPIO_LED_WLAN_2G,
323 - .name = "qca:red:usb",
324 - .gpio = AP136_GPIO_LED_USB,
329 -static struct gpio_keys_button ap136_gpio_keys[] __initdata = {
331 - .desc = "WPS button",
333 - .code = KEY_WPS_BUTTON,
334 - .debounce_interval = AP136_KEYS_DEBOUNCE_INTERVAL,
335 - .gpio = AP136_GPIO_BTN_WPS,
339 - .desc = "RFKILL button",
341 - .code = KEY_RFKILL,
342 - .debounce_interval = AP136_KEYS_DEBOUNCE_INTERVAL,
343 - .gpio = AP136_GPIO_BTN_RFKILL,
348 -static struct spi_board_info ap136_spi_info[] = {
352 - .max_speed_hz = 25000000,
353 - .modalias = "mx25l6405d",
357 -static struct ath79_spi_platform_data ap136_spi_data = {
359 - .num_chipselect = 1,
363 -static struct ath9k_platform_data ap136_ath9k_data;
365 -static int ap136_pci_plat_dev_init(struct pci_dev *dev)
367 - if (dev->bus->number == 1 && (PCI_SLOT(dev->devfn)) == 0)
368 - dev->dev.platform_data = &ap136_ath9k_data;
373 -static void __init ap136_pci_init(u8 *eeprom)
375 - memcpy(ap136_ath9k_data.eeprom_data, eeprom,
376 - sizeof(ap136_ath9k_data.eeprom_data));
378 - ath79_pci_set_plat_dev_init(ap136_pci_plat_dev_init);
379 - ath79_register_pci();
382 -static inline void ap136_pci_init(u8 *eeprom) {}
383 -#endif /* CONFIG_PCI */
385 -static void __init ap136_setup(void)
387 - u8 *art = (u8 *) KSEG1ADDR(0x1fff0000);
389 - ath79_register_leds_gpio(-1, ARRAY_SIZE(ap136_leds_gpio),
391 - ath79_register_gpio_keys_polled(-1, AP136_KEYS_POLL_INTERVAL,
392 - ARRAY_SIZE(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);
401 -MIPS_MACHINE(ATH79_MACH_AP136_010, "AP136-010",
402 - "Atheros AP136-010 reference board",
404 --- a/arch/mips/ath79/mach-ap81.c
408 - * Atheros AP81 board support
410 - * Copyright (C) 2009-2010 Gabor Juhos <juhosg@openwrt.org>
411 - * Copyright (C) 2009 Imre Kaloz <kaloz@openwrt.org>
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.
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"
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
430 -#define AP81_GPIO_BTN_SW4 12
431 -#define AP81_GPIO_BTN_SW1 21
433 -#define AP81_KEYS_POLL_INTERVAL 20 /* msecs */
434 -#define AP81_KEYS_DEBOUNCE_INTERVAL (3 * AP81_KEYS_POLL_INTERVAL)
436 -#define AP81_CAL_DATA_ADDR 0x1fff1000
438 -static struct gpio_led ap81_leds_gpio[] __initdata = {
440 - .name = "ap81:green:status",
441 - .gpio = AP81_GPIO_LED_STATUS,
444 - .name = "ap81:amber:aoss",
445 - .gpio = AP81_GPIO_LED_AOSS,
448 - .name = "ap81:green:wlan",
449 - .gpio = AP81_GPIO_LED_WLAN,
452 - .name = "ap81:green:power",
453 - .gpio = AP81_GPIO_LED_POWER,
458 -static struct gpio_keys_button ap81_gpio_keys[] __initdata = {
463 - .debounce_interval = AP81_KEYS_DEBOUNCE_INTERVAL,
464 - .gpio = AP81_GPIO_BTN_SW1,
470 - .debounce_interval = AP81_KEYS_DEBOUNCE_INTERVAL,
471 - .gpio = AP81_GPIO_BTN_SW4,
476 -static struct spi_board_info ap81_spi_info[] = {
480 - .max_speed_hz = 25000000,
481 - .modalias = "m25p64",
485 -static struct ath79_spi_platform_data ap81_spi_data = {
487 - .num_chipselect = 1,
490 -static void __init ap81_setup(void)
492 - u8 *cal_data = (u8 *) KSEG1ADDR(AP81_CAL_DATA_ADDR);
494 - ath79_register_leds_gpio(-1, ARRAY_SIZE(ap81_leds_gpio),
496 - ath79_register_gpio_keys_polled(-1, AP81_KEYS_POLL_INTERVAL,
497 - ARRAY_SIZE(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();
505 -MIPS_MACHINE(ATH79_MACH_AP81, "AP81", "Atheros AP81 reference board",
507 --- a/arch/mips/ath79/mach-db120.c
511 - * Atheros DB120 reference board support
513 - * Copyright (c) 2011 Qualcomm Atheros
514 - * Copyright (c) 2011 Gabor Juhos <juhosg@openwrt.org>
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.
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.
530 -#include <linux/pci.h>
531 -#include <linux/ath9k_platform.h>
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"
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
546 -#define DB120_GPIO_BTN_WPS 16
548 -#define DB120_KEYS_POLL_INTERVAL 20 /* msecs */
549 -#define DB120_KEYS_DEBOUNCE_INTERVAL (3 * DB120_KEYS_POLL_INTERVAL)
551 -#define DB120_WMAC_CALDATA_OFFSET 0x1000
552 -#define DB120_PCIE_CALDATA_OFFSET 0x5000
554 -static struct gpio_led db120_leds_gpio[] __initdata = {
556 - .name = "db120:green:status",
557 - .gpio = DB120_GPIO_LED_STATUS,
561 - .name = "db120:green:wps",
562 - .gpio = DB120_GPIO_LED_WPS,
566 - .name = "db120:green:wlan-5g",
567 - .gpio = DB120_GPIO_LED_WLAN_5G,
571 - .name = "db120:green:wlan-2g",
572 - .gpio = DB120_GPIO_LED_WLAN_2G,
577 -static struct gpio_keys_button db120_gpio_keys[] __initdata = {
579 - .desc = "WPS button",
581 - .code = KEY_WPS_BUTTON,
582 - .debounce_interval = DB120_KEYS_DEBOUNCE_INTERVAL,
583 - .gpio = DB120_GPIO_BTN_WPS,
588 -static struct spi_board_info db120_spi_info[] = {
592 - .max_speed_hz = 25000000,
593 - .modalias = "s25sl064a",
597 -static struct ath79_spi_platform_data db120_spi_data = {
599 - .num_chipselect = 1,
603 -static struct ath9k_platform_data db120_ath9k_data;
605 -static int db120_pci_plat_dev_init(struct pci_dev *dev)
607 - switch (PCI_SLOT(dev->devfn)) {
609 - dev->dev.platform_data = &db120_ath9k_data;
616 -static void __init db120_pci_init(u8 *eeprom)
618 - memcpy(db120_ath9k_data.eeprom_data, eeprom,
619 - sizeof(db120_ath9k_data.eeprom_data));
621 - ath79_pci_set_plat_dev_init(db120_pci_plat_dev_init);
622 - ath79_register_pci();
625 -static inline void db120_pci_init(u8 *eeprom) {}
626 -#endif /* CONFIG_PCI */
628 -static void __init db120_setup(void)
630 - u8 *art = (u8 *) KSEG1ADDR(0x1fff0000);
632 - ath79_register_leds_gpio(-1, ARRAY_SIZE(db120_leds_gpio),
634 - ath79_register_gpio_keys_polled(-1, DB120_KEYS_POLL_INTERVAL,
635 - ARRAY_SIZE(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);
644 -MIPS_MACHINE(ATH79_MACH_DB120, "DB120", "Atheros DB120 reference board",
646 --- a/arch/mips/ath79/mach-pb44.c
650 - * Atheros PB44 reference board support
652 - * Copyright (C) 2009-2010 Gabor Juhos <juhosg@openwrt.org>
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.
659 -#include <linux/init.h>
660 -#include <linux/platform_device.h>
661 -#include <linux/i2c.h>
662 -#include <linux/gpio/machine.h>
663 -#include <linux/platform_data/pcf857x.h>
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"
672 -#define PB44_GPIO_I2C_SCL 0
673 -#define PB44_GPIO_I2C_SDA 1
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)
681 -#define PB44_KEYS_POLL_INTERVAL 20 /* msecs */
682 -#define PB44_KEYS_DEBOUNCE_INTERVAL (3 * PB44_KEYS_POLL_INTERVAL)
684 -static struct gpiod_lookup_table pb44_i2c_gpiod_table = {
685 - .dev_id = "i2c-gpio.0",
687 - GPIO_LOOKUP_IDX("ath79-gpio", PB44_GPIO_I2C_SDA,
688 - NULL, 0, GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN),
689 - GPIO_LOOKUP_IDX("ath79-gpio", PB44_GPIO_I2C_SCL,
690 - NULL, 1, GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN),
694 -static struct platform_device pb44_i2c_gpio_device = {
695 - .name = "i2c-gpio",
698 - .platform_data = NULL,
702 -static struct pcf857x_platform_data pb44_pcf857x_data = {
703 - .gpio_base = PB44_GPIO_EXP_BASE,
706 -static struct i2c_board_info pb44_i2c_board_info[] __initdata = {
708 - I2C_BOARD_INFO("pcf8575", 0x20),
709 - .platform_data = &pb44_pcf857x_data,
713 -static struct gpio_led pb44_leds_gpio[] __initdata = {
715 - .name = "pb44:amber:jump1",
716 - .gpio = PB44_GPIO_LED_JUMP1,
719 - .name = "pb44:green:jump2",
720 - .gpio = PB44_GPIO_LED_JUMP2,
725 -static struct gpio_keys_button pb44_gpio_keys[] __initdata = {
727 - .desc = "soft_reset",
729 - .code = KEY_RESTART,
730 - .debounce_interval = PB44_KEYS_DEBOUNCE_INTERVAL,
731 - .gpio = PB44_GPIO_SW_RESET,
734 - .desc = "jumpstart",
736 - .code = KEY_WPS_BUTTON,
737 - .debounce_interval = PB44_KEYS_DEBOUNCE_INTERVAL,
738 - .gpio = PB44_GPIO_SW_JUMP,
743 -static struct spi_board_info pb44_spi_info[] = {
747 - .max_speed_hz = 25000000,
748 - .modalias = "m25p64",
752 -static struct ath79_spi_platform_data pb44_spi_data = {
754 - .num_chipselect = 1,
757 -static void __init pb44_init(void)
759 - gpiod_add_lookup_table(&pb44_i2c_gpiod_table);
760 - i2c_register_board_info(0, pb44_i2c_board_info,
761 - ARRAY_SIZE(pb44_i2c_board_info));
762 - platform_device_register(&pb44_i2c_gpio_device);
764 - ath79_register_leds_gpio(-1, ARRAY_SIZE(pb44_leds_gpio),
766 - ath79_register_gpio_keys_polled(-1, PB44_KEYS_POLL_INTERVAL,
767 - ARRAY_SIZE(pb44_gpio_keys),
769 - ath79_register_spi(&pb44_spi_data, pb44_spi_info,
770 - ARRAY_SIZE(pb44_spi_info));
771 - ath79_register_usb();
772 - ath79_register_pci();
775 -MIPS_MACHINE(ATH79_MACH_PB44, "PB44", "Atheros PB44 reference board",
777 --- a/arch/mips/ath79/mach-ubnt-xm.c
781 - * Ubiquiti Networks XM (rev 1.0) board support
783 - * Copyright (C) 2011 René Bolldorf <xsecute@googlemail.com>
785 - * Derived from: mach-pb44.c
787 - * This program is free software; you can redistribute it and/or modify it
788 - * under the terms of the GNU General Public License version 2 as published
789 - * by the Free Software Foundation.
792 -#include <linux/init.h>
793 -#include <linux/pci.h>
794 -#include <linux/ath9k_platform.h>
796 -#include <asm/mach-ath79/irq.h>
798 -#include "machtypes.h"
799 -#include "dev-gpio-buttons.h"
800 -#include "dev-leds-gpio.h"
801 -#include "dev-spi.h"
804 -#define UBNT_XM_GPIO_LED_L1 0
805 -#define UBNT_XM_GPIO_LED_L2 1
806 -#define UBNT_XM_GPIO_LED_L3 11
807 -#define UBNT_XM_GPIO_LED_L4 7
809 -#define UBNT_XM_GPIO_BTN_RESET 12
811 -#define UBNT_XM_KEYS_POLL_INTERVAL 20
812 -#define UBNT_XM_KEYS_DEBOUNCE_INTERVAL (3 * UBNT_XM_KEYS_POLL_INTERVAL)
814 -#define UBNT_XM_EEPROM_ADDR (u8 *) KSEG1ADDR(0x1fff1000)
816 -static struct gpio_led ubnt_xm_leds_gpio[] __initdata = {
818 - .name = "ubnt-xm:red:link1",
819 - .gpio = UBNT_XM_GPIO_LED_L1,
822 - .name = "ubnt-xm:orange:link2",
823 - .gpio = UBNT_XM_GPIO_LED_L2,
826 - .name = "ubnt-xm:green:link3",
827 - .gpio = UBNT_XM_GPIO_LED_L3,
830 - .name = "ubnt-xm:green:link4",
831 - .gpio = UBNT_XM_GPIO_LED_L4,
836 -static struct gpio_keys_button ubnt_xm_gpio_keys[] __initdata = {
840 - .code = KEY_RESTART,
841 - .debounce_interval = UBNT_XM_KEYS_DEBOUNCE_INTERVAL,
842 - .gpio = UBNT_XM_GPIO_BTN_RESET,
847 -static struct spi_board_info ubnt_xm_spi_info[] = {
851 - .max_speed_hz = 25000000,
852 - .modalias = "mx25l6405d",
856 -static struct ath79_spi_platform_data ubnt_xm_spi_data = {
858 - .num_chipselect = 1,
862 -static struct ath9k_platform_data ubnt_xm_eeprom_data;
864 -static int ubnt_xm_pci_plat_dev_init(struct pci_dev *dev)
866 - switch (PCI_SLOT(dev->devfn)) {
868 - dev->dev.platform_data = &ubnt_xm_eeprom_data;
875 -static void __init ubnt_xm_pci_init(void)
877 - memcpy(ubnt_xm_eeprom_data.eeprom_data, UBNT_XM_EEPROM_ADDR,
878 - sizeof(ubnt_xm_eeprom_data.eeprom_data));
880 - ath79_pci_set_plat_dev_init(ubnt_xm_pci_plat_dev_init);
881 - ath79_register_pci();
884 -static inline void ubnt_xm_pci_init(void) {}
885 -#endif /* CONFIG_PCI */
887 -static void __init ubnt_xm_init(void)
889 - ath79_register_leds_gpio(-1, ARRAY_SIZE(ubnt_xm_leds_gpio),
890 - ubnt_xm_leds_gpio);
892 - ath79_register_gpio_keys_polled(-1, UBNT_XM_KEYS_POLL_INTERVAL,
893 - ARRAY_SIZE(ubnt_xm_gpio_keys),
894 - ubnt_xm_gpio_keys);
896 - ath79_register_spi(&ubnt_xm_spi_data, ubnt_xm_spi_info,
897 - ARRAY_SIZE(ubnt_xm_spi_info));
899 - ubnt_xm_pci_init();
902 -MIPS_MACHINE(ATH79_MACH_UBNT_XM,
904 - "Ubiquiti Networks XM (rev 1.0) board",
906 --- a/arch/mips/ath79/machtypes.h
910 - * Atheros AR71XX/AR724X/AR913X machine type definitions
912 - * Copyright (C) 2008-2010 Gabor Juhos <juhosg@openwrt.org>
913 - * Copyright (C) 2008 Imre Kaloz <kaloz@openwrt.org>
915 - * This program is free software; you can redistribute it and/or modify it
916 - * under the terms of the GNU General Public License version 2 as published
917 - * by the Free Software Foundation.
920 -#ifndef _ATH79_MACHTYPE_H
921 -#define _ATH79_MACHTYPE_H
923 -#include <asm/mips_machine.h>
925 -enum ath79_mach_type {
926 - ATH79_MACH_GENERIC_OF = -1, /* Device tree board */
927 - ATH79_MACH_GENERIC = 0,
928 - ATH79_MACH_AP121, /* Atheros AP121 reference board */
929 - ATH79_MACH_AP136_010, /* Atheros AP136-010 reference board */
930 - ATH79_MACH_AP81, /* Atheros AP81 reference board */
931 - ATH79_MACH_DB120, /* Atheros DB120 reference board */
932 - ATH79_MACH_PB44, /* Atheros PB44 reference board */
933 - ATH79_MACH_UBNT_XM, /* Ubiquiti Networks XM board rev 1.0 */
936 -#endif /* _ATH79_MACHTYPE_H */
937 --- a/arch/mips/ath79/setup.c
938 +++ b/arch/mips/ath79/setup.c
940 #include <asm/mach-ath79/ar71xx_regs.h>
942 #include "dev-common.h"
943 -#include "machtypes.h"
945 #define ATH79_SYS_TYPE_LEN 64
947 @@ -230,25 +229,21 @@ void __init plat_mem_setup(void)
948 else if (fw_passed_dtb)
949 __dt_setup_arch((void *)KSEG0ADDR(fw_passed_dtb));
951 - if (mips_machtype != ATH79_MACH_GENERIC_OF) {
952 - ath79_reset_base = ioremap_nocache(AR71XX_RESET_BASE,
953 - AR71XX_RESET_SIZE);
954 - ath79_pll_base = ioremap_nocache(AR71XX_PLL_BASE,
956 - ath79_detect_sys_type();
957 - ath79_ddr_ctrl_init();
958 + ath79_reset_base = ioremap_nocache(AR71XX_RESET_BASE,
959 + AR71XX_RESET_SIZE);
960 + ath79_pll_base = ioremap_nocache(AR71XX_PLL_BASE,
962 + ath79_detect_sys_type();
963 + ath79_ddr_ctrl_init();
965 - detect_memory_region(0, ATH79_MEM_SIZE_MIN, ATH79_MEM_SIZE_MAX);
967 - /* OF machines should use the reset driver */
968 - _machine_restart = ath79_restart;
970 + detect_memory_region(0, ATH79_MEM_SIZE_MIN, ATH79_MEM_SIZE_MAX);
972 + _machine_restart = ath79_restart;
973 _machine_halt = ath79_halt;
974 pm_power_off = ath79_halt;
977 -static void __init ath79_of_plat_time_init(void)
978 +void __init plat_time_init(void)
980 struct device_node *np;
982 @@ -278,66 +273,12 @@ static void __init ath79_of_plat_time_in
986 -void __init plat_time_init(void)
988 - unsigned long cpu_clk_rate;
989 - unsigned long ahb_clk_rate;
990 - unsigned long ddr_clk_rate;
991 - unsigned long ref_clk_rate;
993 - if (IS_ENABLED(CONFIG_OF) && mips_machtype == ATH79_MACH_GENERIC_OF) {
994 - ath79_of_plat_time_init();
998 - ath79_clocks_init();
1000 - cpu_clk_rate = ath79_get_sys_clk_rate("cpu");
1001 - ahb_clk_rate = ath79_get_sys_clk_rate("ahb");
1002 - ddr_clk_rate = ath79_get_sys_clk_rate("ddr");
1003 - ref_clk_rate = ath79_get_sys_clk_rate("ref");
1005 - pr_info("Clocks: CPU:%lu.%03luMHz, DDR:%lu.%03luMHz, AHB:%lu.%03luMHz, Ref:%lu.%03luMHz\n",
1006 - cpu_clk_rate / 1000000, (cpu_clk_rate / 1000) % 1000,
1007 - ddr_clk_rate / 1000000, (ddr_clk_rate / 1000) % 1000,
1008 - ahb_clk_rate / 1000000, (ahb_clk_rate / 1000) % 1000,
1009 - ref_clk_rate / 1000000, (ref_clk_rate / 1000) % 1000);
1011 - mips_hpt_frequency = cpu_clk_rate / 2;
1014 void __init arch_init_irq(void)
1019 -static int __init ath79_setup(void)
1021 - if (mips_machtype == ATH79_MACH_GENERIC_OF)
1024 - ath79_gpio_init();
1025 - ath79_register_uart();
1026 - ath79_register_wdt();
1028 - mips_machine_setup();
1033 -arch_initcall(ath79_setup);
1035 void __init device_tree_init(void)
1037 unflatten_and_copy_device_tree();
1040 -MIPS_MACHINE(ATH79_MACH_GENERIC,
1042 - "Generic AR71XX/AR724X/AR913X based board",
1045 -MIPS_MACHINE(ATH79_MACH_GENERIC_OF,
1047 - "Generic AR71XX/AR724X/AR913X based board (DT)",