diff options
Diffstat (limited to 'arch/arm/mach-ep93xx/core.c')
-rw-r--r-- | arch/arm/mach-ep93xx/core.c | 46 |
1 files changed, 40 insertions, 6 deletions
diff --git a/arch/arm/mach-ep93xx/core.c b/arch/arm/mach-ep93xx/core.c index f99f4366939..de53f0be71b 100644 --- a/arch/arm/mach-ep93xx/core.c +++ b/arch/arm/mach-ep93xx/core.c | |||
@@ -32,6 +32,7 @@ | |||
32 | #include <linux/termios.h> | 32 | #include <linux/termios.h> |
33 | #include <linux/amba/bus.h> | 33 | #include <linux/amba/bus.h> |
34 | #include <linux/amba/serial.h> | 34 | #include <linux/amba/serial.h> |
35 | #include <linux/io.h> | ||
35 | 36 | ||
36 | #include <asm/types.h> | 37 | #include <asm/types.h> |
37 | #include <asm/setup.h> | 38 | #include <asm/setup.h> |
@@ -41,7 +42,6 @@ | |||
41 | #include <asm/system.h> | 42 | #include <asm/system.h> |
42 | #include <asm/tlbflush.h> | 43 | #include <asm/tlbflush.h> |
43 | #include <asm/pgtable.h> | 44 | #include <asm/pgtable.h> |
44 | #include <asm/io.h> | ||
45 | 45 | ||
46 | #include <asm/mach/map.h> | 46 | #include <asm/mach/map.h> |
47 | #include <asm/mach/time.h> | 47 | #include <asm/mach/time.h> |
@@ -157,7 +157,7 @@ static unsigned char gpio_int_type2[3]; | |||
157 | static const u8 int_type1_register_offset[3] = { 0x90, 0xac, 0x4c }; | 157 | static const u8 int_type1_register_offset[3] = { 0x90, 0xac, 0x4c }; |
158 | static const u8 int_type2_register_offset[3] = { 0x94, 0xb0, 0x50 }; | 158 | static const u8 int_type2_register_offset[3] = { 0x94, 0xb0, 0x50 }; |
159 | static const u8 eoi_register_offset[3] = { 0x98, 0xb4, 0x54 }; | 159 | static const u8 eoi_register_offset[3] = { 0x98, 0xb4, 0x54 }; |
160 | static const u8 int_en_register_offset[3] = { 0x9c, 0xb8, 0x5c }; | 160 | static const u8 int_en_register_offset[3] = { 0x9c, 0xb8, 0x58 }; |
161 | 161 | ||
162 | void ep93xx_gpio_update_int_params(unsigned port) | 162 | void ep93xx_gpio_update_int_params(unsigned port) |
163 | { | 163 | { |
@@ -192,8 +192,7 @@ static void ep93xx_gpio_ab_irq_handler(unsigned int irq, struct irq_desc *desc) | |||
192 | for (i = 0; i < 8; i++) { | 192 | for (i = 0; i < 8; i++) { |
193 | if (status & (1 << i)) { | 193 | if (status & (1 << i)) { |
194 | int gpio_irq = gpio_to_irq(EP93XX_GPIO_LINE_A(0)) + i; | 194 | int gpio_irq = gpio_to_irq(EP93XX_GPIO_LINE_A(0)) + i; |
195 | desc = irq_desc + gpio_irq; | 195 | generic_handle_irq(gpio_irq); |
196 | desc_handle_irq(gpio_irq, desc); | ||
197 | } | 196 | } |
198 | } | 197 | } |
199 | 198 | ||
@@ -202,7 +201,7 @@ static void ep93xx_gpio_ab_irq_handler(unsigned int irq, struct irq_desc *desc) | |||
202 | if (status & (1 << i)) { | 201 | if (status & (1 << i)) { |
203 | int gpio_irq = gpio_to_irq(EP93XX_GPIO_LINE_B(0)) + i; | 202 | int gpio_irq = gpio_to_irq(EP93XX_GPIO_LINE_B(0)) + i; |
204 | desc = irq_desc + gpio_irq; | 203 | desc = irq_desc + gpio_irq; |
205 | desc_handle_irq(gpio_irq, desc); | 204 | generic_handle_irq(gpio_irq); |
206 | } | 205 | } |
207 | } | 206 | } |
208 | } | 207 | } |
@@ -217,7 +216,7 @@ static void ep93xx_gpio_f_irq_handler(unsigned int irq, struct irq_desc *desc) | |||
217 | int port_f_idx = ((irq + 1) & 7) ^ 4; /* {19..22,47..50} -> {0..7} */ | 216 | int port_f_idx = ((irq + 1) & 7) ^ 4; /* {19..22,47..50} -> {0..7} */ |
218 | int gpio_irq = gpio_to_irq(EP93XX_GPIO_LINE_F(0)) + port_f_idx; | 217 | int gpio_irq = gpio_to_irq(EP93XX_GPIO_LINE_F(0)) + port_f_idx; |
219 | 218 | ||
220 | desc_handle_irq(gpio_irq, irq_desc + gpio_irq); | 219 | generic_handle_irq(gpio_irq); |
221 | } | 220 | } |
222 | 221 | ||
223 | static void ep93xx_gpio_irq_ack(unsigned int irq) | 222 | static void ep93xx_gpio_irq_ack(unsigned int irq) |
@@ -461,6 +460,41 @@ static struct platform_device ep93xx_ohci_device = { | |||
461 | .resource = ep93xx_ohci_resources, | 460 | .resource = ep93xx_ohci_resources, |
462 | }; | 461 | }; |
463 | 462 | ||
463 | static struct ep93xx_eth_data ep93xx_eth_data; | ||
464 | |||
465 | static struct resource ep93xx_eth_resource[] = { | ||
466 | { | ||
467 | .start = EP93XX_ETHERNET_PHYS_BASE, | ||
468 | .end = EP93XX_ETHERNET_PHYS_BASE + 0xffff, | ||
469 | .flags = IORESOURCE_MEM, | ||
470 | }, { | ||
471 | .start = IRQ_EP93XX_ETHERNET, | ||
472 | .end = IRQ_EP93XX_ETHERNET, | ||
473 | .flags = IORESOURCE_IRQ, | ||
474 | } | ||
475 | }; | ||
476 | |||
477 | static struct platform_device ep93xx_eth_device = { | ||
478 | .name = "ep93xx-eth", | ||
479 | .id = -1, | ||
480 | .dev = { | ||
481 | .platform_data = &ep93xx_eth_data, | ||
482 | }, | ||
483 | .num_resources = ARRAY_SIZE(ep93xx_eth_resource), | ||
484 | .resource = ep93xx_eth_resource, | ||
485 | }; | ||
486 | |||
487 | void __init ep93xx_register_eth(struct ep93xx_eth_data *data, int copy_addr) | ||
488 | { | ||
489 | if (copy_addr) { | ||
490 | memcpy(data->dev_addr, | ||
491 | (void *)(EP93XX_ETHERNET_BASE + 0x50), 6); | ||
492 | } | ||
493 | |||
494 | ep93xx_eth_data = *data; | ||
495 | platform_device_register(&ep93xx_eth_device); | ||
496 | } | ||
497 | |||
464 | extern void ep93xx_gpio_init(void); | 498 | extern void ep93xx_gpio_init(void); |
465 | 499 | ||
466 | void __init ep93xx_init_devices(void) | 500 | void __init ep93xx_init_devices(void) |