608-MIPS-ath79-ubnt-xm-add-more-boards.patch 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531
  1. --- a/arch/mips/ath79/mach-ubnt-xm.c
  2. +++ b/arch/mips/ath79/mach-ubnt-xm.c
  3. @@ -12,16 +12,24 @@
  4. #include <linux/init.h>
  5. #include <linux/pci.h>
  6. +#include <linux/platform_device.h>
  7. #include <linux/ath9k_platform.h>
  8. +#include <linux/etherdevice.h>
  9. +#include <linux/ar8216_platform.h>
  10. +#include <asm/mach-ath79/ath79.h>
  11. #include <asm/mach-ath79/irq.h>
  12. +#include <asm/mach-ath79/ar71xx_regs.h>
  13. +#include "common.h"
  14. #include "dev-ap9x-pci.h"
  15. +#include "dev-eth.h"
  16. #include "dev-gpio-buttons.h"
  17. #include "dev-leds-gpio.h"
  18. #include "dev-m25p80.h"
  19. +#include "dev-usb.h"
  20. +#include "dev-wmac.h"
  21. #include "machtypes.h"
  22. -#include "pci.h"
  23. #define UBNT_XM_GPIO_LED_L1 0
  24. #define UBNT_XM_GPIO_LED_L2 1
  25. @@ -37,19 +45,19 @@
  26. static struct gpio_led ubnt_xm_leds_gpio[] __initdata = {
  27. {
  28. - .name = "ubnt-xm:red:link1",
  29. + .name = "ubnt:red:link1",
  30. .gpio = UBNT_XM_GPIO_LED_L1,
  31. .active_low = 0,
  32. }, {
  33. - .name = "ubnt-xm:orange:link2",
  34. + .name = "ubnt:orange:link2",
  35. .gpio = UBNT_XM_GPIO_LED_L2,
  36. .active_low = 0,
  37. }, {
  38. - .name = "ubnt-xm:green:link3",
  39. + .name = "ubnt:green:link3",
  40. .gpio = UBNT_XM_GPIO_LED_L3,
  41. .active_low = 0,
  42. }, {
  43. - .name = "ubnt-xm:green:link4",
  44. + .name = "ubnt:green:link4",
  45. .gpio = UBNT_XM_GPIO_LED_L4,
  46. .active_low = 0,
  47. },
  48. @@ -66,9 +74,13 @@ static struct gpio_keys_button ubnt_xm_g
  49. }
  50. };
  51. +#define UBNT_M_WAN_PHYMASK BIT(4)
  52. +
  53. static void __init ubnt_xm_init(void)
  54. {
  55. u8 *eeprom = (u8 *) KSEG1ADDR(UBNT_XM_EEPROM_ADDR);
  56. + u8 *mac1 = (u8 *) KSEG1ADDR(0x1fff0000);
  57. + u8 *mac2 = (u8 *) KSEG1ADDR(0x1fff0000 + ETH_ALEN);
  58. ath79_register_leds_gpio(-1, ARRAY_SIZE(ubnt_xm_leds_gpio),
  59. ubnt_xm_leds_gpio);
  60. @@ -79,9 +91,428 @@ static void __init ubnt_xm_init(void)
  61. ath79_register_m25p80(NULL);
  62. ap91_pci_init(eeprom, NULL);
  63. +
  64. + ath79_register_mdio(0, ~UBNT_M_WAN_PHYMASK);
  65. + ath79_init_mac(ath79_eth0_data.mac_addr, mac1, 0);
  66. + ath79_init_mac(ath79_eth1_data.mac_addr, mac2, 0);
  67. + ath79_register_eth(0);
  68. }
  69. MIPS_MACHINE(ATH79_MACH_UBNT_XM,
  70. "UBNT-XM",
  71. "Ubiquiti Networks XM (rev 1.0) board",
  72. ubnt_xm_init);
  73. +
  74. +MIPS_MACHINE(ATH79_MACH_UBNT_BULLET_M, "UBNT-BM", "Ubiquiti Bullet M",
  75. + ubnt_xm_init);
  76. +
  77. +static void __init ubnt_rocket_m_setup(void)
  78. +{
  79. + ubnt_xm_init();
  80. + ath79_register_usb();
  81. +}
  82. +
  83. +MIPS_MACHINE(ATH79_MACH_UBNT_ROCKET_M, "UBNT-RM", "Ubiquiti Rocket M",
  84. + ubnt_rocket_m_setup);
  85. +
  86. +static void __init ubnt_nano_m_setup(void)
  87. +{
  88. + ubnt_xm_init();
  89. + ath79_register_eth(1);
  90. +}
  91. +
  92. +MIPS_MACHINE(ATH79_MACH_UBNT_NANO_M, "UBNT-NM", "Ubiquiti Nanostation M",
  93. + ubnt_nano_m_setup);
  94. +
  95. +static struct gpio_led ubnt_airrouter_leds_gpio[] __initdata = {
  96. + {
  97. + .name = "ubnt:green:globe",
  98. + .gpio = 0,
  99. + .active_low = 1,
  100. + }, {
  101. + .name = "ubnt:green:power",
  102. + .gpio = 11,
  103. + .active_low = 1,
  104. + .default_state = LEDS_GPIO_DEFSTATE_ON,
  105. + }
  106. +};
  107. +
  108. +static void __init ubnt_airrouter_setup(void)
  109. +{
  110. + u8 *mac1 = (u8 *) KSEG1ADDR(0x1fff0000);
  111. + u8 *ee = (u8 *) KSEG1ADDR(0x1fff1000);
  112. +
  113. + ath79_register_m25p80(NULL);
  114. + ath79_register_mdio(0, ~UBNT_M_WAN_PHYMASK);
  115. +
  116. + ath79_init_mac(ath79_eth0_data.mac_addr, mac1, 0);
  117. + ath79_init_local_mac(ath79_eth1_data.mac_addr, mac1);
  118. +
  119. + ath79_register_eth(1);
  120. + ath79_register_eth(0);
  121. + ath79_register_usb();
  122. +
  123. + ap91_pci_init(ee, NULL);
  124. + ath79_register_leds_gpio(-1, ARRAY_SIZE(ubnt_airrouter_leds_gpio),
  125. + ubnt_airrouter_leds_gpio);
  126. +
  127. + ath79_register_gpio_keys_polled(-1, UBNT_XM_KEYS_POLL_INTERVAL,
  128. + ARRAY_SIZE(ubnt_xm_gpio_keys),
  129. + ubnt_xm_gpio_keys);
  130. +}
  131. +
  132. +MIPS_MACHINE(ATH79_MACH_UBNT_AIRROUTER, "UBNT-AR", "Ubiquiti AirRouter",
  133. + ubnt_airrouter_setup);
  134. +
  135. +static struct gpio_led ubnt_unifi_leds_gpio[] __initdata = {
  136. + {
  137. + .name = "ubnt:orange:dome",
  138. + .gpio = 1,
  139. + .active_low = 0,
  140. + }, {
  141. + .name = "ubnt:green:dome",
  142. + .gpio = 0,
  143. + .active_low = 0,
  144. + }
  145. +};
  146. +
  147. +static struct gpio_led ubnt_unifi_outdoor_leds_gpio[] __initdata = {
  148. + {
  149. + .name = "ubnt:orange:front",
  150. + .gpio = 1,
  151. + .active_low = 0,
  152. + }, {
  153. + .name = "ubnt:green:front",
  154. + .gpio = 0,
  155. + .active_low = 0,
  156. + }
  157. +};
  158. +
  159. +static struct gpio_led ubnt_unifi_outdoor_plus_leds_gpio[] __initdata = {
  160. + {
  161. + .name = "ubnt:white:front",
  162. + .gpio = 1,
  163. + .active_low = 0,
  164. + }, {
  165. + .name = "ubnt:blue:front",
  166. + .gpio = 0,
  167. + .active_low = 0,
  168. + }
  169. +};
  170. +
  171. +
  172. +static void __init ubnt_unifi_setup(void)
  173. +{
  174. + u8 *mac = (u8 *) KSEG1ADDR(0x1fff0000);
  175. + u8 *ee = (u8 *) KSEG1ADDR(0x1fff1000);
  176. +
  177. + ath79_register_m25p80(NULL);
  178. +
  179. + ath79_register_mdio(0, ~UBNT_M_WAN_PHYMASK);
  180. +
  181. + ath79_init_mac(ath79_eth0_data.mac_addr, mac, 0);
  182. + ath79_register_eth(0);
  183. +
  184. + ap91_pci_init(ee, NULL);
  185. +
  186. + ath79_register_leds_gpio(-1, ARRAY_SIZE(ubnt_unifi_leds_gpio),
  187. + ubnt_unifi_leds_gpio);
  188. +
  189. + ath79_register_gpio_keys_polled(-1, UBNT_XM_KEYS_POLL_INTERVAL,
  190. + ARRAY_SIZE(ubnt_xm_gpio_keys),
  191. + ubnt_xm_gpio_keys);
  192. +}
  193. +
  194. +MIPS_MACHINE(ATH79_MACH_UBNT_UNIFI, "UBNT-UF", "Ubiquiti UniFi",
  195. + ubnt_unifi_setup);
  196. +
  197. +
  198. +#define UBNT_UNIFIOD_PRI_PHYMASK BIT(4)
  199. +#define UBNT_UNIFIOD_2ND_PHYMASK (BIT(0) | BIT(1) | BIT(2) | BIT(3))
  200. +
  201. +static void __init ubnt_unifi_outdoor_setup(void)
  202. +{
  203. + u8 *mac1 = (u8 *) KSEG1ADDR(0x1fff0000);
  204. + u8 *mac2 = (u8 *) KSEG1ADDR(0x1fff0000 + ETH_ALEN);
  205. + u8 *ee = (u8 *) KSEG1ADDR(0x1fff1000);
  206. +
  207. + ath79_register_m25p80(NULL);
  208. +
  209. + ath79_register_mdio(0, ~(UBNT_UNIFIOD_PRI_PHYMASK |
  210. + UBNT_UNIFIOD_2ND_PHYMASK));
  211. +
  212. + ath79_init_mac(ath79_eth0_data.mac_addr, mac1, 0);
  213. + ath79_init_mac(ath79_eth1_data.mac_addr, mac2, 0);
  214. + ath79_register_eth(0);
  215. + ath79_register_eth(1);
  216. +
  217. + ap91_pci_init(ee, NULL);
  218. +
  219. + ath79_register_leds_gpio(-1, ARRAY_SIZE(ubnt_unifi_outdoor_leds_gpio),
  220. + ubnt_unifi_outdoor_leds_gpio);
  221. +
  222. + ath79_register_gpio_keys_polled(-1, UBNT_XM_KEYS_POLL_INTERVAL,
  223. + ARRAY_SIZE(ubnt_xm_gpio_keys),
  224. + ubnt_xm_gpio_keys);
  225. +}
  226. +
  227. +MIPS_MACHINE(ATH79_MACH_UBNT_UNIFI_OUTDOOR, "UBNT-U20",
  228. + "Ubiquiti UniFiAP Outdoor",
  229. + ubnt_unifi_outdoor_setup);
  230. +
  231. +
  232. +static void __init ubnt_unifi_outdoor_plus_setup(void)
  233. +{
  234. + u8 *mac1 = (u8 *) KSEG1ADDR(0x1fff0000);
  235. + u8 *mac2 = (u8 *) KSEG1ADDR(0x1fff0000 + ETH_ALEN);
  236. + u8 *ee = (u8 *) KSEG1ADDR(0x1fff1000);
  237. +
  238. + ath79_register_m25p80(NULL);
  239. +
  240. + ath79_register_mdio(0, ~(UBNT_UNIFIOD_PRI_PHYMASK |
  241. + UBNT_UNIFIOD_2ND_PHYMASK));
  242. +
  243. + ath79_init_mac(ath79_eth0_data.mac_addr, mac1, 0);
  244. + ath79_init_mac(ath79_eth1_data.mac_addr, mac2, 0);
  245. + ath79_register_eth(0);
  246. + ath79_register_eth(1);
  247. +
  248. + ap91_pci_init(ee, NULL);
  249. +
  250. + ath79_register_leds_gpio(-1, ARRAY_SIZE(ubnt_unifi_outdoor_plus_leds_gpio),
  251. + ubnt_unifi_outdoor_plus_leds_gpio);
  252. +
  253. + ath79_register_gpio_keys_polled(-1, UBNT_XM_KEYS_POLL_INTERVAL,
  254. + ARRAY_SIZE(ubnt_xm_gpio_keys),
  255. + ubnt_xm_gpio_keys);
  256. +}
  257. +
  258. +MIPS_MACHINE(ATH79_MACH_UBNT_UNIFI_OUTDOOR_PLUS, "UBNT-UOP",
  259. + "Ubiquiti UniFiAP Outdoor+",
  260. + ubnt_unifi_outdoor_plus_setup);
  261. +
  262. +
  263. +static struct gpio_led ubnt_uap_pro_gpio_leds[] __initdata = {
  264. + {
  265. + .name = "ubnt:white:dome",
  266. + .gpio = 12,
  267. + }, {
  268. + .name = "ubnt:blue:dome",
  269. + .gpio = 13,
  270. + }
  271. +};
  272. +
  273. +static struct gpio_keys_button uap_pro_gpio_keys[] __initdata = {
  274. + {
  275. + .desc = "reset",
  276. + .type = EV_KEY,
  277. + .code = KEY_RESTART,
  278. + .debounce_interval = UBNT_XM_KEYS_DEBOUNCE_INTERVAL,
  279. + .gpio = 17,
  280. + .active_low = 1,
  281. + }
  282. +};
  283. +
  284. +static struct ar8327_pad_cfg uap_pro_ar8327_pad0_cfg = {
  285. + .mode = AR8327_PAD_MAC_RGMII,
  286. + .txclk_delay_en = true,
  287. + .rxclk_delay_en = true,
  288. + .txclk_delay_sel = AR8327_CLK_DELAY_SEL1,
  289. + .rxclk_delay_sel = AR8327_CLK_DELAY_SEL2,
  290. +};
  291. +
  292. +static struct ar8327_platform_data uap_pro_ar8327_data = {
  293. + .pad0_cfg = &uap_pro_ar8327_pad0_cfg,
  294. + .port0_cfg = {
  295. + .force_link = 1,
  296. + .speed = AR8327_PORT_SPEED_1000,
  297. + .duplex = 1,
  298. + .txpause = 1,
  299. + .rxpause = 1,
  300. + },
  301. +};
  302. +
  303. +static struct mdio_board_info uap_pro_mdio0_info[] = {
  304. + {
  305. + .bus_id = "ag71xx-mdio.0",
  306. + .phy_addr = 0,
  307. + .platform_data = &uap_pro_ar8327_data,
  308. + },
  309. +};
  310. +
  311. +#define UAP_PRO_MAC0_OFFSET 0x0000
  312. +#define UAP_PRO_MAC1_OFFSET 0x0006
  313. +#define UAP_PRO_WMAC_CALDATA_OFFSET 0x1000
  314. +#define UAP_PRO_PCI_CALDATA_OFFSET 0x5000
  315. +
  316. +static void __init ubnt_uap_pro_setup(void)
  317. +{
  318. + u8 *eeprom = (u8 *) KSEG1ADDR(0x1fff0000);
  319. +
  320. + ath79_register_m25p80(NULL);
  321. +
  322. + ath79_register_leds_gpio(-1, ARRAY_SIZE(ubnt_uap_pro_gpio_leds),
  323. + ubnt_uap_pro_gpio_leds);
  324. + ath79_register_gpio_keys_polled(-1, UBNT_XM_KEYS_POLL_INTERVAL,
  325. + ARRAY_SIZE(uap_pro_gpio_keys),
  326. + uap_pro_gpio_keys);
  327. +
  328. + ath79_register_wmac(eeprom + UAP_PRO_WMAC_CALDATA_OFFSET, NULL);
  329. + ap91_pci_init(eeprom + UAP_PRO_PCI_CALDATA_OFFSET, NULL);
  330. +
  331. + ath79_register_mdio(0, 0x0);
  332. + mdiobus_register_board_info(uap_pro_mdio0_info,
  333. + ARRAY_SIZE(uap_pro_mdio0_info));
  334. +
  335. + ath79_setup_ar934x_eth_cfg(AR934X_ETH_CFG_RGMII_GMAC0);
  336. + ath79_init_mac(ath79_eth0_data.mac_addr,
  337. + eeprom + UAP_PRO_MAC0_OFFSET, 0);
  338. +
  339. + /* GMAC0 is connected to an AR8327 switch */
  340. + ath79_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_RGMII;
  341. + ath79_eth0_data.phy_mask = BIT(0);
  342. + ath79_eth0_data.mii_bus_dev = &ath79_mdio0_device.dev;
  343. + ath79_eth0_pll_data.pll_1000 = 0x06000000;
  344. + ath79_register_eth(0);
  345. +}
  346. +
  347. +MIPS_MACHINE(ATH79_MACH_UBNT_UAP_PRO, "UAP-PRO", "Ubiquiti UniFi AP Pro",
  348. + ubnt_uap_pro_setup);
  349. +
  350. +#define UBNT_XW_GPIO_LED_L1 11
  351. +#define UBNT_XW_GPIO_LED_L2 16
  352. +#define UBNT_XW_GPIO_LED_L3 13
  353. +#define UBNT_XW_GPIO_LED_L4 14
  354. +
  355. +static struct gpio_led ubnt_xw_leds_gpio[] __initdata = {
  356. + {
  357. + .name = "ubnt:red:link1",
  358. + .gpio = UBNT_XW_GPIO_LED_L1,
  359. + .active_low = 1,
  360. + }, {
  361. + .name = "ubnt:orange:link2",
  362. + .gpio = UBNT_XW_GPIO_LED_L2,
  363. + .active_low = 1,
  364. + }, {
  365. + .name = "ubnt:green:link3",
  366. + .gpio = UBNT_XW_GPIO_LED_L3,
  367. + .active_low = 1,
  368. + }, {
  369. + .name = "ubnt:green:link4",
  370. + .gpio = UBNT_XW_GPIO_LED_L4,
  371. + .active_low = 1,
  372. + },
  373. +};
  374. +
  375. +static void __init ubnt_xw_init(void)
  376. +{
  377. + u8 *eeprom = (u8 *) KSEG1ADDR(0x1fff0000);
  378. +
  379. + ath79_register_m25p80(NULL);
  380. +
  381. + ath79_register_leds_gpio(-1, ARRAY_SIZE(ubnt_xw_leds_gpio),
  382. + ubnt_xw_leds_gpio);
  383. + ath79_register_gpio_keys_polled(-1, UBNT_XM_KEYS_POLL_INTERVAL,
  384. + ARRAY_SIZE(ubnt_xm_gpio_keys),
  385. + ubnt_xm_gpio_keys);
  386. +
  387. + ath79_register_wmac(eeprom + UAP_PRO_WMAC_CALDATA_OFFSET, NULL);
  388. + ap91_pci_init(eeprom + UAP_PRO_PCI_CALDATA_OFFSET, NULL);
  389. +
  390. +
  391. + ath79_setup_ar934x_eth_cfg(AR934X_ETH_CFG_MII_GMAC0 | AR934X_ETH_CFG_MII_GMAC0_SLAVE);
  392. + ath79_init_mac(ath79_eth0_data.mac_addr,
  393. + eeprom + UAP_PRO_MAC0_OFFSET, 0);
  394. +
  395. + ath79_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_MII;
  396. + ath79_eth0_data.mii_bus_dev = &ath79_mdio0_device.dev;
  397. +}
  398. +
  399. +static void __init ubnt_nano_m_xw_setup(void)
  400. +{
  401. + ubnt_xw_init();
  402. +
  403. + /* GMAC0 is connected to an AR8326 switch */
  404. + ath79_register_mdio(0, ~(BIT(0) | BIT(1) | BIT(5)));
  405. + ath79_eth0_data.phy_mask = (BIT(0) | BIT(1) | BIT(5));
  406. + ath79_eth0_data.speed = SPEED_100;
  407. + ath79_eth0_data.duplex = DUPLEX_FULL;
  408. + ath79_register_eth(0);
  409. +}
  410. +
  411. +static void __init ubnt_loco_m_xw_setup(void)
  412. +{
  413. + ubnt_xw_init();
  414. +
  415. + ath79_register_mdio(0, ~BIT(1));
  416. + ath79_eth0_data.phy_mask = BIT(1);
  417. + ath79_register_eth(0);
  418. +}
  419. +
  420. +MIPS_MACHINE(ATH79_MACH_UBNT_NANO_M_XW, "UBNT-NM-XW", "Ubiquiti Nanostation M XW",
  421. + ubnt_nano_m_xw_setup);
  422. +
  423. +MIPS_MACHINE(ATH79_MACH_UBNT_LOCO_M_XW, "UBNT-LOCO-XW", "Ubiquiti Loco M XW",
  424. + ubnt_loco_m_xw_setup);
  425. +
  426. +static struct gpio_led ubnt_airgateway_gpio_leds[] __initdata = {
  427. + {
  428. + .name = "ubnt:blue:wlan",
  429. + .gpio = 0,
  430. + }, {
  431. + .name = "ubnt:white:status",
  432. + .gpio = 1,
  433. + },
  434. +};
  435. +
  436. +static struct gpio_keys_button airgateway_gpio_keys[] __initdata = {
  437. + {
  438. + .desc = "reset",
  439. + .type = EV_KEY,
  440. + .code = KEY_RESTART,
  441. + .debounce_interval = UBNT_XM_KEYS_DEBOUNCE_INTERVAL,
  442. + .gpio = 12,
  443. + .active_low = 1,
  444. + }
  445. +};
  446. +
  447. +static void __init ubnt_airgateway_setup(void)
  448. +{
  449. + u32 t;
  450. + u8 *mac0 = (u8 *) KSEG1ADDR(0x1fff0000);
  451. + u8 *mac1 = (u8 *) KSEG1ADDR(0x1fff0000 + ETH_ALEN);
  452. + u8 *ee = (u8 *) KSEG1ADDR(0x1fff1000);
  453. +
  454. +
  455. + ath79_gpio_function_disable(AR933X_GPIO_FUNC_ETH_SWITCH_LED0_EN |
  456. + AR933X_GPIO_FUNC_ETH_SWITCH_LED1_EN |
  457. + AR933X_GPIO_FUNC_ETH_SWITCH_LED2_EN |
  458. + AR933X_GPIO_FUNC_ETH_SWITCH_LED3_EN |
  459. + AR933X_GPIO_FUNC_ETH_SWITCH_LED4_EN);
  460. +
  461. + t = ath79_reset_rr(AR933X_RESET_REG_BOOTSTRAP);
  462. + t |= AR933X_BOOTSTRAP_MDIO_GPIO_EN;
  463. + ath79_reset_wr(AR933X_RESET_REG_BOOTSTRAP, t);
  464. +
  465. + ath79_register_m25p80(NULL);
  466. + ath79_register_leds_gpio(-1, ARRAY_SIZE(ubnt_airgateway_gpio_leds),
  467. + ubnt_airgateway_gpio_leds);
  468. +
  469. + ath79_register_gpio_keys_polled(-1, UBNT_XM_KEYS_POLL_INTERVAL,
  470. + ARRAY_SIZE(airgateway_gpio_keys),
  471. + airgateway_gpio_keys);
  472. +
  473. + ath79_init_mac(ath79_eth1_data.mac_addr, mac0, 0);
  474. + ath79_init_mac(ath79_eth0_data.mac_addr, mac1, 0);
  475. +
  476. + ath79_register_mdio(0, 0x0);
  477. +
  478. + ath79_register_eth(1);
  479. + ath79_register_eth(0);
  480. +
  481. + ath79_register_wmac(ee, NULL);
  482. +}
  483. +
  484. +MIPS_MACHINE(ATH79_MACH_UBNT_AIRGW, "UBNT-AGW", "Ubiquiti AirGateway",
  485. + ubnt_airgateway_setup);
  486. +
  487. --- a/arch/mips/ath79/Kconfig
  488. +++ b/arch/mips/ath79/Kconfig
  489. @@ -68,12 +68,16 @@ config ATH79_MACH_PB44
  490. Atheros PB44 reference board.
  491. config ATH79_MACH_UBNT_XM
  492. - bool "Ubiquiti Networks XM (rev 1.0) board"
  493. + bool "Ubiquiti Networks XM/UniFi boards"
  494. select SOC_AR724X
  495. + select SOC_AR934X
  496. select ATH79_DEV_AP9X_PCI if PCI
  497. + select ATH79_DEV_ETH
  498. select ATH79_DEV_GPIO_BUTTONS
  499. select ATH79_DEV_LEDS_GPIO
  500. select ATH79_DEV_M25P80
  501. + select ATH79_DEV_USB
  502. + select ATH79_DEV_WMAC
  503. help
  504. Say 'Y' here if you want your kernel to support the
  505. Ubiquiti Networks XM (rev 1.0) board.
  506. --- a/arch/mips/ath79/machtypes.h
  507. +++ b/arch/mips/ath79/machtypes.h
  508. @@ -22,6 +22,13 @@ enum ath79_mach_type {
  509. ATH79_MACH_AP81, /* Atheros AP81 reference board */
  510. ATH79_MACH_DB120, /* Atheros DB120 reference board */
  511. ATH79_MACH_PB44, /* Atheros PB44 reference board */
  512. + ATH79_MACH_UBNT_AIRROUTER, /* Ubiquiti AirRouter */
  513. + ATH79_MACH_UBNT_BULLET_M, /* Ubiquiti Bullet M */
  514. + ATH79_MACH_UBNT_NANO_M, /* Ubiquiti NanoStation M */
  515. + ATH79_MACH_UBNT_ROCKET_M, /* Ubiquiti Rocket M */
  516. + ATH79_MACH_UBNT_UAP_PRO, /* Ubiquiti UniFi AP Pro */
  517. + ATH79_MACH_UBNT_UNIFI, /* Ubiquiti Unifi */
  518. + ATH79_MACH_UBNT_UNIFI_OUTDOOR, /* Ubiquiti UnifiAP Outdoor */
  519. ATH79_MACH_UBNT_XM, /* Ubiquiti Networks XM board rev 1.0 */
  520. };