예제 #1
0
static void __init k2t_setup(void)
{
	u8 *art = (u8 *) KSEG1ADDR(0x1fff0000);

	ath79_register_m25p80(NULL);

	ath79_register_leds_gpio(-1, ARRAY_SIZE(k2t_leds_gpio),
				 k2t_leds_gpio);
	ath79_register_gpio_keys_polled(-1, K2T_KEYS_POLL_INTERVAL,
					ARRAY_SIZE(k2t_gpio_keys),
					k2t_gpio_keys);

	ath79_register_usb();

	platform_device_register(&ath79_mdio0_device);

	mdiobus_register_board_info(k2t_mdio0_info,
				    ARRAY_SIZE(k2t_mdio0_info));

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

	/* GMAC0 is connected to an AR8337 switch */
	ath79_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_SGMII;
	ath79_eth0_data.speed = SPEED_1000;
	ath79_eth0_data.duplex = DUPLEX_FULL;
	ath79_eth0_data.phy_mask = BIT(0);
	ath79_eth0_data.mii_bus_dev = &ath79_mdio0_device.dev;

	ath79_register_eth(0);

	ath79_register_wmac_simple();
	ath79_register_pci();
}
예제 #2
0
static void __init wnr2000_setup(void)
{
	u8 *eeprom = (u8 *) KSEG1ADDR(0x1fff1000);

	ath79_register_mdio(0, 0x0);

	ath79_init_mac(ath79_eth0_data.mac_addr, eeprom, 0);
	ath79_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_RMII;
	ath79_eth0_data.speed = SPEED_100;
	ath79_eth0_data.duplex = DUPLEX_FULL;
	ath79_eth0_data.has_ar8216 = 1;

	ath79_init_mac(ath79_eth1_data.mac_addr, eeprom, 1);
	ath79_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_RMII;
	ath79_eth1_data.phy_mask = 0x10;

	ath79_register_eth(0);
	ath79_register_eth(1);

	ath79_register_m25p80(&wnr2000_flash_data);

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

	ath79_register_gpio_keys_polled(-1, WNR2000_KEYS_POLL_INTERVAL,
					ARRAY_SIZE(wnr2000_gpio_keys),
					wnr2000_gpio_keys);

	ath79_register_wmac(eeprom, NULL);
}
예제 #3
0
static void __init antminer_s1_setup(void)
{
	u8 *mac = (u8 *) KSEG1ADDR(0x1f01fc00);
	u8 *ee = (u8 *) KSEG1ADDR(0x1fff1000);

	/* disable PHY_SWAP and PHY_ADDR_SWAP bits */
	ath79_setup_ar933x_phy4_switch(false, false);

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

	ath79_register_gpio_keys_polled(-1, ANTMINER_S1_KEYSPOLL_INTERVAL,
					ARRAY_SIZE(ANTMINER_S1_GPIO_keys),
					ANTMINER_S1_GPIO_keys);

	gpio_request_one(ANTMINER_S1_GPIO_USB_POWER,
			 GPIOF_OUT_INIT_HIGH | GPIOF_EXPORT_DIR_FIXED,
			 "USB power");
	ath79_register_usb();

	ath79_register_m25p80(&ANTMINER_S1_flash_data);
	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);
	ath79_register_eth(0);
	ath79_register_eth(1);

	ath79_register_wmac(ee, mac);
}
예제 #4
0
static void __init rb2011_setup(void)
{
	rb2011_gpio_init();

	ath79_register_m25p80(&rb2011_spi_flash_data);
	rb2011_nand_init();

	rb2011_gmac_setup();

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

	mdiobus_register_board_info(rb2011_mdio0_info,
				    ARRAY_SIZE(rb2011_mdio0_info));

	/* GMAC0 is connected to an ar8327 switch */
	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_eth0_pll_data.pll_1000 = 0x06000000;

	ath79_register_eth(0);

	/* GMAC1 is connected to the internal switch */
	ath79_init_mac(ath79_eth1_data.mac_addr, ath79_mac_base, 5);
	ath79_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_GMII;
	ath79_eth1_data.speed = SPEED_1000;
	ath79_eth1_data.duplex = DUPLEX_FULL;

	ath79_register_eth(1);
}
static void __init anonabox_pro_setup(void)
{
	u8 *art = (u8 *) KSEG1ADDR(0x1fff0000);

	ath79_register_m25p80(NULL);

	anonabox_pro_gpio_led_setup();

	ath79_register_usb();

	ath79_register_wmac(art + ANONABOX_PRO_WMAC_CALDATA_OFFSET, NULL);

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

	ath79_init_mac(ath79_eth0_data.mac_addr, art + ANONABOX_PRO_MAC0_OFFSET, 0);
	ath79_init_mac(ath79_eth1_data.mac_addr, art + ANONABOX_PRO_MAC1_OFFSET, 0);

	/* WAN port */
	ath79_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_MII;
	ath79_eth0_data.speed = SPEED_100;
	ath79_eth0_data.duplex = DUPLEX_FULL;
	ath79_eth0_data.phy_mask = BIT(4);
	ath79_register_eth(0);

	/* LAN ports */
	ath79_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_GMII;
	ath79_eth1_data.speed = SPEED_1000;
	ath79_eth1_data.duplex = DUPLEX_FULL;
	ath79_switch_data.phy_poll_mask |= BIT(4);
	ath79_switch_data.phy4_mii_en = 1;
	ath79_register_eth(1);
}
예제 #6
0
static void __init ubnt_rocket_m_xw_setup(void)
{
	u8 *eeprom = (u8 *) KSEG1ADDR(0x1fff0000);

	ath79_register_m25p80(NULL);

	ath79_register_leds_gpio(-1, ARRAY_SIZE(ubnt_xw_leds_gpio),
				 ubnt_xw_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_wmac(eeprom + UAP_PRO_WMAC_CALDATA_OFFSET, NULL);
	ap91_pci_init(eeprom + UAP_PRO_PCI_CALDATA_OFFSET, NULL);

	ath79_setup_ar934x_eth_cfg(AR934X_ETH_CFG_RGMII_GMAC0);
	ath79_init_mac(ath79_eth0_data.mac_addr,
		       eeprom + UAP_PRO_MAC0_OFFSET, 0);

	ath79_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_RGMII;
	ath79_eth0_data.mii_bus_dev = &ath79_mdio0_device.dev;
	
	ath79_register_mdio(0, ~BIT(4));
	ath79_eth0_data.phy_mask = BIT(4);
	ath79_eth0_pll_data.pll_1000 = 0x06000000;
	ath79_register_eth(0);
}
예제 #7
0
static void __init tl_wr1043nd_setup(void)
{
    u8 *mac = (u8 *) KSEG1ADDR(0x1f01fc00);
    u8 *eeprom = (u8 *) KSEG1ADDR(0x1fff1000);

    tl_wr1043nd_rtl8366rb_hw_reset(true);

    ath79_init_mac(ath79_eth0_data.mac_addr, mac, 0);
    ath79_eth0_data.mii_bus_dev = &tl_wr1043nd_rtl8366rb_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 = 0x1a000000;

    ath79_register_eth(0);

    ath79_register_usb();

    ath79_register_m25p80(&tl_wr1043nd_flash_data);

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

    platform_device_register(&tl_wr1043nd_rtl8366rb_device);

    ath79_register_gpio_keys_polled(-1, TL_WR1043ND_KEYS_POLL_INTERVAL,
                                    ARRAY_SIZE(tl_wr1043nd_gpio_keys),
                                    tl_wr1043nd_gpio_keys);

    ath79_register_wmac(eeprom, mac);
}
예제 #8
0
static void __init ap113_setup(void)
{
	u8 *mac = (u8 *) KSEG1ADDR(0x1fff0000);

	ath79_register_m25p80(&ap113_flash_data);

	ath79_register_mdio(0, ~BIT(0));
	ath79_init_mac(ath79_eth0_data.mac_addr, mac, 0);
	ath79_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_RGMII;
	ath79_eth0_data.speed = SPEED_1000;
	ath79_eth0_data.duplex = DUPLEX_FULL;
	ath79_eth0_data.phy_mask = BIT(0);

	ath79_register_eth(0);

	ath79_register_gpio_keys_polled(-1, AP113_KEYS_POLL_INTERVAL,
					 ARRAY_SIZE(ap113_gpio_keys),
					 ap113_gpio_keys);
	ath79_register_leds_gpio(-1, ARRAY_SIZE(ap113_leds_gpio),
					ap113_leds_gpio);

	ath79_register_pci();

	ath79_register_usb();
}
예제 #9
0
static void __init dir825b1_setup(void)
{
	dir825b1_wlan_init();

	ath79_register_mdio(0, 0x0);

	ath79_eth0_data.mii_bus_dev = &dir825b1_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 = &dir825b1_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(dir825b1_leds_gpio),
				 dir825b1_leds_gpio);

	ath79_register_gpio_keys_polled(-1, DIR825B1_KEYS_POLL_INTERVAL,
					ARRAY_SIZE(dir825b1_gpio_keys),
					dir825b1_gpio_keys);

	ath79_register_usb();

	platform_device_register(&dir825b1_rtl8366s_device);
}
예제 #10
0
static void __init gl_mifi_setup(void)
{

	/* ART base address */
	u8 *art = (u8 *) KSEG1ADDR(0x1fff0000);

	/* disable PHY_SWAP and PHY_ADDR_SWAP bits */
	ath79_setup_ar933x_phy4_switch(false, false);

	/* register flash. */
	ath79_register_m25p80(NULL);

	/* register gpio LEDs and keys */
	ath79_register_leds_gpio(-1, ARRAY_SIZE(gl_mifi_leds_gpio),
				 gl_mifi_leds_gpio);
	ath79_register_gpio_keys_polled(-1, GL_MIFI_KEYS_POLL_INTERVAL,
					ARRAY_SIZE(gl_mifi_gpio_keys),
					gl_mifi_gpio_keys);

	/* enable usb */
	ath79_register_usb();

	/* register eth0 as WAN, eth1 as LAN */
	ath79_init_mac(ath79_eth0_data.mac_addr, art+GL_MIFI_MAC0_OFFSET, 0);
	ath79_init_mac(ath79_eth1_data.mac_addr, art+GL_MIFI_MAC1_OFFSET, 0);
	ath79_register_mdio(0, 0x0);
	ath79_register_eth(0);
	ath79_register_eth(1);

	/* register wireless mac with cal data */
	ath79_register_wmac(art + GL_MIFI_CALDATA_OFFSET, art + GL_MIFI_WMAC_MAC_OFFSET);
}
예제 #11
0
static void __init tl_wa901nd_setup(void)
{
	u8 *mac = (u8 *) KSEG1ADDR(0x1f01fc00);
	u8 *ee  = (u8 *) KSEG1ADDR(0x1fff1000);

	ath79_gpio_function_disable(AR724X_GPIO_FUNC_ETH_SWITCH_LED0_EN |
				    AR724X_GPIO_FUNC_ETH_SWITCH_LED1_EN |
				    AR724X_GPIO_FUNC_ETH_SWITCH_LED2_EN |
				    AR724X_GPIO_FUNC_ETH_SWITCH_LED3_EN |
				    AR724X_GPIO_FUNC_ETH_SWITCH_LED4_EN);

	/*
	 * ath79_eth0 would be the WAN port, but is not connected on
	 * the TL-WA901ND. 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);

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

	ath79_register_gpio_keys_polled(-1, TL_WA901ND_KEYS_POLL_INTERVAL,
					ARRAY_SIZE(tl_wa901nd_gpio_keys),
					tl_wa901nd_gpio_keys);

	ap91_pci_init(ee, mac);
}
예제 #12
0
static void __init TL_WA901ND_V4_setup(void)
{
	u8 *mac = (u8 *) KSEG1ADDR(0x1f01fc00);
	u8 *ee = (u8 *) KSEG1ADDR(0x1fff1000);

	ath79_register_m25p80(&tl_wa901nd_v4_flash_data);

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

	ath79_register_gpio_keys_polled(-1, TL_WA901ND_V4_KEYS_POLL_INTERVAL,
					ARRAY_SIZE(TL_WA901ND_V4_gpio_keys),
					TL_WA901ND_V4_gpio_keys);

	ath79_register_mdio(0, 0x0);

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

	ath79_switch_data.phy4_mii_en = 1;

	ath79_register_eth(0);
	ath79_register_eth(1);

	ath79_register_wmac(ee, mac);

}
예제 #13
0
static void __init tl_mr11u_setup(void)
{
	u8 *mac = (u8 *) KSEG1ADDR(0x1f01fc00);
	u8 *ee = (u8 *) KSEG1ADDR(0x1fff1000);

	ath79_setup_ar933x_phy4_switch(false, true);

	ath79_register_m25p80(&tl_mr11u_flash_data);
	ath79_register_leds_gpio(-1, ARRAY_SIZE(tl_mr11u_leds_gpio),
				 tl_mr11u_leds_gpio);
	ath79_register_gpio_keys_polled(-1, TL_MR11U_KEYS_POLL_INTERVAL,
					ARRAY_SIZE(tl_mr11u_gpio_keys),
					tl_mr11u_gpio_keys);

	gpio_request(TL_MR11U_GPIO_USB_POWER, "USB power");
	gpio_direction_output(TL_MR11U_GPIO_USB_POWER, 1);
	ath79_register_usb();

	ath79_init_mac(ath79_eth0_data.mac_addr, mac, 0);

	ath79_register_mdio(0, 0x0);
	ath79_register_eth(0);
	ath79_eth0_data.phy_mask = BIT(0);

	ath79_register_wmac(ee, mac);
}
예제 #14
0
static void __init bsb_setup(void)
{
	u8 *art = (u8 *) KSEG1ADDR(0x1fff0000);

	/* disable PHY_SWAP and PHY_ADDR_SWAP bits */
	ath79_setup_ar933x_phy4_switch(false,false);

	ath79_register_leds_gpio(-1, ARRAY_SIZE(bsb_leds_gpio),
				 bsb_leds_gpio);
	ath79_register_gpio_keys_polled(-1, BSB_KEYS_POLL_INTERVAL,
					ARRAY_SIZE(bsb_gpio_keys),
					bsb_gpio_keys);

	ath79_register_usb();

	ath79_register_m25p80(NULL);

	ath79_init_mac(ath79_eth0_data.mac_addr, art + BSB_MAC_OFFSET, 1);
	ath79_init_mac(ath79_eth1_data.mac_addr, art + BSB_MAC_OFFSET, 2);

	ath79_register_mdio(0, 0x0);

	ath79_register_eth(0);
	ath79_register_eth(1);

	ath79_register_wmac(art + BSB_CALDATA_OFFSET,
			    art + BSB_MAC_OFFSET);
}
예제 #15
0
static void __init ubnt_unifi_outdoor_plus_setup(void)
{
	u8 *mac1 = (u8 *) KSEG1ADDR(0x1fff0000);
	u8 *mac2 = (u8 *) KSEG1ADDR(0x1fff0000 + ETH_ALEN);
	u8 *ee = (u8 *) KSEG1ADDR(0x1fff1000);

	ath79_register_m25p80(NULL);

	ath79_register_mdio(0, ~(UBNT_UNIFIOD_PRI_PHYMASK |
				 UBNT_UNIFIOD_2ND_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);
	ath79_register_eth(1);

	ap91_pci_init(ee, NULL);

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

	ath79_register_gpio_keys_polled(-1, UBNT_XM_KEYS_POLL_INTERVAL,
                                        ARRAY_SIZE(ubnt_xm_gpio_keys),
                                        ubnt_xm_gpio_keys);
}
예제 #16
0
static void __init tl_wr941nd_setup(void)
{
	u8 *mac = (u8 *) KSEG1ADDR(0x1f01fc00);
	u8 *eeprom = (u8 *) KSEG1ADDR(0x1fff1000);

	ath79_register_mdio(0, 0x0);

	ath79_init_mac(ath79_eth0_data.mac_addr, mac, 0);
	ath79_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_RMII;
	ath79_eth0_data.speed = SPEED_100;
	ath79_eth0_data.duplex = DUPLEX_FULL;

	ath79_register_eth(0);
	ath79_register_dsa(&ath79_eth0_device.dev, &ath79_mdio0_device.dev,
			   &tl_wr941nd_dsa_data);

	ath79_register_m25p80(&tl_wr941nd_flash_data);

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

	ath79_register_gpio_keys_polled(-1, TL_WR941ND_KEYS_POLL_INTERVAL,
					ARRAY_SIZE(tl_wr941nd_gpio_keys),
					tl_wr941nd_gpio_keys);
	ath79_register_wmac(eeprom, mac);
}
예제 #17
0
static void __init ubnt_uap_pro_setup(void)
{
	u8 *eeprom = (u8 *) KSEG1ADDR(0x1fff0000);

	ath79_register_m25p80(NULL);

	ath79_register_leds_gpio(-1, ARRAY_SIZE(ubnt_uap_pro_gpio_leds),
				 ubnt_uap_pro_gpio_leds);
	ath79_register_gpio_keys_polled(-1, UBNT_XM_KEYS_POLL_INTERVAL,
                                        ARRAY_SIZE(uap_pro_gpio_keys),
                                        uap_pro_gpio_keys);

	ath79_register_wmac(eeprom + UAP_PRO_WMAC_CALDATA_OFFSET, NULL);
	ap91_pci_init(eeprom + UAP_PRO_PCI_CALDATA_OFFSET, NULL);

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

	ath79_setup_ar934x_eth_cfg(AR934X_ETH_CFG_RGMII_GMAC0);
	ath79_init_mac(ath79_eth0_data.mac_addr,
		       eeprom + UAP_PRO_MAC0_OFFSET, 0);

	/* GMAC0 is connected to an AR8327 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);
}
예제 #18
0
static void __init tl_wr1041nv2_setup(void)
{
	u8 *mac = (u8 *) KSEG1ADDR(0x1f01fc00);
	u8 *ee = (u8 *) KSEG1ADDR(0x1fff1000);

	ath79_register_m25p80(&tl_wr1041nv2_flash_data);

	ath79_register_leds_gpio(-1, ARRAY_SIZE(tl_wr1041nv2_leds_gpio),
				 tl_wr1041nv2_leds_gpio);
	ath79_register_gpio_keys_polled(-1, TL_WR1041NV2_KEYS_POLL_INTERVAL,
					 ARRAY_SIZE(tl_wr1041nv2_gpio_keys),
					 tl_wr1041nv2_gpio_keys);
	ath79_register_wmac(ee, mac);

	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, 1);

	mdiobus_register_board_info(db120_mdio0_info,
				    ARRAY_SIZE(db120_mdio0_info));

	/* GMAC0 is connected to an AR8327 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);
}
예제 #19
0
static void __init hornet_ub_setup(void)
{
	u8 *art = (u8 *) KSEG1ADDR(0x1fff0000);

	hornet_ub_gpio_setup();

	ath79_register_m25p80(NULL);
	ath79_register_leds_gpio(-1, ARRAY_SIZE(hornet_ub_leds_gpio),
					hornet_ub_leds_gpio);
	ath79_register_gpio_keys_polled(-1, HORNET_UB_KEYS_POLL_INTERVAL,
					 ARRAY_SIZE(hornet_ub_gpio_keys),
					 hornet_ub_gpio_keys);

	ath79_init_mac(ath79_eth1_data.mac_addr,
			art + HORNET_UB_MAC0_OFFSET, 0);
	ath79_init_mac(ath79_eth0_data.mac_addr,
			art + HORNET_UB_MAC1_OFFSET, 0);

	ath79_register_mdio(0, 0x0);

	ath79_register_eth(1);
	ath79_register_eth(0);

	ath79_register_wmac(art + HORNET_UB_CALDATA_OFFSET, NULL);
	ath79_register_usb();
}
예제 #20
0
static void __init WPJ563_setup(void)
{
	u8 *art = (u8 *) KSEG1ADDR(0x1fff0000);
	u8 *mac = (u8 *) KSEG1ADDR(0x1f02e000);

	ath79_register_m25p80(NULL);

	ath79_register_leds_gpio(-1, ARRAY_SIZE(WPJ563_leds_gpio),
				 WPJ563_leds_gpio);
	ath79_register_gpio_keys_polled(-1, WPJ563_KEYS_POLL_INTERVAL,
					ARRAY_SIZE(WPJ563_gpio_keys),
					WPJ563_gpio_keys);

	ath79_register_usb();
	
	ath79_register_wmac(art + WPJ563_WMAC_CALDATA_OFFSET, NULL);
	
	ath79_register_pci();

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

	ath79_init_mac(ath79_eth0_data.mac_addr, mac + WPJ563_MAC0_OFFSET, 0);
	ath79_init_mac(ath79_eth1_data.mac_addr, mac + WPJ563_MAC1_OFFSET, 0);

	/* GMAC0 is connected to an QCA8334 switch */
	ath79_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_SGMII;
	ath79_eth0_data.speed = SPEED_1000;
	ath79_eth0_data.duplex = DUPLEX_FULL;
	ath79_eth0_data.phy_mask = BIT(0);
	ath79_eth0_data.mii_bus_dev = &ath79_mdio0_device.dev;

	ath79_register_eth(0);
}
예제 #21
0
static void __init wndap360_setup(void)
{
	u8 *art = (u8 *) KSEG1ADDR(0x1fff0000);

	ath79_register_mdio(0, ~(WNDAP360_LAN_PHYMASK));

	/* Reusing wifi MAC with offset of 1 as eth0 MAC */
	ath79_init_mac(ath79_eth0_data.mac_addr,
		       art + WNDAP360_WMAC0_MAC_OFFSET, 1);
	ath79_eth0_pll_data.pll_1000 = 0x11110000;
	ath79_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_RGMII;
	ath79_eth0_data.phy_mask = WNDAP360_LAN_PHYMASK;
	ath79_eth0_data.speed = SPEED_1000;
	ath79_eth0_data.duplex = DUPLEX_FULL;

	ath79_register_eth(0);

	ath79_register_m25p80(NULL);

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

	ath79_register_gpio_keys_polled(-1, WNDAP360_KEYS_POLL_INTERVAL,
					 ARRAY_SIZE(wndap360_gpio_keys),
					 wndap360_gpio_keys);

	ap9x_pci_setup_wmac_led_pin(0, 5);
	ap9x_pci_setup_wmac_led_pin(1, 5);

	ap94_pci_init(art + WNDAP360_CALDATA0_OFFSET,
		      art + WNDAP360_WMAC0_MAC_OFFSET,
		      art + WNDAP360_CALDATA1_OFFSET,
		      art + WNDAP360_WMAC1_MAC_OFFSET);
}
static void __init tl_ap151_setup(void)
{
	u8 *mac = (u8 *) KSEG1ADDR(0x1f00fc00);
	u8 *ee = (u8 *) KSEG1ADDR(0x1fff0000);
	u8 tmpmac[ETH_ALEN];

	ath79_register_m25p80(&tl_wdr6500_v2_flash_data);

	ath79_setup_ar933x_phy4_switch(false, false);

	ath79_register_mdio(0, 0x0);

	/* WAN */
	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_init_mac(ath79_eth0_data.mac_addr, mac, 1);
	ath79_register_eth(0);

	/* LAN */
	ath79_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_GMII;
	ath79_eth1_data.duplex = DUPLEX_FULL;
	ath79_eth1_data.speed = SPEED_1000;
	ath79_init_mac(ath79_eth1_data.mac_addr, mac, 0);
	ath79_register_eth(1);

	ath79_init_mac(tmpmac, mac, -1);
	ath79_register_wmac(ee + TL_WDR6500_V2_WMAC_CALDATA_OFFSET, tmpmac);

	ath79_register_pci();

	ath79_register_usb();
}
예제 #23
0
static void __init gl_inet_setup(void)
{
	/* get the mac address which is stored in the 1st 64k uboot MTD */
	u8 *mac = (u8 *) KSEG1ADDR(0x1f01fc00);

	/* get the art address, which is the last 64K. By using
	   0x1fff1000, it doesn't matter it is 4M, 8M or 16M flash */
	u8 *ee = (u8 *) KSEG1ADDR(0x1fff1000);

	/* disable PHY_SWAP and PHY_ADDR_SWAP bits */
	ath79_setup_ar933x_phy4_switch(false, false);

	/* register flash. MTD will use tp-link parser to parser MTD */
	ath79_register_m25p80(&gl_inet_flash_data);

	/* register gpio LEDs and keys */
	ath79_register_leds_gpio(-1, ARRAY_SIZE(gl_inet_leds_gpio),
				 gl_inet_leds_gpio);
	ath79_register_gpio_keys_polled(-1, GL_INET_KEYS_POLL_INTERVAL,
					ARRAY_SIZE(gl_inet_gpio_keys),
					gl_inet_gpio_keys);

	/* enable usb */
	ath79_register_usb();

	/* register eth0 as WAN, eth1 as LAN */
	ath79_init_mac(ath79_eth0_data.mac_addr, mac, 0);
	ath79_register_mdio(0, 0x0);
	ath79_register_eth(0);
	ath79_init_mac(ath79_eth1_data.mac_addr, mac, 0);
	ath79_register_eth(1);

	/* register wireless mac with cal data */
	ath79_register_wmac(ee, mac);
}
예제 #24
0
static void __init ew_dorin_setup(void)
{
	u8 *art = (u8 *) KSEG1ADDR(0x1fff0000);
	static u8 mac[6];

	ath79_register_m25p80(NULL);

	ath79_register_usb();

	if (ar93xx_wmac_read_mac_address(mac)) {
		ath79_register_wmac(NULL, NULL);
	} else {
		ath79_register_wmac(art + DORIN_CALDATA_OFFSET,
				    art + DORIN_WMAC_MAC_OFFSET);
		memcpy(mac, art + DORIN_WMAC_MAC_OFFSET, sizeof(mac));
	}

	mac[3] |= 0x40;
	ath79_init_mac(ath79_eth1_data.mac_addr, mac, 0);

	ath79_register_mdio(0, 0x0);

	/* LAN ports */
	ath79_register_eth(1);

	ath79_register_leds_gpio(-1, ARRAY_SIZE(dorin_leds_gpio),
				 dorin_leds_gpio);
	ath79_register_gpio_keys_polled(-1, DORIN_KEYS_POLL_INTERVAL,
					ARRAY_SIZE(dorin_gpio_keys),
					dorin_gpio_keys);
}
예제 #25
0
static void __init alfa_nx_setup(void)
{
	u8 *art = (u8 *) KSEG1ADDR(0x1fff0000);

	ath79_gpio_function_setup(AR724X_GPIO_FUNC_JTAG_DISABLE,
				  AR724X_GPIO_FUNC_ETH_SWITCH_LED0_EN |
				  AR724X_GPIO_FUNC_ETH_SWITCH_LED1_EN |
				  AR724X_GPIO_FUNC_ETH_SWITCH_LED2_EN |
				  AR724X_GPIO_FUNC_ETH_SWITCH_LED3_EN |
				  AR724X_GPIO_FUNC_ETH_SWITCH_LED4_EN);

	ath79_register_m25p80(&alfa_nx_flash_data);

	ath79_register_leds_gpio(0, ARRAY_SIZE(alfa_nx_leds_gpio),
				 alfa_nx_leds_gpio);

	ath79_register_gpio_keys_polled(-1, ALFA_NX_KEYS_POLL_INTERVAL,
					ARRAY_SIZE(alfa_nx_gpio_keys),
					alfa_nx_gpio_keys);

	ath79_register_mdio(0, 0x0);

	ath79_init_mac(ath79_eth0_data.mac_addr,
		       art + ALFA_NX_MAC0_OFFSET, 0);
	ath79_init_mac(ath79_eth1_data.mac_addr,
		       art + ALFA_NX_MAC1_OFFSET, 0);

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

	ap91_pci_init(art + ALFA_NX_CALDATA_OFFSET, NULL);
}
예제 #26
0
static void __init tl_ap143_setup(void)
{
	u8 *mac = (u8 *) KSEG1ADDR(0x1f01fc00);
	u8 *ee = (u8 *) KSEG1ADDR(0x1fff1000);
	u8 tmpmac[ETH_ALEN];

	ath79_register_m25p80(&tl_wr841n_v9_flash_data);

	ath79_setup_ar933x_phy4_switch(false, false);

	ath79_register_mdio(0, 0x0);

	/* LAN */
	ath79_init_mac(ath79_eth1_data.mac_addr, mac, 0);
	ath79_register_eth(1);

	/* WAN */
	ath79_switch_data.phy4_mii_en = 1;
	ath79_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_MII;
	ath79_init_mac(ath79_eth0_data.mac_addr, mac, 1);
	ath79_register_eth(0);

	ath79_init_mac(tmpmac, mac, 0);
	ath79_register_wmac(ee, tmpmac);
}
static void __init ds_common_setup(void)
{
	static u8 mac[6];

	u8 *art = (u8 *) KSEG1ADDR(0x1fff0000);
	ath79_register_m25p80(NULL);

	if (ar93xx_wmac_read_mac_address(mac)) {
		ath79_register_wmac(NULL, NULL);
	} else {
		ath79_register_wmac(art + DS_CALDATA_OFFSET,
				    art + DS_WMAC_MAC_OFFSET);
		memcpy(mac, art + DS_WMAC_MAC_OFFSET, sizeof(mac));
	}

	mac[3] |= 0x08;
	ath79_init_mac(ath79_eth0_data.mac_addr, mac, 0);

	mac[3] &= 0xF7;
	ath79_init_mac(ath79_eth1_data.mac_addr, mac, 0);
	ath79_register_mdio(0, 0x0);

	/* LAN ports */
	ath79_register_eth(1);

	/* WAN port */
	ath79_register_eth(0);
}
예제 #28
0
static void __init db120_vhyfi_setup(void)
{
	u8 *art = (u8 *) KSEG1ADDR(0x1fff0000);

	ath79_gpio_output_select(DB120_VHYFI_GPIO_LED_USB, AR934X_GPIO_OUT_GPIO);
	ath79_register_m25p80(NULL);

	ath79_register_leds_gpio(-1, ARRAY_SIZE(db120_vhyfi_leds_gpio),
				 db120_vhyfi_leds_gpio);
	ath79_register_gpio_keys_polled(-1, DB120_VHYFI_KEYS_POLL_INTERVAL,
					ARRAY_SIZE(db120_vhyfi_gpio_keys),
					db120_vhyfi_gpio_keys);
	ath79_register_usb();
	ath79_register_wmac(art + DB120_VHYFI_WMAC_CALDATA_OFFSET, NULL);
	ap91_pci_init(art + DB120_VHYFI_PCIE_CALDATA_OFFSET, NULL);

	db120_vhyfi_gmac_setup();

	ath79_register_mdio(0, 0x0);

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

	mdiobus_register_board_info(db120_vhyfi_mdio0_info,
				    ARRAY_SIZE(db120_vhyfi_mdio0_info));

	/* GMAC0 is connected to an AR8327 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);
}
예제 #29
0
static void __init common_setup(unsigned usb_power_gpio, bool sec_ethernet)
{
    u8 *mac = (u8 *) KSEG1ADDR(0x1f01fc00);

    /* disable PHY_SWAP and PHY_ADDR_SWAP bits */
    ath79_setup_ar933x_phy4_switch(false, false);

    ath79_register_m25p80(&tl_wr703n_flash_data);
    ath79_register_leds_gpio(-1, ARRAY_SIZE(tl_wr703n_leds_gpio),
                             tl_wr703n_leds_gpio);
    ath79_register_gpio_keys_polled(-1, TL_WR703N_KEYS_POLL_INTERVAL,
                                    ARRAY_SIZE(tl_wr703n_gpio_keys),
                                    tl_wr703n_gpio_keys);

    gpio_request_one(usb_power_gpio,
                     GPIOF_OUT_INIT_HIGH | GPIOF_EXPORT_DIR_FIXED,
                     "USB power");
    ath79_register_usb();

    ath79_register_mdio(0, 0x0);
    ath79_init_mac(ath79_eth0_data.mac_addr, mac, 1);
    ath79_register_eth(0);

    if (sec_ethernet)
    {
        ath79_init_mac(ath79_eth1_data.mac_addr, mac, -1);
        ath79_register_eth(1);
    }
    tplink_register_builtin_wmac1(0x1000, mac, 0);
}
예제 #30
0
파일: mach-epmp.c 프로젝트: nycmeshnet/epmp
static void __init epmp_setup(void)
{
	u8 *art = (u8 *)KSEG1ADDR(0x1fff0000);
	u8 mac[6];
	u8 *cal_data;

	ath79_register_m25p80(&epmp_flash_data);
	
	ath79_init_mac(mac, art, 2);

	ath79_setup_ar934x_eth_cfg(AR934X_ETH_CFG_SW_ONLY_MODE|AR934X_ETH_CFG_SW_PHY_SWAP);
	ath79_register_mdio(1, 0x0);
	ath79_init_mac(ath79_eth0_data.mac_addr, mac, 0);
	ath79_init_mac(ath79_eth1_data.mac_addr, mac, 1);
	
	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);

	cal_data=kmalloc(0x1000,GFP_KERNEL);
	memcpy(cal_data, art + EPMP_WMAC_CALDATA_OFFSET, 0x1000);
	memset(cal_data+0x1C,0x64,1);
	memset(cal_data+0x1D,0x00,1);
	ath79_register_wmac(cal_data, mac);
	kfree(cal_data);

	ath79_register_leds_gpio(-1, ARRAY_SIZE(epmp_leds_gpio) - 1,
				 epmp_leds_gpio);
}