iounmap(base);
}
-void __init ar71xx_add_device_mdio(u32 phy_mask)
+void __init ar71xx_add_device_mdio(unsigned int id, u32 phy_mask)
{
+ if (id > 0) {
+ printk(KERN_ERR "ar71xx: invalid MDIO id %u\n", id);
+ return;
+ }
+
switch (ar71xx_soc) {
case AR71XX_SOC_AR7240:
ar71xx_mdio_data.is_ar7240 = 1;
void ar71xx_add_device_eth(unsigned int id) __init;
extern struct platform_device ar71xx_mdio_device;
-void ar71xx_add_device_mdio(u32 phy_mask) __init;
+void ar71xx_add_device_mdio(unsigned int id, u32 phy_mask) __init;
void ar71xx_add_device_uart(void) __init;
ar71xx_eth1_data.phy_mask = ALL0258N_SEC_PHYMASK;
ar71xx_eth1_data.has_ar7240_switch = 1;
- ar71xx_add_device_mdio(0x0);
+ ar71xx_add_device_mdio(0, 0x0);
ar71xx_add_device_eth(0);
ar71xx_add_device_eth(1);
ar71xx_eth1_data.duplex = DUPLEX_FULL;
ar71xx_eth1_data.has_ar7240_switch = 1;
- ar71xx_add_device_mdio(0x0);
+ ar71xx_add_device_mdio(0, 0x0);
ar71xx_add_device_eth(1);
ar71xx_add_device_eth(0);
{
u8 *eeprom = (u8 *) KSEG1ADDR(0x1fff1000);
- ar71xx_add_device_mdio(0x0);
+ 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;
{
u8 *eeprom = (u8 *) KSEG1ADDR(0x1fff1000);
- ar71xx_add_device_mdio(0xfffffffe);
+ ar71xx_add_device_mdio(0, 0xfffffffe);
ar71xx_init_mac(ar71xx_eth0_data.mac_addr, eeprom, 0);
ar71xx_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_RGMII;
{
u8 *art = (u8 *) KSEG1ADDR(0x1fff0000);
- ar71xx_add_device_mdio(~(AP96_WAN_PHYMASK | AP96_LAN_PHYMASK));
+ ar71xx_add_device_mdio(0, ~(AP96_WAN_PHYMASK | AP96_LAN_PHYMASK));
ar71xx_init_mac(ar71xx_eth0_data.mac_addr, art, 0);
ar71xx_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_RGMII;
static void __init aw_nr580_setup(void)
{
- ar71xx_add_device_mdio(0x0);
+ ar71xx_add_device_mdio(0, 0x0);
ar71xx_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_MII;
ar71xx_eth0_data.speed = SPEED_100;
ar71xx_eth1_data.speed = SPEED_1000;
ar71xx_eth1_data.duplex = DUPLEX_FULL;
- ar71xx_add_device_mdio(0x0);
+ ar71xx_add_device_mdio(0, 0x0);
ar71xx_add_device_eth(1);
ar71xx_add_device_eth(0);
wlan_mac = mac;
}
- ar71xx_add_device_mdio(DIR_615C1_MDIO_MASK);
+ 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;
dir825b1_read_ascii_mac(mac1, DIR825B1_MAC_LOCATION_0);
dir825b1_read_ascii_mac(mac2, DIR825B1_MAC_LOCATION_1);
- ar71xx_add_device_mdio(0x0);
+ ar71xx_add_device_mdio(0, 0x0);
ar71xx_init_mac(ar71xx_eth0_data.mac_addr, mac1, 2);
ar71xx_eth0_data.mii_bus_dev = &dir825b1_rtl8366s_device.dev;
{
u8 *boardconfig = (u8 *) KSEG1ADDR(EAP7660D_BOARDCONFIG);
- ar71xx_add_device_mdio(~EAP7660D_PHYMASK);
+ ar71xx_add_device_mdio(0, ~EAP7660D_PHYMASK);
ar71xx_init_mac(ar71xx_eth0_data.mac_addr,
boardconfig + EAP7660D_GBIC_MAC_OFFSET, 0);
{
ar71xx_add_device_m25p80(NULL);
- ar71xx_add_device_mdio(~JA76PF_MDIO_PHYMASK);
+ ar71xx_add_device_mdio(0, ~JA76PF_MDIO_PHYMASK);
ar71xx_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_RGMII;
ar71xx_eth0_data.phy_mask = JA76PF_LAN_PHYMASK;
{
ar71xx_add_device_m25p80(NULL);
- ar71xx_add_device_mdio(0x0);
+ ar71xx_add_device_mdio(0, 0x0);
ar71xx_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_RMII;
ar71xx_eth0_data.phy_mask = JWAP003_WAN_PHYMASK;
{
u8 *eeprom = (u8 *) KSEG1ADDR(0x1fff1000);
- ar71xx_add_device_mdio(MZK_W04NU_MDIO_MASK);
+ ar71xx_add_device_mdio(0, MZK_W04NU_MDIO_MASK);
ar71xx_init_mac(ar71xx_eth0_data.mac_addr, eeprom, 0);
ar71xx_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_RMII;
{
u8 *eeprom = (u8 *) KSEG1ADDR(0x1fff1000);
- ar71xx_add_device_mdio(MZK_W300NH_MDIO_MASK);
+ ar71xx_add_device_mdio(0, MZK_W300NH_MDIO_MASK);
ar71xx_init_mac(ar71xx_eth0_data.mac_addr, eeprom, 0);
ar71xx_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_RMII;
ar71xx_add_device_m25p80(&om2p_flash_data);
- ar71xx_add_device_mdio(~OM2P_WAN_PHYMASK);
+ ar71xx_add_device_mdio(0, ~OM2P_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_m25p80(NULL);
- ar71xx_add_device_mdio(~PB42_MDIO_PHYMASK);
+ ar71xx_add_device_mdio(0, ~PB42_MDIO_PHYMASK);
ar71xx_init_mac(ar71xx_eth0_data.mac_addr, ar71xx_mac_base, 0);
ar71xx_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_MII;
static void __init pb44_init(void)
{
- ar71xx_add_device_mdio(~PB44_MDIO_PHYMASK);
+ ar71xx_add_device_mdio(0, ~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_add_device_m25p80(&pb92_flash_data);
- ar71xx_add_device_mdio(~BIT(0));
+ 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;
spi_register_board_info(rb4xx_microsd_info,
ARRAY_SIZE(rb4xx_microsd_info));
- ar71xx_add_device_mdio(0xfffffffc);
+ ar71xx_add_device_mdio(0, 0xfffffffc);
ar71xx_init_mac(ar71xx_eth0_data.mac_addr, ar71xx_mac_base, 0);
ar71xx_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_MII;
spi_register_board_info(rb4xx_microsd_info,
ARRAY_SIZE(rb4xx_microsd_info));
- ar71xx_add_device_mdio(~RB433_MDIO_PHYMASK);
+ ar71xx_add_device_mdio(0, ~RB433_MDIO_PHYMASK);
ar71xx_init_mac(ar71xx_eth0_data.mac_addr, ar71xx_mac_base, 1);
ar71xx_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_MII;
static void __init rb450_generic_setup(int gige)
{
rb4xx_generic_setup();
- ar71xx_add_device_mdio(~RB450_MDIO_PHYMASK);
+ ar71xx_add_device_mdio(0, ~RB450_MDIO_PHYMASK);
ar71xx_init_mac(ar71xx_eth0_data.mac_addr, ar71xx_mac_base, 1);
ar71xx_eth0_data.phy_if_mode = (gige) ?
{
rb4xx_generic_setup();
- ar71xx_add_device_mdio(0x3fffff00);
+ ar71xx_add_device_mdio(0, 0x3fffff00);
ar71xx_init_mac(ar71xx_eth0_data.mac_addr, ar71xx_mac_base, 0);
ar71xx_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_MII;
platform_device_register(&rb4xx_spi_device);
platform_device_register(&rb4xx_nand_device);
- ar71xx_add_device_mdio(~RB493G_MDIO_PHYMASK);
+ ar71xx_add_device_mdio(0, ~RB493G_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_eth1_data.duplex = DUPLEX_FULL;
ar71xx_eth1_data.has_ar7240_switch = 1;
- ar71xx_add_device_mdio(0x0);
+ ar71xx_add_device_mdio(0, 0x0);
ar71xx_add_device_eth(1);
ar71xx_add_device_eth(0);
wlan_mac = mac;
}
- ar71xx_add_device_mdio(TEW_632BRP_MDIO_MASK);
+ ar71xx_add_device_mdio(0, TEW_632BRP_MDIO_MASK);
ar71xx_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_RMII;
ar71xx_eth0_data.phy_mask = TEW_632BRP_LAN_PHYMASK;
ar71xx_eth1_data.speed = SPEED_1000;
ar71xx_eth1_data.duplex = DUPLEX_FULL;
- ar71xx_add_device_mdio(0x0);
+ ar71xx_add_device_mdio(0, 0x0);
ar71xx_add_device_eth(1);
ar71xx_add_device_eth(0);
ar71xx_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_MII;
ar71xx_eth0_data.phy_mask = 0x00001000;
- ar71xx_add_device_mdio(0x0);
+ ar71xx_add_device_mdio(0, 0x0);
ar71xx_eth0_data.reset_bit = RESET_MODULE_GE0_MAC |
RESET_MODULE_GE0_PHY;
ar71xx_eth1_data.duplex = DUPLEX_FULL;
ar71xx_eth1_data.has_ar7240_switch = 1;
- ar71xx_add_device_mdio(0x0);
+ ar71xx_add_device_mdio(0, 0x0);
ar71xx_add_device_eth(1);
ar71xx_add_device_m25p80(&tl_wa901nd_flash_data);
ar71xx_eth0_data.duplex = DUPLEX_FULL;
ar71xx_eth0_data.phy_mask = BIT(4);
- ar71xx_add_device_mdio(0x0);
+ ar71xx_add_device_mdio(0, 0x0);
ar71xx_add_device_eth(0);
ar9xxx_add_device_wmac(ee, mac);
ar71xx_eth1_data.duplex = DUPLEX_FULL;
ar71xx_eth1_data.has_ar7240_switch = 1;
- ar71xx_add_device_mdio(0x0);
+ ar71xx_add_device_mdio(0, 0x0);
ar71xx_add_device_eth(1);
ar71xx_add_device_eth(0);
ar71xx_eth1_data.speed = SPEED_1000;
ar71xx_eth1_data.duplex = DUPLEX_FULL;
- ar71xx_add_device_mdio(0x0);
+ ar71xx_add_device_mdio(0, 0x0);
ar71xx_add_device_eth(1);
ar71xx_add_device_eth(0);
{
u8 *mac = (u8 *) KSEG1ADDR(0x1f01fc00);
- ar71xx_add_device_mdio(0x0);
+ 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;
u8 *mac = (u8 *) KSEG1ADDR(0x1f01fc00);
u8 *eeprom = (u8 *) KSEG1ADDR(0x1fff1000);
- ar71xx_add_device_mdio(0x0);
+ 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;
{
ubnt_generic_setup();
- ar71xx_add_device_mdio(~(UBNT_RS_WAN_PHYMASK | UBNT_RS_LAN_PHYMASK));
+ ar71xx_add_device_mdio(0, ~(UBNT_RS_WAN_PHYMASK | UBNT_RS_LAN_PHYMASK));
ar71xx_init_mac(ar71xx_eth0_data.mac_addr, ar71xx_mac_base, 0);
ar71xx_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_MII;
{
ubnt_generic_setup();
- ar71xx_add_device_mdio(~(UBNT_RSPRO_WAN_PHYMASK |
+ ar71xx_add_device_mdio(0, ~(UBNT_RSPRO_WAN_PHYMASK |
UBNT_RSPRO_LAN_PHYMASK));
ar71xx_init_mac(ar71xx_eth0_data.mac_addr, ar71xx_mac_base, 0);
{
ubnt_generic_setup();
- ar71xx_add_device_mdio(~UBNT_LSSR71_PHY_MASK);
+ ar71xx_add_device_mdio(0, ~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_add_device_m25p80(NULL);
- ar71xx_add_device_mdio(~UBNT_M_WAN_PHYMASK);
+ 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_m25p80(NULL);
- ar71xx_add_device_mdio(~UBNT_M_WAN_PHYMASK);
+ ar71xx_add_device_mdio(0, ~UBNT_M_WAN_PHYMASK);
ar71xx_init_mac(ar71xx_eth0_data.mac_addr, mac, 0);
ar71xx_eth0_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_mdio(0, 0x0);
ar71xx_add_device_eth(1);
ar71xx_add_device_eth(0);
{
u8 *eeprom = (u8 *) KSEG1ADDR(0x1fff1000);
- ar71xx_add_device_mdio(0x0);
+ 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_add_device_m25p80(NULL);
- ar71xx_add_device_mdio(0xfffffff7);
+ 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_init_mac(ar71xx_eth1_data.mac_addr, mac, 1);
}
- ar71xx_add_device_mdio(0x0);
+ ar71xx_add_device_mdio(0, 0x0);
ar71xx_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_RMII;
ar71xx_eth0_data.phy_mask = 0x01;
u8 *art = (u8 *) KSEG1ADDR(0x1fff0000);
u8 *mac = art + WRT400N_MAC_ADDR_OFFSET;
- ar71xx_add_device_mdio(0x0);
+ ar71xx_add_device_mdio(0, 0x0);
ar71xx_init_mac(ar71xx_eth0_data.mac_addr, mac, 1);
ar71xx_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_RMII;
ar71xx_init_mac(ar71xx_eth0_data.mac_addr, mac1, 0);
ar71xx_init_mac(ar71xx_eth1_data.mac_addr, mac2, 1);
- ar71xx_add_device_mdio(~(BIT(0) | BIT(4)));
+ 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_eth1_data.speed = SPEED_1000;
ar71xx_eth1_data.duplex = DUPLEX_FULL;
- ar71xx_add_device_mdio(0x0);
+ ar71xx_add_device_mdio(0, 0x0);
ar71xx_add_device_eth(0);
}