示例#1
0
static void __init dir_615c1_setup(void)
{
	ar71xx_add_device_mdio(0x0);

	ar71xx_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_RMII;
	ar71xx_eth0_data.phy_mask = 0xf;
	ar71xx_eth0_data.speed = SPEED_100;
	ar71xx_eth0_data.duplex = DUPLEX_FULL;

	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(&dir_615c1_flash_data);

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

	ar71xx_add_device_gpio_buttons(-1, DIR_615C1_BUTTONS_POLL_INTERVAL,
					ARRAY_SIZE(dir_615c1_gpio_buttons),
					dir_615c1_gpio_buttons);

	ar913x_add_device_wmac();
}
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);
}
示例#3
0
static void __init tl_wr941nd_setup(void)
{
	u8 *mac = (u8 *) KSEG1ADDR(0x1f01fc00);
	u8 *eeprom = (u8 *) KSEG1ADDR(0x1fff1000);

	ar71xx_add_device_mdio(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(0, &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);
}
示例#4
0
static void __init pb44_init(void)
{
	ar71xx_add_device_mdio(~PB44_MDIO_PHYMASK);

	ar71xx_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_RGMII;
	ar71xx_eth0_data.phy_mask = PB44_WAN_PHYMASK;

	ar71xx_add_device_eth(0);

	ar71xx_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_RGMII;
	ar71xx_eth1_data.phy_mask = PB44_LAN_PHYMASK;
	ar71xx_eth1_data.speed = SPEED_1000;
	ar71xx_eth1_data.duplex = DUPLEX_FULL;
	ar71xx_eth1_pll_data.pll_1000 = 0x110000;

	ar71xx_add_device_eth(1);

	ar71xx_add_device_usb();

	ar71xx_pci_init(ARRAY_SIZE(pb44_pci_irqs), pb44_pci_irqs);

	i2c_register_board_info(0, pb44_i2c_board_info,
 				ARRAY_SIZE(pb44_i2c_board_info));

	platform_device_register(&pb44_i2c_gpio_device);

	spi_register_board_info(pb44_spi_info, ARRAY_SIZE(pb44_spi_info));
	platform_device_register(&pb44_spi_device);

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

	ar71xx_add_device_gpio_buttons(-1, 20, ARRAY_SIZE(pb44_gpio_buttons),
				       pb44_gpio_buttons);
}
示例#5
0
static void __init wrt400n_setup(void)
{
	u8 *art = (u8 *) KSEG1ADDR(0x1fff0000);
	u8 *mac = art + WRT400N_MAC_ADDR_OFFSET;

	ar71xx_add_device_mdio(0x0);

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

	ar71xx_init_mac(ar71xx_eth1_data.mac_addr, mac, 2);
	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(&wrt400n_flash_data);

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

	ar71xx_add_device_gpio_buttons(-1, WRT400N_BUTTONS_POLL_INTERVAL,
					ARRAY_SIZE(wrt400n_gpio_buttons),
					wrt400n_gpio_buttons);

	ap94_pci_init(art + WRT400N_CALDATA0_OFFSET, NULL,
		      art + WRT400N_CALDATA1_OFFSET, NULL);
}
static void __init whrhpg300n_setup(void)
{
	u8 *ee = (u8 *) KSEG1ADDR(0x1fff1000);
	u8 *mac = (u8 *) KSEG1ADDR(ee + WHRHPG300N_MAC_OFFSET);

	ar71xx_add_device_m25p80(&whrhpg300n_flash_data);

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

	ar71xx_register_gpio_keys_polled(-1, WHRHPG300N_KEYS_POLL_INTERVAL,
					 ARRAY_SIZE(whrhpg300n_gpio_keys),
					 whrhpg300n_gpio_keys);

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

	ar71xx_add_device_mdio(0, 0x0);

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

	ap91_pci_setup_wmac_led_pin(1);

	ap91_pci_init(ee, mac);
}
示例#7
0
static void __init ubnt_m_setup(void)
{
	u8 *mac = (u8 *) KSEG1ADDR(0x1fff0000);
	u8 *ee = (u8 *) KSEG1ADDR(0x1fff1000);

	ar71xx_set_mac_base(mac);

	ar71xx_add_device_m25p80(NULL);

	ar71xx_add_device_mdio(~0);

	ar71xx_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_MII;
	ar71xx_eth0_data.speed = SPEED_100;
	ar71xx_eth0_data.duplex = DUPLEX_FULL;
	ar71xx_eth0_data.fifo_cfg1 = 0x0010ffff;
	ar71xx_eth0_data.fifo_cfg2 = 0x015500aa;
	ar71xx_eth0_data.fifo_cfg3 = 0x01f00140;

	ar71xx_add_device_eth(0);

	ap91_pci_init(ee, NULL);

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

	ar71xx_add_device_gpio_buttons(-1, UBNT_BUTTONS_POLL_INTERVAL,
					ARRAY_SIZE(ubnt_m_gpio_buttons),
					ubnt_m_gpio_buttons);
}
示例#8
0
static void __init rb493_setup(void)
{
	rb4xx_add_device_spi();

	ar71xx_add_device_mdio(0x3fffff00);

	ar71xx_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_MII;
	ar71xx_eth0_data.phy_mask = 0;
	ar71xx_eth0_data.speed = SPEED_100;
	ar71xx_eth0_data.duplex = DUPLEX_FULL;

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

	ar71xx_add_device_eth(0);
	ar71xx_add_device_eth(1);

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

	ar71xx_add_device_gpio_buttons(-1, RB4XX_BUTTONS_POLL_INTERVAL,
					ARRAY_SIZE(rb4xx_gpio_buttons),
					rb4xx_gpio_buttons);

	platform_device_register(&rb4xx_nand_device);

	ar71xx_pci_init(ARRAY_SIZE(rb4xx_pci_irqs), rb4xx_pci_irqs);
}
示例#9
0
static void __init mzk_w300nh_setup(void)
{
	u8 *eeprom = (u8 *) KSEG1ADDR(0x1fff1000);

	ar71xx_set_mac_base(eeprom);

	ar71xx_add_device_mdio(MZK_W300NH_MDIO_MASK);

	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_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_RMII;
	ar71xx_eth1_data.phy_mask = MZK_W300NH_WAN_PHYMASK;

	ar71xx_add_device_eth(0);
	ar71xx_add_device_eth(1);

	ar71xx_add_device_m25p80(&mzk_w300nh_flash_data);

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

	ar71xx_add_device_gpio_buttons(-1, MZK_W04NU_BUTTONS_POLL_INTERVAL,
				       ARRAY_SIZE(mzk_w300nh_gpio_buttons),
				       mzk_w300nh_gpio_buttons);
	ar913x_add_device_wmac(eeprom, NULL);
}
示例#10
0
static void __init mzk_w04nu_setup(void)
{
	u8 *mac = (u8 *) KSEG1ADDR(0x1fff1000);

	ar71xx_set_mac_base(mac);

	ar71xx_add_device_mdio(0x0);

	ar71xx_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_RMII;
	ar71xx_eth0_data.phy_mask = 0xf;
	ar71xx_eth0_data.speed = SPEED_100;
	ar71xx_eth0_data.duplex = DUPLEX_FULL;
	ar71xx_eth0_data.has_ar8216 = 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_spi(NULL, mzk_w04nu_spi_info,
					ARRAY_SIZE(mzk_w04nu_spi_info));

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

	ar71xx_add_device_gpio_buttons(-1, MZK_W04NU_BUTTONS_POLL_INTERVAL,
					ARRAY_SIZE(mzk_w04nu_gpio_buttons),
					mzk_w04nu_gpio_buttons);
	ar71xx_add_device_usb();

	ar913x_add_device_wmac();
}
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_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);
}
示例#13
0
static void __init tl_wa901nd_setup(void)
{
	u8 *mac = (u8 *) KSEG1ADDR(0x1f01fc00);
	u8 *ee  = (u8 *) KSEG1ADDR(0x1fff1000);

	/*
	 * ar71xx_eth0 would be the WAN port, but is not connected on
	 * the TL-WA901ND. ar71xx_eth1 connects to the internal switch chip,
	 * however we have a single LAN port only.
	 */
	ar71xx_init_mac(ar71xx_eth1_data.mac_addr, mac, 0);
	ar71xx_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_RMII;
	ar71xx_eth1_data.speed       = SPEED_1000;
	ar71xx_eth1_data.duplex      = DUPLEX_FULL;
	ar71xx_eth1_data.has_ar7240_switch = 1;

	ar71xx_add_device_mdio(0x0);
	ar71xx_add_device_eth(1);

	ar71xx_add_device_m25p80(&tl_wa901nd_flash_data);

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

	ar71xx_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);
}
示例#14
0
static void __init rb750_setup(void)
{
	ar71xx_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);

	/* WAN port */
	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);

	/* LAN ports */
	ar71xx_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_RMII;
	ar71xx_eth1_data.speed = SPEED_1000;
	ar71xx_eth1_data.duplex = DUPLEX_FULL;
	ar71xx_eth1_data.has_ar7240_switch = 1;

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

	platform_device_register(&rb750_leds_device);
	platform_device_register(&rb750_nand_device);
}
static void __init tl_wr741nd_setup(void)
{
	u8 *mac = (u8 *) KSEG1ADDR(0x1f01fc00);
	u8 *ee = (u8 *) KSEG1ADDR(0x1fff1000);

	ar71xx_add_device_m25p80(&tl_wr741nd_flash_data);

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

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

	ar71xx_register_gpio_keys_polled(-1, TL_WR741ND_KEYS_POLL_INTERVAL,
					 ARRAY_SIZE(tl_wr741nd_gpio_keys),
					 tl_wr741nd_gpio_keys);

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

	/* LAN ports */
	ar71xx_add_device_eth(1);

	/* WAN port */
	ar71xx_add_device_eth(0);

	ap91_pci_setup_wmac_led_pin(1);

	ap91_pci_init(ee, mac);
}
示例#16
0
static void __init tew_632brp_setup(void)
{
	ar71xx_add_device_mdio(0x0);

	ar71xx_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_RMII;
	ar71xx_eth0_data.phy_mask = 0xf;
	ar71xx_eth0_data.speed = SPEED_100;
	ar71xx_eth0_data.duplex = DUPLEX_FULL;

	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_spi(NULL, tew_632brp_spi_info,
					ARRAY_SIZE(tew_632brp_spi_info));

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

	ar71xx_add_device_gpio_buttons(-1, TEW_632BRP_BUTTONS_POLL_INTERVAL,
					ARRAY_SIZE(tew_632brp_gpio_buttons),
					tew_632brp_gpio_buttons);

	ar91xx_add_device_wmac();
}
示例#17
0
static void __init ap113_setup(void)
{
	u8 *mac = (u8 *) KSEG1ADDR(0x1fff0000);

	ar71xx_add_device_m25p80(&ap113_flash_data);

	ar71xx_add_device_mdio(0, ~BIT(0));
	ar71xx_init_mac(ar71xx_eth0_data.mac_addr, mac, 0);
	ar71xx_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_RGMII;
	ar71xx_eth0_data.speed = SPEED_1000;
	ar71xx_eth0_data.duplex = DUPLEX_FULL;
	ar71xx_eth0_data.phy_mask = BIT(0);

	ar71xx_add_device_eth(0);

	ar71xx_register_gpio_keys_polled(-1, AP113_KEYS_POLL_INTERVAL,
					 ARRAY_SIZE(ap113_gpio_keys),
					 ap113_gpio_keys);
	ar71xx_add_device_leds_gpio(-1, ARRAY_SIZE(ap113_leds_gpio),
					ap113_leds_gpio);

	ar71xx_add_device_usb();

	pb9x_pci_init();
}
示例#18
0
void __init ap91_eth_init(u8 *mac_addr, const char *port_names[])
{
	if (mac_addr)
		ar71xx_set_mac_base(mac_addr);

	if (port_names) {
		int i;

		for (i = 0; i < AP91_ETH_NUM_PORT_NAMES; i++)
			ap91_eth_set_port_name(i + 1, port_names[i]);
	}

	/* WAN port */
	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.fifo_cfg1 = 0x0fff0000;
	ar71xx_eth0_data.fifo_cfg2 = 0x00001fff;
	ar71xx_eth0_data.fifo_cfg3 = 0x008001ff;

	/* LAN ports */
	ar71xx_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_RMII;
	ar71xx_eth1_data.speed = SPEED_1000;
	ar71xx_eth1_data.duplex = DUPLEX_FULL;
	ar71xx_eth1_data.fifo_cfg1 = 0x0fff0000;
	ar71xx_eth1_data.fifo_cfg2 = 0x00001fff;
	ar71xx_eth1_data.fifo_cfg3 = 0x008001ff;

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

	ar71xx_add_device_dsa(1, &ap91_dsa_data);
}
示例#19
0
static void __init ezbox_tl_wr740n_v4_setup(void)
{
	const char *nvram = (char *) KSEG1ADDR(EZBOX_TL_WR740N_V4_NVRAM_ADDR);
	const char *ubootenv = (char *) KSEG1ADDR(EZBOX_TL_WR740N_V4_UBOOT_ENV_ADDR);
	u8 mac[6];
	u8 *ee = (u8 *) KSEG1ADDR(0x1fff1000);

	/* enable power for the USB port */
	gpio_request(EZBOX_TL_WR740N_V4_GPIO_USB_POWER, "USB power");
	gpio_direction_output(EZBOX_TL_WR740N_V4_GPIO_USB_POWER, 1);

	ar71xx_add_device_m25p80(&ezbox_tl_wr740n_v4_flash_data);

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

	ar71xx_register_gpio_keys_polled(-1, EZBOX_TL_WR740N_V4_KEYS_POLL_INTERVAL,
					ARRAY_SIZE(ezbox_tl_wr740n_v4_gpio_keys),
					ezbox_tl_wr740n_v4_gpio_keys);

	ar71xx_eth1_data.has_ar7240_switch = 1;
	if (nvram_parse_mac_addr(nvram, EZBOX_TL_WR740N_V4_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);
	}
	else if (ubootenv_parse_mac_addr(ubootenv, EZBOX_TL_WR740N_V4_UBOOT_ENV_SIZE,
	                         "ethaddr=", mac) == 0) {
		ar71xx_init_mac(ar71xx_eth0_data.mac_addr, mac, 0);
		ar71xx_init_mac(ar71xx_eth1_data.mac_addr, mac, 1);
	}
	else {
		memcpy(mac, (u8 *) KSEG1ADDR(0x1f01fc00), sizeof(mac));
		ar71xx_init_mac(ar71xx_eth0_data.mac_addr, mac, 0);
		ar71xx_init_mac(ar71xx_eth1_data.mac_addr, mac, 1);
	}

	/* WAN port */
	ar71xx_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_RMII;
	ar71xx_eth0_data.speed = SPEED_100;
	ar71xx_eth0_data.duplex = DUPLEX_FULL;

	/* LAN ports */
	ar71xx_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_RMII;
	ar71xx_eth1_data.speed = SPEED_1000;
	ar71xx_eth1_data.duplex = DUPLEX_FULL;

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

	ar71xx_add_device_usb();

	ap91_pci_setup_wmac_led_pin(1);

	ap91_pci_init(ee, mac);
}
示例#20
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);
}
示例#21
0
static void __init rb411_setup(void)
{
	rb4xx_generic_setup();
	rb4xx_add_device_spi();

	ar71xx_add_device_mdio(0xfffffffe);

	ar71xx_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_MII;
	ar71xx_eth0_data.phy_mask = 0x00000001;

	ar71xx_add_device_eth(0);

	ar71xx_pci_init(ARRAY_SIZE(rb4xx_pci_irqs), rb4xx_pci_irqs);
}
示例#22
0
static void __init ubnt_lssr71_setup(void)
{
	ubnt_generic_setup();

	ar71xx_add_device_mdio(~UBNT_LSSR71_PHY_MASK);

	ar71xx_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_MII;
	ar71xx_eth0_data.phy_mask = UBNT_LSSR71_PHY_MASK;

	ar71xx_add_device_eth(0);

	ar71xx_add_device_leds_gpio(-1, ARRAY_SIZE(ubnt_ls_sr71_leds_gpio),
					ubnt_ls_sr71_leds_gpio);
}
示例#23
0
static void __init dir825b1_setup(void)
{
        u8 mac[6], i;

	memcpy(mac, (u8*)KSEG1ADDR(DIR825B1_MAC_LOCATION_1), 6);
	for(i = 5; i >= 3; i--)
		if(++mac[i] != 0x00) break;

	ar71xx_set_mac_base(mac);

	ar71xx_add_device_mdio(0x0);

	ar71xx_eth0_data.mii_bus_dev = &dir825b1_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_eth0_pll_data.pll_1000 = 0x11110000;

	ar71xx_eth1_data.mii_bus_dev = &dir825b1_rtl8366s_device.dev;
	ar71xx_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_RGMII;
	ar71xx_eth1_data.phy_mask = 0x10;
	ar71xx_eth1_pll_data.pll_1000 = 0x11110000;

	ar71xx_add_device_eth(0);
	ar71xx_add_device_eth(1);

	ar71xx_add_device_m25p80(&dir825b1_flash_data);

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

	ar71xx_add_device_gpio_buttons(-1, DIR825B1_BUTTONS_POLL_INTERVAL,
					ARRAY_SIZE(dir825b1_gpio_buttons),
					dir825b1_gpio_buttons);

	ar71xx_add_device_usb();

	platform_device_register(&dir825b1_rtl8366s_device);

	ap94_pci_setup_wmac_led_pin(0, 5);
	ap94_pci_setup_wmac_led_pin(1, 5);

	ap94_pci_init((u8 *) KSEG1ADDR(DIR825B1_CAL_LOCATION_0),
		      (u8 *) KSEG1ADDR(DIR825B1_MAC_LOCATION_0),
		      (u8 *) KSEG1ADDR(DIR825B1_CAL_LOCATION_1),
		      (u8 *) KSEG1ADDR(DIR825B1_MAC_LOCATION_1));
}
static void __init ubnt_unifi_setup(void)
{
	u8 *mac = (u8 *) KSEG1ADDR(0x1fff0000);
	u8 *ee = (u8 *) KSEG1ADDR(0x1fff1000);

	ar71xx_add_device_m25p80(NULL);

	ar71xx_add_device_mdio(0, ~UBNT_M_WAN_PHYMASK);

	ar71xx_init_mac(ar71xx_eth0_data.mac_addr, mac, 0);
	ar71xx_add_device_eth(0);

	ap91_pci_init(ee, NULL);

	ar71xx_add_device_leds_gpio(-1, ARRAY_SIZE(ubnt_unifi_leds_gpio),
					ubnt_unifi_leds_gpio);
}
示例#25
0
static void __init rb450_generic_setup(int gige)
{
	rb4xx_generic_setup();
	rb4xx_add_device_spi();

	ar71xx_add_device_mdio(0xffffffe0);

	ar71xx_eth0_data.phy_if_mode = (gige) ? PHY_INTERFACE_MODE_RGMII : PHY_INTERFACE_MODE_MII;
	ar71xx_eth0_data.phy_mask = (gige) ? (1 << 0) : 0;
	ar71xx_eth0_data.speed = (gige) ? SPEED_1000 : SPEED_100;
	ar71xx_eth0_data.duplex = DUPLEX_FULL;

	ar71xx_eth1_data.phy_if_mode = (gige) ? PHY_INTERFACE_MODE_RGMII : PHY_INTERFACE_MODE_RMII;
	ar71xx_eth1_data.phy_mask = 0x00000010;

	ar71xx_add_device_eth(1);
	ar71xx_add_device_eth(0);
}
示例#26
0
static void __init rb450_setup(void)
{
	rb4xx_generic_setup();
	rb4xx_add_device_spi();

	ar71xx_add_device_mdio(0xffffffe0);

	ar71xx_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_MII;
	ar71xx_eth0_data.phy_mask = 0x0000000f;
	ar71xx_eth0_data.speed = SPEED_100;
	ar71xx_eth0_data.duplex = DUPLEX_FULL;

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

	ar71xx_add_device_eth(1);
	ar71xx_add_device_eth(0);
}
示例#27
0
static void __init wzrhpg450h_init(void)
{
	u8 *ee = (u8 *) KSEG1ADDR(0x1f051000);
	u8 *mac = (u8 *) ee + 2;

	ar71xx_add_device_m25p80_multi(&wzrhpg450h_flash_data);

	ar71xx_add_device_mdio(0, ~BIT(0));
	ar71xx_init_mac(ar71xx_eth0_data.mac_addr, mac, 0);
	ar71xx_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_RGMII;
	ar71xx_eth0_data.speed = SPEED_1000;
	ar71xx_eth0_data.duplex = DUPLEX_FULL;
	ar71xx_eth0_data.phy_mask = BIT(0);

	ar71xx_add_device_eth(0);

	ap91_pci_init(ee, NULL);
}
static void __init ubnt_airrouter_setup(void)
{
	u8 *mac1 = (u8 *) KSEG1ADDR(0x1fff0000);
	u8 *ee = (u8 *) KSEG1ADDR(0x1fff1000);

	ar71xx_add_device_m25p80(NULL);
	ar71xx_add_device_mdio(0, ~UBNT_M_WAN_PHYMASK);

	ar71xx_init_mac(ar71xx_eth0_data.mac_addr, mac1, 0);
	ubnt_init_secondary_mac(mac1);

	ar71xx_add_device_eth(1);
	ar71xx_add_device_eth(0);
	ar71xx_add_device_usb();

	ap91_pci_init(ee, NULL);
	ar71xx_add_device_leds_gpio(-1, ARRAY_SIZE(ubnt_airrouter_leds_gpio),
					ubnt_airrouter_leds_gpio);
}
示例#29
0
static void __init rb493_setup(void)
{
	rb4xx_generic_setup();
	rb4xx_add_device_spi();

	ar71xx_add_device_mdio(0x3fffff00);

	ar71xx_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_MII;
	ar71xx_eth0_data.speed = SPEED_100;
	ar71xx_eth0_data.duplex = DUPLEX_FULL;

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

	ar71xx_add_device_eth(0);
	ar71xx_add_device_eth(1);

	ar71xx_pci_init(ARRAY_SIZE(rb4xx_pci_irqs), rb4xx_pci_irqs);
}
示例#30
0
static void __init wzrhpag300h_setup(void)
{
	u8 *eeprom1 = (u8 *) KSEG1ADDR(0x1f051000);
	u8 *eeprom2 = (u8 *) KSEG1ADDR(0x1f055000);
	u8 *mac1 = eeprom1 + WZRHPAG300H_MAC_OFFSET;
	u8 *mac2 = eeprom2 + WZRHPAG300H_MAC_OFFSET;

	ar71xx_init_mac(ar71xx_eth0_data.mac_addr, mac1, 0);
	ar71xx_init_mac(ar71xx_eth1_data.mac_addr, mac2, 1);

	ar71xx_add_device_mdio(0, ~(BIT(0) | BIT(4)));

	ar71xx_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_RGMII;
	ar71xx_eth0_data.speed = SPEED_1000;
	ar71xx_eth0_data.duplex = DUPLEX_FULL;
	ar71xx_eth0_data.phy_mask = BIT(0);

	ar71xx_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_RGMII;
	ar71xx_eth1_data.phy_mask = BIT(4);

	ar71xx_add_device_eth(0);
	ar71xx_add_device_eth(1);

	ar71xx_add_device_usb();
	gpio_request(2, "usb");
	gpio_direction_output(2, 1);

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

	ar71xx_register_gpio_keys_polled(-1, WZRHPAG300H_KEYS_POLL_INTERVAL,
					 ARRAY_SIZE(wzrhpag300h_gpio_keys),
					 wzrhpag300h_gpio_keys);

	ar71xx_add_device_spi(NULL, ar71xx_spi_info,
			      ARRAY_SIZE(ar71xx_spi_info));

	add_mtd_concat_notifier();

	ap94_pci_init(eeprom1, mac1, eeprom2, mac2);
}