aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips
diff options
context:
space:
mode:
authorJohn Crispin <blogic@openwrt.org>2011-05-05 18:10:01 -0400
committerRalf Baechle <ralf@linux-mips.org>2011-05-19 04:55:43 -0400
commit504d4721ee8e432af4b5f196a08af38bc4dac5fe (patch)
tree964df243c11ce5d6ad6b839e1a205431b008c990 /arch/mips
parentdfec1a827d2bdc35d0990afd100f79a685ec0985 (diff)
MIPS: Lantiq: Add ethernet driver
This patch adds the driver for the ETOP Packet Processing Engine (PPE32) found inside the XWAY family of Lantiq MIPS SoCs. This driver makes 100MBit ethernet work. Support for all 8 dma channels, gbit and the embedded switch found on the ar9/vr9 still needs to be implemented. Signed-off-by: John Crispin <blogic@openwrt.org> Signed-off-by: Ralph Hempel <ralph.hempel@lantiq.com> Cc: linux-mips@linux-mips.org Cc: netdev@vger.kernel.org Patchwork: https://patchwork.linux-mips.org/patch/2357/ Acked-by: David S. Miller <davem@davemloft.net> Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips')
-rw-r--r--arch/mips/include/asm/mach-lantiq/lantiq_platform.h7
-rw-r--r--arch/mips/include/asm/mach-lantiq/xway/lantiq_soc.h4
-rw-r--r--arch/mips/lantiq/xway/devices.c23
-rw-r--r--arch/mips/lantiq/xway/devices.h1
4 files changed, 33 insertions, 2 deletions
diff --git a/arch/mips/include/asm/mach-lantiq/lantiq_platform.h b/arch/mips/include/asm/mach-lantiq/lantiq_platform.h
index 1f1dba6d073..a305f1d0259 100644
--- a/arch/mips/include/asm/mach-lantiq/lantiq_platform.h
+++ b/arch/mips/include/asm/mach-lantiq/lantiq_platform.h
@@ -10,6 +10,7 @@
10#define _LANTIQ_PLATFORM_H__ 10#define _LANTIQ_PLATFORM_H__
11 11
12#include <linux/mtd/partitions.h> 12#include <linux/mtd/partitions.h>
13#include <linux/socket.h>
13 14
14/* struct used to pass info to the pci core */ 15/* struct used to pass info to the pci core */
15enum { 16enum {
@@ -43,4 +44,10 @@ struct ltq_pci_data {
43 int irq[16]; 44 int irq[16];
44}; 45};
45 46
47/* struct used to pass info to network drivers */
48struct ltq_eth_data {
49 struct sockaddr mac;
50 int mii_mode;
51};
52
46#endif 53#endif
diff --git a/arch/mips/include/asm/mach-lantiq/xway/lantiq_soc.h b/arch/mips/include/asm/mach-lantiq/xway/lantiq_soc.h
index 4827afbe373..8a3c6be669d 100644
--- a/arch/mips/include/asm/mach-lantiq/xway/lantiq_soc.h
+++ b/arch/mips/include/asm/mach-lantiq/xway/lantiq_soc.h
@@ -82,8 +82,8 @@
82#define PMU_SWITCH 0x10000000 82#define PMU_SWITCH 0x10000000
83 83
84/* ETOP - ethernet */ 84/* ETOP - ethernet */
85#define LTQ_PPE32_BASE_ADDR 0xBE180000 85#define LTQ_ETOP_BASE_ADDR 0x1E180000
86#define LTQ_PPE32_SIZE 0x40000 86#define LTQ_ETOP_SIZE 0x40000
87 87
88/* DMA */ 88/* DMA */
89#define LTQ_DMA_BASE_ADDR 0x1E104100 89#define LTQ_DMA_BASE_ADDR 0x1E104100
diff --git a/arch/mips/lantiq/xway/devices.c b/arch/mips/lantiq/xway/devices.c
index a71b3b532a0..e09e789dfc2 100644
--- a/arch/mips/lantiq/xway/devices.c
+++ b/arch/mips/lantiq/xway/devices.c
@@ -96,3 +96,26 @@ void __init ltq_register_ase_asc(void)
96 platform_device_register_simple("ltq_asc", 0, 96 platform_device_register_simple("ltq_asc", 0,
97 ltq_ase_asc_resources, ARRAY_SIZE(ltq_ase_asc_resources)); 97 ltq_ase_asc_resources, ARRAY_SIZE(ltq_ase_asc_resources));
98} 98}
99
100/* ethernet */
101static struct resource ltq_etop_resources = {
102 .name = "etop",
103 .start = LTQ_ETOP_BASE_ADDR,
104 .end = LTQ_ETOP_BASE_ADDR + LTQ_ETOP_SIZE - 1,
105 .flags = IORESOURCE_MEM,
106};
107
108static struct platform_device ltq_etop = {
109 .name = "ltq_etop",
110 .resource = &ltq_etop_resources,
111 .num_resources = 1,
112};
113
114void __init
115ltq_register_etop(struct ltq_eth_data *eth)
116{
117 if (eth) {
118 ltq_etop.dev.platform_data = eth;
119 platform_device_register(&ltq_etop);
120 }
121}
diff --git a/arch/mips/lantiq/xway/devices.h b/arch/mips/lantiq/xway/devices.h
index d5730842340..e90493471bc 100644
--- a/arch/mips/lantiq/xway/devices.h
+++ b/arch/mips/lantiq/xway/devices.h
@@ -15,5 +15,6 @@
15extern void ltq_register_gpio(void); 15extern void ltq_register_gpio(void);
16extern void ltq_register_gpio_stp(void); 16extern void ltq_register_gpio_stp(void);
17extern void ltq_register_ase_asc(void); 17extern void ltq_register_ase_asc(void);
18extern void ltq_register_etop(struct ltq_eth_data *eth);
18 19
19#endif 20#endif