aboutsummaryrefslogtreecommitdiffstats
path: root/arch/blackfin/mach-bf518
diff options
context:
space:
mode:
authorSonic Zhang <sonic.zhang@analog.com>2010-06-11 06:44:22 -0400
committerMike Frysinger <vapier@gentoo.org>2010-10-25 04:54:25 -0400
commit02460d08930656b3a50381cfb119864efcd4eef9 (patch)
treeaf76f49fbf61b252f9aca181d2911526a7ecc2c6 /arch/blackfin/mach-bf518
parent229aebb873e29726b91e076161649cf45154b0bf (diff)
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 <sonic.zhang@analog.com> Acked-by: David S. Miller <davem@davemloft.net> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Diffstat (limited to 'arch/blackfin/mach-bf518')
-rw-r--r--arch/blackfin/mach-bf518/boards/ezbrd.c44
-rw-r--r--arch/blackfin/mach-bf518/boards/tcm-bf518.c24
2 files changed, 66 insertions, 2 deletions
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 = {
87#endif 87#endif
88 88
89#if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE) 89#if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE)
90#include <linux/bfin_mac.h>
91static const unsigned short bfin_mac_peripherals[] = {
92 P_MII0_ETxD0,
93 P_MII0_ETxD1,
94 P_MII0_ETxEN,
95 P_MII0_ERxD0,
96 P_MII0_ERxD1,
97 P_MII0_TxCLK,
98 P_MII0_PHYINT,
99 P_MII0_CRS,
100 P_MII0_MDC,
101 P_MII0_MDIO,
102 0
103};
104
105static struct bfin_phydev_platform_data bfin_phydev_data[] = {
106 {
107 .addr = 1,
108 .irq = IRQ_MAC_PHYINT,
109 },
110 {
111 .addr = 2,
112 .irq = IRQ_MAC_PHYINT,
113 },
114 {
115 .addr = 3,
116 .irq = IRQ_MAC_PHYINT,
117 },
118};
119
120static struct bfin_mii_bus_platform_data bfin_mii_bus_data = {
121 .phydev_number = 3,
122 .phydev_data = bfin_phydev_data,
123 .phy_mode = PHY_INTERFACE_MODE_MII,
124 .mac_peripherals = bfin_mac_peripherals,
125};
126
90static struct platform_device bfin_mii_bus = { 127static struct platform_device bfin_mii_bus = {
91 .name = "bfin_mii_bus", 128 .name = "bfin_mii_bus",
129 .dev = {
130 .platform_data = &bfin_mii_bus_data,
131 }
92}; 132};
93 133
94static struct platform_device bfin_mac_device = { 134static struct platform_device bfin_mac_device = {
95 .name = "bfin_mac", 135 .name = "bfin_mac",
96 .dev.platform_data = &bfin_mii_bus, 136 .dev = {
137 .platform_data = &bfin_mii_bus,
138 }
97}; 139};
98 140
99#if defined(CONFIG_NET_DSA_KSZ8893M) || defined(CONFIG_NET_DSA_KSZ8893M_MODULE) 141#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 = {
81#endif 81#endif
82 82
83#if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE) 83#if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE)
84#include <linux/bfin_mac.h>
85static const unsigned short bfin_mac_peripherals[] = P_MII0;
86
87static struct bfin_phydev_platform_data bfin_phydev_data[] = {
88 {
89 .addr = 1,
90 .irq = IRQ_MAC_PHYINT,
91 },
92};
93
94static struct bfin_mii_bus_platform_data bfin_mii_bus_data = {
95 .phydev_number = 1,
96 .phydev_data = bfin_phydev_data,
97 .phy_mode = PHY_INTERFACE_MODE_MII,
98 .mac_peripherals = bfin_mac_peripherals,
99};
100
84static struct platform_device bfin_mii_bus = { 101static struct platform_device bfin_mii_bus = {
85 .name = "bfin_mii_bus", 102 .name = "bfin_mii_bus",
103 .dev = {
104 .platform_data = &bfin_mii_bus_data,
105 }
86}; 106};
87 107
88static struct platform_device bfin_mac_device = { 108static struct platform_device bfin_mac_device = {
89 .name = "bfin_mac", 109 .name = "bfin_mac",
90 .dev.platform_data = &bfin_mii_bus, 110 .dev = {
111 .platform_data = &bfin_mii_bus,
112 }
91}; 113};
92#endif 114#endif
93 115