aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-loki
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-loki')
-rw-r--r--arch/arm/mach-loki/common.c109
1 files changed, 10 insertions, 99 deletions
diff --git a/arch/arm/mach-loki/common.c b/arch/arm/mach-loki/common.c
index c07180492bf..5f02664db81 100644
--- a/arch/arm/mach-loki/common.c
+++ b/arch/arm/mach-loki/common.c
@@ -13,7 +13,6 @@
13#include <linux/platform_device.h> 13#include <linux/platform_device.h>
14#include <linux/serial_8250.h> 14#include <linux/serial_8250.h>
15#include <linux/mbus.h> 15#include <linux/mbus.h>
16#include <linux/mv643xx_eth.h>
17#include <linux/dma-mapping.h> 16#include <linux/dma-mapping.h>
18#include <asm/page.h> 17#include <asm/page.h>
19#include <asm/timex.h> 18#include <asm/timex.h>
@@ -45,116 +44,28 @@ void __init loki_map_io(void)
45 44
46 45
47/***************************************************************************** 46/*****************************************************************************
48 * GE0 47 * GE00
49 ****************************************************************************/ 48 ****************************************************************************/
50struct mv643xx_eth_shared_platform_data loki_ge0_shared_data = {
51 .t_clk = LOKI_TCLK,
52 .dram = &loki_mbus_dram_info,
53};
54
55static struct resource loki_ge0_shared_resources[] = {
56 {
57 .name = "ge0 base",
58 .start = GE0_PHYS_BASE + 0x2000,
59 .end = GE0_PHYS_BASE + SZ_16K - 1,
60 .flags = IORESOURCE_MEM,
61 },
62};
63
64static struct platform_device loki_ge0_shared = {
65 .name = MV643XX_ETH_SHARED_NAME,
66 .id = 0,
67 .dev = {
68 .platform_data = &loki_ge0_shared_data,
69 },
70 .num_resources = 1,
71 .resource = loki_ge0_shared_resources,
72};
73
74static struct resource loki_ge0_resources[] = {
75 {
76 .name = "ge0 irq",
77 .start = IRQ_LOKI_GBE_A_INT,
78 .end = IRQ_LOKI_GBE_A_INT,
79 .flags = IORESOURCE_IRQ,
80 },
81};
82
83static struct platform_device loki_ge0 = {
84 .name = MV643XX_ETH_NAME,
85 .id = 0,
86 .num_resources = 1,
87 .resource = loki_ge0_resources,
88 .dev = {
89 .coherent_dma_mask = DMA_BIT_MASK(32),
90 },
91};
92
93void __init loki_ge0_init(struct mv643xx_eth_platform_data *eth_data) 49void __init loki_ge0_init(struct mv643xx_eth_platform_data *eth_data)
94{ 50{
95 eth_data->shared = &loki_ge0_shared;
96 loki_ge0.dev.platform_data = eth_data;
97
98 writel(0x00079220, GE0_VIRT_BASE + 0x20b0); 51 writel(0x00079220, GE0_VIRT_BASE + 0x20b0);
99 platform_device_register(&loki_ge0_shared); 52
100 platform_device_register(&loki_ge0); 53 orion_ge00_init(eth_data, &loki_mbus_dram_info,
54 GE0_PHYS_BASE, IRQ_LOKI_GBE_A_INT,
55 0, LOKI_TCLK);
101} 56}
102 57
103 58
104/***************************************************************************** 59/*****************************************************************************
105 * GE1 60 * GE01
106 ****************************************************************************/ 61 ****************************************************************************/
107struct mv643xx_eth_shared_platform_data loki_ge1_shared_data = {
108 .t_clk = LOKI_TCLK,
109 .dram = &loki_mbus_dram_info,
110};
111
112static struct resource loki_ge1_shared_resources[] = {
113 {
114 .name = "ge1 base",
115 .start = GE1_PHYS_BASE + 0x2000,
116 .end = GE1_PHYS_BASE + SZ_16K - 1,
117 .flags = IORESOURCE_MEM,
118 },
119};
120
121static struct platform_device loki_ge1_shared = {
122 .name = MV643XX_ETH_SHARED_NAME,
123 .id = 1,
124 .dev = {
125 .platform_data = &loki_ge1_shared_data,
126 },
127 .num_resources = 1,
128 .resource = loki_ge1_shared_resources,
129};
130
131static struct resource loki_ge1_resources[] = {
132 {
133 .name = "ge1 irq",
134 .start = IRQ_LOKI_GBE_B_INT,
135 .end = IRQ_LOKI_GBE_B_INT,
136 .flags = IORESOURCE_IRQ,
137 },
138};
139
140static struct platform_device loki_ge1 = {
141 .name = MV643XX_ETH_NAME,
142 .id = 1,
143 .num_resources = 1,
144 .resource = loki_ge1_resources,
145 .dev = {
146 .coherent_dma_mask = DMA_BIT_MASK(32),
147 },
148};
149
150void __init loki_ge1_init(struct mv643xx_eth_platform_data *eth_data) 62void __init loki_ge1_init(struct mv643xx_eth_platform_data *eth_data)
151{ 63{
152 eth_data->shared = &loki_ge1_shared;
153 loki_ge1.dev.platform_data = eth_data;
154
155 writel(0x00079220, GE1_VIRT_BASE + 0x20b0); 64 writel(0x00079220, GE1_VIRT_BASE + 0x20b0);
156 platform_device_register(&loki_ge1_shared); 65
157 platform_device_register(&loki_ge1); 66 orion_ge01_init(eth_data, &loki_mbus_dram_info,
67 GE1_PHYS_BASE, IRQ_LOKI_GBE_B_INT,
68 0, LOKI_TCLK);
158} 69}
159 70
160 71