* [PATCH 3/4] alchemy: pass PHY informations to au1000_eth
@ 2009-07-28 21:00 Florian Fainelli
0 siblings, 0 replies; only message in thread
From: Florian Fainelli @ 2009-07-28 21:00 UTC (permalink / raw)
To: Ralf Baechle; +Cc: linux-mips, Manuel Lauss
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@openwrt.org>
---
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 */
+
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2009-07-28 21:01 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-07-28 21:00 [PATCH 3/4] alchemy: pass PHY informations to au1000_eth Florian Fainelli
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).