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); }
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 ap81_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_usb(); ar71xx_add_device_spi(NULL, ap81_spi_info, ARRAY_SIZE(ap81_spi_info)); ar71xx_add_device_leds_gpio(-1, ARRAY_SIZE(ap81_leds_gpio), ap81_leds_gpio); ar71xx_add_device_gpio_buttons(-1, AP81_BUTTONS_POLL_INTERVAL, ARRAY_SIZE(ap81_gpio_buttons), ap81_gpio_buttons); ar91xx_add_device_wmac(); }
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); }
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(); }
static void __init ap81_setup(void) { u8 *eeprom = (u8 *) KSEG1ADDR(0x1fff1000); ar71xx_add_device_mdio(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_usb(); ar71xx_add_device_m25p80(&ap81_flash_data); ar71xx_add_device_leds_gpio(-1, ARRAY_SIZE(ap81_leds_gpio), ap81_leds_gpio); ar71xx_register_gpio_keys_polled(-1, AP81_KEYS_POLL_INTERVAL, ARRAY_SIZE(ap81_gpio_keys), ap81_gpio_keys); ar9xxx_add_device_wmac(eeprom, NULL); }
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); }
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); }
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); }
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); }
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); }
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); }
static void __init wrt160nl_setup(void) { /* TODO: ethernet, LEDs, buttons */ ar71xx_add_device_spi(NULL, wrt160nl_spi_info, ARRAY_SIZE(wrt160nl_spi_info)); ar71xx_add_device_usb(); ar91xx_add_device_wmac(); }
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); }
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); }
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_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); }
static void __init db120_setup(void) { u8 *art = (u8 *) KSEG1ADDR(0x1fff0000); 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); ar9xxx_add_device_wmac(art + DB120_CALDATA_OFFSET, art + DB120_WMAC_MAC_OFFSET); db120_pci_init(); }
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); }
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); }
static void __init ubnt_rs_setup(void) { ubnt_generic_setup(); ar71xx_add_device_mdio(~(UBNT_RS_WAN_PHYMASK | UBNT_RS_LAN_PHYMASK)); ar71xx_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_MII; ar71xx_eth0_data.phy_mask = UBNT_RS_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_usb(); ar71xx_add_device_leds_gpio(-1, ARRAY_SIZE(ubnt_rs_leds_gpio), ubnt_rs_leds_gpio); }
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); }
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); }
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); }
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); }
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_add_device_mdio(0, 0x0); ar71xx_add_device_eth(0); ar9xxx_add_device_wmac(ee, mac); }
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); }
static void __init wp543_setup(void) { ar71xx_add_device_m25p80(NULL); ar71xx_add_device_mdio(0, 0xfffffff7); 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 = 0x08; 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_register_gpio_keys_polled(-1, WP543_KEYS_POLL_INTERVAL, ARRAY_SIZE(wp543_gpio_keys), wp543_gpio_keys); }
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)); }
static void __init ubnt_rocket_m_setup(void) { ubnt_m_setup(); ar71xx_add_device_usb(); }