aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-pxa
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-pxa')
-rw-r--r--arch/arm/mach-pxa/Makefile2
-rw-r--r--arch/arm/mach-pxa/cm-x270.c351
-rw-r--r--arch/arm/mach-pxa/cm-x2xx.c334
3 files changed, 356 insertions, 331 deletions
diff --git a/arch/arm/mach-pxa/Makefile b/arch/arm/mach-pxa/Makefile
index a148c39391f1..d2d179ecfc50 100644
--- a/arch/arm/mach-pxa/Makefile
+++ b/arch/arm/mach-pxa/Makefile
@@ -53,7 +53,7 @@ obj-$(CONFIG_MACH_LITTLETON) += littleton.o
53obj-$(CONFIG_MACH_TAVOREVB) += tavorevb.o 53obj-$(CONFIG_MACH_TAVOREVB) += tavorevb.o
54obj-$(CONFIG_MACH_SAAR) += saar.o 54obj-$(CONFIG_MACH_SAAR) += saar.o
55 55
56obj-$(CONFIG_MACH_ARMCORE) += cm-x2xx.o 56obj-$(CONFIG_MACH_ARMCORE) += cm-x2xx.o cm-x270.o
57obj-$(CONFIG_MACH_CM_X300) += cm-x300.o 57obj-$(CONFIG_MACH_CM_X300) += cm-x300.o
58obj-$(CONFIG_PXA_EZX) += ezx.o 58obj-$(CONFIG_PXA_EZX) += ezx.o
59 59
diff --git a/arch/arm/mach-pxa/cm-x270.c b/arch/arm/mach-pxa/cm-x270.c
new file mode 100644
index 000000000000..102a43186618
--- /dev/null
+++ b/arch/arm/mach-pxa/cm-x270.c
@@ -0,0 +1,351 @@
1/*
2 * linux/arch/arm/mach-pxa/cm-x270.c
3 *
4 * Copyright (C) 2007, 2008 CompuLab, Ltd.
5 * Mike Rapoport <mike@compulab.co.il>
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 */
11
12#include <linux/platform_device.h>
13#include <linux/sysdev.h>
14#include <linux/irq.h>
15#include <linux/gpio.h>
16
17#include <linux/rtc-v3020.h>
18#include <video/mbxfb.h>
19
20#include <mach/mfp-pxa27x.h>
21#include <mach/ohci.h>
22#include <mach/mmc.h>
23
24#include "generic.h"
25
26/* physical address if local-bus attached devices */
27#define RTC_PHYS_BASE (PXA_CS1_PHYS + (5 << 22))
28
29/* GPIO IRQ usage */
30#define GPIO83_MMC_IRQ (83)
31
32#define CMX270_MMC_IRQ IRQ_GPIO(GPIO83_MMC_IRQ)
33
34/* MMC power enable */
35#define GPIO105_MMC_POWER (105)
36
37static unsigned long cmx270_pin_config[] = {
38 /* AC'97 */
39 GPIO28_AC97_BITCLK,
40 GPIO29_AC97_SDATA_IN_0,
41 GPIO30_AC97_SDATA_OUT,
42 GPIO31_AC97_SYNC,
43 GPIO98_AC97_SYSCLK,
44 GPIO113_AC97_nRESET,
45
46 /* BTUART */
47 GPIO42_BTUART_RXD,
48 GPIO43_BTUART_TXD,
49 GPIO44_BTUART_CTS,
50 GPIO45_BTUART_RTS,
51
52 /* STUART */
53 GPIO46_STUART_RXD,
54 GPIO47_STUART_TXD,
55
56 /* MCI controller */
57 GPIO32_MMC_CLK,
58 GPIO112_MMC_CMD,
59 GPIO92_MMC_DAT_0,
60 GPIO109_MMC_DAT_1,
61 GPIO110_MMC_DAT_2,
62 GPIO111_MMC_DAT_3,
63
64 /* LCD */
65 GPIO58_LCD_LDD_0,
66 GPIO59_LCD_LDD_1,
67 GPIO60_LCD_LDD_2,
68 GPIO61_LCD_LDD_3,
69 GPIO62_LCD_LDD_4,
70 GPIO63_LCD_LDD_5,
71 GPIO64_LCD_LDD_6,
72 GPIO65_LCD_LDD_7,
73 GPIO66_LCD_LDD_8,
74 GPIO67_LCD_LDD_9,
75 GPIO68_LCD_LDD_10,
76 GPIO69_LCD_LDD_11,
77 GPIO70_LCD_LDD_12,
78 GPIO71_LCD_LDD_13,
79 GPIO72_LCD_LDD_14,
80 GPIO73_LCD_LDD_15,
81 GPIO74_LCD_FCLK,
82 GPIO75_LCD_LCLK,
83 GPIO76_LCD_PCLK,
84 GPIO77_LCD_BIAS,
85
86 /* I2C */
87 GPIO117_I2C_SCL,
88 GPIO118_I2C_SDA,
89
90 /* SSP1 */
91 GPIO23_SSP1_SCLK,
92 GPIO24_SSP1_SFRM,
93 GPIO25_SSP1_TXD,
94 GPIO26_SSP1_RXD,
95
96 /* SSP2 */
97 GPIO19_SSP2_SCLK,
98 GPIO14_SSP2_SFRM,
99 GPIO87_SSP2_TXD,
100 GPIO88_SSP2_RXD,
101
102 /* PC Card */
103 GPIO48_nPOE,
104 GPIO49_nPWE,
105 GPIO50_nPIOR,
106 GPIO51_nPIOW,
107 GPIO85_nPCE_1,
108 GPIO54_nPCE_2,
109 GPIO55_nPREG,
110 GPIO56_nPWAIT,
111 GPIO57_nIOIS16,
112
113 /* SDRAM and local bus */
114 GPIO15_nCS_1,
115 GPIO78_nCS_2,
116 GPIO79_nCS_3,
117 GPIO80_nCS_4,
118 GPIO33_nCS_5,
119 GPIO49_nPWE,
120 GPIO18_RDY,
121
122 /* GPIO */
123 GPIO0_GPIO | WAKEUP_ON_EDGE_BOTH,
124 GPIO105_GPIO | MFP_LPM_DRIVE_HIGH, /* MMC/SD power */
125 GPIO53_GPIO, /* PC card reset */
126
127 /* NAND controls */
128 GPIO11_GPIO | MFP_LPM_DRIVE_HIGH, /* NAND CE# */
129 GPIO89_GPIO, /* NAND Ready/Busy */
130
131 /* interrupts */
132 GPIO10_GPIO, /* DM9000 interrupt */
133 GPIO83_GPIO, /* MMC card detect */
134};
135
136/* V3020 RTC */
137#if defined(CONFIG_RTC_DRV_V3020) || defined(CONFIG_RTC_DRV_V3020_MODULE)
138static struct resource cmx270_v3020_resource[] = {
139 [0] = {
140 .start = RTC_PHYS_BASE,
141 .end = RTC_PHYS_BASE + 4,
142 .flags = IORESOURCE_MEM,
143 },
144};
145
146struct v3020_platform_data cmx270_v3020_pdata = {
147 .leftshift = 16,
148};
149
150static struct platform_device cmx270_rtc_device = {
151 .name = "v3020",
152 .num_resources = ARRAY_SIZE(cmx270_v3020_resource),
153 .resource = cmx270_v3020_resource,
154 .id = -1,
155 .dev = {
156 .platform_data = &cmx270_v3020_pdata,
157 }
158};
159
160static void __init cmx270_init_rtc(void)
161{
162 platform_device_register(&cmx270_rtc_device);
163}
164#else
165static inline void cmx2xx_init_rtc(void) {}
166#endif
167
168/* 2700G graphics */
169#if defined(CONFIG_FB_MBX) || defined(CONFIG_FB_MBX_MODULE)
170static u64 fb_dma_mask = ~(u64)0;
171
172static struct resource cmx270_2700G_resource[] = {
173 /* frame buffer memory including ODFB and External SDRAM */
174 [0] = {
175 .start = PXA_CS2_PHYS,
176 .end = PXA_CS2_PHYS + 0x01ffffff,
177 .flags = IORESOURCE_MEM,
178 },
179 /* Marathon registers */
180 [1] = {
181 .start = PXA_CS2_PHYS + 0x03fe0000,
182 .end = PXA_CS2_PHYS + 0x03ffffff,
183 .flags = IORESOURCE_MEM,
184 },
185};
186
187static unsigned long save_lcd_regs[10];
188
189static int cmx270_marathon_probe(struct fb_info *fb)
190{
191 /* save PXA-270 pin settings before enabling 2700G */
192 save_lcd_regs[0] = GPDR1;
193 save_lcd_regs[1] = GPDR2;
194 save_lcd_regs[2] = GAFR1_U;
195 save_lcd_regs[3] = GAFR2_L;
196 save_lcd_regs[4] = GAFR2_U;
197
198 /* Disable PXA-270 on-chip controller driving pins */
199 GPDR1 &= ~(0xfc000000);
200 GPDR2 &= ~(0x00c03fff);
201 GAFR1_U &= ~(0xfff00000);
202 GAFR2_L &= ~(0x0fffffff);
203 GAFR2_U &= ~(0x0000f000);
204 return 0;
205}
206
207static int cmx270_marathon_remove(struct fb_info *fb)
208{
209 GPDR1 = save_lcd_regs[0];
210 GPDR2 = save_lcd_regs[1];
211 GAFR1_U = save_lcd_regs[2];
212 GAFR2_L = save_lcd_regs[3];
213 GAFR2_U = save_lcd_regs[4];
214 return 0;
215}
216
217static struct mbxfb_platform_data cmx270_2700G_data = {
218 .xres = {
219 .min = 240,
220 .max = 1200,
221 .defval = 640,
222 },
223 .yres = {
224 .min = 240,
225 .max = 1200,
226 .defval = 480,
227 },
228 .bpp = {
229 .min = 16,
230 .max = 32,
231 .defval = 16,
232 },
233 .memsize = 8*1024*1024,
234 .probe = cmx270_marathon_probe,
235 .remove = cmx270_marathon_remove,
236};
237
238static struct platform_device cmx270_2700G = {
239 .name = "mbx-fb",
240 .dev = {
241 .platform_data = &cmx270_2700G_data,
242 .dma_mask = &fb_dma_mask,
243 .coherent_dma_mask = 0xffffffff,
244 },
245 .num_resources = ARRAY_SIZE(cmx270_2700G_resource),
246 .resource = cmx270_2700G_resource,
247 .id = -1,
248};
249
250static void __init cmx270_init_2700G(void)
251{
252 platform_device_register(&cmx270_2700G);
253}
254#else
255static inline void cmx270_init_2700G(void) {}
256#endif
257
258/* PXA27x OHCI controller setup */
259#if defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE)
260static int cmx270_ohci_init(struct device *dev)
261{
262 /* Set the Power Control Polarity Low */
263 UHCHR = (UHCHR | UHCHR_PCPL) &
264 ~(UHCHR_SSEP1 | UHCHR_SSEP2 | UHCHR_SSE);
265
266 return 0;
267}
268
269static struct pxaohci_platform_data cmx270_ohci_platform_data = {
270 .port_mode = PMM_PERPORT_MODE,
271 .init = cmx270_ohci_init,
272};
273
274static void __init cmx270_init_ohci(void)
275{
276 pxa_set_ohci_info(&cmx270_ohci_platform_data);
277}
278#else
279static inline void cmx270_init_ohci(void) {}
280#endif
281
282#if defined(CONFIG_MMC) || defined(CONFIG_MMC_MODULE)
283static int cmx270_mci_init(struct device *dev,
284 irq_handler_t cmx270_detect_int,
285 void *data)
286{
287 int err;
288
289 err = gpio_request(GPIO105_MMC_POWER, "MMC/SD power");
290 if (err) {
291 dev_warn(dev, "power gpio unavailable\n");
292 return err;
293 }
294
295 gpio_direction_output(GPIO105_MMC_POWER, 0);
296
297 err = request_irq(CMX270_MMC_IRQ, cmx270_detect_int,
298 IRQF_DISABLED | IRQF_TRIGGER_FALLING,
299 "MMC card detect", data);
300 if (err) {
301 gpio_free(GPIO105_MMC_POWER);
302 dev_err(dev, "cmx270_mci_init: MMC/SD: can't"
303 " request MMC card detect IRQ\n");
304 }
305
306 return err;
307}
308
309static void cmx270_mci_setpower(struct device *dev, unsigned int vdd)
310{
311 struct pxamci_platform_data *p_d = dev->platform_data;
312
313 if ((1 << vdd) & p_d->ocr_mask) {
314 dev_dbg(dev, "power on\n");
315 gpio_set_value(GPIO105_MMC_POWER, 0);
316 } else {
317 gpio_set_value(GPIO105_MMC_POWER, 1);
318 dev_dbg(dev, "power off\n");
319 }
320}
321
322static void cmx270_mci_exit(struct device *dev, void *data)
323{
324 free_irq(CMX270_MMC_IRQ, data);
325 gpio_free(GPIO105_MMC_POWER);
326}
327
328static struct pxamci_platform_data cmx270_mci_platform_data = {
329 .ocr_mask = MMC_VDD_32_33|MMC_VDD_33_34,
330 .init = cmx270_mci_init,
331 .setpower = cmx270_mci_setpower,
332 .exit = cmx270_mci_exit,
333};
334
335static void __init cmx270_init_mmc(void)
336{
337 pxa_set_mci_info(&cmx270_mci_platform_data);
338}
339#else
340static inline void cmx270_init_mmc(void) {}
341#endif
342
343void __init cmx270_init(void)
344{
345 pxa2xx_mfp_config(ARRAY_AND_SIZE(cmx270_pin_config));
346
347 cmx270_init_rtc();
348 cmx270_init_mmc();
349 cmx270_init_ohci();
350 cmx270_init_2700G();
351}
diff --git a/arch/arm/mach-pxa/cm-x2xx.c b/arch/arm/mach-pxa/cm-x2xx.c
index cc79005b1794..cb16eb5bac8f 100644
--- a/arch/arm/mach-pxa/cm-x2xx.c
+++ b/arch/arm/mach-pxa/cm-x2xx.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * linux/arch/arm/mach-pxa/cm-x2xx.c 2 * linux/arch/arm/mach-pxa/cm-x2xx.c
3 * 3 *
4 * Copyright (C) 2007, 2008 CompuLab, Ltd. 4 * Copyright (C) 2008 CompuLab, Ltd.
5 * Mike Rapoport <mike@compulab.co.il> 5 * Mike Rapoport <mike@compulab.co.il>
6 * 6 *
7 * This program is free software; you can redistribute it and/or modify 7 * This program is free software; you can redistribute it and/or modify
@@ -15,8 +15,6 @@
15#include <linux/gpio.h> 15#include <linux/gpio.h>
16 16
17#include <linux/dm9000.h> 17#include <linux/dm9000.h>
18#include <linux/rtc-v3020.h>
19#include <video/mbxfb.h>
20#include <linux/leds.h> 18#include <linux/leds.h>
21 19
22#include <asm/mach/arch.h> 20#include <asm/mach/arch.h>
@@ -28,20 +26,19 @@
28#include <mach/pxa-regs.h> 26#include <mach/pxa-regs.h>
29#include <mach/audio.h> 27#include <mach/audio.h>
30#include <mach/pxafb.h> 28#include <mach/pxafb.h>
31#include <mach/ohci.h>
32#include <mach/mmc.h>
33#include <mach/bitfield.h>
34 29
35#include <asm/hardware/it8152.h> 30#include <asm/hardware/it8152.h>
36 31
37#include "generic.h" 32#include "generic.h"
38#include "cm-x2xx-pci.h" 33#include "cm-x2xx-pci.h"
39 34
35extern void cmx270_init(void);
36
40/* virtual addresses for statically mapped regions */ 37/* virtual addresses for statically mapped regions */
41#define CMX2XX_VIRT_BASE (0xe8000000) 38#define CMX2XX_VIRT_BASE (0xe8000000)
42#define CMX2XX_IT8152_VIRT (CMX2XX_VIRT_BASE) 39#define CMX2XX_IT8152_VIRT (CMX2XX_VIRT_BASE)
43 40
44#define RTC_PHYS_BASE (PXA_CS1_PHYS + (5 << 22)) 41/* physical address if local-bus attached devices */
45#define CMX270_DM9000_PHYS_BASE (PXA_CS1_PHYS + (6 << 22)) 42#define CMX270_DM9000_PHYS_BASE (PXA_CS1_PHYS + (6 << 22))
46 43
47/* leds */ 44/* leds */
@@ -51,114 +48,8 @@
51/* GPIO IRQ usage */ 48/* GPIO IRQ usage */
52#define GPIO10_ETHIRQ (10) 49#define GPIO10_ETHIRQ (10)
53#define CMX270_GPIO_IT8152_IRQ (22) 50#define CMX270_GPIO_IT8152_IRQ (22)
54#define GPIO83_MMC_IRQ (83)
55#define GPIO95_GFXIRQ (95)
56 51
57#define CMX270_ETHIRQ IRQ_GPIO(GPIO10_ETHIRQ) 52#define CMX270_ETHIRQ IRQ_GPIO(GPIO10_ETHIRQ)
58#define CMX270_MMC_IRQ IRQ_GPIO(GPIO83_MMC_IRQ)
59#define CMX270_GFXIRQ IRQ_GPIO(GPIO95_GFXIRQ)
60
61/* MMC power enable */
62#define GPIO105_MMC_POWER (105)
63
64static unsigned long cmx270_pin_config[] = {
65 /* AC'97 */
66 GPIO28_AC97_BITCLK,
67 GPIO29_AC97_SDATA_IN_0,
68 GPIO30_AC97_SDATA_OUT,
69 GPIO31_AC97_SYNC,
70 GPIO98_AC97_SYSCLK,
71 GPIO113_AC97_nRESET,
72
73 /* BTUART */
74 GPIO42_BTUART_RXD,
75 GPIO43_BTUART_TXD,
76 GPIO44_BTUART_CTS,
77 GPIO45_BTUART_RTS,
78
79 /* STUART */
80 GPIO46_STUART_RXD,
81 GPIO47_STUART_TXD,
82
83 /* MCI controller */
84 GPIO32_MMC_CLK,
85 GPIO112_MMC_CMD,
86 GPIO92_MMC_DAT_0,
87 GPIO109_MMC_DAT_1,
88 GPIO110_MMC_DAT_2,
89 GPIO111_MMC_DAT_3,
90
91 /* LCD */
92 GPIO58_LCD_LDD_0,
93 GPIO59_LCD_LDD_1,
94 GPIO60_LCD_LDD_2,
95 GPIO61_LCD_LDD_3,
96 GPIO62_LCD_LDD_4,
97 GPIO63_LCD_LDD_5,
98 GPIO64_LCD_LDD_6,
99 GPIO65_LCD_LDD_7,
100 GPIO66_LCD_LDD_8,
101 GPIO67_LCD_LDD_9,
102 GPIO68_LCD_LDD_10,
103 GPIO69_LCD_LDD_11,
104 GPIO70_LCD_LDD_12,
105 GPIO71_LCD_LDD_13,
106 GPIO72_LCD_LDD_14,
107 GPIO73_LCD_LDD_15,
108 GPIO74_LCD_FCLK,
109 GPIO75_LCD_LCLK,
110 GPIO76_LCD_PCLK,
111 GPIO77_LCD_BIAS,
112
113 /* I2C */
114 GPIO117_I2C_SCL,
115 GPIO118_I2C_SDA,
116
117 /* SSP1 */
118 GPIO23_SSP1_SCLK,
119 GPIO24_SSP1_SFRM,
120 GPIO25_SSP1_TXD,
121 GPIO26_SSP1_RXD,
122
123 /* SSP2 */
124 GPIO19_SSP2_SCLK,
125 GPIO14_SSP2_SFRM,
126 GPIO87_SSP2_TXD,
127 GPIO88_SSP2_RXD,
128
129 /* PC Card */
130 GPIO48_nPOE,
131 GPIO49_nPWE,
132 GPIO50_nPIOR,
133 GPIO51_nPIOW,
134 GPIO85_nPCE_1,
135 GPIO54_nPCE_2,
136 GPIO55_nPREG,
137 GPIO56_nPWAIT,
138 GPIO57_nIOIS16,
139
140 /* SDRAM and local bus */
141 GPIO15_nCS_1,
142 GPIO78_nCS_2,
143 GPIO79_nCS_3,
144 GPIO80_nCS_4,
145 GPIO33_nCS_5,
146 GPIO49_nPWE,
147 GPIO18_RDY,
148
149 /* GPIO */
150 GPIO0_GPIO | WAKEUP_ON_EDGE_BOTH,
151 GPIO105_GPIO | MFP_LPM_DRIVE_HIGH, /* MMC/SD power */
152 GPIO53_GPIO, /* PC card reset */
153
154 /* NAND controls */
155 GPIO11_GPIO | MFP_LPM_DRIVE_HIGH, /* NAND CE# */
156 GPIO89_GPIO, /* NAND Ready/Busy */
157
158 /* interrupts */
159 GPIO10_GPIO, /* DM9000 interrupt */
160 GPIO83_GPIO, /* MMC card detect */
161};
162 53
163#if defined(CONFIG_DM9000) || defined(CONFIG_DM9000_MODULE) 54#if defined(CONFIG_DM9000) || defined(CONFIG_DM9000_MODULE)
164static struct resource cmx270_dm9000_resource[] = { 55static struct resource cmx270_dm9000_resource[] = {
@@ -216,38 +107,6 @@ static void __init cmx2xx_init_touchscreen(void)
216static inline void cmx2xx_init_touchscreen(void) {} 107static inline void cmx2xx_init_touchscreen(void) {}
217#endif 108#endif
218 109
219/* V3020 RTC */
220#if defined(CONFIG_RTC_DRV_V3020) || defined(CONFIG_RTC_DRV_V3020_MODULE)
221static struct resource cmx270_v3020_resource[] = {
222 [0] = {
223 .start = RTC_PHYS_BASE,
224 .end = RTC_PHYS_BASE + 4,
225 .flags = IORESOURCE_MEM,
226 },
227};
228
229struct v3020_platform_data cmx270_v3020_pdata = {
230 .leftshift = 16,
231};
232
233static struct platform_device cmx270_rtc_device = {
234 .name = "v3020",
235 .num_resources = ARRAY_SIZE(cmx270_v3020_resource),
236 .resource = cmx270_v3020_resource,
237 .id = -1,
238 .dev = {
239 .platform_data = &cmx270_v3020_pdata,
240 }
241};
242
243static void __init cmx270_init_rtc(void)
244{
245 platform_device_register(&cmx270_rtc_device);
246}
247#else
248static inline void cmx2xx_init_rtc(void) {}
249#endif
250
251/* CM-X270 LEDs */ 110/* CM-X270 LEDs */
252#if defined(CONFIG_LEDS_GPIO) || defined(CONFIG_LEDS_GPIO_MODULE) 111#if defined(CONFIG_LEDS_GPIO) || defined(CONFIG_LEDS_GPIO_MODULE)
253static struct gpio_led cmx2xx_leds[] = { 112static struct gpio_led cmx2xx_leds[] = {
@@ -286,96 +145,6 @@ static void __init cmx2xx_init_leds(void)
286static inline void cmx2xx_init_leds(void) {} 145static inline void cmx2xx_init_leds(void) {}
287#endif 146#endif
288 147
289/* 2700G graphics */
290#if defined(CONFIG_FB_MBX) || defined(CONFIG_FB_MBX_MODULE)
291static u64 fb_dma_mask = ~(u64)0;
292
293static struct resource cmx270_2700G_resource[] = {
294 /* frame buffer memory including ODFB and External SDRAM */
295 [0] = {
296 .start = PXA_CS2_PHYS,
297 .end = PXA_CS2_PHYS + 0x01ffffff,
298 .flags = IORESOURCE_MEM,
299 },
300 /* Marathon registers */
301 [1] = {
302 .start = PXA_CS2_PHYS + 0x03fe0000,
303 .end = PXA_CS2_PHYS + 0x03ffffff,
304 .flags = IORESOURCE_MEM,
305 },
306};
307
308static unsigned long save_lcd_regs[10];
309
310static int cmx270_marathon_probe(struct fb_info *fb)
311{
312 /* save PXA-270 pin settings before enabling 2700G */
313 save_lcd_regs[0] = GPDR1;
314 save_lcd_regs[1] = GPDR2;
315 save_lcd_regs[2] = GAFR1_U;
316 save_lcd_regs[3] = GAFR2_L;
317 save_lcd_regs[4] = GAFR2_U;
318
319 /* Disable PXA-270 on-chip controller driving pins */
320 GPDR1 &= ~(0xfc000000);
321 GPDR2 &= ~(0x00c03fff);
322 GAFR1_U &= ~(0xfff00000);
323 GAFR2_L &= ~(0x0fffffff);
324 GAFR2_U &= ~(0x0000f000);
325 return 0;
326}
327
328static int cmx270_marathon_remove(struct fb_info *fb)
329{
330 GPDR1 = save_lcd_regs[0];
331 GPDR2 = save_lcd_regs[1];
332 GAFR1_U = save_lcd_regs[2];
333 GAFR2_L = save_lcd_regs[3];
334 GAFR2_U = save_lcd_regs[4];
335 return 0;
336}
337
338static struct mbxfb_platform_data cmx270_2700G_data = {
339 .xres = {
340 .min = 240,
341 .max = 1200,
342 .defval = 640,
343 },
344 .yres = {
345 .min = 240,
346 .max = 1200,
347 .defval = 480,
348 },
349 .bpp = {
350 .min = 16,
351 .max = 32,
352 .defval = 16,
353 },
354 .memsize = 8*1024*1024,
355 .probe = cmx270_marathon_probe,
356 .remove = cmx270_marathon_remove,
357};
358
359static struct platform_device cmx270_2700G = {
360 .name = "mbx-fb",
361 .dev = {
362 .platform_data = &cmx270_2700G_data,
363 .dma_mask = &fb_dma_mask,
364 .coherent_dma_mask = 0xffffffff,
365 },
366 .num_resources = ARRAY_SIZE(cmx270_2700G_resource),
367 .resource = cmx270_2700G_resource,
368 .id = -1,
369};
370
371static void __init cmx270_init_2700G(void)
372{
373 platform_device_register(&cmx270_2700G);
374}
375#else
376static inline void cmx270_init_2700G(void) {}
377#endif
378
379#if defined(CONFIG_FB_PXA) || defined(CONFIG_FB_PXA_MODULE) 148#if defined(CONFIG_FB_PXA) || defined(CONFIG_FB_PXA_MODULE)
380/* 149/*
381 Display definitions 150 Display definitions
@@ -594,91 +363,6 @@ static void __init cmx2xx_init_display(void)
594static inline void cmx2xx_init_display(void) {} 363static inline void cmx2xx_init_display(void) {}
595#endif 364#endif
596 365
597/* PXA27x OHCI controller setup */
598#if defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE)
599static int cmx270_ohci_init(struct device *dev)
600{
601 /* Set the Power Control Polarity Low */
602 UHCHR = (UHCHR | UHCHR_PCPL) &
603 ~(UHCHR_SSEP1 | UHCHR_SSEP2 | UHCHR_SSE);
604
605 return 0;
606}
607
608static struct pxaohci_platform_data cmx270_ohci_platform_data = {
609 .port_mode = PMM_PERPORT_MODE,
610 .init = cmx270_ohci_init,
611};
612
613static void __init cmx270_init_ohci(void)
614{
615 pxa_set_ohci_info(&cmx270_ohci_platform_data);
616}
617#else
618static inline void cmx270_init_ohci(void) {}
619#endif
620
621#if defined(CONFIG_MMC) || defined(CONFIG_MMC_MODULE)
622static int cmx270_mci_init(struct device *dev,
623 irq_handler_t cmx270_detect_int,
624 void *data)
625{
626 int err;
627
628 err = gpio_request(GPIO105_MMC_POWER, "MMC/SD power");
629 if (err) {
630 dev_warn(dev, "power gpio unavailable\n");
631 return err;
632 }
633
634 gpio_direction_output(GPIO105_MMC_POWER, 0);
635
636 err = request_irq(CMX270_MMC_IRQ, cmx270_detect_int,
637 IRQF_DISABLED | IRQF_TRIGGER_FALLING,
638 "MMC card detect", data);
639 if (err) {
640 gpio_free(GPIO105_MMC_POWER);
641 dev_err(dev, "cmx270_mci_init: MMC/SD: can't"
642 " request MMC card detect IRQ\n");
643 }
644
645 return err;
646}
647
648static void cmx270_mci_setpower(struct device *dev, unsigned int vdd)
649{
650 struct pxamci_platform_data *p_d = dev->platform_data;
651
652 if ((1 << vdd) & p_d->ocr_mask) {
653 dev_dbg(dev, "power on\n");
654 gpio_set_value(GPIO105_MMC_POWER, 0);
655 } else {
656 gpio_set_value(GPIO105_MMC_POWER, 1);
657 dev_dbg(dev, "power off\n");
658 }
659}
660
661static void cmx270_mci_exit(struct device *dev, void *data)
662{
663 free_irq(CMX270_MMC_IRQ, data);
664 gpio_free(GPIO105_MMC_POWER);
665}
666
667static struct pxamci_platform_data cmx270_mci_platform_data = {
668 .ocr_mask = MMC_VDD_32_33|MMC_VDD_33_34,
669 .init = cmx270_mci_init,
670 .setpower = cmx270_mci_setpower,
671 .exit = cmx270_mci_exit,
672};
673
674static void __init cmx270_init_mmc(void)
675{
676 pxa_set_mci_info(&cmx270_mci_platform_data);
677}
678#else
679static inline void cmx270_init_mmc(void) {}
680#endif
681
682#ifdef CONFIG_PM 366#ifdef CONFIG_PM
683static unsigned long sleep_save_msc[10]; 367static unsigned long sleep_save_msc[10];
684 368
@@ -749,16 +433,6 @@ static void __init cmx2xx_init_ac97(void)
749static inline void cmx2xx_init_ac97(void) {} 433static inline void cmx2xx_init_ac97(void) {}
750#endif 434#endif
751 435
752static void __init cmx270_init(void)
753{
754 pxa2xx_mfp_config(ARRAY_AND_SIZE(cmx270_pin_config));
755
756 cmx270_init_rtc();
757 cmx270_init_mmc();
758 cmx270_init_ohci();
759 cmx270_init_2700G();
760}
761
762static void __init cmx2xx_init(void) 436static void __init cmx2xx_init(void)
763{ 437{
764 cmx2xx_pm_init(); 438 cmx2xx_pm_init();