ar71xx: add an id argument to ar71xx_add_device_mdio

SVN-Revision: 28982
This commit is contained in:
Gabor Juhos 2011-11-12 12:09:48 +00:00
parent b07b687aec
commit 9daa2149fd
39 changed files with 52 additions and 47 deletions

View file

@ -169,8 +169,13 @@ static void ar71xx_set_pll(u32 cfg_reg, u32 pll_reg, u32 pll_val, u32 shift)
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;

View file

@ -41,7 +41,7 @@ extern struct platform_device ar71xx_eth1_device;
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;

View file

@ -134,7 +134,7 @@ static void __init all0258n_setup(void)
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);

View file

@ -200,7 +200,7 @@ static void __init ap121_common_setup(void)
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);

View file

@ -110,7 +110,7 @@ static void __init ap81_setup(void)
{
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;

View file

@ -197,7 +197,7 @@ static void __init ap83_generic_setup(void)
{
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;

View file

@ -142,7 +142,7 @@ static void __init ap96_setup(void)
{
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;

View file

@ -78,7 +78,7 @@ static struct gpio_keys_button aw_nr580_gpio_keys[] __initdata = {
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;

View file

@ -148,7 +148,7 @@ static void __init dir_600_a1_setup(void)
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);

View file

@ -148,7 +148,7 @@ static void __init dir_615c1_setup(void)
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;

View file

@ -169,7 +169,7 @@ static void __init dir825b1_setup(void)
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;

View file

@ -157,7 +157,7 @@ static void __init eap7660d_setup(void)
{
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);

View file

@ -73,7 +73,7 @@ static void __init ja76pf_init(void)
{
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;

View file

@ -53,7 +53,7 @@ static void __init jwap003_init(void)
{
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;

View file

@ -134,7 +134,7 @@ static void __init mzk_w04nu_setup(void)
{
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;

View file

@ -129,7 +129,7 @@ static void __init mzk_w300nh_setup(void)
{
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;

View file

@ -93,7 +93,7 @@ static void __init om2p_setup(void)
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);

View file

@ -50,7 +50,7 @@ static void __init pb42_init(void)
{
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;

View file

@ -174,7 +174,7 @@ static struct platform_device pb44_spi_device = {
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;

View file

@ -86,7 +86,7 @@ static void __init pb92_init(void)
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;

View file

@ -218,7 +218,7 @@ static void __init rb411_setup(void)
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;
@ -251,7 +251,7 @@ static void __init rb433_setup(void)
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;
@ -286,7 +286,7 @@ MIPS_MACHINE(AR71XX_MACH_RB_433U, "433U", "MikroTik RouterBOARD 433UAH",
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) ?
@ -324,7 +324,7 @@ static void __init rb493_setup(void)
{
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;
@ -376,7 +376,7 @@ static void __init rb493g_setup(void)
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;

View file

@ -132,7 +132,7 @@ static void __init rb750_setup(void)
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);

View file

@ -124,7 +124,7 @@ static void __init tew_632brp_setup(void)
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;

View file

@ -138,7 +138,7 @@ static void __init tl_mr3x20_setup(void)
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);

View file

@ -110,7 +110,7 @@ static void __init tl_wa901nd_v2_setup(void)
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;

View file

@ -111,7 +111,7 @@ static void __init tl_wa901nd_setup(void)
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);

View file

@ -111,7 +111,7 @@ static void __init tl_wr703n_setup(void)
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);

View file

@ -145,7 +145,7 @@ static void __init tl_wr741ndv4_setup(void)
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);

View file

@ -123,7 +123,7 @@ static void __init tl_wr741nd_setup(void)
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);

View file

@ -118,7 +118,7 @@ static void __init tl_wr841n_v1_setup(void)
{
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;

View file

@ -123,7 +123,7 @@ static void __init tl_wr941nd_setup(void)
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;

View file

@ -152,7 +152,7 @@ static void __init ubnt_rs_setup(void)
{
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;
@ -182,7 +182,7 @@ static void __init ubnt_rspro_setup(void)
{
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);
@ -220,7 +220,7 @@ static void __init ubnt_lssr71_setup(void)
{
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;
@ -245,7 +245,7 @@ static void __init ubnt_m_setup(void)
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);
@ -313,7 +313,7 @@ static void __init ubnt_unifi_setup(void)
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;

View file

@ -159,7 +159,7 @@ static void __init whrhpg300n_setup(void)
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);

View file

@ -119,7 +119,7 @@ static void __init wnr2000_setup(void)
{
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;

View file

@ -77,7 +77,7 @@ static void __init wp543_setup(void)
{
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;

View file

@ -127,7 +127,7 @@ static void __init wrt160nl_setup(void)
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;

View file

@ -134,7 +134,7 @@ static void __init wrt400n_setup(void)
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;

View file

@ -194,7 +194,7 @@ static void __init wzrhpag300h_setup(void)
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;

View file

@ -184,7 +184,7 @@ static void __init zcn_1523h_generic_setup(void)
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);
}