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)); }
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)); }
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); ath79_register_usb(); gpio_request(2, "usb"); gpio_direction_output(2, 1); 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); }
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); }
static void __init qihoo_c301_setup(void) { ath79_register_m25p80_multi(&flash); ath79_gpio_function_enable(AR934X_GPIO_FUNC_JTAG_DISABLE); ath79_gpio_output_select(QIHOO_C301_GPIO_LED_WAN, AR934X_GPIO_OUT_LED_LINK4); ath79_gpio_output_select(QIHOO_C301_GPIO_LED_LAN1, AR934X_GPIO_OUT_LED_LINK1); ath79_gpio_output_select(QIHOO_C301_GPIO_LED_LAN2, AR934X_GPIO_OUT_LED_LINK2); ath79_gpio_output_select(QIHOO_C301_GPIO_SPI_CS1, AR934X_GPIO_OUT_SPI_CS1); gpio_request_one(QIHOO_C301_GPIO_ETH_LEN_EN, GPIOF_OUT_INIT_LOW | GPIOF_EXPORT_DIR_FIXED, "Ethernet LED enable"); ath79_register_leds_gpio(-1, ARRAY_SIZE(qihoo_c301_leds_gpio), qihoo_c301_leds_gpio); ath79_register_gpio_keys_polled(-1, QIHOO_C301_KEYS_POLL_INTERVAL, ARRAY_SIZE(qihoo_c301_gpio_keys), qihoo_c301_gpio_keys); ath79_wmac_set_ext_lna_gpio(0, QIHOO_C301_GPIO_EXTERNAL_LNA0); ath79_wmac_set_ext_lna_gpio(1, QIHOO_C301_GPIO_EXTERNAL_LNA1); qihoo_c301_get_mac("wlan24mac=", wlan24mac); ath79_register_pci(); ath79_setup_ar934x_eth_cfg(AR934X_ETH_CFG_SW_ONLY_MODE | AR934X_ETH_CFG_SW_PHY_SWAP); ath79_register_mdio(1, 0x0); /* LAN */ qihoo_c301_get_mac("lanmac=", ath79_eth1_data.mac_addr); /* GMAC1 is connected to the internal switch */ ath79_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_GMII; ath79_register_eth(1); /* WAN */ qihoo_c301_get_mac("wanmac=", ath79_eth0_data.mac_addr); /* GMAC0 is connected to the PHY4 of the internal switch */ ath79_switch_data.phy4_mii_en = 1; ath79_switch_data.phy_poll_mask = BIT(0); ath79_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_MII; ath79_eth0_data.phy_mask = BIT(0); ath79_eth0_data.mii_bus_dev = &ath79_mdio1_device.dev; ath79_register_eth(0); gpio_request_one(QIHOO_C301_GPIO_USB_POWER, GPIOF_OUT_INIT_HIGH | GPIOF_EXPORT_DIR_FIXED, "USB power"); ath79_register_usb(); qihoo_c301_board = 1; }