aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/ar71xx/files
diff options
context:
space:
mode:
authorPiotr Dymacz <pepe2k@gmail.com>2018-02-18 22:49:10 +0100
committerPiotr Dymacz <pepe2k@gmail.com>2018-02-22 18:53:22 +0100
commit1b0e7a1453ad968cd866b9d206a588caabbbb835 (patch)
treef924b1e62f2f960b63bf974926da718734d0589a /target/linux/ar71xx/files
parent650a5e993b3b252da511e90706f3759d5ea68ce1 (diff)
downloadupstream-1b0e7a1453ad968cd866b9d206a588caabbbb835.tar.gz
upstream-1b0e7a1453ad968cd866b9d206a588caabbbb835.tar.bz2
upstream-1b0e7a1453ad968cd866b9d206a588caabbbb835.zip
ar71xx: fix COMFAST CF-E375AC support
Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
Diffstat (limited to 'target/linux/ar71xx/files')
-rw-r--r--target/linux/ar71xx/files/arch/mips/ath79/mach-cf-e316n-v2.c50
1 files changed, 24 insertions, 26 deletions
diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-cf-e316n-v2.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-cf-e316n-v2.c
index a5baeac2ed..587e66d22d 100644
--- a/target/linux/ar71xx/files/arch/mips/ath79/mach-cf-e316n-v2.c
+++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-cf-e316n-v2.c
@@ -188,37 +188,38 @@ static struct gpio_keys_button cf_e355ac_gpio_keys[] __initdata = {
},
};
-#define CF_E375AC_GPIO_XWDT_TRIGGER 6
+/* CF-E375AC */
+#define CF_E375AC_GPIO_LED_LAN 17
+#define CF_E375AC_GPIO_LED_WLAN2G 16
+#define CF_E375AC_GPIO_LED_WLAN5G 15
-#define CF_E375AC_GPIO_BTN_RESET_WPS 2
+#define CF_E375AC_GPIO_EXT_WDT 6
-#define CF_E375AC_GPIO_LED_WAN 15
-#define CF_E375AC_GPIO_LED_LAN 17
-#define CF_E375AC_GPIO_LED_WLAN 16
+#define CF_E375AC_GPIO_BTN_RESET 2
static struct gpio_led cf_e375ac_leds_gpio[] __initdata = {
{
- .name = "comfast:red:wan",
- .gpio = CF_E375AC_GPIO_LED_WAN,
+ .name = "cf-e375ac:green:lan",
+ .gpio = CF_E375AC_GPIO_LED_LAN,
.active_low = 0,
}, {
- .name = "comfast:green:lan",
- .gpio = CF_E375AC_GPIO_LED_LAN,
+ .name = "cf-e375ac:red:wlan5g",
+ .gpio = CF_E375AC_GPIO_LED_WLAN5G,
.active_low = 0,
}, {
- .name = "comfast:blue:wlan",
- .gpio = CF_E375AC_GPIO_LED_WLAN,
+ .name = "cf-e375ac:blue:wlan2g",
+ .gpio = CF_E375AC_GPIO_LED_WLAN2G,
.active_low = 0,
},
};
static struct gpio_keys_button cf_e375ac_gpio_keys[] __initdata = {
{
- .desc = "Reset button/WPS button",
+ .desc = "Reset button",
.type = EV_KEY,
.code = KEY_RESTART,
.debounce_interval = CF_EXXXN_KEYS_DEBOUNCE_INTERVAL,
- .gpio = CF_E375AC_GPIO_BTN_RESET_WPS,
+ .gpio = CF_E375AC_GPIO_BTN_RESET,
.active_low = 1,
},
};
@@ -535,25 +536,19 @@ MIPS_MACHINE(ATH79_MACH_CF_E355AC_V2, "CF-E355AC-V2", "COMFAST CF-E355AC v2",
static void __init cf_e375ac_setup(void)
{
u8 *mac = (u8 *) KSEG1ADDR(0x1f040000);
- u8 *art = (u8 *) KSEG1ADDR(0x1f040000);
- u8 wlan1_mac[ETH_ALEN];
-
- ath79_init_mac(ath79_eth0_data.mac_addr, mac, 0);
- ath79_init_mac(ath79_eth1_data.mac_addr, mac, 1);
- ath79_init_mac(wlan1_mac, art, 3);
/* Disable JTAG, enabling GPIOs 0-3 */
- /* Configure OBS4 line, for GPIO 4*/
ath79_gpio_function_setup(AR934X_GPIO_FUNC_JTAG_DISABLE, 0);
- cf_exxxn_common_setup(0x40000, CF_E375AC_GPIO_XWDT_TRIGGER);
+ cf_exxxn_common_setup(0x40000, CF_E375AC_GPIO_EXT_WDT);
- ath79_gpio_output_select(CF_E375AC_GPIO_LED_WAN, 0);
ath79_gpio_output_select(CF_E375AC_GPIO_LED_LAN, 0);
- ath79_gpio_output_select(CF_E375AC_GPIO_LED_WLAN, 0);
+ ath79_gpio_output_select(CF_E375AC_GPIO_LED_WLAN2G, 0);
+ ath79_gpio_output_select(CF_E375AC_GPIO_LED_WLAN5G, 0);
ath79_register_leds_gpio(-1, ARRAY_SIZE(cf_e375ac_leds_gpio),
- cf_e375ac_leds_gpio);
+ cf_e375ac_leds_gpio);
+
ath79_register_gpio_keys_polled(-1, CF_EXXXN_KEYS_POLL_INTERVAL,
ARRAY_SIZE(cf_e375ac_gpio_keys),
cf_e375ac_gpio_keys);
@@ -569,11 +564,14 @@ static void __init cf_e375ac_setup(void)
ath79_eth0_data.duplex = DUPLEX_FULL;
ath79_eth0_data.phy_mask = BIT(0);
ath79_eth0_data.mii_bus_dev = &ath79_mdio0_device.dev;
+ ath79_init_mac(ath79_eth0_data.mac_addr, mac, 0);
ath79_register_eth(0);
- ap91_pci_init(art + 0x5000, wlan1_mac);
+ ath79_register_pci();
}
-MIPS_MACHINE(ATH79_MACH_CF_E375AC, "CF-E375AC", "COMFAST CF-E375AC", cf_e375ac_setup);
+
+MIPS_MACHINE(ATH79_MACH_CF_E375AC, "CF-E375AC", "COMFAST CF-E375AC",
+ cf_e375ac_setup);
static void __init cf_e38xac_common_setup(unsigned long art_ofs)
{