From 02460d08930656b3a50381cfb119864efcd4eef9 Mon Sep 17 00:00:00 2001 From: Sonic Zhang Date: Fri, 11 Jun 2010 10:44:22 +0000 Subject: netdev: bfin_mac: push settings to platform resources Move all the pin settings out of the Kconfig and into the platform resources (MII vs RMII). This clean up also lets us push out the phy settings so that board porters may control the layout. Signed-off-by: Sonic Zhang Acked-by: David S. Miller Signed-off-by: Mike Frysinger --- arch/blackfin/mach-bf518/boards/ezbrd.c | 44 ++++++++++++++++++++++++++++- arch/blackfin/mach-bf518/boards/tcm-bf518.c | 24 +++++++++++++++- 2 files changed, 66 insertions(+), 2 deletions(-) (limited to 'arch/blackfin/mach-bf518') diff --git a/arch/blackfin/mach-bf518/boards/ezbrd.c b/arch/blackfin/mach-bf518/boards/ezbrd.c index f95e6096719b..b894c8abe7ec 100644 --- a/arch/blackfin/mach-bf518/boards/ezbrd.c +++ b/arch/blackfin/mach-bf518/boards/ezbrd.c @@ -87,13 +87,55 @@ static struct platform_device rtc_device = { #endif #if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE) +#include +static const unsigned short bfin_mac_peripherals[] = { + P_MII0_ETxD0, + P_MII0_ETxD1, + P_MII0_ETxEN, + P_MII0_ERxD0, + P_MII0_ERxD1, + P_MII0_TxCLK, + P_MII0_PHYINT, + P_MII0_CRS, + P_MII0_MDC, + P_MII0_MDIO, + 0 +}; + +static struct bfin_phydev_platform_data bfin_phydev_data[] = { + { + .addr = 1, + .irq = IRQ_MAC_PHYINT, + }, + { + .addr = 2, + .irq = IRQ_MAC_PHYINT, + }, + { + .addr = 3, + .irq = IRQ_MAC_PHYINT, + }, +}; + +static struct bfin_mii_bus_platform_data bfin_mii_bus_data = { + .phydev_number = 3, + .phydev_data = bfin_phydev_data, + .phy_mode = PHY_INTERFACE_MODE_MII, + .mac_peripherals = bfin_mac_peripherals, +}; + static struct platform_device bfin_mii_bus = { .name = "bfin_mii_bus", + .dev = { + .platform_data = &bfin_mii_bus_data, + } }; static struct platform_device bfin_mac_device = { .name = "bfin_mac", - .dev.platform_data = &bfin_mii_bus, + .dev = { + .platform_data = &bfin_mii_bus, + } }; #if defined(CONFIG_NET_DSA_KSZ8893M) || defined(CONFIG_NET_DSA_KSZ8893M_MODULE) diff --git a/arch/blackfin/mach-bf518/boards/tcm-bf518.c b/arch/blackfin/mach-bf518/boards/tcm-bf518.c index bead810a6546..e6ce1d7c523a 100644 --- a/arch/blackfin/mach-bf518/boards/tcm-bf518.c +++ b/arch/blackfin/mach-bf518/boards/tcm-bf518.c @@ -81,13 +81,35 @@ static struct platform_device rtc_device = { #endif #if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE) +#include +static const unsigned short bfin_mac_peripherals[] = P_MII0; + +static struct bfin_phydev_platform_data bfin_phydev_data[] = { + { + .addr = 1, + .irq = IRQ_MAC_PHYINT, + }, +}; + +static struct bfin_mii_bus_platform_data bfin_mii_bus_data = { + .phydev_number = 1, + .phydev_data = bfin_phydev_data, + .phy_mode = PHY_INTERFACE_MODE_MII, + .mac_peripherals = bfin_mac_peripherals, +}; + static struct platform_device bfin_mii_bus = { .name = "bfin_mii_bus", + .dev = { + .platform_data = &bfin_mii_bus_data, + } }; static struct platform_device bfin_mac_device = { .name = "bfin_mac", - .dev.platform_data = &bfin_mii_bus, + .dev = { + .platform_data = &bfin_mii_bus, + } }; #endif -- cgit