diff options
author | Mike Rapoport <mike@compulab.co.il> | 2008-10-05 05:25:44 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2008-10-07 07:05:05 -0400 |
commit | da591937ba8c3a98ced845247859693a27543863 (patch) | |
tree | 93ae125daa920e2f844f10f2392484caff2e6d6e /arch/arm/mach-pxa/cm-x2xx-pci.c | |
parent | 7d76e3f171216757a2ea630d76442084f88a0b4c (diff) |
[ARM] 5280/1: pxa: prepare cm-x2xx.c and cm-x2xx-pci.[ch] for addition of CM-X255
- Change CM-X255 and CM-X270 common function prefix from cmx270 to cmx2xx
- Split cmx2xx_init to common and CM-X270-specific parts
- Use dynamic assignement for DM9000 resources and led GPIOs.
Signed-off-by: Russ Dill <russ.dill@gmail.com>
Signed-off-by: Mike Rapoport <mike@compulab.co.il>
Acked-by: Eric Miao <eric.miao@marvell.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/mach-pxa/cm-x2xx-pci.c')
-rw-r--r-- | arch/arm/mach-pxa/cm-x2xx-pci.c | 50 |
1 files changed, 25 insertions, 25 deletions
diff --git a/arch/arm/mach-pxa/cm-x2xx-pci.c b/arch/arm/mach-pxa/cm-x2xx-pci.c index 2d5bcea1e520..b6e93ecbf9da 100644 --- a/arch/arm/mach-pxa/cm-x2xx-pci.c +++ b/arch/arm/mach-pxa/cm-x2xx-pci.c | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * linux/arch/arm/mach-pxa/cm-x270-pci.c | 2 | * linux/arch/arm/mach-pxa/cm-x2xx-pci.c |
3 | * | 3 | * |
4 | * PCI bios-type initialisation for PCI machines | 4 | * PCI bios-type initialisation for PCI machines |
5 | * | 5 | * |
@@ -28,7 +28,7 @@ | |||
28 | #include <asm/hardware/it8152.h> | 28 | #include <asm/hardware/it8152.h> |
29 | 29 | ||
30 | unsigned long it8152_base_address; | 30 | unsigned long it8152_base_address; |
31 | static int cmx270_it8152_irq_gpio; | 31 | static int cmx2xx_it8152_irq_gpio; |
32 | 32 | ||
33 | /* | 33 | /* |
34 | * Only first 64MB of memory can be accessed via PCI. | 34 | * Only first 64MB of memory can be accessed via PCI. |
@@ -36,13 +36,13 @@ static int cmx270_it8152_irq_gpio; | |||
36 | * This is really ugly and we need a better way of specifying | 36 | * This is really ugly and we need a better way of specifying |
37 | * DMA-capable regions of memory. | 37 | * DMA-capable regions of memory. |
38 | */ | 38 | */ |
39 | void __init cmx270_pci_adjust_zones(int node, unsigned long *zone_size, | 39 | void __init cmx2xx_pci_adjust_zones(int node, unsigned long *zone_size, |
40 | unsigned long *zhole_size) | 40 | unsigned long *zhole_size) |
41 | { | 41 | { |
42 | unsigned int sz = SZ_64M >> PAGE_SHIFT; | 42 | unsigned int sz = SZ_64M >> PAGE_SHIFT; |
43 | 43 | ||
44 | if (machine_is_armcore()) { | 44 | if (machine_is_armcore()) { |
45 | pr_info("Adjusting zones for CM-X270\n"); | 45 | pr_info("Adjusting zones for CM-X2XX\n"); |
46 | 46 | ||
47 | /* | 47 | /* |
48 | * Only adjust if > 64M on current system | 48 | * Only adjust if > 64M on current system |
@@ -57,29 +57,29 @@ void __init cmx270_pci_adjust_zones(int node, unsigned long *zone_size, | |||
57 | } | 57 | } |
58 | } | 58 | } |
59 | 59 | ||
60 | static void cmx270_it8152_irq_demux(unsigned int irq, struct irq_desc *desc) | 60 | static void cmx2xx_it8152_irq_demux(unsigned int irq, struct irq_desc *desc) |
61 | { | 61 | { |
62 | /* clear our parent irq */ | 62 | /* clear our parent irq */ |
63 | GEDR(cmx270_it8152_irq_gpio) = GPIO_bit(cmx270_it8152_irq_gpio); | 63 | GEDR(cmx2xx_it8152_irq_gpio) = GPIO_bit(cmx2xx_it8152_irq_gpio); |
64 | 64 | ||
65 | it8152_irq_demux(irq, desc); | 65 | it8152_irq_demux(irq, desc); |
66 | } | 66 | } |
67 | 67 | ||
68 | void __cmx270_pci_init_irq(int irq_gpio) | 68 | void __cmx2xx_pci_init_irq(int irq_gpio) |
69 | { | 69 | { |
70 | it8152_init_irq(); | 70 | it8152_init_irq(); |
71 | 71 | ||
72 | cmx270_it8152_irq_gpio = irq_gpio; | 72 | cmx2xx_it8152_irq_gpio = irq_gpio; |
73 | 73 | ||
74 | set_irq_type(gpio_to_irq(irq_gpio), IRQ_TYPE_EDGE_RISING); | 74 | set_irq_type(gpio_to_irq(irq_gpio), IRQ_TYPE_EDGE_RISING); |
75 | 75 | ||
76 | set_irq_chained_handler(gpio_to_irq(irq_gpio), cmx270_it8152_irq_demux); | 76 | set_irq_chained_handler(gpio_to_irq(irq_gpio), cmx2xx_it8152_irq_demux); |
77 | } | 77 | } |
78 | 78 | ||
79 | #ifdef CONFIG_PM | 79 | #ifdef CONFIG_PM |
80 | static unsigned long sleep_save_ite[10]; | 80 | static unsigned long sleep_save_ite[10]; |
81 | 81 | ||
82 | void __cmx270_pci_suspend(void) | 82 | void __cmx2xx_pci_suspend(void) |
83 | { | 83 | { |
84 | /* save ITE state */ | 84 | /* save ITE state */ |
85 | sleep_save_ite[0] = __raw_readl(IT8152_INTC_PDCNIMR); | 85 | sleep_save_ite[0] = __raw_readl(IT8152_INTC_PDCNIMR); |
@@ -91,7 +91,7 @@ void __cmx270_pci_suspend(void) | |||
91 | __raw_writel((0), IT8152_INTC_LPCNIRR); | 91 | __raw_writel((0), IT8152_INTC_LPCNIRR); |
92 | } | 92 | } |
93 | 93 | ||
94 | void __cmx270_pci_resume(void) | 94 | void __cmx2xx_pci_resume(void) |
95 | { | 95 | { |
96 | /* restore IT8152 state */ | 96 | /* restore IT8152 state */ |
97 | __raw_writel((sleep_save_ite[0]), IT8152_INTC_PDCNIMR); | 97 | __raw_writel((sleep_save_ite[0]), IT8152_INTC_PDCNIMR); |
@@ -99,12 +99,12 @@ void __cmx270_pci_resume(void) | |||
99 | __raw_writel((sleep_save_ite[2]), IT8152_INTC_LPNIAR); | 99 | __raw_writel((sleep_save_ite[2]), IT8152_INTC_LPNIAR); |
100 | } | 100 | } |
101 | #else | 101 | #else |
102 | void cmx270_pci_suspend(void) {} | 102 | void cmx2xx_pci_suspend(void) {} |
103 | void cmx270_pci_resume(void) {} | 103 | void cmx2xx_pci_resume(void) {} |
104 | #endif | 104 | #endif |
105 | 105 | ||
106 | /* PCI IRQ mapping*/ | 106 | /* PCI IRQ mapping*/ |
107 | static int __init cmx270_pci_map_irq(struct pci_dev *dev, u8 slot, u8 pin) | 107 | static int __init cmx2xx_pci_map_irq(struct pci_dev *dev, u8 slot, u8 pin) |
108 | { | 108 | { |
109 | int irq; | 109 | int irq; |
110 | 110 | ||
@@ -116,14 +116,14 @@ static int __init cmx270_pci_map_irq(struct pci_dev *dev, u8 slot, u8 pin) | |||
116 | 116 | ||
117 | /* | 117 | /* |
118 | Here comes the ugly part. The routing is baseboard specific, | 118 | Here comes the ugly part. The routing is baseboard specific, |
119 | but defining a platform for each possible base of CM-X270 is | 119 | but defining a platform for each possible base of CM-X2XX is |
120 | unrealistic. Here we keep mapping for ATXBase and SB-X270. | 120 | unrealistic. Here we keep mapping for ATXBase and SB-X2XX. |
121 | */ | 121 | */ |
122 | /* ATXBASE PCI slot */ | 122 | /* ATXBASE PCI slot */ |
123 | if (slot == 7) | 123 | if (slot == 7) |
124 | return IT8152_PCI_INTA; | 124 | return IT8152_PCI_INTA; |
125 | 125 | ||
126 | /* ATXBase/SB-x270 CardBus */ | 126 | /* ATXBase/SB-X2XX CardBus */ |
127 | if (slot == 8 || slot == 0) | 127 | if (slot == 8 || slot == 0) |
128 | return IT8152_PCI_INTB; | 128 | return IT8152_PCI_INTB; |
129 | 129 | ||
@@ -144,9 +144,9 @@ static int __init cmx270_pci_map_irq(struct pci_dev *dev, u8 slot, u8 pin) | |||
144 | return(0); | 144 | return(0); |
145 | } | 145 | } |
146 | 146 | ||
147 | static void cmx270_pci_preinit(void) | 147 | static void cmx2xx_pci_preinit(void) |
148 | { | 148 | { |
149 | pr_info("Initializing CM-X270 PCI subsystem\n"); | 149 | pr_info("Initializing CM-X2XX PCI subsystem\n"); |
150 | 150 | ||
151 | __raw_writel(0x800, IT8152_PCI_CFG_ADDR); | 151 | __raw_writel(0x800, IT8152_PCI_CFG_ADDR); |
152 | if (__raw_readl(IT8152_PCI_CFG_DATA) == 0x81521283) { | 152 | if (__raw_readl(IT8152_PCI_CFG_DATA) == 0x81521283) { |
@@ -200,21 +200,21 @@ static void cmx270_pci_preinit(void) | |||
200 | } | 200 | } |
201 | } | 201 | } |
202 | 202 | ||
203 | static struct hw_pci cmx270_pci __initdata = { | 203 | static struct hw_pci cmx2xx_pci __initdata = { |
204 | .swizzle = pci_std_swizzle, | 204 | .swizzle = pci_std_swizzle, |
205 | .map_irq = cmx270_pci_map_irq, | 205 | .map_irq = cmx2xx_pci_map_irq, |
206 | .nr_controllers = 1, | 206 | .nr_controllers = 1, |
207 | .setup = it8152_pci_setup, | 207 | .setup = it8152_pci_setup, |
208 | .scan = it8152_pci_scan_bus, | 208 | .scan = it8152_pci_scan_bus, |
209 | .preinit = cmx270_pci_preinit, | 209 | .preinit = cmx2xx_pci_preinit, |
210 | }; | 210 | }; |
211 | 211 | ||
212 | static int __init cmx270_init_pci(void) | 212 | static int __init cmx2xx_init_pci(void) |
213 | { | 213 | { |
214 | if (machine_is_armcore()) | 214 | if (machine_is_armcore()) |
215 | pci_common_init(&cmx270_pci); | 215 | pci_common_init(&cmx2xx_pci); |
216 | 216 | ||
217 | return 0; | 217 | return 0; |
218 | } | 218 | } |
219 | 219 | ||
220 | subsys_initcall(cmx270_init_pci); | 220 | subsys_initcall(cmx2xx_init_pci); |