diff options
author | Piotr Dymacz <pepe2k@gmail.com> | 2018-01-23 21:37:16 +0100 |
---|---|---|
committer | Piotr Dymacz <pepe2k@gmail.com> | 2018-02-22 18:53:22 +0100 |
commit | 650a5e993b3b252da511e90706f3759d5ea68ce1 (patch) | |
tree | d154341bc8d38334e2e3d9b9cf98d2cb84a7022d /target/linux/ar71xx/files | |
parent | 29d7c29046dba69f92bce528c8dc9d2579862b4c (diff) | |
download | upstream-650a5e993b3b252da511e90706f3759d5ea68ce1.tar.gz upstream-650a5e993b3b252da511e90706f3759d5ea68ce1.tar.bz2 upstream-650a5e993b3b252da511e90706f3759d5ea68ce1.zip |
ar71xx: add support for COMFAST CF-E385AC
COMFAST CF-E385AC is an AC2200 ceiling mount AP with PoE support, based
on Qualcomm/Atheros QCA9558 + QCA9984 + QCA8337N.
Specification:
- 720/600/200 MHz (CPU/DDR/AHB)
- 256 MB of RAM (DDR2)
- 16 MB of FLASH (SPI NOR)
- 2x 10/100/1000 Mbps Ethernet, with PoE support
- 3T3R 2.4 GHz (QCA9558), with external LNA and PA (SE2576L)
- 4T4R 5 GHz (QCA9984), with external FEM (SKY85728-11)
- 7x internal antennas
- 1x RGB LED (driven by GPIO)
- 1x button (reset)
- UART, LEDs/GPIO and USB headers on PCB
- external watchdog (Pericon Technology PT7A7514)
Flash instruction:
Original firmware is based on OpenWrt.
Use sysupgrade image directly in vendor GUI.
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.c | 173 | ||||
-rw-r--r-- | target/linux/ar71xx/files/arch/mips/ath79/machtypes.h | 1 |
2 files changed, 139 insertions, 35 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 1ac6c8eddd..a5baeac2ed 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 @@ -6,6 +6,7 @@ * - CF-E355AC v2 (QCA9531 + QCA9886) * - CF-E375AC (QCA9563 + QCA9886 + QCA8337) * - CF-E380AC v1/v2 (QCA9558) + * - CF-E385AC (QCA9558 + QCA9984 + QCA8337) * - CF-E520N/CF-E530N (QCA9531) * * Copyright (C) 2016 Piotr Dymacz <pepe2k@gmail.com> @@ -35,6 +36,7 @@ #include "dev-wmac.h" #include "dev-usb.h" #include "machtypes.h" +#include "pci.h" #define CF_EXXXN_KEYS_POLL_INTERVAL 20 #define CF_EXXXN_KEYS_DEBOUNCE_INTERVAL (3 * CF_EXXXN_KEYS_POLL_INTERVAL) @@ -245,27 +247,27 @@ static struct mdio_board_info cf_e375ac_mdio0_info[] = { }, }; -/* CF-E380AC v1/v2 */ -#define CF_E380AC_V1V2_GPIO_LED_LAN 0 -#define CF_E380AC_V1V2_GPIO_LED_WLAN2G 2 -#define CF_E380AC_V1V2_GPIO_LED_WLAN5G 3 +/* CF-E380AC v1/v2, CF-E385AC */ +#define CF_E38XAC_GPIO_LED_LAN 0 +#define CF_E38XAC_GPIO_LED_WLAN2G 2 +#define CF_E38XAC_GPIO_LED_WLAN5G 3 -#define CF_E380AC_V1V2_GPIO_EXT_WDT 17 +#define CF_E38XAC_GPIO_EXT_WDT 17 -#define CF_E380AC_V1V2_GPIO_BTN_RESET 19 +#define CF_E38XAC_GPIO_BTN_RESET 19 static struct gpio_led cf_e380ac_v1_leds_gpio[] __initdata = { { .name = "cf-e380ac-v1:green:lan", - .gpio = CF_E380AC_V1V2_GPIO_LED_LAN, + .gpio = CF_E38XAC_GPIO_LED_LAN, .active_low = 0, }, { .name = "cf-e380ac-v1:blue:wlan2g", - .gpio = CF_E380AC_V1V2_GPIO_LED_WLAN2G, + .gpio = CF_E38XAC_GPIO_LED_WLAN2G, .active_low = 0, }, { .name = "cf-e380ac-v1:red:wlan5g", - .gpio = CF_E380AC_V1V2_GPIO_LED_WLAN5G, + .gpio = CF_E38XAC_GPIO_LED_WLAN5G, .active_low = 0, }, }; @@ -273,26 +275,42 @@ static struct gpio_led cf_e380ac_v1_leds_gpio[] __initdata = { static struct gpio_led cf_e380ac_v2_leds_gpio[] __initdata = { { .name = "cf-e380ac-v2:green:lan", - .gpio = CF_E380AC_V1V2_GPIO_LED_LAN, + .gpio = CF_E38XAC_GPIO_LED_LAN, .active_low = 0, }, { .name = "cf-e380ac-v2:blue:wlan2g", - .gpio = CF_E380AC_V1V2_GPIO_LED_WLAN2G, + .gpio = CF_E38XAC_GPIO_LED_WLAN2G, .active_low = 0, }, { .name = "cf-e380ac-v2:red:wlan5g", - .gpio = CF_E380AC_V1V2_GPIO_LED_WLAN5G, + .gpio = CF_E38XAC_GPIO_LED_WLAN5G, .active_low = 0, }, }; -static struct gpio_keys_button cf_e380ac_v1v2_gpio_keys[] __initdata = { +static struct gpio_led cf_e385ac_leds_gpio[] __initdata = { + { + .name = "cf-e385ac:green:lan", + .gpio = CF_E38XAC_GPIO_LED_LAN, + .active_low = 0, + }, { + .name = "cf-e385ac:blue:wlan2g", + .gpio = CF_E38XAC_GPIO_LED_WLAN2G, + .active_low = 0, + }, { + .name = "cf-e385ac:red:wlan5g", + .gpio = CF_E38XAC_GPIO_LED_WLAN5G, + .active_low = 0, + }, +}; + +static struct gpio_keys_button cf_e38xac_gpio_keys[] __initdata = { { .desc = "Reset button", .type = EV_KEY, .code = KEY_RESTART, .debounce_interval = CF_EXXXN_KEYS_DEBOUNCE_INTERVAL, - .gpio = CF_E380AC_V1V2_GPIO_BTN_RESET, + .gpio = CF_E38XAC_GPIO_BTN_RESET, .active_low = 1, }, }; @@ -557,11 +575,36 @@ static void __init cf_e375ac_setup(void) } 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) +{ + cf_exxxn_common_setup(art_ofs, CF_E38XAC_GPIO_EXT_WDT); + + ath79_register_pci(); + + /* Disable JTAG (enables GPIO0-3) */ + ath79_gpio_function_enable(AR934X_GPIO_FUNC_JTAG_DISABLE); + + ath79_gpio_direction_select(CF_E38XAC_GPIO_LED_LAN, true); + ath79_gpio_direction_select(CF_E38XAC_GPIO_LED_WLAN2G, true); + ath79_gpio_direction_select(CF_E38XAC_GPIO_LED_WLAN5G, true); + + ath79_gpio_output_select(CF_E38XAC_GPIO_LED_LAN, 0); + ath79_gpio_output_select(CF_E38XAC_GPIO_LED_WLAN2G, 0); + ath79_gpio_output_select(CF_E38XAC_GPIO_LED_WLAN5G, 0); + + /* For J7-4 */ + ath79_gpio_function_disable(AR934X_GPIO_FUNC_CLK_OBS4_EN); + + ath79_register_gpio_keys_polled(-1, CF_EXXXN_KEYS_POLL_INTERVAL, + ARRAY_SIZE(cf_e38xac_gpio_keys), + cf_e38xac_gpio_keys); +} + static void __init cf_e380ac_v1v2_common_setup(unsigned long art_ofs) { u8 *mac = (u8 *) KSEG1ADDR(0x1f000000 + art_ofs); - cf_exxxn_common_setup(art_ofs, CF_E380AC_V1V2_GPIO_EXT_WDT); + cf_e38xac_common_setup(art_ofs); ath79_setup_qca955x_eth_cfg(QCA955X_ETH_CFG_RGMII_EN); @@ -578,26 +621,6 @@ static void __init cf_e380ac_v1v2_common_setup(unsigned long art_ofs) ath79_eth0_pll_data.pll_10 = 0xb0001313; ath79_init_mac(ath79_eth0_data.mac_addr, mac, 0); ath79_register_eth(0); - - ap91_pci_init(mac + 0x5000, NULL); - - /* Disable JTAG (enables GPIO0-3) */ - ath79_gpio_function_enable(AR934X_GPIO_FUNC_JTAG_DISABLE); - - ath79_gpio_direction_select(CF_E380AC_V1V2_GPIO_LED_LAN, true); - ath79_gpio_direction_select(CF_E380AC_V1V2_GPIO_LED_WLAN2G, true); - ath79_gpio_direction_select(CF_E380AC_V1V2_GPIO_LED_WLAN5G, true); - - ath79_gpio_output_select(CF_E380AC_V1V2_GPIO_LED_LAN, 0); - ath79_gpio_output_select(CF_E380AC_V1V2_GPIO_LED_WLAN2G, 0); - ath79_gpio_output_select(CF_E380AC_V1V2_GPIO_LED_WLAN5G, 0); - - /* For J7-4 */ - ath79_gpio_function_disable(AR934X_GPIO_FUNC_CLK_OBS4_EN); - - ath79_register_gpio_keys_polled(-1, CF_EXXXN_KEYS_POLL_INTERVAL, - ARRAY_SIZE(cf_e380ac_v1v2_gpio_keys), - cf_e380ac_v1v2_gpio_keys); } static void __init cf_e380ac_v1_setup(void) @@ -622,6 +645,86 @@ static void __init cf_e380ac_v2_setup(void) MIPS_MACHINE(ATH79_MACH_CF_E380AC_V2, "CF-E380AC-V2", "COMFAST CF-E380AC v2", cf_e380ac_v2_setup); +/* QCA8337 GMAC0 is connected with QCA9558 over RGMII */ +static struct ar8327_pad_cfg cf_e385ac_qca8337_pad0_cfg = { + .mode = AR8327_PAD_MAC_RGMII, + .txclk_delay_en = true, + .rxclk_delay_en = true, + .txclk_delay_sel = AR8327_CLK_DELAY_SEL1, + .rxclk_delay_sel = AR8327_CLK_DELAY_SEL1, +}; + +/* QCA8337 GMAC6 is connected with QCA9558 over SGMII */ +static struct ar8327_pad_cfg cf_e385ac_qca8337_pad6_cfg = { + .mode = AR8327_PAD_MAC_SGMII, + .sgmii_delay_en = true, + .rxclk_delay_sel = AR8327_CLK_DELAY_SEL0, +}; + +static struct ar8327_platform_data cf_e385ac_qca8337_data = { + .pad0_cfg = &cf_e385ac_qca8337_pad0_cfg, + .pad6_cfg = &cf_e385ac_qca8337_pad6_cfg, + .port0_cfg = { + .force_link = 1, + .speed = AR8327_PORT_SPEED_1000, + .duplex = 1, + .txpause = 1, + .rxpause = 1, + }, + .port6_cfg = { + .force_link = 1, + .speed = AR8327_PORT_SPEED_1000, + .duplex = 1, + .txpause = 1, + .rxpause = 1, + }, +}; + +static struct mdio_board_info cf_e385ac_mdio0_info[] = { + { + .bus_id = "ag71xx-mdio.0", + .phy_addr = 0, + .platform_data = &cf_e385ac_qca8337_data, + }, +}; + +static void __init cf_e385ac_setup(void) +{ + u8 *mac = (u8 *) KSEG1ADDR(0x1f040000); + + cf_e38xac_common_setup(0x40000); + + ath79_register_leds_gpio(-1, ARRAY_SIZE(cf_e385ac_leds_gpio), + cf_e385ac_leds_gpio); + + mdiobus_register_board_info(cf_e385ac_mdio0_info, + ARRAY_SIZE(cf_e385ac_mdio0_info)); + ath79_register_mdio(0, 0x0); + + ath79_setup_qca955x_eth_cfg(QCA955X_ETH_CFG_RGMII_EN); + + /* QCA9558 GMAC0 is connected to RMGII interface */ + ath79_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_RGMII; + ath79_eth0_data.phy_mask = BIT(0); + ath79_eth0_data.mii_bus_dev = &ath79_mdio0_device.dev; + ath79_eth0_pll_data.pll_1000 = 0x96000000; + + ath79_init_mac(ath79_eth0_data.mac_addr, mac, 0); + ath79_register_eth(0); + + /* QCA9558 GMAC1 is connected to SGMII interface */ + ath79_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_SGMII; + ath79_eth1_data.speed = SPEED_1000; + ath79_eth1_data.duplex = DUPLEX_FULL; + ath79_eth1_pll_data.pll_1000 = 0x03000101; + + ath79_init_mac(ath79_eth1_data.mac_addr, mac, 1); + ath79_register_eth(1); +} + +MIPS_MACHINE(ATH79_MACH_CF_E385AC, "CF-E385AC", "COMFAST CF-E385AC", + cf_e385ac_setup); + static void __init cf_e5x0n_gpio_setup(void) { ath79_gpio_direction_select(CF_E5X0N_GPIO_LED_WAN, true); diff --git a/target/linux/ar71xx/files/arch/mips/ath79/machtypes.h b/target/linux/ar71xx/files/arch/mips/ath79/machtypes.h index 2d26b86c4d..c7e16ec07f 100644 --- a/target/linux/ar71xx/files/arch/mips/ath79/machtypes.h +++ b/target/linux/ar71xx/files/arch/mips/ath79/machtypes.h @@ -68,6 +68,7 @@ enum ath79_mach_type { ATH79_MACH_CF_E375AC, /* COMFAST CF-E375AC */ ATH79_MACH_CF_E380AC_V1, /* COMFAST CF-E380AC v1 */ ATH79_MACH_CF_E380AC_V2, /* COMFAST CF-E380AC v2 */ + ATH79_MACH_CF_E385AC, /* COMFAST CF-E385AC */ ATH79_MACH_CF_E520N, /* COMFAST CF-E520N */ ATH79_MACH_CF_E530N, /* COMFAST CF-E530N */ ATH79_MACH_CPE210, /* TP-LINK CPE210 */ |