예제 #1
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);
}
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);
}
예제 #3
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);
}
예제 #4
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_register_gpio_keys_polled(-1, WRT400N_KEYS_POLL_INTERVAL,
					 ARRAY_SIZE(wrt400n_gpio_keys),
					 wrt400n_gpio_keys);

	ap94_pci_init(art + WRT400N_CALDATA0_OFFSET, NULL,
		      art + WRT400N_CALDATA1_OFFSET, NULL);
}
예제 #5
0
static void __init tl_mr3x20_setup(void)
{
	u8 *mac = (u8 *) KSEG1ADDR(0x1f01fc00);
	u8 *ee = (u8 *) KSEG1ADDR(0x1fff1000);

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

	ar71xx_add_device_m25p80(&tl_mr3x20_flash_data);

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

	ar71xx_register_gpio_keys_polled(-1, TL_MR3X20_KEYS_POLL_INTERVAL,
					 ARRAY_SIZE(tl_mr3x20_gpio_keys),
					 tl_mr3x20_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);

	ar71xx_add_device_usb();

	ap91_pci_init(ee, mac);
}
static void __init all0258n_setup(void)
{
	u8 *mac = (u8 *) KSEG1ADDR(0x1f7f0000);
	u8 *ee =  (u8 *) KSEG1ADDR(0x1f7f1000);

	ar71xx_add_device_m25p80(&all0258n_flash_data);

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

	ar71xx_register_gpio_keys_polled(-1, ALL0258N_KEYS_POLL_INTERVAL,
					 ARRAY_SIZE(all0258n_gpio_keys),
					 all0258n_gpio_keys);

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

	ar71xx_eth1_data.phy_mask = ALL0258N_SEC_PHYMASK;

	ar71xx_add_device_mdio(0, 0x0);

	ar71xx_add_device_eth(0);
	ar71xx_add_device_eth(1);

	ap91_pci_init(ee, mac);
}
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);
}
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);
}
예제 #9
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);
}
예제 #10
0
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(~UBNT_M_WAN_PHYMASK);

	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_RMII;
	ar71xx_eth0_data.speed = SPEED_100;
	ar71xx_eth0_data.duplex = DUPLEX_FULL;
	ar71xx_eth0_data.phy_mask = UBNT_M_WAN_PHYMASK;

	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_register_gpio_keys_polled(-1, UBNT_KEYS_POLL_INTERVAL,
					 ARRAY_SIZE(ubnt_m_gpio_keys),
					 ubnt_m_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);

}
예제 #12
0
static void __init wndr3700_common_setup(void)
{
	u8 *art = (u8 *) KSEG1ADDR(0x1fff0000);

	ar71xx_init_mac(ar71xx_eth0_data.mac_addr,
			art + WNDR3700_ETH0_MAC_OFFSET, 0);
	ar71xx_eth0_pll_data.pll_1000 = 0x11110000;
	ar71xx_eth0_data.mii_bus_dev = &wndr3700_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_init_mac(ar71xx_eth1_data.mac_addr,
			art + WNDR3700_ETH1_MAC_OFFSET, 0);
	ar71xx_eth1_pll_data.pll_1000 = 0x11110000;
	ar71xx_eth1_data.mii_bus_dev = &wndr3700_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();

	ar71xx_add_device_m25p80(&wndr3700_flash_data);

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

	ar71xx_register_gpio_keys_polled(-1, WNDR3700_KEYS_POLL_INTERVAL,
					 ARRAY_SIZE(wndr3700_gpio_keys),
					 wndr3700_gpio_keys);

	platform_device_register(&wndr3700_rtl8366s_device);
	platform_device_register_simple("wndr3700-led-usb", -1, NULL, 0);

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

	/* 2.4 GHz uses the first fixed antenna group (1, 0, 1, 0) */
	ap94_pci_setup_wmac_gpio(0, (0xf << 6), (0xa << 6));

	/* 5 GHz uses the second fixed antenna group (0, 1, 1, 0) */
	ap94_pci_setup_wmac_gpio(1, (0xf << 6), (0x6 << 6));

	ap94_pci_init(art + WNDR3700_CALDATA0_OFFSET,
		      art + WNDR3700_WMAC0_MAC_OFFSET,
		      art + WNDR3700_CALDATA1_OFFSET,
		      art + WNDR3700_WMAC1_MAC_OFFSET);
}
예제 #13
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();
}
예제 #14
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);
}
예제 #15
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);
}
예제 #16
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);
}
예제 #17
0
파일: mach-ubnt.c 프로젝트: jumoog/openwrt
static void __init ubnt_rspro_setup(void)
{
	ubnt_generic_setup();

	ar71xx_add_device_mdio(~(UBNT_RSPRO_WAN_PHYMASK |
				 UBNT_RSPRO_LAN_PHYMASK));

	ar71xx_init_mac(ar71xx_eth0_data.mac_addr, ar71xx_mac_base, 0);
	ar71xx_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_RGMII;
	ar71xx_eth0_data.phy_mask = UBNT_RSPRO_WAN_PHYMASK;

	ubnt_init_secondary_mac(ar71xx_mac_base);
	ar71xx_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_RGMII;
	ar71xx_eth1_data.phy_mask = UBNT_RSPRO_LAN_PHYMASK;
	ar71xx_eth1_data.speed = SPEED_1000;
	ar71xx_eth1_data.duplex = DUPLEX_FULL;

	ar71xx_add_device_eth(0);
	ar71xx_add_device_eth(1);

	ar71xx_add_device_usb();

	ar71xx_add_device_leds_gpio(-1, ARRAY_SIZE(ubnt_rs_leds_gpio),
					ubnt_rs_leds_gpio);
}
예제 #18
0
static void __init tl_wr841n_v1_setup(void)
{
    u8 *mac = (u8 *) KSEG1ADDR(0x1f01fc00);

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

    ar71xx_add_device_m25p80(&tl_wr841n_v1_flash_data);

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

    ar71xx_register_gpio_keys_polled(-1, TL_WR841ND_V1_KEYS_POLL_INTERVAL,
                                     ARRAY_SIZE(tl_wr841n_v1_gpio_keys),
                                     tl_wr841n_v1_gpio_keys);

    pb42_pci_init();
}
예제 #19
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_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);
}
예제 #20
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);
}
예제 #21
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);

}
예제 #22
0
파일: mach-om2p.c 프로젝트: ETegro/OpenSAN
static void __init om2p_setup(void)
{
	u8 *mac1 = (u8 *)KSEG1ADDR(0x1ffc0000);
	u8 *mac2 = (u8 *)KSEG1ADDR(0x1ffc0000 + ETH_ALEN);
	u8 *ee = (u8 *)KSEG1ADDR(0x1ffc1000);

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

	ar71xx_add_device_mdio(~OM2P_WAN_PHYMASK);

	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.phy_mask = OM2P_WAN_PHYMASK;

	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_eth(0);
	ar71xx_add_device_eth(1);

	ap91_pci_init(ee, NULL);

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

	ar71xx_register_gpio_keys_polled(-1, OM2P_KEYS_POLL_INTERVAL,
					 ARRAY_SIZE(om2p_gpio_keys),
					 om2p_gpio_keys);
}
예제 #23
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);
}
예제 #24
0
static void __init wpe72_setup(void)
{
	ar71xx_add_device_m25p80(&wpe72_flash_data);
	ar71xx_add_device_mdio(0, 0x0);

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

	ar71xx_add_device_eth(0);
	ar71xx_add_device_eth(1);

	ar71xx_add_device_usb();

	pb42_pci_init();

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

	ar71xx_register_gpio_keys_polled(-1, WPE72_KEYS_POLL_INTERVAL,
					ARRAY_SIZE(wpe72_gpio_keys),
					wpe72_gpio_keys);
}
예제 #25
0
static void __init zcn_1523h_generic_setup(void)
{
	u8 *mac = (u8 *) KSEG1ADDR(0x1f7e0004);
	u8 *ee = (u8 *) KSEG1ADDR(0x1fff1000);

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

	ar71xx_add_device_leds_gpio(0, ARRAY_SIZE(zcn_1523h_leds_gpio),
					zcn_1523h_leds_gpio);

	ar71xx_register_gpio_keys_polled(-1, ZCN_1523H_KEYS_POLL_INTERVAL,
					 ARRAY_SIZE(zcn_1523h_gpio_keys),
					 zcn_1523h_gpio_keys);

	ap91_pci_init(ee, mac);

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

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

	/* LAN2 port */
	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(0);
}
예제 #26
0
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, ~UBNT_M_WAN_PHYMASK);

	ar71xx_init_mac(ar71xx_eth0_data.mac_addr, mac1, 0);
	ar71xx_init_mac(ar71xx_eth1_data.mac_addr, mac2, 0);
	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_register_gpio_keys_polled(-1, UBNT_KEYS_POLL_INTERVAL,
					 ARRAY_SIZE(ubnt_m_gpio_keys),
					 ubnt_m_gpio_keys);
}
예제 #27
0
static void __init pb44_init(void)
{
	ar71xx_add_device_mdio(~PB44_MDIO_PHYMASK);

	ar71xx_init_mac(ar71xx_eth0_data.mac_addr, ar71xx_mac_base, 0);
	ar71xx_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_RGMII;
	ar71xx_eth0_data.phy_mask = PB44_WAN_PHYMASK;

	ar71xx_add_device_eth(0);

	ar71xx_init_mac(ar71xx_eth1_data.mac_addr, ar71xx_mac_base, 1);
	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 = 0x110000;

	ar71xx_add_device_eth(1);

	ar71xx_add_device_usb();

	pb42_pci_init();

	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_register_gpio_keys_polled(-1, PB44_KEYS_POLL_INTERVAL,
					 ARRAY_SIZE(pb44_gpio_keys),
					 pb44_gpio_keys);
}
예제 #28
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);
}
예제 #29
0
파일: mach-ubnt.c 프로젝트: jumoog/openwrt
static void __init ubnt_lssr71_setup(void)
{
	ubnt_generic_setup();

	ar71xx_add_device_mdio(~UBNT_LSSR71_PHY_MASK);

	ar71xx_init_mac(ar71xx_eth0_data.mac_addr, ar71xx_mac_base, 0);
	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);
}
예제 #30
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);
}