2 * AirTight Networks C-55 board support
4 * Copyright (C) 2014-2015 Chris Blake <chrisrblake93@gmail.com>
6 * Based on Senao CAP4200AG board support
8 * Copyright (C) 2012 Gabor Juhos <juhosg@openwrt.org>
10 * This program is free software; you can redistribute it and/or modify it
11 * under the terms of the GNU General Public License version 2 as published
12 * by the Free Software Foundation.
15 #include <linux/pci.h>
16 #include <linux/phy.h>
17 #include <linux/mtd/mtd.h>
18 #include <linux/mtd/partitions.h>
19 #include <linux/mtd/physmap.h>
20 #include <linux/platform_device.h>
21 #include <linux/ath9k_platform.h>
23 #include <asm/mach-ath79/ar71xx_regs.h>
27 #include "dev-ap9x-pci.h"
29 #include "dev-gpio-buttons.h"
30 #include "dev-leds-gpio.h"
31 #include "dev-m25p80.h"
34 #include "machtypes.h"
36 #define C55_GPIO_LED_PWR_GREEN 12
37 #define C55_GPIO_LED_PWR_AMBER 13
38 #define C55_GPIO_LED_LAN_GREEN 14
39 #define C55_GPIO_LED_LAN_AMBER 15
40 #define C55_GPIO_LED_WLAN_GREEN 18
41 #define C55_GPIO_LED_WLAN_AMBER 19
43 #define C55_GPIO_BTN_RESET 17
45 #define C55_KEYS_POLL_INTERVAL 20 /* msecs */
46 #define C55_KEYS_DEBOUNCE_INTERVAL (3 * C55_KEYS_POLL_INTERVAL)
48 #define C55_MAC_OFFSET 0
49 #define C55_WMAC_CALDATA_OFFSET 0x1000
50 #define C55_PCIE_CALDATA_OFFSET 0x5000
52 static struct gpio_led c55_leds_gpio
[] __initdata
= {
54 .name
= "c-55:green:pwr",
55 .gpio
= C55_GPIO_LED_PWR_GREEN
,
59 .name
= "c-55:amber:pwr",
60 .gpio
= C55_GPIO_LED_PWR_AMBER
,
64 .name
= "c-55:green:lan",
65 .gpio
= C55_GPIO_LED_LAN_GREEN
,
69 .name
= "c-55:amber:lan",
70 .gpio
= C55_GPIO_LED_LAN_AMBER
,
74 .name
= "c-55:green:wlan",
75 .gpio
= C55_GPIO_LED_WLAN_GREEN
,
79 .name
= "c-55:amber:wlan",
80 .gpio
= C55_GPIO_LED_WLAN_AMBER
,
85 static struct gpio_keys_button c55_gpio_keys
[] __initdata
= {
87 .desc
= "Reset button",
90 .debounce_interval
= C55_KEYS_DEBOUNCE_INTERVAL
,
91 .gpio
= C55_GPIO_BTN_RESET
,
96 static void __init
c55_setup(void)
99 ath79_register_m25p80_large(NULL
);
102 ath79_register_mdio(0, 0x0);
104 /* AR8035-A Ethernet */
105 ath79_setup_ar934x_eth_cfg(AR934X_ETH_CFG_RGMII_GMAC0
|
106 AR934X_ETH_CFG_SW_ONLY_MODE
);
107 ath79_init_mac(ath79_eth0_data
.mac_addr
, NULL
, 0);
108 ath79_eth0_data
.phy_if_mode
= PHY_INTERFACE_MODE_RGMII
;
109 ath79_eth0_data
.phy_mask
= BIT(0);
110 ath79_eth0_data
.mii_bus_dev
= &ath79_mdio0_device
.dev
;
111 ath79_eth0_pll_data
.pll_1000
= 0x06000000;
112 ath79_register_eth(0);
115 ath79_gpio_output_select(C55_GPIO_LED_LAN_GREEN
,
116 AR934X_GPIO_OUT_GPIO
);
117 ath79_gpio_output_select(C55_GPIO_LED_LAN_AMBER
,
118 AR934X_GPIO_OUT_GPIO
);
119 ath79_register_leds_gpio(-1, ARRAY_SIZE(c55_leds_gpio
),
121 ath79_register_gpio_keys_polled(-1, C55_KEYS_POLL_INTERVAL
,
122 ARRAY_SIZE(c55_gpio_keys
),
126 ath79_wmac_disable_2ghz();
127 ath79_register_wmac_simple();
128 ap91_pci_init_simple();
131 MIPS_MACHINE(ATH79_MACH_C55
, "C-55", "AirTight Networks C-55",