Beispiel #1
0
static void __init ubnt_airrouter_setup(void)
{
	u8 *mac1 = (u8 *) KSEG1ADDR(0x1fff0000);
	u8 *ee = (u8 *) KSEG1ADDR(0x1fff1000);

	ath79_register_m25p80(NULL);
	ath79_register_mdio(0, ~UBNT_M_WAN_PHYMASK);

	ath79_init_mac(ath79_eth0_data.mac_addr, mac1, 0);
	ath79_init_local_mac(ath79_eth1_data.mac_addr, mac1);

	ath79_register_eth(1);
	ath79_register_eth(0);
	ath79_register_usb();

	ap91_pci_init(ee, NULL);
	ath79_register_leds_gpio(-1, ARRAY_SIZE(ubnt_airrouter_leds_gpio),
				 ubnt_airrouter_leds_gpio);

	ath79_register_gpio_keys_polled(-1, UBNT_XM_KEYS_POLL_INTERVAL,
                                        ARRAY_SIZE(ubnt_xm_gpio_keys),
                                        ubnt_xm_gpio_keys);
}
Beispiel #2
0
static void __init tl_ap99_setup(void)
{
	u8 *mac = (u8 *) KSEG1ADDR(0x1f01fc00);
	u8 *ee = (ath79_get_eeprom() + 0x1000);

	ath79_register_m25p80(&tl_mr3x20_flash_data);

	ath79_register_gpio_keys_polled(-1, TL_MR3X20_KEYS_POLL_INTERVAL,
					 ARRAY_SIZE(tl_mr3x20_gpio_keys),
					 tl_mr3x20_gpio_keys);

	ath79_init_mac(ath79_eth0_data.mac_addr, mac, 1);
	ath79_init_mac(ath79_eth1_data.mac_addr, mac, -1);

	ath79_register_mdio(0, 0x0);

	/* LAN ports */
	ath79_register_eth(1);
	/* WAN port */
	ath79_register_eth(0);

	ap91_pci_init(ee, mac);
}
Beispiel #3
0
static void __init tew673gru_setup(void)
{
	tew673gru_wlan_init();

	ath79_register_mdio(0, 0x0);

	ath79_eth0_data.mii_bus_dev = &tew673gru_rtl8366s_device.dev;
	ath79_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_RGMII;
	ath79_eth0_data.speed = SPEED_1000;
	ath79_eth0_data.duplex = DUPLEX_FULL;
	ath79_eth0_pll_data.pll_1000 = 0x11110000;

	ath79_eth1_data.mii_bus_dev = &tew673gru_rtl8366s_device.dev;
	ath79_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_RGMII;
	ath79_eth1_data.phy_mask = 0x10;
	ath79_eth1_pll_data.pll_1000 = 0x11110000;

	ath79_register_eth(0);
	ath79_register_eth(1);

	ath79_register_m25p80(NULL);

	ath79_register_leds_gpio(-1, ARRAY_SIZE(tew673gru_leds_gpio),
				 tew673gru_leds_gpio);

	ath79_register_gpio_keys_polled(-1, TEW673GRU_KEYS_POLL_INTERVAL,
					ARRAY_SIZE(tew673gru_gpio_keys),
					tew673gru_gpio_keys);

	ath79_register_usb();

	platform_device_register(&tew673gru_rtl8366s_device);

	spi_register_board_info(tew673gru_spi_info,
				ARRAY_SIZE(tew673gru_spi_info));
	platform_device_register(&tew673gru_spi_device);
}
Beispiel #4
0
static void __init om5p_setup(void)
{
	u8 *art = (u8 *)KSEG1ADDR(0x1fff0000);
	u8 mac[6];

	/* make lan / wan leds software controllable */
	ath79_gpio_output_select(OM5P_GPIO_LED_LAN, AR934X_GPIO_OUT_GPIO);
	ath79_gpio_output_select(OM5P_GPIO_LED_WAN, AR934X_GPIO_OUT_GPIO);

	ath79_register_m25p80(&om5p_flash_data);
	ath79_register_leds_gpio(-1, ARRAY_SIZE(om5p_leds_gpio),
				 om5p_leds_gpio);
	ath79_register_gpio_keys_polled(-1, OM5P_KEYS_POLL_INTERVAL,
					ARRAY_SIZE(om5p_gpio_keys),
					om5p_gpio_keys);

	ath79_init_mac(mac, art, 2);
	ath79_register_wmac(art + OM5P_WMAC_CALDATA_OFFSET, mac);

	ath79_setup_ar934x_eth_cfg(AR934X_ETH_CFG_SW_PHY_SWAP);
	ath79_register_mdio(1, 0x0);

	ath79_init_mac(ath79_eth0_data.mac_addr, art, 0);
	ath79_init_mac(ath79_eth1_data.mac_addr, art, 1);

	/* GMAC0 is connected to the PHY0 of the internal switch */
	ath79_switch_data.phy4_mii_en = 1;
	ath79_switch_data.phy_poll_mask = BIT(0);
	ath79_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_MII;
	ath79_eth0_data.phy_mask = BIT(0);
	ath79_eth0_data.mii_bus_dev = &ath79_mdio1_device.dev;
	ath79_register_eth(0);

	/* GMAC1 is connected to the internal switch */
	ath79_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_GMII;
	ath79_register_eth(1);
}
Beispiel #5
0
static void __init r6100_setup(void)
{
	ath79_register_leds_gpio(-1, ARRAY_SIZE(r6100_leds_gpio),
				 r6100_leds_gpio);
	ath79_register_gpio_keys_polled(-1, R6100_KEYS_POLL_INTERVAL,
					ARRAY_SIZE(r6100_gpio_keys),
					r6100_gpio_keys);

	ath79_setup_ar934x_eth_cfg(AR934X_ETH_CFG_SW_PHY_SWAP);

	ath79_register_mdio(1, 0x0);

	/* GMAC0 is connected to the PHY0 of the internal switch */
	ath79_switch_data.phy4_mii_en = 1;
	ath79_switch_data.phy_poll_mask = BIT(0);
	ath79_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_MII;
	ath79_eth0_data.phy_mask = BIT(0);
	ath79_eth0_data.mii_bus_dev = &ath79_mdio1_device.dev;
	ath79_register_eth(0);

	/* GMAC1 is connected to the internal switch */
	ath79_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_GMII;
	ath79_register_eth(1);

	gpio_request_one(R6100_GPIO_USB_POWER,
			 GPIOF_OUT_INIT_HIGH | GPIOF_EXPORT_DIR_FIXED,
			 "USB power");

	ath79_nfc_set_ecc_mode(AR934X_NFC_ECC_HW);
	ath79_register_nfc();

	ath79_register_usb();

	ath79_register_wmac_simple();

	ap91_pci_init_simple();
}
Beispiel #6
0
static void __init omy_x1_setup(void)
{
    u8 *mac = (u8 *) KSEG1ADDR(0x1f01fc00);
    u8 *ee = (u8 *) KSEG1ADDR(0x1fff1000);

    ath79_gpio_function_setup(AR934X_GPIO_FUNC_JTAG_DISABLE,
                              AR934X_GPIO_FUNC_CLK_OBS4_EN);

    ath79_register_m25p80(&omy_x1_flash_data);

    ath79_register_leds_gpio(-1, ARRAY_SIZE(omy_x1_leds_gpio),
                             omy_x1_leds_gpio);

    ath79_register_gpio_keys_polled(1, OMY_X1_KEYS_POLL_INTERVAL,
                                    ARRAY_SIZE(omy_x1_gpio_keys),
                                    omy_x1_gpio_keys);

    ath79_setup_ar934x_eth_cfg(AR934X_ETH_CFG_SW_PHY_SWAP);

    ath79_register_mdio(1, 0x0);

    ath79_init_mac(ath79_eth0_data.mac_addr, mac, -1);
    ath79_init_mac(ath79_eth1_data.mac_addr, mac, 0);

    ath79_switch_data.phy4_mii_en = 1;
    ath79_switch_data.phy_poll_mask = BIT(0);
    ath79_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_MII;
    ath79_eth0_data.phy_mask = BIT(0);
    ath79_eth0_data.mii_bus_dev = &ath79_mdio1_device.dev;
    ath79_register_eth(0);

    ath79_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_GMII;
    ath79_register_eth(1);

    ath79_register_wmac(ee, mac);

}
Beispiel #7
0
static void __init cf_e316n_v2_setup(void)
{
	u8 *mac = (u8 *) KSEG1ADDR(0x1f010000);

	cf_exxxn_common_setup(0x10000, CF_E316N_V2_GPIO_EXT_WDT);

	ath79_setup_ar934x_eth_cfg(AR934X_ETH_CFG_SW_PHY_SWAP);

	ath79_register_mdio(1, 0x0);

	/* GMAC0 is connected to the PHY0 of the internal switch */
	ath79_switch_data.phy4_mii_en = 1;
	ath79_switch_data.phy_poll_mask = BIT(0);
	ath79_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_MII;
	ath79_eth0_data.phy_mask = BIT(0);
	ath79_eth0_data.mii_bus_dev = &ath79_mdio1_device.dev;
	ath79_init_mac(ath79_eth0_data.mac_addr, mac, 0);
	ath79_register_eth(0);

	/* GMAC1 is connected to the internal switch */
	ath79_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_GMII;
	ath79_init_mac(ath79_eth1_data.mac_addr, mac, 2);
	ath79_register_eth(1);

	/* Enable 2x Skyworks SE2576L WLAN power amplifiers */
	gpio_request_one(CF_E316N_V2_GPIO_EXTERNAL_PA0, GPIOF_OUT_INIT_HIGH,
			 "WLAN PA0");
	gpio_request_one(CF_E316N_V2_GPIO_EXTERNAL_PA1, GPIOF_OUT_INIT_HIGH,
			 "WLAN PA1");

	ath79_register_leds_gpio(-1, ARRAY_SIZE(cf_e316n_v2_leds_gpio),
				 cf_e316n_v2_leds_gpio);

	ath79_register_gpio_keys_polled(1, CF_EXXXN_KEYS_POLL_INTERVAL,
					ARRAY_SIZE(cf_e316n_v2_gpio_keys),
					cf_e316n_v2_gpio_keys);
}
Beispiel #8
0
static void __init tl_ap123_setup(void)
{
	u8 *mac = (u8 *) KSEG1ADDR(0x1f01fc00);
	u8 *ee = (u8 *) KSEG1ADDR(0x1fff1000);

	/* Disable JTAG, enabling GPIOs 0-3 */
	/* Configure OBS4 line, for GPIO 4*/
	ath79_gpio_function_setup(AR934X_GPIO_FUNC_JTAG_DISABLE,
				 AR934X_GPIO_FUNC_CLK_OBS4_EN);

	/* config gpio4 as normal gpio function */
	ath79_gpio_output_select(TL_MR3420V2_GPIO_USB_POWER,
				 AR934X_GPIO_OUT_GPIO);

	ath79_register_m25p80(&tl_wr841n_v8_flash_data);

	ath79_setup_ar934x_eth_cfg(AR934X_ETH_CFG_SW_PHY_SWAP);

	ath79_register_mdio(1, 0x0);

	ath79_init_mac(ath79_eth0_data.mac_addr, mac, -1);
	ath79_init_mac(ath79_eth1_data.mac_addr, mac, 0);

	/* GMAC0 is connected to the PHY0 of the internal switch */
	ath79_switch_data.phy4_mii_en = 1;
	ath79_switch_data.phy_poll_mask = BIT(0);
	ath79_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_MII;
	ath79_eth0_data.phy_mask = BIT(0);
	ath79_eth0_data.mii_bus_dev = &ath79_mdio1_device.dev;
	ath79_register_eth(0);

	/* GMAC1 is connected to the internal switch */
	ath79_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_GMII;
	ath79_register_eth(1);

	ath79_register_wmac(ee, mac);
}
Beispiel #9
0
static void __init ap83_generic_setup(void)
{
	u8 *eeprom = (u8 *) KSEG1ADDR(0x1fff1000);

	ath79_register_mdio(0, 0xfffffffe);

	ath79_init_mac(ath79_eth0_data.mac_addr, eeprom, 0);
	ath79_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_RGMII;
	ath79_eth0_data.phy_mask = 0x1;

	ath79_register_eth(0);

	ath79_init_mac(ath79_eth1_data.mac_addr, eeprom, 1);
	ath79_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_RGMII;
	ath79_eth1_data.speed = SPEED_1000;
	ath79_eth1_data.duplex = DUPLEX_FULL;

	ath79_eth1_pll_data.pll_1000 = 0x1f000000;

	ath79_register_eth(1);

	ath79_register_leds_gpio(-1, ARRAY_SIZE(ap83_leds_gpio),
					ap83_leds_gpio);

	ath79_register_gpio_keys_polled(-1, AP83_KEYS_POLL_INTERVAL,
					 ARRAY_SIZE(ap83_gpio_keys),
					 ap83_gpio_keys);

	ath79_register_usb();

	ath79_register_wmac(eeprom, NULL);

	platform_device_register(&ap83_flash_device);

	spi_register_board_info(ap83_spi_info, ARRAY_SIZE(ap83_spi_info));
}
Beispiel #10
0
static void __init tew_632brp_setup(void)
{
	const char *config = (char *) KSEG1ADDR(TEW_632BRP_CONFIG_ADDR);
	u8 *eeprom = (u8 *) KSEG1ADDR(0x1fff1000);
	u8 mac[6];
	u8 *wlan_mac = NULL;

	if (ath79_nvram_parse_mac_addr(config, TEW_632BRP_CONFIG_SIZE,
				       "lan_mac=", mac) == 0) {
		ath79_init_mac(ath79_eth0_data.mac_addr, mac, 0);
		ath79_init_mac(ath79_eth1_data.mac_addr, mac, 1);
		wlan_mac = mac;
	}

	ath79_register_mdio(0, TEW_632BRP_MDIO_MASK);

	ath79_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_RMII;
	ath79_eth0_data.phy_mask = TEW_632BRP_LAN_PHYMASK;

	ath79_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_RMII;
	ath79_eth1_data.phy_mask = TEW_632BRP_WAN_PHYMASK;

	ath79_register_eth(0);
	ath79_register_eth(1);

	ath79_register_m25p80(&tew_632brp_flash_data);

	ath79_register_leds_gpio(-1, ARRAY_SIZE(tew_632brp_leds_gpio),
				 tew_632brp_leds_gpio);

	ath79_register_gpio_keys_polled(-1, TEW_632BRP_KEYS_POLL_INTERVAL,
					ARRAY_SIZE(tew_632brp_gpio_keys),
					tew_632brp_gpio_keys);

	ath79_register_wmac(eeprom, wlan_mac);
}
Beispiel #11
0
static void __init wlr8100_common_setup(void)
{

	ath79_register_m25p80(NULL);

	ath79_register_leds_gpio(-1, ARRAY_SIZE(wlr8100_leds_gpio),
				 wlr8100_leds_gpio);
	ath79_register_gpio_keys_polled(-1, WLR8100_KEYS_POLL_INTERVAL,
					ARRAY_SIZE(wlr8100_gpio_keys),
					wlr8100_gpio_keys);

	ath79_register_usb();

	ath79_register_wmac_simple();

	ath79_setup_qca955x_eth_cfg(QCA955X_ETH_CFG_RGMII_EN);

	ath79_register_mdio(0, 0x0);

	mdiobus_register_board_info(wlr8100_mdio0_info,
				    ARRAY_SIZE(wlr8100_mdio0_info));

	/* GMAC0 is connected to the 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_register_eth(0);

	/* GMAC1 is connected tot eh 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_register_eth(1);
}
Beispiel #12
0
static void __init bhr_4grv2_setup(void)
{
	u8 *art = (u8 *) KSEG1ADDR(0x1fff0000);

	ath79_register_m25p80(NULL);

	ath79_register_leds_gpio(-1, ARRAY_SIZE(bhr_4grv2_leds_gpio),
				 bhr_4grv2_leds_gpio);
	ath79_register_gpio_keys_polled(-1, BHR_4GRV2_KEYS_POLL_INTERVAL,
					ARRAY_SIZE(bhr_4grv2_gpio_keys),
					bhr_4grv2_gpio_keys);

	mdiobus_register_board_info(bhr_4grv2_mdio0_info,
				    ARRAY_SIZE(bhr_4grv2_mdio0_info));
	ath79_register_mdio(0, 0x0);

	ath79_setup_qca955x_eth_cfg(QCA955X_ETH_CFG_RGMII_EN);

	/* GMAC0 is connected to the RGMII 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 = 0x56000000;

	ath79_init_mac(ath79_eth0_data.mac_addr, art + BHR_4GRV2_MAC0_OFFSET, 0);
	ath79_register_eth(0);

	/* GMAC1 is connected to the 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, art + BHR_4GRV2_MAC1_OFFSET, 0);
	ath79_register_eth(1);
}
Beispiel #13
0
/*
 * Common network init routine for all SPI NOR devices.
 * Sets LAN/WAN/WLAN.
 */
static void __init rbspi_network_setup(u32 flags, int gmac1_offset,
					int wmac_offset)
{
	/* for QCA953x that will init mdio1_device/data */
	ath79_register_mdio(0, 0x0);

	if (flags & RBSPI_HAS_WAN4) {
		ath79_setup_ar934x_eth_cfg(0);

		/* set switch to oper mode 1, PHY4 connected to CPU */
		ath79_switch_data.phy4_mii_en = 1;
		ath79_switch_data.phy_poll_mask |= BIT(4);

		/* init GMAC0 connected to PHY4 at 100M */
		ath79_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_MII;
		ath79_eth0_data.phy_mask = BIT(4);
		ath79_init_mac(ath79_eth0_data.mac_addr, ath79_mac_base, 0);
		ath79_register_eth(0);
	} else {
		/* set the SoC to SW_ONLY_MODE, which connects all PHYs
		 * to the internal switch.
		 * We hijack ath79_setup_ar934x_eth_cfg() to set the switch in
		 * the QCA953x, this works because this configuration bit is
		 * the same as the AR934x. There's no equivalent function for
		 * QCA953x for now. */
		ath79_setup_ar934x_eth_cfg(AR934X_ETH_CFG_SW_ONLY_MODE);
	}

	/* init GMAC1 */
	ath79_init_mac(ath79_eth1_data.mac_addr, ath79_mac_base, gmac1_offset);
	ath79_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_GMII;
	ath79_register_eth(1);

	if (flags & RBSPI_HAS_WLAN)
		rbspi_wlan_init(wmac_offset);
}
Beispiel #14
0
static void __init common_setup(void)
{
	u8 *mac = (u8 *) KSEG1ADDR(0x1f01fc00);

	/*
	 * ath79_eth0 would be the WAN port, but is not connected.
	 * ath79_eth1 connects to the internal switch chip, however
	 * we have a single LAN port only.
	 */
	ath79_init_mac(ath79_eth1_data.mac_addr, mac, 0);
	ath79_register_mdio(0, 0x0);
	ath79_register_eth(1);

	ath79_register_m25p80(&tl_wa901nd_flash_data);
}
Beispiel #15
0
static void __init pb42_init(void)
{
	ath79_register_m25p80(&pb42_flash_data);

	ath79_register_mdio(0, ~PB42_MDIO_PHYMASK);

	ath79_init_mac(ath79_eth0_data.mac_addr, ath79_mac_base, 0);
	ath79_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_MII;
	ath79_eth0_data.phy_mask = PB42_WAN_PHYMASK;

	ath79_init_mac(ath79_eth1_data.mac_addr, ath79_mac_base, 1);
	ath79_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_RMII;
	ath79_eth1_data.speed = SPEED_100;
	ath79_eth1_data.duplex = DUPLEX_FULL;

	ath79_register_eth(0);
	ath79_register_eth(1);

	ath79_register_gpio_keys_polled(-1, PB42_KEYS_POLL_INTERVAL,
					ARRAY_SIZE(pb42_gpio_keys),
					pb42_gpio_keys);

	ath79_register_pci();
}
Beispiel #16
0
static void __init ubnt_airgateway_setup(void)
{
	u32 t;
	u8 *mac0 = (u8 *) KSEG1ADDR(0x1fff0000);
	u8 *mac1 = (u8 *) KSEG1ADDR(0x1fff0000 + ETH_ALEN);
	u8 *ee = (u8 *) KSEG1ADDR(0x1fff1000);


	ath79_gpio_function_disable(AR933X_GPIO_FUNC_ETH_SWITCH_LED0_EN |
				     AR933X_GPIO_FUNC_ETH_SWITCH_LED1_EN |
				     AR933X_GPIO_FUNC_ETH_SWITCH_LED2_EN |
				     AR933X_GPIO_FUNC_ETH_SWITCH_LED3_EN |
				     AR933X_GPIO_FUNC_ETH_SWITCH_LED4_EN);

	t = ath79_reset_rr(AR933X_RESET_REG_BOOTSTRAP);
	t |= AR933X_BOOTSTRAP_MDIO_GPIO_EN;
	ath79_reset_wr(AR933X_RESET_REG_BOOTSTRAP, t);

	ath79_register_m25p80(NULL);
	ath79_register_leds_gpio(-1, ARRAY_SIZE(ubnt_airgateway_gpio_leds),
				 ubnt_airgateway_gpio_leds);

	ath79_register_gpio_keys_polled(-1, UBNT_XM_KEYS_POLL_INTERVAL,
					ARRAY_SIZE(airgateway_gpio_keys),
					airgateway_gpio_keys);

	ath79_init_mac(ath79_eth1_data.mac_addr, mac0, 0);
	ath79_init_mac(ath79_eth0_data.mac_addr, mac1, 0);

	ath79_register_mdio(0, 0x0);

	ath79_register_eth(1);
	ath79_register_eth(0);

	ath79_register_wmac(ee, NULL);
}
Beispiel #17
0
static void __init dir_615c1_setup(void)
{
    const char *config = (char *) KSEG1ADDR(DIR_615C1_CONFIG_ADDR);
    u8 *eeprom = (u8 *) KSEG1ADDR(0x1fff1000);
    u8 mac[6];
    u8 *wlan_mac = NULL;

    if (ath79_nvram_parse_mac_addr(config, DIR_615C1_CONFIG_SIZE,
                                   "lan_mac=", mac) == 0) {
        ath79_init_mac(ath79_eth0_data.mac_addr, mac, 0);
        ath79_init_mac(ath79_eth1_data.mac_addr, mac, 1);
        wlan_mac = mac;
    }

    ath79_register_mdio(0, DIR_615C1_MDIO_MASK);

    ath79_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_RMII;
    ath79_eth0_data.phy_mask = DIR_615C1_LAN_PHYMASK;

    ath79_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_RMII;
    ath79_eth1_data.phy_mask = DIR_615C1_WAN_PHYMASK;

    ath79_register_eth(0);
    ath79_register_eth(1);

    ath79_register_m25p80(NULL);

    ath79_register_leds_gpio(-1, ARRAY_SIZE(dir_615c1_leds_gpio),
                             dir_615c1_leds_gpio);

    ath79_register_gpio_keys_polled(-1, DIR_615C1_KEYS_POLL_INTERVAL,
                                    ARRAY_SIZE(dir_615c1_gpio_keys),
                                    dir_615c1_gpio_keys);

    ath79_register_wmac(eeprom, wlan_mac);
}
Beispiel #18
0
static void __init mynet_rext_setup(void)
{
	u8 *art = (u8 *) KSEG1ADDR(MYNET_REXT_ART_ADDR);
	u8 tmpmac[ETH_ALEN];

	ath79_register_m25p80(&mynet_rext_flash_data);

	/* GPIO configuration from drivers/char/GPIO8.c */

	ath79_gpio_output_select(MYNET_REXT_GPIO_LED_POWER,
				 AR934X_GPIO_OUT_GPIO);
	ath79_gpio_output_select(MYNET_REXT_GPIO_LED_WIFI,
				 AR934X_GPIO_OUT_GPIO);
	ath79_gpio_output_select(MYNET_REXT_GPIO_LED_RF_QTY1,
				 AR934X_GPIO_OUT_GPIO);
	ath79_gpio_output_select(MYNET_REXT_GPIO_LED_RF_QTY2,
				 AR934X_GPIO_OUT_GPIO);
	ath79_gpio_output_select(MYNET_REXT_GPIO_LED_RF_QTY3,
				 AR934X_GPIO_OUT_GPIO);
	ath79_gpio_output_select(MYNET_REXT_GPIO_LED_ETHERNET,
				 AR934X_GPIO_OUT_GPIO);
	ath79_register_leds_gpio(-1, ARRAY_SIZE(mynet_rext_leds_gpio),
				 mynet_rext_leds_gpio);

	ath79_register_gpio_keys_polled(-1, MYNET_REXT_KEYS_POLL_INTERVAL,
					ARRAY_SIZE(mynet_rext_gpio_keys),
					mynet_rext_gpio_keys);

	ath79_setup_ar934x_eth_cfg(AR934X_ETH_CFG_RGMII_GMAC0 |
				   AR934X_ETH_CFG_RXD_DELAY |
				   AR934X_ETH_CFG_RDV_DELAY);

	ath79_register_mdio(0, 0x0);

	/* LAN */
	mynet_rext_get_mac("et0macaddr=", ath79_eth0_data.mac_addr);

	/* GMAC0 is connected to an external PHY on Port 4 */
	ath79_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_RGMII;
	ath79_eth0_data.phy_mask = BIT(4);
	ath79_eth0_pll_data.pll_1000 = 0x0e000000; /* athrs_mac.c */
	ath79_eth0_data.mii_bus_dev = &ath79_mdio0_device.dev;
	ath79_register_eth(0);

	/* WLAN */
	mynet_rext_get_mac("wl0_hwaddr=", tmpmac);
	ap91_pci_init(art + MYNET_REXT_WMAC_CALDATA_OFFSET, tmpmac);
}
Beispiel #19
0
static void __init wdr4300_setup(void)
{
	u8 *mac = (u8 *) KSEG1ADDR(0x1f01fc00);
	u8 *art = (u8 *) KSEG1ADDR(0x1fff0000);
	u8 tmpmac[ETH_ALEN];

	ath79_register_m25p80(&wdr4300_flash_data);
	ath79_register_leds_gpio(-1, ARRAY_SIZE(wdr4300_leds_gpio),
				 wdr4300_leds_gpio);
	ath79_register_gpio_keys_polled(-1, WDR4300_KEYS_POLL_INTERVAL,
					ARRAY_SIZE(wdr4300_gpio_keys),
					wdr4300_gpio_keys);

	ath79_wmac_set_ext_lna_gpio(0, WDR4300_GPIO_EXTERNAL_LNA0);
	ath79_wmac_set_ext_lna_gpio(1, WDR4300_GPIO_EXTERNAL_LNA1);

	ath79_init_mac(tmpmac, mac, -1);
	ath79_register_wmac(art + WDR4300_WMAC_CALDATA_OFFSET, tmpmac);

	ath79_init_mac(tmpmac, mac, 0);
	ap9x_pci_setup_wmac_led_pin(0, 0);
	ap91_pci_init(art + WDR4300_PCIE_CALDATA_OFFSET, tmpmac);

	ath79_setup_ar934x_eth_cfg(AR934X_ETH_CFG_RGMII_GMAC0);

	mdiobus_register_board_info(wdr4300_mdio0_info,
				    ARRAY_SIZE(wdr4300_mdio0_info));

	ath79_register_mdio(0, 0x0);

	ath79_init_mac(ath79_eth0_data.mac_addr, mac, -2);

	/* GMAC0 is connected to an AR8327N switch */
	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 = 0x06000000;
	ath79_register_eth(0);

	gpio_request_one(WDR4300_GPIO_USB1_POWER,
			 GPIOF_OUT_INIT_HIGH | GPIOF_EXPORT_DIR_FIXED,
			 "USB1 power");
	gpio_request_one(WDR4300_GPIO_USB2_POWER,
			 GPIOF_OUT_INIT_HIGH | GPIOF_EXPORT_DIR_FIXED,
			 "USB2 power");
	ath79_register_usb();
}
static void __init dir825c1_setup(void)
{
	u8 *mac = (u8 *) KSEG1ADDR(0x1ffe0000);
	u8 *art = (u8 *) KSEG1ADDR(0x1fff0000);
	u8 tmpmac[ETH_ALEN];
	u8 mac1[ETH_ALEN], mac2[ETH_ALEN];

	dir825c1_read_ascii_mac(mac1, mac + DIR825C1_MAC0_OFFSET);
	dir825c1_read_ascii_mac(mac2, mac + DIR825C1_MAC1_OFFSET);

	ath79_gpio_output_select(DIR825C1_GPIO_LED_BLUE_USB, AR934X_GPIO_OUT_GPIO);

	ath79_register_m25p80(NULL);

	ath79_register_leds_gpio(-1, ARRAY_SIZE(dir825c1_leds_gpio),
				 dir825c1_leds_gpio);
	ath79_register_gpio_keys_polled(-1, DIR825C1_KEYS_POLL_INTERVAL,
					ARRAY_SIZE(dir825c1_gpio_keys),
					dir825c1_gpio_keys);

	ap9x_pci_setup_wmac_led_pin(0, 13);
	ap9x_pci_setup_wmac_led_pin(1, 32);

	ath79_init_mac(tmpmac, mac1, 0);
	ath79_register_wmac(art + DIR825C1_WMAC_CALDATA_OFFSET, tmpmac);

	ath79_init_mac(tmpmac, mac2, 0);
	ap91_pci_init(art + DIR825C1_PCIE_CALDATA_OFFSET, tmpmac);

	ath79_setup_ar934x_eth_cfg(AR934X_ETH_CFG_RGMII_GMAC0);

	mdiobus_register_board_info(dir825c1_mdio0_info,
				    ARRAY_SIZE(dir825c1_mdio0_info));

	ath79_register_mdio(0, 0x0);

	ath79_init_mac(ath79_eth0_data.mac_addr, mac1, 0);

	/* GMAC0 is connected to an AR8327N switch */
	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 = 0x06000000;
	ath79_register_eth(0);

	ath79_register_usb();
}
Beispiel #21
0
/*
 * Init the hAP ac / 962UiGS-5HacT2HnT hardware (QCA9558).
 * The hAP ac has 5 ethernet ports provided by an AR8337 switch. Port 1 is
 * assigned to WAN, ports 2-5 are assigned to LAN. Port 0 is connected to the
 * SoC, ports 1-5 of the switch are connected to physical ports 1-5 in order.
 * The SFP cage is not assigned by default on RouterOS. Extra work is required
 * to support this interface as it is directly connected to the SoC (eth1).
 * Wireless is provided by a 2.4GHz radio on the SoC (WLAN1) and a 5GHz radio
 * attached via PCI (QCA9880). Red and green WLAN LEDs are populated however
 * they are not attached to GPIOs, extra work is required to support these.
 * PoE and USB output power control is supported.
 */
static void __init rb962_setup(void)
{
	u32 flags = RBSPI_HAS_USB | RBSPI_HAS_POE | RBSPI_HAS_PCI;

	if (!rbspi_platform_setup())
		return;

	rbspi_peripherals_setup(flags);

	/* Do not call rbspi_network_setup as we have a discrete switch chip */
	ath79_eth0_pll_data.pll_1000 = 0xae000000;
	ath79_eth0_pll_data.pll_100 = 0xa0000101;
	ath79_eth0_pll_data.pll_10 = 0xa0001313;

	ath79_register_mdio(0, 0x0);
	mdiobus_register_board_info(rb962_mdio0_info,
					ARRAY_SIZE(rb962_mdio0_info));

	ath79_setup_qca955x_eth_cfg(QCA955X_ETH_CFG_RGMII_EN);

	ath79_init_mac(ath79_eth0_data.mac_addr, ath79_mac_base, 0);
	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_register_eth(0);

	/* WLAN1 MAC is HW MAC + 7 */
	rbspi_wlan_init(1, 7);

	if (flags & RBSPI_HAS_USB)
		gpio_request_one(RB962_GPIO_USB_PWROFF, GPIOF_ACTIVE_LOW |
				GPIOF_OUT_INIT_HIGH | GPIOF_EXPORT_DIR_FIXED,
				"USB power off");

	/* PoE output GPIO is inverted, set GPIOF_ACTIVE_LOW for consistency */
	if (flags & RBSPI_HAS_POE)
		gpio_request_one(RB962_GPIO_POE_POWER,
				GPIOF_OUT_INIT_HIGH | GPIOF_ACTIVE_LOW |
					GPIOF_EXPORT_DIR_FIXED,
				"POE power");

	ath79_register_leds_gpio(-1, ARRAY_SIZE(rb962_leds_gpio),
				rb962_leds_gpio);

	/* This device has a single reset button as gpio 20 */
	rbspi_register_reset_button(RB962_GPIO_BTN_RESET);
}
Beispiel #22
0
static void __init rb922gs_setup(void)
{
	const struct rb_info *info;
	char buf[64];

	info = rb_init_info((void *) KSEG1ADDR(0x1f000000), 0x10000);
	if (!info)
		return;

	scnprintf(buf, sizeof(buf), "Mikrotik RouterBOARD %s",
		  (info->board_name) ? info->board_name : "");
	mips_set_machine_name(buf);

	rb922gs_init_partitions(info);
	ath79_register_m25p80(&rb922gs_spi_flash_data);

	rb922gs_nand_init();

	ath79_setup_qca955x_eth_cfg(QCA955X_ETH_CFG_RGMII_EN);

	ath79_register_mdio(0, 0x0);

	mdiobus_register_board_info(rb922gs_mdio0_info,
				    ARRAY_SIZE(rb922gs_mdio0_info));

	ath79_init_mac(ath79_eth0_data.mac_addr, ath79_mac_base, 0);
	ath79_eth0_data.mii_bus_dev = &ath79_mdio0_device.dev;
	ath79_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_RGMII;
	ath79_eth0_data.phy_mask = BIT(RB922_PHY_ADDR);
	ath79_eth0_pll_data.pll_10 = 0x81001313;
	ath79_eth0_pll_data.pll_100 = 0x81000101;
	ath79_eth0_pll_data.pll_1000 = 0x8f000000;

	ath79_register_eth(0);

	ath79_register_pci();
	ath79_register_leds_gpio(-1, ARRAY_SIZE(rb922gs_leds), rb922gs_leds);
	ath79_register_gpio_keys_polled(-1, RB922_KEYS_POLL_INTERVAL,
					ARRAY_SIZE(rb922gs_gpio_keys),
					rb922gs_gpio_keys);

	/* NOTE:
	 * This only supports the RB911G-5HPacD board for now. For other boards
	 * more devices must be registered based on the hardware options which
	 * can be found in the hardware configuration of RouterBOOT.
	 */
}
static void __init dlan_pro_1200_ac_setup(void)
{
	u8 *art = (u8 *) KSEG1ADDR(DLAN_PRO_1200_AC_ART_ADDRESS);
	u8 *cal = art + DLAN_PRO_1200_AC_CALDATA_OFFSET;
	u8 *wifi_mac = art + DLAN_PRO_1200_AC_WIFIMAC_OFFSET;

	ath79_register_m25p80(NULL);

	ath79_register_leds_gpio(-1, ARRAY_SIZE(dlan_pro_1200_ac_leds_gpio),
				 dlan_pro_1200_ac_leds_gpio);

	ath79_register_gpio_keys_polled(-1, DLAN_PRO_1200_AC_KEYS_POLL_INTERVAL,
					ARRAY_SIZE(dlan_pro_1200_ac_gpio_keys),
					dlan_pro_1200_ac_gpio_keys);

	/* dLAN power must be enabled from user-space as soon as the boot-from-host daemon is running */
	gpio_request_one(DLAN_PRO_1200_AC_GPIO_DLAN_POWER_ENABLE,
			 GPIOF_OUT_INIT_LOW | GPIOF_EXPORT_DIR_FIXED,
			 "dLAN power");

	/* WLAN power is turned on initially to allow the PCI bus scan to succeed */
	gpio_request_one(DLAN_PRO_1200_AC_GPIO_WLAN_POWER_ENABLE,
			 GPIOF_OUT_INIT_HIGH | GPIOF_EXPORT_DIR_FIXED,
			 "WLAN power");

	ath79_register_wmac(cal, wifi_mac);
	ap91_pci_init(art + DLAN_PRO_1200_AC_PCIE_CALDATA_OFFSET, NULL);

	ath79_setup_ar934x_eth_cfg(AR934X_ETH_CFG_RGMII_GMAC0 | AR934X_ETH_CFG_SW_ONLY_MODE);

	ath79_register_mdio(1, 0x0);
	ath79_register_mdio(0, 0x0);

	ath79_init_mac(ath79_eth0_data.mac_addr, wifi_mac, 2);

	mdiobus_register_board_info(dlan_pro_1200_ac_mdio0_info,
				    ARRAY_SIZE(dlan_pro_1200_ac_mdio0_info));

	/* GMAC0 is connected to an AR8337 */
	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 = 0x02000000;
	ath79_register_eth(0);
}
Beispiel #24
0
static void __init mr900_setup(void)
{
    u8 *art = (u8 *)KSEG1ADDR(0x1fff0000);
    u8 mac[6], pcie_mac[6];
    struct ath9k_platform_data *pdata;

    ath79_eth0_pll_data.pll_1000 = 0xae000000;
    ath79_eth0_pll_data.pll_100 = 0xa0000101;
    ath79_eth0_pll_data.pll_10 = 0xa0001313;

    ath79_register_m25p80(NULL);

    ath79_register_leds_gpio(-1, ARRAY_SIZE(mr900_leds_gpio),
                             mr900_leds_gpio);
    ath79_register_gpio_keys_polled(-1, MR900_KEYS_POLL_INTERVAL,
                                    ARRAY_SIZE(mr900_gpio_keys),
                                    mr900_gpio_keys);

    ath79_init_mac(mac, art + MR900_MAC0_OFFSET, 1);
    ath79_register_wmac(art + MR900_WMAC_CALDATA_OFFSET, mac);
    ath79_init_mac(pcie_mac, art + MR900_MAC0_OFFSET, 16);
    ap91_pci_init(art + MR900_PCIE_CALDATA_OFFSET, pcie_mac);
    pdata = ap9x_pci_get_wmac_data(0);
    if (!pdata) {
        pr_err("mr900: unable to get address of wlan data\n");
        return;
    }
    pdata->use_eeprom = true;

    mr900_setup_qca955x_eth_cfg(QCA955X_ETH_CFG_RGMII_EN, 3, 3, 0, 0);
    ath79_register_mdio(0, 0x0);

    mdiobus_register_board_info(mr900_mdio0_info,
                                ARRAY_SIZE(mr900_mdio0_info));

    ath79_init_mac(ath79_eth0_data.mac_addr, art + MR900_MAC0_OFFSET, 0);

    /* GMAC0 is connected to the RMGII interface */
    ath79_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_RGMII;
    ath79_eth0_data.phy_mask = BIT(5);
    ath79_eth0_data.mii_bus_dev = &ath79_mdio0_device.dev;

    ath79_register_eth(0);
}
static void __init mynet_n750_setup(void)
{
	u8 *art = (u8 *) KSEG1ADDR(0x1fff0000);
	u8 tmpmac[ETH_ALEN];

	ath79_register_m25p80(NULL);
	ath79_register_leds_gpio(-1, ARRAY_SIZE(mynet_n750_leds_gpio),
				 mynet_n750_leds_gpio);
	ath79_register_gpio_keys_polled(-1, MYNET_N750_KEYS_POLL_INTERVAL,
					ARRAY_SIZE(mynet_n750_gpio_keys),
					mynet_n750_gpio_keys);
	/*
	 * Control signal for external LNAs 0 and 1
	 * Taken from GPL bootloader source:
	 *   board/ar7240/db12x/alpha_gpio.c
	 */
	ath79_wmac_set_ext_lna_gpio(0, MYNET_N750_GPIO_EXTERNAL_LNA0);
	ath79_wmac_set_ext_lna_gpio(1, MYNET_N750_GPIO_EXTERNAL_LNA1);

	mynet_n750_get_mac("wlan24mac=", tmpmac);
	ath79_register_wmac(art + MYNET_N750_WMAC_CALDATA_OFFSET, tmpmac);

	mynet_n750_get_mac("wlan5mac=", tmpmac);
	ap91_pci_init(art + MYNET_N750_PCIE_CALDATA_OFFSET, tmpmac);

	ath79_setup_ar934x_eth_cfg(AR934X_ETH_CFG_RGMII_GMAC0);

	mdiobus_register_board_info(mynet_n750_mdio0_info,
				    ARRAY_SIZE(mynet_n750_mdio0_info));

	ath79_mdio0_data.reset = mynet_n750_mdio_fixup;
	ath79_register_mdio(0, 0x0);

	mynet_n750_get_mac("lanmac=", ath79_eth0_data.mac_addr);

	/* GMAC0 is connected to an AR8327N switch */
	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 = 0x06000000;
	ath79_register_eth(0);

	ath79_register_usb();
}
Beispiel #26
0
static void __init rb95x_setup(void)
{
	rb95x_gpio_init();
	rb95x_nand_init();

	ath79_setup_ar934x_eth_cfg(AR934X_ETH_CFG_RGMII_GMAC0 |
				   AR934X_ETH_CFG_SW_ONLY_MODE);

	ath79_register_mdio(0, 0x0);

	mdiobus_register_board_info(rb95x_mdio0_info,
				    ARRAY_SIZE(rb95x_mdio0_info));

	ath79_init_mac(ath79_eth0_data.mac_addr, ath79_mac_base, 0);
	ath79_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_RGMII;
	ath79_eth0_data.phy_mask = BIT(0);

	ath79_register_eth(0);
}
Beispiel #27
0
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);

	ath79_setup_qca955x_eth_cfg(QCA955X_ETH_CFG_RGMII_EN);

	ath79_register_mdio(0, 0x0);
	mdiobus_register_board_info(cf_e380ac_v1v2_mdio0_info,
				    ARRAY_SIZE(cf_e380ac_v1v2_mdio0_info));

	/* LAN */
	ath79_eth0_data.mii_bus_dev = &ath79_mdio0_device.dev;
	ath79_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_RGMII;
	ath79_eth0_data.phy_mask = BIT(0);
	ath79_eth0_pll_data.pll_1000 = 0xbe000000;
	ath79_eth0_pll_data.pll_100 = 0xb0000101;
	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);
}
Beispiel #28
0
static void __init tl_ap123_setup(void)
{
	u8 *mac = (u8 *) KSEG1ADDR(0x1f01fc00);
	u8 *ee = (u8 *) KSEG1ADDR(0x1fff1000);

	ath79_register_m25p80(&tl_wax50re_flash_data);

	ath79_setup_ar934x_eth_cfg(AR934X_ETH_CFG_SW_PHY_SWAP);

	ath79_register_mdio(1, 0x0);

	ath79_init_mac(ath79_eth0_data.mac_addr, mac, 0);

	ath79_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_MII;
	ath79_eth0_data.phy_mask = BIT(0);
	ath79_eth0_data.mii_bus_dev = &ath79_mdio1_device.dev;
	ath79_register_eth(0);

	ath79_register_wmac(ee, mac);
}
static void __init wa161dd_setup(void)
{
	u8 *mac = (u8 *) KSEG1ADDR(0x1f01fc00);

	ath79_register_m25p80(&huawei_wa161dd_flash_data);

	ath79_register_leds_gpio(-1, ARRAY_SIZE(huawei_wa161dd_leds_gpio),
				 huawei_wa161dd_leds_gpio);
	ath79_register_gpio_keys_polled(-1, HUAWEI_WA161DD_KEYS_POLL_INTERVAL,
					 ARRAY_SIZE(huawei_wa161dd_gpio_keys),
					 huawei_wa161dd_gpio_keys);

	tplink_register_builtin_wmac1(HUAWEI_WA161DD_WMAC_CALDATA_OFFSET, mac, -1);
	tplink_register_ap91_wmac2(HUAWEI_WA161DD_PCIE_CALDATA_OFFSET, mac, 2);

	ath79_setup_ar934x_eth_cfg(AR934X_ETH_CFG_RGMII_GMAC0 |
				   AR934X_ETH_CFG_SW_ONLY_MODE);

	ath79_register_mdio(1, 0x0);
	ath79_register_mdio(0, 0x0);

	ath79_init_mac(ath79_eth0_data.mac_addr, mac, 0);

	mdiobus_register_board_info(mi124_mdio0_info,
				    ARRAY_SIZE(mi124_mdio0_info));

	/* GMAC0 is connected to an AR8035 Gigabit PHY */
	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 = 0x0e000000;
	ath79_eth0_pll_data.pll_100 = 0x0101;
	ath79_eth0_pll_data.pll_10 = 0x1313;
	ath79_register_eth(0);

	ath79_register_usb();

	gpio_request_one(HUAWEI_WA161DD_GPIO_LED_GREEN_LAN_POLARITY,
			 GPIOF_OUT_INIT_HIGH | GPIOF_EXPORT_DIR_FIXED,
			 "LAN LED Polarity");
}
Beispiel #30
0
static void __init ubnt_xm_init(void)
{
	u8 *eeprom = (u8 *) KSEG1ADDR(UBNT_XM_EEPROM_ADDR);
	u8 *mac1 = (u8 *) KSEG1ADDR(0x1fff0000);
	u8 *mac2 = (u8 *) KSEG1ADDR(0x1fff0000 + ETH_ALEN);

	ath79_register_leds_gpio(-1, ARRAY_SIZE(ubnt_xm_leds_gpio),
				 ubnt_xm_leds_gpio);

	ath79_register_gpio_keys_polled(-1, UBNT_XM_KEYS_POLL_INTERVAL,
					ARRAY_SIZE(ubnt_xm_gpio_keys),
					ubnt_xm_gpio_keys);

	ath79_register_m25p80(NULL);
	ap91_pci_init(eeprom, NULL);

	ath79_register_mdio(0, ~UBNT_M_WAN_PHYMASK);
	ath79_init_mac(ath79_eth0_data.mac_addr, mac1, 0);
	ath79_init_mac(ath79_eth1_data.mac_addr, mac2, 0);
	ath79_register_eth(0);
}