Ejemplo n.º 1
0
static void __init tl_wr703n_setup(void)
{
	u8 *mac = (u8 *) KSEG1ADDR(0x1f01fc00);
	u8 *ee = (u8 *) KSEG1ADDR(0x1fff1000);

	ar71xx_add_device_m25p80(&tl_wr703n_flash_data);
	ar71xx_add_device_leds_gpio(-1, ARRAY_SIZE(tl_wr703n_leds_gpio),
					tl_wr703n_leds_gpio);
	ar71xx_register_gpio_keys_polled(-1, TL_WR703N_KEYS_POLL_INTERVAL,
					 ARRAY_SIZE(tl_wr703n_gpio_keys),
					 tl_wr703n_gpio_keys);

	gpio_request(TL_WR703N_GPIO_USB_POWER, "USB power");
	gpio_direction_output(TL_WR703N_GPIO_USB_POWER, 1);
	ar71xx_add_device_usb();

	ar71xx_init_mac(ar71xx_eth0_data.mac_addr, mac, 0);

	ar71xx_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_RMII;
	ar71xx_eth0_data.speed = SPEED_100;
	ar71xx_eth0_data.duplex = DUPLEX_FULL;
	ar71xx_eth0_data.phy_mask = BIT(4);

	ar71xx_add_device_mdio(0x0);
	ar71xx_add_device_eth(0);

	ar9xxx_add_device_wmac(ee, mac);
}
Ejemplo n.º 2
0
static void __init wnr2000_setup(void)
{
    u8 *eeprom = (u8 *) KSEG1ADDR(0x1fff1000);

    ar71xx_add_device_mdio(0, 0x0);

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

    ar71xx_init_mac(ar71xx_eth1_data.mac_addr, eeprom, 1);
    ar71xx_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_RMII;
    ar71xx_eth1_data.phy_mask = 0x10;

    ar71xx_add_device_eth(0);
    ar71xx_add_device_eth(1);

    ar71xx_add_device_m25p80(&wnr2000_flash_data);

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

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


    ar9xxx_add_device_wmac(eeprom, NULL);
}
static void __init tl_wr941nd_setup(void)
{
	u8 *mac = (u8 *) KSEG1ADDR(0x1f01fc00);
	u8 *eeprom = (u8 *) KSEG1ADDR(0x1fff1000);

	ar71xx_add_device_mdio(0, 0x0);

	ar71xx_init_mac(ar71xx_eth0_data.mac_addr, mac, 0);
	ar71xx_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_RMII;
	ar71xx_eth0_data.speed = SPEED_100;
	ar71xx_eth0_data.duplex = DUPLEX_FULL;

	ar71xx_add_device_eth(0);
	ar71xx_add_device_dsa(&ar71xx_eth0_device.dev, &ar71xx_mdio0_device.dev,
			      &tl_wr941nd_dsa_data);

	ar71xx_add_device_m25p80(&tl_wr941nd_flash_data);

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

	ar71xx_register_gpio_keys_polled(-1, TL_WR941ND_KEYS_POLL_INTERVAL,
					 ARRAY_SIZE(tl_wr941nd_gpio_keys),
					 tl_wr941nd_gpio_keys);
	ar9xxx_add_device_wmac(eeprom, mac);
}
Ejemplo n.º 4
0
static void __init tl_wr1043nd_setup(void)
{
	u8 *mac = (u8 *) KSEG1ADDR(0x1f01fc00);
	u8 *eeprom = (u8 *) KSEG1ADDR(0x1fff1000);

	ar71xx_init_mac(ar71xx_eth0_data.mac_addr, mac, 0);
	ar71xx_eth0_data.mii_bus_dev = &tl_wr1043nd_rtl8366rb_device.dev;
	ar71xx_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_RGMII;
	ar71xx_eth0_data.speed = SPEED_1000;
	ar71xx_eth0_data.duplex = DUPLEX_FULL;
	ar71xx_eth0_pll_data.pll_1000 = 0x1a000000;

	ar71xx_add_device_eth(0);

	ar71xx_add_device_usb();

	ar71xx_add_device_m25p80(&tl_wr1043nd_flash_data);

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

	platform_device_register(&tl_wr1043nd_rtl8366rb_device);

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

	ar9xxx_add_device_wmac(eeprom, mac);
}
static void __init tl_wr741ndv4_setup(void)
{
	u8 *mac = (u8 *) KSEG1ADDR(0x1f01fc00);
	u8 *ee = (u8 *) KSEG1ADDR(0x1fff1000);

	tl_wr741ndv4_gmac_setup();

	ar71xx_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);

	ar71xx_add_device_leds_gpio(-1, ARRAY_SIZE(tl_wr741ndv4_leds_gpio),
					tl_wr741ndv4_leds_gpio);

	ar71xx_register_gpio_keys_polled(1, TL_WR741NDV4_KEYS_POLL_INTERVAL,
					 ARRAY_SIZE(tl_wr741ndv4_gpio_keys),
					 tl_wr741ndv4_gpio_keys);

	ar71xx_add_device_m25p80(&tl_wr741ndv4_flash_data);
	ar71xx_init_mac(ar71xx_eth0_data.mac_addr, mac, 1);
	ar71xx_init_mac(ar71xx_eth1_data.mac_addr, mac, -1);

	ar71xx_add_device_mdio(0, 0x0);
	ar71xx_add_device_eth(1);
	ar71xx_add_device_eth(0);

	ar9xxx_add_device_wmac(ee, mac);
}
Ejemplo n.º 6
0
static void __init mzk_w04nu_setup(void)
{
	u8 *eeprom = (u8 *) KSEG1ADDR(0x1fff1000);

	ar71xx_add_device_mdio(MZK_W04NU_MDIO_MASK);

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

	ar71xx_init_mac(ar71xx_eth1_data.mac_addr, eeprom, 1);
	ar71xx_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_RMII;
	ar71xx_eth1_data.phy_mask = MZK_W04NU_WAN_PHYMASK;

	ar71xx_add_device_eth(0);
	ar71xx_add_device_eth(1);

	ar71xx_add_device_m25p80(&mzk_w04nu_flash_data);

	ar71xx_add_device_leds_gpio(-1, ARRAY_SIZE(mzk_w04nu_leds_gpio),
					mzk_w04nu_leds_gpio);

	ar71xx_register_gpio_keys_polled(-1, MZK_W04NU_KEYS_POLL_INTERVAL,
					 ARRAY_SIZE(mzk_w04nu_gpio_keys),
					 mzk_w04nu_gpio_keys);
	ar71xx_add_device_usb();

	ar9xxx_add_device_wmac(eeprom, NULL);
}
Ejemplo n.º 7
0
static void __init wrt160nl_setup(void)
{
	const char *nvram = (char *) KSEG1ADDR(WRT160NL_NVRAM_ADDR);
	u8 *eeprom = (u8 *) KSEG1ADDR(0x1fff1000);
	u8 mac[6];

	if (nvram_parse_mac_addr(nvram, WRT160NL_NVRAM_SIZE,
				 "lan_hwaddr=", mac) == 0) {
		ar71xx_init_mac(ar71xx_eth0_data.mac_addr, mac, 0);
		ar71xx_init_mac(ar71xx_eth1_data.mac_addr, mac, 1);
	}

	ar71xx_add_device_mdio(0x0);

	ar71xx_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_RMII;
	ar71xx_eth0_data.phy_mask = 0x01;

	ar71xx_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_RMII;
	ar71xx_eth1_data.phy_mask = 0x10;

	ar71xx_add_device_eth(0);
	ar71xx_add_device_eth(1);

	ar71xx_add_device_m25p80(&wrt160nl_flash_data);

	ar71xx_add_device_usb();

	if (nvram_parse_mac_addr(nvram, WRT160NL_NVRAM_SIZE,
				 "wl0_hwaddr=", mac) == 0)
		ar9xxx_add_device_wmac(eeprom, mac);
	else
		ar9xxx_add_device_wmac(eeprom, NULL);

	ar71xx_add_device_leds_gpio(-1, ARRAY_SIZE(wrt160nl_leds_gpio),
					wrt160nl_leds_gpio);

	ar71xx_register_gpio_keys_polled(-1, WRT160NL_KEYS_POLL_INTERVAL,
					 ARRAY_SIZE(wrt160nl_gpio_keys),
					 wrt160nl_gpio_keys);

}
static void __init wzrhpg30xnh_setup(void)
{
	u8 *eeprom = (u8 *) KSEG1ADDR(0x1fff1000);
	u8 *mac = eeprom + WZRHPG300NH_MAC_OFFSET;
	bool hasrtl8366rb = false;

	ar71xx_init_mac(ar71xx_eth0_data.mac_addr, mac, 0);
	ar71xx_init_mac(ar71xx_eth1_data.mac_addr, mac, 1);

	if (rtl8366_smi_detect(&wzrhpg300nh_rtl8366_data) == RTL8366_TYPE_RB)
		hasrtl8366rb = true;

	if (hasrtl8366rb) {
		ar71xx_eth0_pll_data.pll_1000 = 0x1f000000;
		ar71xx_eth0_data.mii_bus_dev = &wzrhpg301nh_rtl8366rb_device.dev;
		ar71xx_eth1_pll_data.pll_1000 = 0x100;
		ar71xx_eth1_data.mii_bus_dev = &wzrhpg301nh_rtl8366rb_device.dev;
	} else {
		ar71xx_eth0_pll_data.pll_1000 = 0x1e000100;
		ar71xx_eth0_data.mii_bus_dev = &wzrhpg300nh_rtl8366s_device.dev;
		ar71xx_eth1_pll_data.pll_1000 = 0x1e000100;
		ar71xx_eth1_data.mii_bus_dev = &wzrhpg300nh_rtl8366s_device.dev;
	}

	ar71xx_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_RGMII;
	ar71xx_eth0_data.speed = SPEED_1000;
	ar71xx_eth0_data.duplex = DUPLEX_FULL;

	ar71xx_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_RGMII;
	ar71xx_eth1_data.phy_mask = 0x10;

	ar71xx_add_device_eth(0);
	ar71xx_add_device_eth(1);

	ar71xx_add_device_usb();
	ar9xxx_add_device_wmac(eeprom, NULL);

	platform_device_register(&wzrhpg300nh_74hc153_device);
	platform_device_register(&wzrhpg300nh_flash_device);

	if (hasrtl8366rb)
		platform_device_register(&wzrhpg301nh_rtl8366rb_device);
	else
		platform_device_register(&wzrhpg300nh_rtl8366s_device);

	ar71xx_add_device_leds_gpio(-1, ARRAY_SIZE(wzrhpg300nh_leds_gpio),
					wzrhpg300nh_leds_gpio);

	ar71xx_register_gpio_keys_polled(-1, WZRHPG300NH_KEYS_POLL_INTERVAL,
					 ARRAY_SIZE(wzrhpg300nh_gpio_keys),
					 wzrhpg300nh_gpio_keys);

}
Ejemplo n.º 9
0
static void __init db120_setup(void)
{
	u8 *art = (u8 *) KSEG1ADDR(0x1fff0000);

	ar71xx_add_device_usb();

	ar71xx_add_device_m25p80(&db120_flash_data);

	ar71xx_add_device_leds_gpio(-1, ARRAY_SIZE(db120_leds_gpio),
					db120_leds_gpio);

	ar71xx_register_gpio_keys_polled(-1, DB120_KEYS_POLL_INTERVAL,
					 ARRAY_SIZE(db120_gpio_keys),
					 db120_gpio_keys);

	ar9xxx_add_device_wmac(art + DB120_CALDATA_OFFSET,
				art + DB120_WMAC_MAC_OFFSET);

	db120_pci_init();
}
Ejemplo n.º 10
0
static void __init db120_setup(void)
{
	u8 *art = (u8 *) KSEG1ADDR(0x1fff0000);

	ar71xx_gpio_output_select(DB120_GPIO_LED_USB, AR934X_GPIO_OUT_GPIO);

	ar71xx_add_device_usb();

	ar71xx_add_device_m25p80(&db120_flash_data);

	ar71xx_add_device_leds_gpio(-1, ARRAY_SIZE(db120_leds_gpio),
					db120_leds_gpio);

	ar71xx_register_gpio_keys_polled(-1, DB120_KEYS_POLL_INTERVAL,
					 ARRAY_SIZE(db120_gpio_keys),
					 db120_gpio_keys);

	ar71xx_add_device_mdio(0, 0x0);
	ar71xx_add_device_mdio(1, 0x0);

	/* GMAC0 is connected to an AR8327 switch */
	ar71xx_init_mac(ar71xx_eth0_data.mac_addr, art + DB120_MAC0_OFFSET, 0);
	ar71xx_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_RGMII;
	ar71xx_eth0_data.speed = SPEED_1000;
	ar71xx_eth0_data.duplex = DUPLEX_FULL;

	ar71xx_add_device_eth(0);

	/* GMAC1 is connected to the internal switch */
	ar71xx_init_mac(ar71xx_eth1_data.mac_addr, art + DB120_MAC1_OFFSET, 0);
	ar71xx_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_GMII;
	ar71xx_eth1_data.speed = SPEED_100;
	ar71xx_eth1_data.duplex = DUPLEX_FULL;

	ar71xx_add_device_eth(1);

	ar9xxx_add_device_wmac(art + DB120_WMAC_CALDATA_OFFSET, NULL);

	db120_pci_init(art + DB120_PCIE_CALDATA_OFFSET, NULL);
}
static void __init tl_wr703n_setup(void)
{
	u8 *mac = (u8 *) KSEG1ADDR(0x1f01fc00);
	u8 *ee = (u8 *) KSEG1ADDR(0x1fff1000);

	ar71xx_add_device_m25p80(&tl_wr703n_flash_data);
	ar71xx_add_device_leds_gpio(-1, ARRAY_SIZE(tl_wr703n_leds_gpio),
					tl_wr703n_leds_gpio);
	ar71xx_register_gpio_keys_polled(-1, TL_WR703N_KEYS_POLL_INTERVAL,
					 ARRAY_SIZE(tl_wr703n_gpio_keys),
					 tl_wr703n_gpio_keys);

	gpio_request(TL_WR703N_GPIO_USB_POWER, "USB power");
	gpio_direction_output(TL_WR703N_GPIO_USB_POWER, 1);
	ar71xx_add_device_usb();

	ar71xx_init_mac(ar71xx_eth0_data.mac_addr, mac, 0);

	ar71xx_add_device_mdio(0, 0x0);
	ar71xx_add_device_eth(0);

	ar9xxx_add_device_wmac(ee, mac);
}
Ejemplo n.º 12
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 (nvram_parse_mac_addr(config, DIR_615C1_CONFIG_SIZE,
					"lan_mac=", mac) == 0) {
		ar71xx_init_mac(ar71xx_eth0_data.mac_addr, mac, 0);
		ar71xx_init_mac(ar71xx_eth1_data.mac_addr, mac, 1);
		wlan_mac = mac;
	}

	ar71xx_add_device_mdio(0, DIR_615C1_MDIO_MASK);

	ar71xx_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_RMII;
	ar71xx_eth0_data.phy_mask = DIR_615C1_LAN_PHYMASK;

	ar71xx_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_RMII;
	ar71xx_eth1_data.phy_mask = DIR_615C1_WAN_PHYMASK;

	ar71xx_add_device_eth(0);
	ar71xx_add_device_eth(1);

	ar71xx_add_device_m25p80(&dir_615c1_flash_data);

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

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

	ar9xxx_add_device_wmac(eeprom, wlan_mac);
}