コード例 #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();
}
コード例 #2
0
static void __init mzk_w300nh_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_w300nh_spi_info,
			      ARRAY_SIZE(mzk_w300nh_spi_info));

	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);
	ar91xx_add_device_wmac();
}
コード例 #3
0
ファイル: mach-ubnt.c プロジェクト: jumoog/openwrt
static void __init ubnt_m_setup(void)
{
	u8 *mac1 = (u8 *) KSEG1ADDR(0x1fff0000);
	u8 *mac2 = (u8 *) KSEG1ADDR(0x1fff0000 + ETH_ALEN);
	u8 *ee = (u8 *) KSEG1ADDR(0x1fff1000);

	ar71xx_add_device_m25p80(NULL);

	ar71xx_add_device_mdio(~0);

	ar71xx_init_mac(ar71xx_eth0_data.mac_addr, mac1, 0);
	ar71xx_init_mac(ar71xx_eth1_data.mac_addr, mac2, 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);
}
コード例 #4
0
ファイル: mach-tl-wa901nd.c プロジェクト: jumoog/openwrt
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_add_device_gpio_buttons(-1, TL_WA901ND_BUTTONS_POLL_INTERVAL,
					ARRAY_SIZE(tl_wa901nd_gpio_buttons),
					tl_wa901nd_gpio_buttons);

	ap91_pci_init(ee, mac);
}
コード例 #5
0
static void __init tl_wr941nd_setup(void)
{
	u8 *mac = (u8 *) KSEG1ADDR(0x1f01fc00);

	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 = 0x0;
	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_spi(NULL, tl_wr941nd_spi_info,
					ARRAY_SIZE(tl_wr941nd_spi_info));

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

	ar71xx_add_device_gpio_buttons(-1, TL_WR941ND_BUTTONS_POLL_INTERVAL,
					ARRAY_SIZE(tl_wr941nd_gpio_buttons),
					tl_wr941nd_gpio_buttons);
	ar91xx_add_device_wmac();
}
コード例 #6
0
static void __init wzrhpg300nh_setup(void)
{
	u8 *eeprom = (u8 *) KSEG1ADDR(0x1fff1000);

	ar71xx_set_mac_base(eeprom + WZRHPG300NH_MAC_OFFSET);

	ar71xx_eth0_pll_data.pll_1000 = 0x1e000100;
	ar71xx_eth0_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_pll_data.pll_1000 = 0x1e000100;
	ar71xx_eth1_data.mii_bus_dev = &wzrhpg300nh_rtl8366s_device.dev;
	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();
	ar913x_add_device_wmac(eeprom, NULL);

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

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

	ar71xx_add_device_gpio_buttons(-1, WZRHPG300NH_BUTTONS_POLL_INTERVAL,
				       ARRAY_SIZE(wzrhpg300nh_gpio_buttons),
				       wzrhpg300nh_gpio_buttons);

}
コード例 #7
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();
}
コード例 #8
0
ファイル: mach-mzk-w04nu.c プロジェクト: anchowee/linino
static void __init mzk_w04nu_setup(void)
{
	u8 *eeprom = (u8 *) KSEG1ADDR(0x1fff1000);

	ar71xx_set_mac_base(eeprom);

	ar71xx_add_device_mdio(0x0);

	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 = 0x10;

	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_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(eeprom, NULL);
}
コード例 #9
0
ファイル: mach-rb-4xx.c プロジェクト: 1x23/unifi-gpl
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);
}
コード例 #10
0
ファイル: mach-wrt400n.c プロジェクト: jumoog/openwrt
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);
}
コード例 #11
0
ファイル: mach-pb44.c プロジェクト: gvsurenderreddy/openwrt-9
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);
}
コード例 #12
0
ファイル: mach-ubnt.c プロジェクト: jumoog/openwrt
static void __init ubnt_generic_setup(void)
{
	ar71xx_add_device_m25p80(NULL);

	ar71xx_add_device_gpio_buttons(-1, UBNT_BUTTONS_POLL_INTERVAL,
					ARRAY_SIZE(ubnt_gpio_buttons),
					ubnt_gpio_buttons);

	pb42_pci_init();
}
コード例 #13
0
ファイル: mach-rb-4xx.c プロジェクト: mirko/openwrt-x-burst
static void __init rb4xx_generic_setup(void)
{
	ar71xx_gpio_function_enable(GPIO_FUNC_SPI_CS1_EN |
				    GPIO_FUNC_SPI_CS2_EN);

	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);
}
コード例 #14
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));
}
コード例 #15
0
ファイル: mach-wrt160nl.c プロジェクト: jumoog/openwrt
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)
		ar913x_add_device_wmac(eeprom, mac);
	else
		ar913x_add_device_wmac(eeprom, NULL);

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

	ar71xx_add_device_gpio_buttons(-1, WRT160NL_BUTTONS_POLL_INTERVAL,
					ARRAY_SIZE(wrt160nl_gpio_buttons),
					wrt160nl_gpio_buttons);

}
コード例 #16
0
ファイル: mach-aw-nr580.c プロジェクト: jumoog/openwrt
static void __init aw_nr580_setup(void)
{
	ar71xx_add_device_mdio(0x0);

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

	ar71xx_add_device_eth(0);

	pb42_pci_init();

	ar71xx_add_device_m25p80(NULL);

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

	ar71xx_add_device_gpio_buttons(-1, AW_NR580_BUTTONS_POLL_INTERVAL,
					ARRAY_SIZE(aw_nr580_gpio_buttons),
					aw_nr580_gpio_buttons);
}
コード例 #17
0
static void __init wp543_setup(void)
{
	ar71xx_add_device_spi(NULL, wp543_spi_info, ARRAY_SIZE(wp543_spi_info));

	ar71xx_add_device_mdio(0xfffffff7);

	ar71xx_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_MII;
	ar71xx_eth0_data.phy_mask = 0x00000008;
	ar71xx_add_device_eth(0);

	ar71xx_add_device_usb();

	ar71xx_pci_init(ARRAY_SIZE(wp543_pci_irqs), wp543_pci_irqs);

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

	ar71xx_add_device_gpio_buttons(-1, WP543_BUTTONS_POLL_INTERVAL,
					ARRAY_SIZE(wp543_gpio_buttons),
					wp543_gpio_buttons);
}
コード例 #18
0
static void __init dir_600_a1_setup(void)
{
	const char *nvram = (char *) KSEG1ADDR(DIR_600_A1_NVRAM_ADDR);
	u8 *ee = (u8 *) KSEG1ADDR(0x1fff1000);
	u8 mac_buff[6];
	u8 *mac = NULL;

	if (nvram_parse_mac_addr(nvram, DIR_600_A1_NVRAM_SIZE,
			         "lan_mac=", mac_buff) == 0)
		mac = mac_buff;

	ar71xx_add_device_m25p80(&dir_600_a1_flash_data);

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

	ar71xx_add_device_gpio_buttons(-1, DIR_600_A1_BUTTONS_POLL_INTERVAL,
					ARRAY_SIZE(dir_600_a1_gpio_buttons),
					dir_600_a1_gpio_buttons);

	ar71xx_eth1_data.has_ar7240_switch = 1;
	ar71xx_set_mac_base(mac);

	/* 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_add_device_mdio(0x0);
	ar71xx_add_device_eth(1);
	ar71xx_add_device_eth(0);

	ap91_pci_init(ee, mac);
}
コード例 #19
0
ファイル: mach-pb42.c プロジェクト: roccozhang/wtp-simulator
static void __init pb42_init(void)
{
	ar71xx_add_device_m25p80(NULL);

	ar71xx_add_device_mdio(~PB42_MDIO_PHYMASK);

	ar71xx_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_MII;
	ar71xx_eth0_data.phy_mask = PB42_WAN_PHYMASK;

	ar71xx_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_RMII;
	ar71xx_eth1_data.speed = SPEED_100;
	ar71xx_eth1_data.duplex = DUPLEX_FULL;

	ar71xx_add_device_eth(0);
	ar71xx_add_device_eth(1);

	ar71xx_add_device_gpio_buttons(-1, PB42_BUTTONS_POLL_INTERVAL,
				       ARRAY_SIZE(pb42_gpio_buttons),
				       pb42_gpio_buttons);

	pb42_pci_init();
}
コード例 #20
0
ファイル: mach-rb-4xx.c プロジェクト: 1x23/unifi-gpl
static void __init rb411_setup(void)
{
	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_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);
}
コード例 #21
0
ファイル: mach-wp543.c プロジェクト: Cribstone/linino
static void __init wp543_setup(void)
{
	ar71xx_add_device_m25p80(NULL);

	ar71xx_add_device_mdio(0xfffffff0);

	ar71xx_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_MII;
	ar71xx_eth0_data.phy_mask = 0x0f;
	ar71xx_eth0_data.reset_bit = RESET_MODULE_GE0_MAC |
				     RESET_MODULE_GE0_PHY;
	ar71xx_add_device_eth(0);

	ar71xx_add_device_usb();

	pb42_pci_init();

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

	ar71xx_add_device_gpio_buttons(-1, WP543_BUTTONS_POLL_INTERVAL,
					ARRAY_SIZE(wp543_gpio_buttons),
					wp543_gpio_buttons);
}
コード例 #22
0
static void __init wrt400n_setup(void)
{
	u8 *art = (u8 *) KSEG1ADDR(0x1fff0000);
	u8 mac[6];
	int i;

	memcpy(mac, art + WRT400N_MAC_ADDR_OFFSET, 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.phy_if_mode = PHY_INTERFACE_MODE_RMII;
	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(&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);
}
コード例 #23
0
ファイル: mach-dir-615-c1.c プロジェクト: anchowee/linino
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_set_mac_base(mac);
		wlan_mac = mac;
	}

	ar71xx_add_device_mdio(0x0);

	ar71xx_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_RMII;
	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(eeprom, wlan_mac);
}
コード例 #24
0
ファイル: mach-ap83.c プロジェクト: roccozhang/wtp-simulator
static void __init ap83_generic_setup(void)
{
	u8 *eeprom = (u8 *) KSEG1ADDR(0x1fff1000);

	ar71xx_set_mac_base(eeprom);

	ar71xx_add_device_mdio(0xfffffffe);

	ar71xx_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_RGMII;
	ar71xx_eth0_data.phy_mask = 0x1;

	ar71xx_add_device_eth(0);

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

	ar71xx_eth1_pll_data.pll_1000 = 0x1f000000;

	ar71xx_add_device_eth(1);

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

	ar71xx_add_device_gpio_buttons(-1, AP83_BUTTONS_POLL_INTERVAL,
					ARRAY_SIZE(ap83_gpio_buttons),
					ap83_gpio_buttons);

	ar71xx_add_device_usb();

	ar913x_add_device_wmac(eeprom, NULL);

	platform_device_register(&ap83_flash_device);

	spi_register_board_info(ap83_spi_info, ARRAY_SIZE(ap83_spi_info));
}