This patch completes the au1000_eth platform device conversion by passing PHY informations to the au1000_eth driver. In order not to break boards, we maintain the Bosporus specific configuration. Tested on Meshcube. Signed-off-by: Florian Fainelli <florian@xxxxxxxxxxx> --- diff --git a/arch/mips/alchemy/common/platform.c b/arch/mips/alchemy/common/platform.c index acc1ae2..63686ab 100644 --- a/arch/mips/alchemy/common/platform.c +++ b/arch/mips/alchemy/common/platform.c @@ -19,6 +19,7 @@ #include <asm/mach-au1x00/au1xxx.h> #include <asm/mach-au1x00/au1xxx_dbdma.h> #include <asm/mach-au1x00/au1100_mmc.h> +#include <asm/mach-au1x00/au1xxx_eth.h> #define PORT(_base, _irq) \ { \ @@ -370,14 +371,20 @@ static struct resource au1xxx_eth1_resources[] = { #endif }; +static struct au1000_eth_platform_data au1xxx_eth0_platform_data = { + .phy1_search_mac0 = 1, +}; + static struct platform_device au1xxx_eth0_device = { .name = "au1000-eth", .id = 0, .num_resources = ARRAY_SIZE(au1xxx_eth0_resources), .resource = au1xxx_eth0_resources, + .dev.platform_data = &au1xxx_eth0_platform_data, }; #ifndef CONFIG_SOC_AU1100 +/* We do not pass a platform_data structure to MAC1 to assume defaults */ static struct platform_device au1xxx_eth1_device = { .name = "au1000-eth", .id = 1, @@ -418,6 +425,20 @@ static int __init au1xxx_platform_init(void) for (i = 0; au1x00_uart_data[i].flags; i++) au1x00_uart_data[i].uartclk = uartclk; +#ifdef CONFIG_MIPS_BOSPORUS + /* + * Micrel/Kendin 5 port switch attached to MAC0, + * MAC0 is associated with PHY address 5 (== WAN port) + * MAC1 is not associated with any PHY, since it's connected directly + * to the switch. + * no interrupts are used + */ + au1xxx_eth0_platform_data.phy1_search_mac0 = 0; + au1xxx_eth0_platform_data.phy_static_config = 1; + au1xxx_eth0_platform_data.phy_addr = 5; + au1xxx_eth0_platform_data.phy_busid = 0; +#endif + /* Register second MAC if enabled in pinfunc */ #ifndef CONFIG_SOC_AU1100 ni = (int)((au_readl(SYS_PINFUNC) & (u32)(SYS_PF_NI2)) >> 4); diff --git a/arch/mips/include/asm/mach-au1x00/au1xxx_eth.h b/arch/mips/include/asm/mach-au1x00/au1xxx_eth.h new file mode 100644 index 0000000..9937621 --- /dev/null +++ b/arch/mips/include/asm/mach-au1x00/au1xxx_eth.h @@ -0,0 +1,15 @@ +#ifndef __AU1X00_ETH_PDATA_H +#define __AU1X00_ETH_PDATA_H + +/* Platform specific PHY configuration passed to the MAC driver */ +struct au1000_eth_platform_data { + int phy_static_config; + int phy_search_highest_addr; + int phy1_search_mac0; + int phy_addr; + int phy_busid; + int phy_irq; +}; + +#endif /* __AU1X00_ETH_PDATA_H */ +