|
楼主 |
发表于 2018-11-8 09:40
|
显示全部楼层
本帖最后由 hello_limin 于 2018-11-8 11:02 编辑
=======
qca9561 + qca9887
- /*
- * TP-Link TL-WDR5600 v3.0 module and development board support
- *
- * Copyright (C) 2018 Kerwin Lee <kerwin.lee@yandex.com>
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 as published
- * by the Free Software Foundation.
- */
- #include <linux/pci.h>
- #include <linux/phy.h>
- #include <linux/gpio.h>
- #include <linux/platform_device.h>
- #include <asm/mach-ath79/ath79.h>
- #include <asm/mach-ath79/ar71xx_regs.h>
- #include "common.h"
- #include "dev-eth.h"
- #include "dev-gpio-buttons.h"
- #include "dev-leds-gpio.h"
- #include "dev-m25p80.h"
- #include "dev-ap9x-pci.h"
- #include "dev-wmac.h"
- #include "machtypes.h"
- #include "pci.h"
- #define TL_WDR5600_V3_DEV_GPIO_BTN_RESET 1
- #define TL_WDR5600_V3_DEV_GPIO_LED_SYSTEM 19
- #define TL_WDR5600_V3_KEYS_POLL_INTERVAL 20 /* msec */
- #define TL_WDR5600_V3_KEYS_DEBOUNCE_INTERVAL (3 * TL_WDR5600_V3_KEYS_POLL_INTERVAL)
- #define TL_WDR5600_V3_WMAC_CALDATA_OFFSET 0x1000
- #define TL_WDR5600_V3_PCIE_CALDATA_OFFSET 0x5000
- static const char *tl_wdr5600_v3_part_probes[] = {
- "tp-link",
- NULL,
- };
- static struct flash_platform_data tl_wdr5600_v3_flash_data = {
- .part_probes = tl_wdr5600_v3_part_probes,
- };
- static struct gpio_led tl_wdr5600_v3_dev_gpio_leds[] __initdata = {
- {
- .name = "tl-wdr5600-v3:blue:system",
- .gpio = TL_WDR5600_V3_DEV_GPIO_LED_SYSTEM,
- .active_low = 1,
- },
- };
- static struct gpio_keys_button tl_wdr5600_v3_dev_gpio_keys[] __initdata = {
- {
- .desc = "reset",
- .type = EV_KEY,
- .code = KEY_RESTART,
- .debounce_interval = TL_WDR5600_V3_KEYS_DEBOUNCE_INTERVAL,
- .gpio = TL_WDR5600_V3_DEV_GPIO_BTN_RESET,
- .active_low = 1,
- },
- };
- static void __init ap152_setup(void)
- {
- u8 *mac = (u8 *) KSEG1ADDR(0x1f01fc00);
- u8 *art = (u8 *) KSEG1ADDR(0x1fff0000);
- u8 tmpmac[ETH_ALEN];
- ath79_register_m25p80(&tl_wdr5600_v3_flash_data);
- /* Ensure 2.4G */
- ath79_init_mac(tmpmac, mac, 1);
- ath79_register_wmac(art + TL_WDR5600_V3_WMAC_CALDATA_OFFSET, tmpmac);
- /* Ensure 5G */
- ath79_register_pci();
- ath79_init_mac(tmpmac, mac, 2);
- ath79_register_wmac(art + TL_WDR5600_V3_PCIE_CALDATA_OFFSET, tmpmac);
- ath79_setup_qca956x_eth_cfg(QCA956X_ETH_CFG_SW_ONLY_MODE);
- ath79_register_mdio(1, 0x0);
- /* WAN Port*/
- ath79_init_mac(ath79_eth0_data.mac_addr, mac, -1);
- /* GMAC0 is connected to the PHY4 of the internal switch, GE0 */
- ath79_switch_data.phy4_mii_en = 1;
- ath79_switch_data.phy_poll_mask |= BIT(4);
- ath79_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_MII;
- ath79_eth0_data.phy_mask = BIT(4);
- ath79_eth0_data.mii_bus_dev = &ath79_mdio1_device.dev;
- ath79_register_eth(0);
- /* LAN Port*/
- ath79_init_mac(ath79_eth1_data.mac_addr, mac, 0);
- /* GMAC1 is connected to the internal switch, GE1 */
- ath79_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_GMII;
- ath79_register_eth(1);
- }
- static void __init tl_wdr5600_v3_setup(void)
- {
- ap152_setup();
- ath79_register_leds_gpio(-1, ARRAY_SIZE(tl_wdr5600_v3_dev_gpio_leds),
- tl_wdr5600_v3_dev_gpio_leds);
- ath79_register_gpio_keys_polled(-1, TL_WDR5600_V3_KEYS_POLL_INTERVAL,
- ARRAY_SIZE(tl_wdr5600_v3_dev_gpio_keys),
- tl_wdr5600_v3_dev_gpio_keys);
- }
- MIPS_MACHINE(ATH79_MACH_TL_WDR5600_V3, "TL-WDR5600-V3", "TP-Link TL-WDR5600 v3.0", tl_wdr5600_v3_setup);
复制代码
|
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有账号?立即注册
×
|