static void __init wzrhpg450h_init(void)
{
	u8 *ee = (u8 *) KSEG1ADDR(0x1f051000);
	u8 *mac = (u8 *) ee + 2;

	ath79_register_m25p80_multi(&wzrhpg450h_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_leds_gpio(-1, ARRAY_SIZE(wzrhpg450h_leds_gpio),
				 wzrhpg450h_leds_gpio);

	ath79_register_gpio_keys_polled(-1, WZRHPG450H_KEYS_POLL_INTERVAL,
					ARRAY_SIZE(wzrhpg450h_gpio_keys),
					wzrhpg450h_gpio_keys);

	ath79_register_eth(0);

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

	ap91_pci_init(ee, NULL);
	ap9x_pci_get_wmac_data(0)->tx_gain_buffalo = true;
	ap9x_pci_get_wmac_data(1)->tx_gain_buffalo = true;
	ap9x_pci_setup_wmac_led_pin(0, 15);
	ap9x_pci_setup_wmac_leds(0, wzrhpg450h_wmac_leds_gpio,
				 ARRAY_SIZE(wzrhpg450h_wmac_leds_gpio));
}
示例#2
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;

    ath79_init_mac(ath79_eth0_data.mac_addr, mac1, 0);
    ath79_init_mac(ath79_eth1_data.mac_addr, mac2, 1);

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

    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_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_RGMII;
    ath79_eth1_data.phy_mask = BIT(4);

    ath79_register_eth(0);
    ath79_register_eth(1);

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

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

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

    ath79_register_m25p80_multi(&wzrhpag300h_flash_data);

    ap94_pci_init(eeprom1, mac1, eeprom2, mac2);

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

    ap9x_pci_setup_wmac_leds(0, wzrhpag300h_wmac0_leds_gpio,
                             ARRAY_SIZE(wzrhpag300h_wmac0_leds_gpio));
    ap9x_pci_setup_wmac_leds(1, wzrhpag300h_wmac1_leds_gpio,
                             ARRAY_SIZE(wzrhpag300h_wmac1_leds_gpio));
}
示例#3
0
static void __init wnr2000v3_setup(void)
{
	u8 wlan_mac_addr[6];

	/*
	 * Disable JTAG to use all AR724X GPIO LEDs.
	 * Also disable CLKs and bit 20 as u-boot does.
	 * Finally, allow OS to control all link LEDs.
	 */
	ath79_gpio_function_setup(AR724X_GPIO_FUNC_JTAG_DISABLE |
				  AR724X_GPIO_FUNC_UART_EN,
				  AR724X_GPIO_FUNC_CLK_OBS1_EN |
				  AR724X_GPIO_FUNC_CLK_OBS2_EN |
				  AR724X_GPIO_FUNC_CLK_OBS3_EN |
				  AR724X_GPIO_FUNC_CLK_OBS4_EN |
				  AR724X_GPIO_FUNC_CLK_OBS5_EN |
				  AR724X_GPIO_FUNC_GE0_MII_CLK_EN |
				  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 |
				  BIT(20));

	wnr_get_wmac(wlan_mac_addr, WNR2000V3_MAC0_OFFSET,
		     WNR2000V3_MAC1_OFFSET, WNR2000V3_WMAC_OFFSET);

	wnr_common_setup(wlan_mac_addr);

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

	/* Do not use id=-1, we can have more GPIO key-polled devices */
	ath79_register_gpio_keys_polled(PLATFORM_DEVID_AUTO,
					WNR2000V3_KEYS_POLL_INTERVAL,
					ARRAY_SIZE(wnr2000v3_keys_gpio),
					wnr2000v3_keys_gpio);

	ap9x_pci_setup_wmac_led_pin(0, WNR2000V3_GPIO_WMAC_LED_WLAN_BLUE);
	ap9x_pci_setup_wmac_led_name(0, wnr2000v3_wmac_led_name);

	ap9x_pci_setup_wmac_leds(0, wnr2000v3_wmac_leds_gpio,
				 ARRAY_SIZE(wnr2000v3_wmac_leds_gpio));

	ap9x_pci_setup_wmac_btns(0, wnr2000v3_wmac_keys_gpio,
				 ARRAY_SIZE(wnr2000v3_wmac_keys_gpio),
				 WNR2000V3_KEYS_POLL_INTERVAL);
}
示例#4
0
static void __init wnr612v2_setup(void)
{
	u8 wlan_mac_addr[6];

	/*
	 * Disable JTAG and CLKs. Allow OS to control all link LEDs.
	 * Note: U-Boot for WNR612v2 sets undocumented bit 15 but
	 * we leave it for now.
	 */
	ath79_gpio_function_setup(AR724X_GPIO_FUNC_JTAG_DISABLE |
				  AR724X_GPIO_FUNC_UART_EN,
				  AR724X_GPIO_FUNC_CLK_OBS1_EN |
				  AR724X_GPIO_FUNC_CLK_OBS2_EN |
				  AR724X_GPIO_FUNC_CLK_OBS3_EN |
				  AR724X_GPIO_FUNC_CLK_OBS4_EN |
				  AR724X_GPIO_FUNC_CLK_OBS5_EN |
				  AR724X_GPIO_FUNC_GE0_MII_CLK_EN |
				  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);

	wnr_get_wmac(wlan_mac_addr, WNR2000V3_MAC0_OFFSET,
		     WNR2000V3_MAC1_OFFSET, WNR2000V3_WMAC_OFFSET);

	wnr_common_setup(wlan_mac_addr);

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

	/*
	 * This device has no buttons on AR7241 GPIO and no extra LEDs
	 * connected to AR9285 so setup is simpler than for WNR2000v3.
	 */
	ap9x_pci_setup_wmac_led_pin(0, WNR612V2_GPIO_WMAC_LED_WLAN_GREEN);
	ap9x_pci_setup_wmac_led_name(0, wnr612v2_wmac_led_name);

	ap9x_pci_setup_wmac_leds(0, NULL, 0);

	ap9x_pci_setup_wmac_btns(0, wnr612v2_wmac_keys_gpio,
				 ARRAY_SIZE(wnr612v2_wmac_keys_gpio),
				 WNR2000V3_KEYS_POLL_INTERVAL);
}
示例#5
0
static void __init wnr1000v2_setup(void)
{
	u8 wlan_mac_addr[6];

	/*
	 * Disable JTAG and CLKs. Allow OS to control all link LEDs.
	 * Note: U-Boot for WNR1000v2 sets undocumented bit 15 but
	 * we leave it for now.
	 */
	ath79_gpio_function_setup(AR724X_GPIO_FUNC_JTAG_DISABLE |
				  AR724X_GPIO_FUNC_UART_EN,
				  AR724X_GPIO_FUNC_CLK_OBS1_EN |
				  AR724X_GPIO_FUNC_CLK_OBS2_EN |
				  AR724X_GPIO_FUNC_CLK_OBS3_EN |
				  AR724X_GPIO_FUNC_CLK_OBS4_EN |
				  AR724X_GPIO_FUNC_CLK_OBS5_EN |
				  AR724X_GPIO_FUNC_GE0_MII_CLK_EN |
				  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);

	wnr_get_wmac(wlan_mac_addr, WNR2000V3_MAC0_OFFSET,
		     WNR2000V3_MAC1_OFFSET, WNR2000V3_WMAC_OFFSET);

	wnr_common_setup(wlan_mac_addr);

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

	ap9x_pci_setup_wmac_led_pin(0, WNR1000V2_GPIO_WMAC_LED_WLAN_BLUE);
	ap9x_pci_setup_wmac_led_name(0, wnr2000v3_wmac_led_name);

	ap9x_pci_setup_wmac_leds(0, wnr1000v2_wmac_leds_gpio,
				 ARRAY_SIZE(wnr1000v2_wmac_leds_gpio));

	/* All 3 buttons are connected to wireless chip */
	ap9x_pci_setup_wmac_btns(0, wnr1000v2_wmac_keys_gpio,
				 ARRAY_SIZE(wnr1000v2_wmac_keys_gpio),
				 WNR2000V3_KEYS_POLL_INTERVAL);
}
示例#6
0
static void __init wpn824n_setup(void)
{
	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 |
				  AR724X_GPIO_FUNC_CLK_OBS3_EN);

	wnr_common_setup(NULL);

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

	ap9x_pci_setup_wmac_leds(0, wpn824n_wmac_leds_gpio,
				 ARRAY_SIZE(wpn824n_wmac_leds_gpio));
	ap9x_pci_setup_wmac_btns(0, wpn824n_wmac_keys_gpio,
				 ARRAY_SIZE(wpn824n_wmac_keys_gpio),
				 WNR2000V3_KEYS_POLL_INTERVAL);
}
示例#7
0
static void __init wzrhpg300nh2_setup(void)
{

	u8 *eeprom = (u8 *)   KSEG1ADDR(0x1f051000);
	u8 *mac0   = eeprom + WZRHPG300NH2_MAC_OFFSET;
	/* There is an eth1 but it is not connected to the switch */

	ath79_register_m25p80_multi(&wzrhpg300nh2_flash_data);

	ath79_init_mac(ath79_eth0_data.mac_addr, mac0, 0);
	ath79_register_mdio(0, ~(BIT(0)));

	ath79_init_mac(ath79_eth0_data.mac_addr, mac0, 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);

	/* gpio13 is usb power.  Turn it on. */
	gpio_request_one(13, GPIOF_OUT_INIT_HIGH | GPIOF_EXPORT_DIR_FIXED,
			 "USB power");
	ath79_register_usb();

	ath79_register_leds_gpio(-1, ARRAY_SIZE(wzrhpg300nh2_leds_gpio),
				 wzrhpg300nh2_leds_gpio);
	ath79_register_gpio_keys_polled(-1, WZRHPG300NH2_KEYS_POLL_INTERVAL,
					ARRAY_SIZE(wzrhpg300nh2_gpio_keys),
					wzrhpg300nh2_gpio_keys);
	ap9x_pci_setup_wmac_led_pin(0, 5);
	ap9x_pci_setup_wmac_leds(0, wzrhpg300nh2_wmac_leds_gpio,
				ARRAY_SIZE(wzrhpg300nh2_wmac_leds_gpio));

	ap91_pci_init(eeprom, mac0);
}