diff options
author | Mike Rapoport <mike@compulab.co.il> | 2008-10-05 05:26:55 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2008-10-07 07:05:07 -0400 |
commit | a7f3f0309b68d8d07a97a54c492802c294bccacd (patch) | |
tree | 1b1f04bcc09fd6cba966e39e3b005d080de4edcd /arch/arm/mach-pxa/cm-x2xx.c | |
parent | 4adc5fb6733213ab68750f722630d1b9d5655bc1 (diff) |
[ARM] 5282/1: pxa: add CM-X255 support
Signed-off-by: Russ Dill <russ.dill@gmail.com>
Signed-off-by: Mike Rapoport <mike@compulab.co.il>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/mach-pxa/cm-x2xx.c')
-rw-r--r-- | arch/arm/mach-pxa/cm-x2xx.c | 52 |
1 files changed, 47 insertions, 5 deletions
diff --git a/arch/arm/mach-pxa/cm-x2xx.c b/arch/arm/mach-pxa/cm-x2xx.c index cb16eb5bac8f..0b3ce3b6d896 100644 --- a/arch/arm/mach-pxa/cm-x2xx.c +++ b/arch/arm/mach-pxa/cm-x2xx.c | |||
@@ -32,6 +32,7 @@ | |||
32 | #include "generic.h" | 32 | #include "generic.h" |
33 | #include "cm-x2xx-pci.h" | 33 | #include "cm-x2xx-pci.h" |
34 | 34 | ||
35 | extern void cmx255_init(void); | ||
35 | extern void cmx270_init(void); | 36 | extern void cmx270_init(void); |
36 | 37 | ||
37 | /* virtual addresses for statically mapped regions */ | 38 | /* virtual addresses for statically mapped regions */ |
@@ -39,19 +40,43 @@ extern void cmx270_init(void); | |||
39 | #define CMX2XX_IT8152_VIRT (CMX2XX_VIRT_BASE) | 40 | #define CMX2XX_IT8152_VIRT (CMX2XX_VIRT_BASE) |
40 | 41 | ||
41 | /* physical address if local-bus attached devices */ | 42 | /* physical address if local-bus attached devices */ |
43 | #define CMX255_DM9000_PHYS_BASE (PXA_CS1_PHYS + (8 << 22)) | ||
42 | #define CMX270_DM9000_PHYS_BASE (PXA_CS1_PHYS + (6 << 22)) | 44 | #define CMX270_DM9000_PHYS_BASE (PXA_CS1_PHYS + (6 << 22)) |
43 | 45 | ||
44 | /* leds */ | 46 | /* leds */ |
47 | #define CMX255_GPIO_RED (27) | ||
48 | #define CMX255_GPIO_GREEN (32) | ||
45 | #define CMX270_GPIO_RED (93) | 49 | #define CMX270_GPIO_RED (93) |
46 | #define CMX270_GPIO_GREEN (94) | 50 | #define CMX270_GPIO_GREEN (94) |
47 | 51 | ||
48 | /* GPIO IRQ usage */ | 52 | /* GPIO IRQ usage */ |
53 | #define GPIO22_ETHIRQ (22) | ||
49 | #define GPIO10_ETHIRQ (10) | 54 | #define GPIO10_ETHIRQ (10) |
55 | #define CMX255_GPIO_IT8152_IRQ (0) | ||
50 | #define CMX270_GPIO_IT8152_IRQ (22) | 56 | #define CMX270_GPIO_IT8152_IRQ (22) |
51 | 57 | ||
58 | #define CMX255_ETHIRQ IRQ_GPIO(GPIO22_ETHIRQ) | ||
52 | #define CMX270_ETHIRQ IRQ_GPIO(GPIO10_ETHIRQ) | 59 | #define CMX270_ETHIRQ IRQ_GPIO(GPIO10_ETHIRQ) |
53 | 60 | ||
54 | #if defined(CONFIG_DM9000) || defined(CONFIG_DM9000_MODULE) | 61 | #if defined(CONFIG_DM9000) || defined(CONFIG_DM9000_MODULE) |
62 | static struct resource cmx255_dm9000_resource[] = { | ||
63 | [0] = { | ||
64 | .start = CMX255_DM9000_PHYS_BASE, | ||
65 | .end = CMX255_DM9000_PHYS_BASE + 3, | ||
66 | .flags = IORESOURCE_MEM, | ||
67 | }, | ||
68 | [1] = { | ||
69 | .start = CMX255_DM9000_PHYS_BASE + 4, | ||
70 | .end = CMX255_DM9000_PHYS_BASE + 4 + 500, | ||
71 | .flags = IORESOURCE_MEM, | ||
72 | }, | ||
73 | [2] = { | ||
74 | .start = CMX255_ETHIRQ, | ||
75 | .end = CMX255_ETHIRQ, | ||
76 | .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE, | ||
77 | } | ||
78 | }; | ||
79 | |||
55 | static struct resource cmx270_dm9000_resource[] = { | 80 | static struct resource cmx270_dm9000_resource[] = { |
56 | [0] = { | 81 | [0] = { |
57 | .start = CMX270_DM9000_PHYS_BASE, | 82 | .start = CMX270_DM9000_PHYS_BASE, |
@@ -85,7 +110,10 @@ static struct platform_device cmx2xx_dm9000_device = { | |||
85 | 110 | ||
86 | static void __init cmx2xx_init_dm9000(void) | 111 | static void __init cmx2xx_init_dm9000(void) |
87 | { | 112 | { |
88 | cmx2xx_dm9000_device.resource = cmx270_dm9000_resource, | 113 | if (cpu_is_pxa25x()) |
114 | cmx2xx_dm9000_device.resource = cmx255_dm9000_resource; | ||
115 | else | ||
116 | cmx2xx_dm9000_device.resource = cmx270_dm9000_resource; | ||
89 | platform_device_register(&cmx2xx_dm9000_device); | 117 | platform_device_register(&cmx2xx_dm9000_device); |
90 | } | 118 | } |
91 | #else | 119 | #else |
@@ -137,8 +165,13 @@ static struct platform_device cmx2xx_led_device = { | |||
137 | 165 | ||
138 | static void __init cmx2xx_init_leds(void) | 166 | static void __init cmx2xx_init_leds(void) |
139 | { | 167 | { |
140 | cmx2xx_leds[0].gpio = CMX270_GPIO_RED; | 168 | if (cpu_is_pxa25x()) { |
141 | cmx2xx_leds[1].gpio = CMX270_GPIO_GREEN; | 169 | cmx2xx_leds[0].gpio = CMX255_GPIO_RED; |
170 | cmx2xx_leds[1].gpio = CMX255_GPIO_GREEN; | ||
171 | } else { | ||
172 | cmx2xx_leds[0].gpio = CMX270_GPIO_RED; | ||
173 | cmx2xx_leds[1].gpio = CMX270_GPIO_GREEN; | ||
174 | } | ||
142 | platform_device_register(&cmx2xx_led_device); | 175 | platform_device_register(&cmx2xx_led_device); |
143 | } | 176 | } |
144 | #else | 177 | #else |
@@ -437,7 +470,10 @@ static void __init cmx2xx_init(void) | |||
437 | { | 470 | { |
438 | cmx2xx_pm_init(); | 471 | cmx2xx_pm_init(); |
439 | 472 | ||
440 | cmx270_init(); | 473 | if (cpu_is_pxa25x()) |
474 | cmx255_init(); | ||
475 | else | ||
476 | cmx270_init(); | ||
441 | 477 | ||
442 | cmx2xx_init_dm9000(); | 478 | cmx2xx_init_dm9000(); |
443 | cmx2xx_init_display(); | 479 | cmx2xx_init_display(); |
@@ -450,7 +486,13 @@ static void __init cmx2xx_init_irq(void) | |||
450 | { | 486 | { |
451 | pxa27x_init_irq(); | 487 | pxa27x_init_irq(); |
452 | 488 | ||
453 | cmx2xx_pci_init_irq(CMX270_GPIO_IT8152_IRQ); | 489 | if (cpu_is_pxa25x()) { |
490 | pxa25x_init_irq(); | ||
491 | cmx2xx_pci_init_irq(CMX255_GPIO_IT8152_IRQ); | ||
492 | } else { | ||
493 | pxa27x_init_irq(); | ||
494 | cmx2xx_pci_init_irq(CMX270_GPIO_IT8152_IRQ); | ||
495 | } | ||
454 | } | 496 | } |
455 | 497 | ||
456 | #ifdef CONFIG_PCI | 498 | #ifdef CONFIG_PCI |