aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-kirkwood
diff options
context:
space:
mode:
authorRussell King <rmk@dyn-67.arm.linux.org.uk>2008-12-13 04:12:51 -0500
committerRussell King <rmk+kernel@arm.linux.org.uk>2008-12-13 04:12:51 -0500
commit72aaf09fda49f5919d98d65d35e5179f3acb0497 (patch)
tree5fd25748f7f5640f8ee8efb86ddca88d12840791 /arch/arm/mach-kirkwood
parent67fbc2312312095acc2f19a0b601bac10f84cf9d (diff)
parent58c2467355ed3154a12ee49d8f8236547145c9d3 (diff)
Merge git://git.marvell.com/orion into devel
Diffstat (limited to 'arch/arm/mach-kirkwood')
-rw-r--r--arch/arm/mach-kirkwood/common.c59
-rw-r--r--arch/arm/mach-kirkwood/common.h1
-rw-r--r--arch/arm/mach-kirkwood/include/mach/irqs.h1
-rw-r--r--arch/arm/mach-kirkwood/rd88f6281-setup.c16
4 files changed, 76 insertions, 1 deletions
diff --git a/arch/arm/mach-kirkwood/common.c b/arch/arm/mach-kirkwood/common.c
index 0bb1fbd84ccb..7b8ef97fb501 100644
--- a/arch/arm/mach-kirkwood/common.c
+++ b/arch/arm/mach-kirkwood/common.c
@@ -57,6 +57,7 @@ void __init kirkwood_map_io(void)
57 ****************************************************************************/ 57 ****************************************************************************/
58static struct orion_ehci_data kirkwood_ehci_data = { 58static struct orion_ehci_data kirkwood_ehci_data = {
59 .dram = &kirkwood_mbus_dram_info, 59 .dram = &kirkwood_mbus_dram_info,
60 .phy_version = EHCI_PHY_NA,
60}; 61};
61 62
62static u64 ehci_dmamask = 0xffffffffUL; 63static u64 ehci_dmamask = 0xffffffffUL;
@@ -153,6 +154,64 @@ void __init kirkwood_ge00_init(struct mv643xx_eth_platform_data *eth_data)
153 154
154 155
155/***************************************************************************** 156/*****************************************************************************
157 * GE01
158 ****************************************************************************/
159struct mv643xx_eth_shared_platform_data kirkwood_ge01_shared_data = {
160 .dram = &kirkwood_mbus_dram_info,
161 .shared_smi = &kirkwood_ge00_shared,
162};
163
164static struct resource kirkwood_ge01_shared_resources[] = {
165 {
166 .name = "ge01 base",
167 .start = GE01_PHYS_BASE + 0x2000,
168 .end = GE01_PHYS_BASE + 0x3fff,
169 .flags = IORESOURCE_MEM,
170 }, {
171 .name = "ge01 err irq",
172 .start = IRQ_KIRKWOOD_GE01_ERR,
173 .end = IRQ_KIRKWOOD_GE01_ERR,
174 .flags = IORESOURCE_IRQ,
175 },
176};
177
178static struct platform_device kirkwood_ge01_shared = {
179 .name = MV643XX_ETH_SHARED_NAME,
180 .id = 1,
181 .dev = {
182 .platform_data = &kirkwood_ge01_shared_data,
183 },
184 .num_resources = ARRAY_SIZE(kirkwood_ge01_shared_resources),
185 .resource = kirkwood_ge01_shared_resources,
186};
187
188static struct resource kirkwood_ge01_resources[] = {
189 {
190 .name = "ge01 irq",
191 .start = IRQ_KIRKWOOD_GE01_SUM,
192 .end = IRQ_KIRKWOOD_GE01_SUM,
193 .flags = IORESOURCE_IRQ,
194 },
195};
196
197static struct platform_device kirkwood_ge01 = {
198 .name = MV643XX_ETH_NAME,
199 .id = 1,
200 .num_resources = 1,
201 .resource = kirkwood_ge01_resources,
202};
203
204void __init kirkwood_ge01_init(struct mv643xx_eth_platform_data *eth_data)
205{
206 eth_data->shared = &kirkwood_ge01_shared;
207 kirkwood_ge01.dev.platform_data = eth_data;
208
209 platform_device_register(&kirkwood_ge01_shared);
210 platform_device_register(&kirkwood_ge01);
211}
212
213
214/*****************************************************************************
156 * Ethernet switch 215 * Ethernet switch
157 ****************************************************************************/ 216 ****************************************************************************/
158static struct resource kirkwood_switch_resources[] = { 217static struct resource kirkwood_switch_resources[] = {
diff --git a/arch/arm/mach-kirkwood/common.h b/arch/arm/mach-kirkwood/common.h
index 5774632a67e3..fe367c18e722 100644
--- a/arch/arm/mach-kirkwood/common.h
+++ b/arch/arm/mach-kirkwood/common.h
@@ -30,6 +30,7 @@ void kirkwood_pcie_id(u32 *dev, u32 *rev);
30 30
31void kirkwood_ehci_init(void); 31void kirkwood_ehci_init(void);
32void kirkwood_ge00_init(struct mv643xx_eth_platform_data *eth_data); 32void kirkwood_ge00_init(struct mv643xx_eth_platform_data *eth_data);
33void kirkwood_ge01_init(struct mv643xx_eth_platform_data *eth_data);
33void kirkwood_ge00_switch_init(struct dsa_platform_data *d, int irq); 34void kirkwood_ge00_switch_init(struct dsa_platform_data *d, int irq);
34void kirkwood_pcie_init(void); 35void kirkwood_pcie_init(void);
35void kirkwood_rtc_init(void); 36void kirkwood_rtc_init(void);
diff --git a/arch/arm/mach-kirkwood/include/mach/irqs.h b/arch/arm/mach-kirkwood/include/mach/irqs.h
index ffab89f21c11..3a964bb14973 100644
--- a/arch/arm/mach-kirkwood/include/mach/irqs.h
+++ b/arch/arm/mach-kirkwood/include/mach/irqs.h
@@ -51,6 +51,7 @@
51#define IRQ_KIRKWOOD_GPIO_HIGH_8_15 40 51#define IRQ_KIRKWOOD_GPIO_HIGH_8_15 40
52#define IRQ_KIRKWOOD_GPIO_HIGH_16_23 41 52#define IRQ_KIRKWOOD_GPIO_HIGH_16_23 41
53#define IRQ_KIRKWOOD_GE00_ERR 46 53#define IRQ_KIRKWOOD_GE00_ERR 46
54#define IRQ_KIRKWOOD_GE01_ERR 47
54 55
55/* 56/*
56 * KIRKWOOD General Purpose Pins 57 * KIRKWOOD General Purpose Pins
diff --git a/arch/arm/mach-kirkwood/rd88f6281-setup.c b/arch/arm/mach-kirkwood/rd88f6281-setup.c
index 175054abd630..9a0e905d10cd 100644
--- a/arch/arm/mach-kirkwood/rd88f6281-setup.c
+++ b/arch/arm/mach-kirkwood/rd88f6281-setup.c
@@ -80,24 +80,38 @@ static struct dsa_platform_data rd88f6281_switch_data = {
80 .port_names[1] = "lan2", 80 .port_names[1] = "lan2",
81 .port_names[2] = "lan3", 81 .port_names[2] = "lan3",
82 .port_names[3] = "lan4", 82 .port_names[3] = "lan4",
83 .port_names[4] = "wan",
84 .port_names[5] = "cpu", 83 .port_names[5] = "cpu",
85}; 84};
86 85
86static struct mv643xx_eth_platform_data rd88f6281_ge01_data = {
87 .phy_addr = MV643XX_ETH_PHY_ADDR(11),
88};
89
87static struct mv_sata_platform_data rd88f6281_sata_data = { 90static struct mv_sata_platform_data rd88f6281_sata_data = {
88 .n_ports = 2, 91 .n_ports = 2,
89}; 92};
90 93
91static void __init rd88f6281_init(void) 94static void __init rd88f6281_init(void)
92{ 95{
96 u32 dev, rev;
97
93 /* 98 /*
94 * Basic setup. Needs to be called early. 99 * Basic setup. Needs to be called early.
95 */ 100 */
96 kirkwood_init(); 101 kirkwood_init();
97 102
98 kirkwood_ehci_init(); 103 kirkwood_ehci_init();
104
99 kirkwood_ge00_init(&rd88f6281_ge00_data); 105 kirkwood_ge00_init(&rd88f6281_ge00_data);
106 kirkwood_pcie_id(&dev, &rev);
107 if (rev == MV88F6281_REV_A0) {
108 rd88f6281_switch_data.sw_addr = 10;
109 kirkwood_ge01_init(&rd88f6281_ge01_data);
110 } else {
111 rd88f6281_switch_data.port_names[4] = "wan";
112 }
100 kirkwood_ge00_switch_init(&rd88f6281_switch_data, NO_IRQ); 113 kirkwood_ge00_switch_init(&rd88f6281_switch_data, NO_IRQ);
114
101 kirkwood_rtc_init(); 115 kirkwood_rtc_init();
102 kirkwood_sata_init(&rd88f6281_sata_data); 116 kirkwood_sata_init(&rd88f6281_sata_data);
103 kirkwood_uart0_init(); 117 kirkwood_uart0_init();