0023-MIPS-ath79-drop-mach-files.patch 20 KB

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