1 From c038250c16cdefd6d74ad61309ba84973eceb630 Mon Sep 17 00:00:00 2001
2 From: John Crispin <john@phrozen.org>
3 Date: Tue, 6 Mar 2018 09:29:46 +0100
4 Subject: [PATCH 24/27] MIPS: ath79: drop pdata helpers
6 Signed-off-by: John Crispin <john@phrozen.org>
8 arch/mips/ath79/dev-common.c | 168 -------------------------
9 arch/mips/ath79/dev-common.h | 18 ---
10 arch/mips/ath79/dev-gpio-buttons.c | 56 ---------
11 arch/mips/ath79/dev-gpio-buttons.h | 23 ----
12 arch/mips/ath79/dev-leds-gpio.c | 54 ---------
13 arch/mips/ath79/dev-leds-gpio.h | 21 ----
14 arch/mips/ath79/dev-spi.c | 38 ------
15 arch/mips/ath79/dev-spi.h | 22 ----
16 arch/mips/ath79/dev-usb.c | 242 -------------------------------------
17 arch/mips/ath79/dev-usb.h | 17 ---
18 arch/mips/ath79/dev-wmac.c | 155 ------------------------
19 arch/mips/ath79/dev-wmac.h | 17 ---
20 arch/mips/ath79/setup.c | 5 -
21 13 files changed, 836 deletions(-)
22 delete mode 100644 arch/mips/ath79/dev-common.c
23 delete mode 100644 arch/mips/ath79/dev-common.h
24 delete mode 100644 arch/mips/ath79/dev-gpio-buttons.c
25 delete mode 100644 arch/mips/ath79/dev-gpio-buttons.h
26 delete mode 100644 arch/mips/ath79/dev-leds-gpio.c
27 delete mode 100644 arch/mips/ath79/dev-leds-gpio.h
28 delete mode 100644 arch/mips/ath79/dev-spi.c
29 delete mode 100644 arch/mips/ath79/dev-spi.h
30 delete mode 100644 arch/mips/ath79/dev-usb.c
31 delete mode 100644 arch/mips/ath79/dev-usb.h
32 delete mode 100644 arch/mips/ath79/dev-wmac.c
33 delete mode 100644 arch/mips/ath79/dev-wmac.h
35 diff --git a/arch/mips/ath79/dev-common.c b/arch/mips/ath79/dev-common.c
36 deleted file mode 100644
37 index ac8bfe86b656..000000000000
38 --- a/arch/mips/ath79/dev-common.c
42 - * Atheros AR71XX/AR724X/AR913X common devices
44 - * Copyright (C) 2008-2011 Gabor Juhos <juhosg@openwrt.org>
45 - * Copyright (C) 2008 Imre Kaloz <kaloz@openwrt.org>
47 - * Parts of this file are based on Atheros' 2.6.15 BSP
49 - * This program is free software; you can redistribute it and/or modify it
50 - * under the terms of the GNU General Public License version 2 as published
51 - * by the Free Software Foundation.
54 -#include <linux/kernel.h>
55 -#include <linux/init.h>
56 -#include <linux/platform_device.h>
57 -#include <linux/platform_data/gpio-ath79.h>
58 -#include <linux/serial_8250.h>
59 -#include <linux/clk.h>
60 -#include <linux/err.h>
62 -#include <asm/mach-ath79/ath79.h>
63 -#include <asm/mach-ath79/ar71xx_regs.h>
65 -#include "dev-common.h"
67 -static struct resource ath79_uart_resources[] = {
69 - .start = AR71XX_UART_BASE,
70 - .end = AR71XX_UART_BASE + AR71XX_UART_SIZE - 1,
71 - .flags = IORESOURCE_MEM,
75 -#define AR71XX_UART_FLAGS (UPF_BOOT_AUTOCONF | UPF_SKIP_TEST | UPF_IOREMAP)
76 -static struct plat_serial8250_port ath79_uart_data[] = {
78 - .mapbase = AR71XX_UART_BASE,
79 - .irq = ATH79_MISC_IRQ(3),
80 - .flags = AR71XX_UART_FLAGS,
81 - .iotype = UPIO_MEM32,
84 - /* terminating entry */
88 -static struct platform_device ath79_uart_device = {
89 - .name = "serial8250",
90 - .id = PLAT8250_DEV_PLATFORM,
91 - .resource = ath79_uart_resources,
92 - .num_resources = ARRAY_SIZE(ath79_uart_resources),
94 - .platform_data = ath79_uart_data
98 -static struct resource ar933x_uart_resources[] = {
100 - .start = AR933X_UART_BASE,
101 - .end = AR933X_UART_BASE + AR71XX_UART_SIZE - 1,
102 - .flags = IORESOURCE_MEM,
105 - .start = ATH79_MISC_IRQ(3),
106 - .end = ATH79_MISC_IRQ(3),
107 - .flags = IORESOURCE_IRQ,
111 -static struct platform_device ar933x_uart_device = {
112 - .name = "ar933x-uart",
114 - .resource = ar933x_uart_resources,
115 - .num_resources = ARRAY_SIZE(ar933x_uart_resources),
118 -void __init ath79_register_uart(void)
120 - unsigned long uart_clk_rate;
122 - uart_clk_rate = ath79_get_sys_clk_rate("uart");
124 - if (soc_is_ar71xx() ||
128 - soc_is_qca953x() ||
129 - soc_is_qca955x() ||
130 - soc_is_qca956x() ||
132 - ath79_uart_data[0].uartclk = uart_clk_rate;
133 - platform_device_register(&ath79_uart_device);
134 - } else if (soc_is_ar933x()) {
135 - platform_device_register(&ar933x_uart_device);
141 -void __init ath79_register_wdt(void)
143 - struct resource res;
145 - memset(&res, 0, sizeof(res));
147 - res.flags = IORESOURCE_MEM;
148 - res.start = AR71XX_RESET_BASE + AR71XX_RESET_REG_WDOG_CTRL;
149 - res.end = res.start + 0x8 - 1;
151 - platform_device_register_simple("ath79-wdt", -1, &res, 1);
154 -static struct ath79_gpio_platform_data ath79_gpio_pdata;
156 -static struct resource ath79_gpio_resources[] = {
158 - .flags = IORESOURCE_MEM,
159 - .start = AR71XX_GPIO_BASE,
160 - .end = AR71XX_GPIO_BASE + AR71XX_GPIO_SIZE - 1,
163 - .start = ATH79_MISC_IRQ(2),
164 - .end = ATH79_MISC_IRQ(2),
165 - .flags = IORESOURCE_IRQ,
169 -static struct platform_device ath79_gpio_device = {
170 - .name = "ath79-gpio",
172 - .resource = ath79_gpio_resources,
173 - .num_resources = ARRAY_SIZE(ath79_gpio_resources),
175 - .platform_data = &ath79_gpio_pdata
179 -void __init ath79_gpio_init(void)
181 - if (soc_is_ar71xx()) {
182 - ath79_gpio_pdata.ngpios = AR71XX_GPIO_COUNT;
183 - } else if (soc_is_ar7240()) {
184 - ath79_gpio_pdata.ngpios = AR7240_GPIO_COUNT;
185 - } else if (soc_is_ar7241() || soc_is_ar7242()) {
186 - ath79_gpio_pdata.ngpios = AR7241_GPIO_COUNT;
187 - } else if (soc_is_ar913x()) {
188 - ath79_gpio_pdata.ngpios = AR913X_GPIO_COUNT;
189 - } else if (soc_is_ar933x()) {
190 - ath79_gpio_pdata.ngpios = AR933X_GPIO_COUNT;
191 - } else if (soc_is_ar934x()) {
192 - ath79_gpio_pdata.ngpios = AR934X_GPIO_COUNT;
193 - ath79_gpio_pdata.oe_inverted = 1;
194 - } else if (soc_is_qca953x()) {
195 - ath79_gpio_pdata.ngpios = QCA953X_GPIO_COUNT;
196 - ath79_gpio_pdata.oe_inverted = 1;
197 - } else if (soc_is_qca955x()) {
198 - ath79_gpio_pdata.ngpios = QCA955X_GPIO_COUNT;
199 - ath79_gpio_pdata.oe_inverted = 1;
200 - } else if (soc_is_qca956x() || soc_is_tp9343()) {
201 - ath79_gpio_pdata.ngpios = QCA956X_GPIO_COUNT;
202 - ath79_gpio_pdata.oe_inverted = 1;
207 - platform_device_register(&ath79_gpio_device);
209 diff --git a/arch/mips/ath79/dev-common.h b/arch/mips/ath79/dev-common.h
210 deleted file mode 100644
211 index 0f514e1affce..000000000000
212 --- a/arch/mips/ath79/dev-common.h
216 - * Atheros AR71XX/AR724X/AR913X common devices
218 - * Copyright (C) 2008-2010 Gabor Juhos <juhosg@openwrt.org>
219 - * Copyright (C) 2008 Imre Kaloz <kaloz@openwrt.org>
221 - * This program is free software; you can redistribute it and/or modify it
222 - * under the terms of the GNU General Public License version 2 as published
223 - * by the Free Software Foundation.
226 -#ifndef _ATH79_DEV_COMMON_H
227 -#define _ATH79_DEV_COMMON_H
229 -void ath79_register_uart(void);
230 -void ath79_register_wdt(void);
232 -#endif /* _ATH79_DEV_COMMON_H */
233 diff --git a/arch/mips/ath79/dev-gpio-buttons.c b/arch/mips/ath79/dev-gpio-buttons.c
234 deleted file mode 100644
235 index 366b35fb164d..000000000000
236 --- a/arch/mips/ath79/dev-gpio-buttons.c
240 - * Atheros AR71XX/AR724X/AR913X GPIO button support
242 - * Copyright (C) 2008-2010 Gabor Juhos <juhosg@openwrt.org>
243 - * Copyright (C) 2008 Imre Kaloz <kaloz@openwrt.org>
245 - * This program is free software; you can redistribute it and/or modify it
246 - * under the terms of the GNU General Public License version 2 as published
247 - * by the Free Software Foundation.
250 -#include "linux/init.h"
251 -#include "linux/slab.h"
252 -#include <linux/platform_device.h>
254 -#include "dev-gpio-buttons.h"
256 -void __init ath79_register_gpio_keys_polled(int id,
257 - unsigned poll_interval,
259 - struct gpio_keys_button *buttons)
261 - struct platform_device *pdev;
262 - struct gpio_keys_platform_data pdata;
263 - struct gpio_keys_button *p;
266 - p = kmemdup(buttons, nbuttons * sizeof(*p), GFP_KERNEL);
270 - pdev = platform_device_alloc("gpio-keys-polled", id);
272 - goto err_free_buttons;
274 - memset(&pdata, 0, sizeof(pdata));
275 - pdata.poll_interval = poll_interval;
276 - pdata.nbuttons = nbuttons;
279 - err = platform_device_add_data(pdev, &pdata, sizeof(pdata));
283 - err = platform_device_add(pdev);
290 - platform_device_put(pdev);
295 diff --git a/arch/mips/ath79/dev-gpio-buttons.h b/arch/mips/ath79/dev-gpio-buttons.h
296 deleted file mode 100644
297 index 481847ac1cba..000000000000
298 --- a/arch/mips/ath79/dev-gpio-buttons.h
302 - * Atheros AR71XX/AR724X/AR913X GPIO button support
304 - * Copyright (C) 2008-2010 Gabor Juhos <juhosg@openwrt.org>
305 - * Copyright (C) 2008 Imre Kaloz <kaloz@openwrt.org>
307 - * This program is free software; you can redistribute it and/or modify it
308 - * under the terms of the GNU General Public License version 2 as published
309 - * by the Free Software Foundation.
312 -#ifndef _ATH79_DEV_GPIO_BUTTONS_H
313 -#define _ATH79_DEV_GPIO_BUTTONS_H
315 -#include <linux/input.h>
316 -#include <linux/gpio_keys.h>
318 -void ath79_register_gpio_keys_polled(int id,
319 - unsigned poll_interval,
321 - struct gpio_keys_button *buttons);
323 -#endif /* _ATH79_DEV_GPIO_BUTTONS_H */
324 diff --git a/arch/mips/ath79/dev-leds-gpio.c b/arch/mips/ath79/dev-leds-gpio.c
325 deleted file mode 100644
326 index dcb1debcefb8..000000000000
327 --- a/arch/mips/ath79/dev-leds-gpio.c
331 - * Atheros AR71XX/AR724X/AR913X common GPIO LEDs support
333 - * Copyright (C) 2008-2010 Gabor Juhos <juhosg@openwrt.org>
334 - * Copyright (C) 2008 Imre Kaloz <kaloz@openwrt.org>
336 - * This program is free software; you can redistribute it and/or modify it
337 - * under the terms of the GNU General Public License version 2 as published
338 - * by the Free Software Foundation.
341 -#include <linux/init.h>
342 -#include <linux/slab.h>
343 -#include <linux/platform_device.h>
345 -#include "dev-leds-gpio.h"
347 -void __init ath79_register_leds_gpio(int id,
349 - struct gpio_led *leds)
351 - struct platform_device *pdev;
352 - struct gpio_led_platform_data pdata;
353 - struct gpio_led *p;
356 - p = kmemdup(leds, num_leds * sizeof(*p), GFP_KERNEL);
360 - pdev = platform_device_alloc("leds-gpio", id);
362 - goto err_free_leds;
364 - memset(&pdata, 0, sizeof(pdata));
365 - pdata.num_leds = num_leds;
368 - err = platform_device_add_data(pdev, &pdata, sizeof(pdata));
372 - err = platform_device_add(pdev);
379 - platform_device_put(pdev);
384 diff --git a/arch/mips/ath79/dev-leds-gpio.h b/arch/mips/ath79/dev-leds-gpio.h
385 deleted file mode 100644
386 index 6e5d8851ebcf..000000000000
387 --- a/arch/mips/ath79/dev-leds-gpio.h
391 - * Atheros AR71XX/AR724X/AR913X common GPIO LEDs support
393 - * Copyright (C) 2008-2010 Gabor Juhos <juhosg@openwrt.org>
394 - * Copyright (C) 2008 Imre Kaloz <kaloz@openwrt.org>
396 - * This program is free software; you can redistribute it and/or modify it
397 - * under the terms of the GNU General Public License version 2 as published
398 - * by the Free Software Foundation.
401 -#ifndef _ATH79_DEV_LEDS_GPIO_H
402 -#define _ATH79_DEV_LEDS_GPIO_H
404 -#include <linux/leds.h>
406 -void ath79_register_leds_gpio(int id,
408 - struct gpio_led *leds);
410 -#endif /* _ATH79_DEV_LEDS_GPIO_H */
411 diff --git a/arch/mips/ath79/dev-spi.c b/arch/mips/ath79/dev-spi.c
412 deleted file mode 100644
413 index aa30163efbfd..000000000000
414 --- a/arch/mips/ath79/dev-spi.c
418 - * Atheros AR71XX/AR724X/AR913X SPI controller device
420 - * Copyright (C) 2008-2010 Gabor Juhos <juhosg@openwrt.org>
421 - * Copyright (C) 2008 Imre Kaloz <kaloz@openwrt.org>
423 - * This program is free software; you can redistribute it and/or modify it
424 - * under the terms of the GNU General Public License version 2 as published
425 - * by the Free Software Foundation.
428 -#include <linux/platform_device.h>
429 -#include <asm/mach-ath79/ar71xx_regs.h>
430 -#include "dev-spi.h"
432 -static struct resource ath79_spi_resources[] = {
434 - .start = AR71XX_SPI_BASE,
435 - .end = AR71XX_SPI_BASE + AR71XX_SPI_SIZE - 1,
436 - .flags = IORESOURCE_MEM,
440 -static struct platform_device ath79_spi_device = {
441 - .name = "ath79-spi",
443 - .resource = ath79_spi_resources,
444 - .num_resources = ARRAY_SIZE(ath79_spi_resources),
447 -void __init ath79_register_spi(struct ath79_spi_platform_data *pdata,
448 - struct spi_board_info const *info,
451 - spi_register_board_info(info, n);
452 - ath79_spi_device.dev.platform_data = pdata;
453 - platform_device_register(&ath79_spi_device);
455 diff --git a/arch/mips/ath79/dev-spi.h b/arch/mips/ath79/dev-spi.h
456 deleted file mode 100644
457 index d732565ca736..000000000000
458 --- a/arch/mips/ath79/dev-spi.h
462 - * Atheros AR71XX/AR724X/AR913X SPI controller device
464 - * Copyright (C) 2008-2010 Gabor Juhos <juhosg@openwrt.org>
465 - * Copyright (C) 2008 Imre Kaloz <kaloz@openwrt.org>
467 - * This program is free software; you can redistribute it and/or modify it
468 - * under the terms of the GNU General Public License version 2 as published
469 - * by the Free Software Foundation.
472 -#ifndef _ATH79_DEV_SPI_H
473 -#define _ATH79_DEV_SPI_H
475 -#include <linux/spi/spi.h>
476 -#include <asm/mach-ath79/ath79_spi_platform.h>
478 -void ath79_register_spi(struct ath79_spi_platform_data *pdata,
479 - struct spi_board_info const *info,
482 -#endif /* _ATH79_DEV_SPI_H */
483 diff --git a/arch/mips/ath79/dev-usb.c b/arch/mips/ath79/dev-usb.c
484 deleted file mode 100644
485 index 8227265bcc2d..000000000000
486 --- a/arch/mips/ath79/dev-usb.c
490 - * Atheros AR7XXX/AR9XXX USB Host Controller device
492 - * Copyright (C) 2008-2011 Gabor Juhos <juhosg@openwrt.org>
493 - * Copyright (C) 2008 Imre Kaloz <kaloz@openwrt.org>
495 - * Parts of this file are based on Atheros' 2.6.15 BSP
497 - * This program is free software; you can redistribute it and/or modify it
498 - * under the terms of the GNU General Public License version 2 as published
499 - * by the Free Software Foundation.
502 -#include <linux/kernel.h>
503 -#include <linux/init.h>
504 -#include <linux/delay.h>
505 -#include <linux/irq.h>
506 -#include <linux/dma-mapping.h>
507 -#include <linux/platform_device.h>
508 -#include <linux/usb/ehci_pdriver.h>
509 -#include <linux/usb/ohci_pdriver.h>
511 -#include <asm/mach-ath79/ath79.h>
512 -#include <asm/mach-ath79/ar71xx_regs.h>
514 -#include "dev-usb.h"
516 -static u64 ath79_usb_dmamask = DMA_BIT_MASK(32);
518 -static struct usb_ohci_pdata ath79_ohci_pdata = {
521 -static struct usb_ehci_pdata ath79_ehci_pdata_v1 = {
522 - .has_synopsys_hc_bug = 1,
525 -static struct usb_ehci_pdata ath79_ehci_pdata_v2 = {
526 - .caps_offset = 0x100,
530 -static void __init ath79_usb_register(const char *name, int id,
531 - unsigned long base, unsigned long size,
532 - int irq, const void *data,
535 - struct resource res[2];
536 - struct platform_device *pdev;
538 - memset(res, 0, sizeof(res));
540 - res[0].flags = IORESOURCE_MEM;
541 - res[0].start = base;
542 - res[0].end = base + size - 1;
544 - res[1].flags = IORESOURCE_IRQ;
545 - res[1].start = irq;
548 - pdev = platform_device_register_resndata(NULL, name, id,
549 - res, ARRAY_SIZE(res),
552 - if (IS_ERR(pdev)) {
553 - pr_err("ath79: unable to register USB at %08lx, err=%d\n",
554 - base, (int) PTR_ERR(pdev));
558 - pdev->dev.dma_mask = &ath79_usb_dmamask;
559 - pdev->dev.coherent_dma_mask = DMA_BIT_MASK(32);
562 -#define AR71XX_USB_RESET_MASK (AR71XX_RESET_USB_HOST | \
563 - AR71XX_RESET_USB_PHY | \
564 - AR71XX_RESET_USB_OHCI_DLL)
566 -static void __init ath79_usb_setup(void)
568 - void __iomem *usb_ctrl_base;
570 - ath79_device_reset_set(AR71XX_USB_RESET_MASK);
572 - ath79_device_reset_clear(AR71XX_USB_RESET_MASK);
574 - usb_ctrl_base = ioremap(AR71XX_USB_CTRL_BASE, AR71XX_USB_CTRL_SIZE);
576 - /* Turning on the Buff and Desc swap bits */
577 - __raw_writel(0xf0000, usb_ctrl_base + AR71XX_USB_CTRL_REG_CONFIG);
579 - /* WAR for HW bug. Here it adjusts the duration between two SOFS */
580 - __raw_writel(0x20c00, usb_ctrl_base + AR71XX_USB_CTRL_REG_FLADJ);
582 - iounmap(usb_ctrl_base);
586 - ath79_usb_register("ohci-platform", -1,
587 - AR71XX_OHCI_BASE, AR71XX_OHCI_SIZE,
589 - &ath79_ohci_pdata, sizeof(ath79_ohci_pdata));
591 - ath79_usb_register("ehci-platform", -1,
592 - AR71XX_EHCI_BASE, AR71XX_EHCI_SIZE,
594 - &ath79_ehci_pdata_v1, sizeof(ath79_ehci_pdata_v1));
597 -static void __init ar7240_usb_setup(void)
599 - void __iomem *usb_ctrl_base;
601 - ath79_device_reset_clear(AR7240_RESET_OHCI_DLL);
602 - ath79_device_reset_set(AR7240_RESET_USB_HOST);
606 - ath79_device_reset_set(AR7240_RESET_OHCI_DLL);
607 - ath79_device_reset_clear(AR7240_RESET_USB_HOST);
609 - usb_ctrl_base = ioremap(AR7240_USB_CTRL_BASE, AR7240_USB_CTRL_SIZE);
611 - /* WAR for HW bug. Here it adjusts the duration between two SOFS */
612 - __raw_writel(0x3, usb_ctrl_base + AR71XX_USB_CTRL_REG_FLADJ);
614 - iounmap(usb_ctrl_base);
616 - ath79_usb_register("ohci-platform", -1,
617 - AR7240_OHCI_BASE, AR7240_OHCI_SIZE,
619 - &ath79_ohci_pdata, sizeof(ath79_ohci_pdata));
622 -static void __init ar724x_usb_setup(void)
624 - ath79_device_reset_set(AR724X_RESET_USBSUS_OVERRIDE);
627 - ath79_device_reset_clear(AR724X_RESET_USB_HOST);
630 - ath79_device_reset_clear(AR724X_RESET_USB_PHY);
633 - ath79_usb_register("ehci-platform", -1,
634 - AR724X_EHCI_BASE, AR724X_EHCI_SIZE,
636 - &ath79_ehci_pdata_v2, sizeof(ath79_ehci_pdata_v2));
639 -static void __init ar913x_usb_setup(void)
641 - ath79_device_reset_set(AR913X_RESET_USBSUS_OVERRIDE);
644 - ath79_device_reset_clear(AR913X_RESET_USB_HOST);
647 - ath79_device_reset_clear(AR913X_RESET_USB_PHY);
650 - ath79_usb_register("ehci-platform", -1,
651 - AR913X_EHCI_BASE, AR913X_EHCI_SIZE,
653 - &ath79_ehci_pdata_v2, sizeof(ath79_ehci_pdata_v2));
656 -static void __init ar933x_usb_setup(void)
658 - ath79_device_reset_set(AR933X_RESET_USBSUS_OVERRIDE);
661 - ath79_device_reset_clear(AR933X_RESET_USB_HOST);
664 - ath79_device_reset_clear(AR933X_RESET_USB_PHY);
667 - ath79_usb_register("ehci-platform", -1,
668 - AR933X_EHCI_BASE, AR933X_EHCI_SIZE,
670 - &ath79_ehci_pdata_v2, sizeof(ath79_ehci_pdata_v2));
673 -static void __init ar934x_usb_setup(void)
677 - bootstrap = ath79_reset_rr(AR934X_RESET_REG_BOOTSTRAP);
678 - if (bootstrap & AR934X_BOOTSTRAP_USB_MODE_DEVICE)
681 - ath79_device_reset_set(AR934X_RESET_USBSUS_OVERRIDE);
684 - ath79_device_reset_clear(AR934X_RESET_USB_PHY);
687 - ath79_device_reset_clear(AR934X_RESET_USB_PHY_ANALOG);
690 - ath79_device_reset_clear(AR934X_RESET_USB_HOST);
693 - ath79_usb_register("ehci-platform", -1,
694 - AR934X_EHCI_BASE, AR934X_EHCI_SIZE,
696 - &ath79_ehci_pdata_v2, sizeof(ath79_ehci_pdata_v2));
699 -static void __init qca955x_usb_setup(void)
701 - ath79_usb_register("ehci-platform", 0,
702 - QCA955X_EHCI0_BASE, QCA955X_EHCI_SIZE,
704 - &ath79_ehci_pdata_v2, sizeof(ath79_ehci_pdata_v2));
706 - ath79_usb_register("ehci-platform", 1,
707 - QCA955X_EHCI1_BASE, QCA955X_EHCI_SIZE,
709 - &ath79_ehci_pdata_v2, sizeof(ath79_ehci_pdata_v2));
712 -void __init ath79_register_usb(void)
714 - if (soc_is_ar71xx())
716 - else if (soc_is_ar7240())
717 - ar7240_usb_setup();
718 - else if (soc_is_ar7241() || soc_is_ar7242())
719 - ar724x_usb_setup();
720 - else if (soc_is_ar913x())
721 - ar913x_usb_setup();
722 - else if (soc_is_ar933x())
723 - ar933x_usb_setup();
724 - else if (soc_is_ar934x())
725 - ar934x_usb_setup();
726 - else if (soc_is_qca955x())
727 - qca955x_usb_setup();
731 diff --git a/arch/mips/ath79/dev-usb.h b/arch/mips/ath79/dev-usb.h
732 deleted file mode 100644
733 index 4b86a69ca080..000000000000
734 --- a/arch/mips/ath79/dev-usb.h
738 - * Atheros AR71XX/AR724X/AR913X USB Host Controller support
740 - * Copyright (C) 2008-2010 Gabor Juhos <juhosg@openwrt.org>
741 - * Copyright (C) 2008 Imre Kaloz <kaloz@openwrt.org>
743 - * This program is free software; you can redistribute it and/or modify it
744 - * under the terms of the GNU General Public License version 2 as published
745 - * by the Free Software Foundation.
748 -#ifndef _ATH79_DEV_USB_H
749 -#define _ATH79_DEV_USB_H
751 -void ath79_register_usb(void);
753 -#endif /* _ATH79_DEV_USB_H */
754 diff --git a/arch/mips/ath79/dev-wmac.c b/arch/mips/ath79/dev-wmac.c
755 deleted file mode 100644
756 index da190b1b87ce..000000000000
757 --- a/arch/mips/ath79/dev-wmac.c
761 - * Atheros AR913X/AR933X SoC built-in WMAC device support
763 - * Copyright (C) 2010-2011 Jaiganesh Narayanan <jnarayanan@atheros.com>
764 - * Copyright (C) 2008-2011 Gabor Juhos <juhosg@openwrt.org>
765 - * Copyright (C) 2008 Imre Kaloz <kaloz@openwrt.org>
767 - * Parts of this file are based on Atheros 2.6.15/2.6.31 BSP
769 - * This program is free software; you can redistribute it and/or modify it
770 - * under the terms of the GNU General Public License version 2 as published
771 - * by the Free Software Foundation.
774 -#include <linux/init.h>
775 -#include <linux/delay.h>
776 -#include <linux/irq.h>
777 -#include <linux/platform_device.h>
778 -#include <linux/ath9k_platform.h>
780 -#include <asm/mach-ath79/ath79.h>
781 -#include <asm/mach-ath79/ar71xx_regs.h>
782 -#include "dev-wmac.h"
784 -static struct ath9k_platform_data ath79_wmac_data;
786 -static struct resource ath79_wmac_resources[] = {
788 - /* .start and .end fields are filled dynamically */
789 - .flags = IORESOURCE_MEM,
791 - /* .start and .end fields are filled dynamically */
792 - .flags = IORESOURCE_IRQ,
796 -static struct platform_device ath79_wmac_device = {
799 - .resource = ath79_wmac_resources,
800 - .num_resources = ARRAY_SIZE(ath79_wmac_resources),
802 - .platform_data = &ath79_wmac_data,
806 -static void __init ar913x_wmac_setup(void)
808 - /* reset the WMAC */
809 - ath79_device_reset_set(AR913X_RESET_AMBA2WMAC);
812 - ath79_device_reset_clear(AR913X_RESET_AMBA2WMAC);
815 - ath79_wmac_resources[0].start = AR913X_WMAC_BASE;
816 - ath79_wmac_resources[0].end = AR913X_WMAC_BASE + AR913X_WMAC_SIZE - 1;
817 - ath79_wmac_resources[1].start = ATH79_CPU_IRQ(2);
818 - ath79_wmac_resources[1].end = ATH79_CPU_IRQ(2);
822 -static int ar933x_wmac_reset(void)
824 - ath79_device_reset_set(AR933X_RESET_WMAC);
825 - ath79_device_reset_clear(AR933X_RESET_WMAC);
830 -static int ar933x_r1_get_wmac_revision(void)
832 - return ath79_soc_rev;
835 -static void __init ar933x_wmac_setup(void)
839 - ar933x_wmac_reset();
841 - ath79_wmac_device.name = "ar933x_wmac";
843 - ath79_wmac_resources[0].start = AR933X_WMAC_BASE;
844 - ath79_wmac_resources[0].end = AR933X_WMAC_BASE + AR933X_WMAC_SIZE - 1;
845 - ath79_wmac_resources[1].start = ATH79_CPU_IRQ(2);
846 - ath79_wmac_resources[1].end = ATH79_CPU_IRQ(2);
848 - t = ath79_reset_rr(AR933X_RESET_REG_BOOTSTRAP);
849 - if (t & AR933X_BOOTSTRAP_REF_CLK_40)
850 - ath79_wmac_data.is_clk_25mhz = false;
852 - ath79_wmac_data.is_clk_25mhz = true;
854 - if (ath79_soc_rev == 1)
855 - ath79_wmac_data.get_mac_revision = ar933x_r1_get_wmac_revision;
857 - ath79_wmac_data.external_reset = ar933x_wmac_reset;
860 -static void ar934x_wmac_setup(void)
864 - ath79_wmac_device.name = "ar934x_wmac";
866 - ath79_wmac_resources[0].start = AR934X_WMAC_BASE;
867 - ath79_wmac_resources[0].end = AR934X_WMAC_BASE + AR934X_WMAC_SIZE - 1;
868 - ath79_wmac_resources[1].start = ATH79_IP2_IRQ(1);
869 - ath79_wmac_resources[1].end = ATH79_IP2_IRQ(1);
871 - t = ath79_reset_rr(AR934X_RESET_REG_BOOTSTRAP);
872 - if (t & AR934X_BOOTSTRAP_REF_CLK_40)
873 - ath79_wmac_data.is_clk_25mhz = false;
875 - ath79_wmac_data.is_clk_25mhz = true;
878 -static void qca955x_wmac_setup(void)
882 - ath79_wmac_device.name = "qca955x_wmac";
884 - ath79_wmac_resources[0].start = QCA955X_WMAC_BASE;
885 - ath79_wmac_resources[0].end = QCA955X_WMAC_BASE + QCA955X_WMAC_SIZE - 1;
886 - ath79_wmac_resources[1].start = ATH79_IP2_IRQ(1);
887 - ath79_wmac_resources[1].end = ATH79_IP2_IRQ(1);
889 - t = ath79_reset_rr(QCA955X_RESET_REG_BOOTSTRAP);
890 - if (t & QCA955X_BOOTSTRAP_REF_CLK_40)
891 - ath79_wmac_data.is_clk_25mhz = false;
893 - ath79_wmac_data.is_clk_25mhz = true;
896 -void __init ath79_register_wmac(u8 *cal_data)
898 - if (soc_is_ar913x())
899 - ar913x_wmac_setup();
900 - else if (soc_is_ar933x())
901 - ar933x_wmac_setup();
902 - else if (soc_is_ar934x())
903 - ar934x_wmac_setup();
904 - else if (soc_is_qca955x())
905 - qca955x_wmac_setup();
910 - memcpy(ath79_wmac_data.eeprom_data, cal_data,
911 - sizeof(ath79_wmac_data.eeprom_data));
913 - platform_device_register(&ath79_wmac_device);
915 diff --git a/arch/mips/ath79/dev-wmac.h b/arch/mips/ath79/dev-wmac.h
916 deleted file mode 100644
917 index c9cd8709f090..000000000000
918 --- a/arch/mips/ath79/dev-wmac.h
922 - * Atheros AR913X/AR933X SoC built-in WMAC device support
924 - * Copyright (C) 2008-2011 Gabor Juhos <juhosg@openwrt.org>
925 - * Copyright (C) 2008 Imre Kaloz <kaloz@openwrt.org>
927 - * This program is free software; you can redistribute it and/or modify it
928 - * under the terms of the GNU General Public License version 2 as published
929 - * by the Free Software Foundation.
932 -#ifndef _ATH79_DEV_WMAC_H
933 -#define _ATH79_DEV_WMAC_H
935 -void ath79_register_wmac(u8 *cal_data);
937 -#endif /* _ATH79_DEV_WMAC_H */
938 diff --git a/arch/mips/ath79/setup.c b/arch/mips/ath79/setup.c
939 index 4c7a93f4039a..8d7ffa2e8265 100644
940 --- a/arch/mips/ath79/setup.c
941 +++ b/arch/mips/ath79/setup.c
943 #include <asm/mach-ath79/ath79.h>
944 #include <asm/mach-ath79/ar71xx_regs.h>
946 -#include "dev-common.h"
947 #include "machtypes.h"
949 #define ATH79_SYS_TYPE_LEN 64
950 @@ -316,10 +315,6 @@ static int __init ath79_setup(void)
951 if (mips_machtype == ATH79_MACH_GENERIC_OF)
955 - ath79_register_uart();
956 - ath79_register_wdt();
958 mips_machine_setup();