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/generic.c82
-rw-r--r--arch/arm/mach-pxa/idp.c21
-rw-r--r--arch/arm/mach-pxa/lubbock.c27
-rw-r--r--arch/arm/mach-pxa/mainstone.c32
-rw-r--r--arch/arm/mach-pxa/pxa25x.c2
-rw-r--r--arch/arm/mach-pxa/pxa27x.c2
-rw-r--r--arch/arm/mach-pxa/sleep.S7
-rw-r--r--arch/arm/mach-pxa/standby.S2
8 files changed, 148 insertions, 27 deletions
diff --git a/arch/arm/mach-pxa/generic.c b/arch/arm/mach-pxa/generic.c
index 1d7677669a76..3248bc9b9495 100644
--- a/arch/arm/mach-pxa/generic.c
+++ b/arch/arm/mach-pxa/generic.c
@@ -34,6 +34,7 @@
34#include <asm/arch/udc.h> 34#include <asm/arch/udc.h>
35#include <asm/arch/pxafb.h> 35#include <asm/arch/pxafb.h>
36#include <asm/arch/mmc.h> 36#include <asm/arch/mmc.h>
37#include <asm/arch/irda.h>
37#include <asm/arch/i2c.h> 38#include <asm/arch/i2c.h>
38 39
39#include "generic.h" 40#include "generic.h"
@@ -92,14 +93,42 @@ EXPORT_SYMBOL(pxa_set_cken);
92 * and cache flush area. 93 * and cache flush area.
93 */ 94 */
94static struct map_desc standard_io_desc[] __initdata = { 95static struct map_desc standard_io_desc[] __initdata = {
95 /* virtual physical length type */ 96 { /* Devs */
96 { 0xf2000000, 0x40000000, 0x02000000, MT_DEVICE }, /* Devs */ 97 .virtual = 0xf2000000,
97 { 0xf4000000, 0x44000000, 0x00100000, MT_DEVICE }, /* LCD */ 98 .pfn = __phys_to_pfn(0x40000000),
98 { 0xf6000000, 0x48000000, 0x00100000, MT_DEVICE }, /* Mem Ctl */ 99 .length = 0x02000000,
99 { 0xf8000000, 0x4c000000, 0x00100000, MT_DEVICE }, /* USB host */ 100 .type = MT_DEVICE
100 { 0xfa000000, 0x50000000, 0x00100000, MT_DEVICE }, /* Camera */ 101 }, { /* LCD */
101 { 0xfe000000, 0x58000000, 0x00100000, MT_DEVICE }, /* IMem ctl */ 102 .virtual = 0xf4000000,
102 { 0xff000000, 0x00000000, 0x00100000, MT_DEVICE } /* UNCACHED_PHYS_0 */ 103 .pfn = __phys_to_pfn(0x44000000),
104 .length = 0x00100000,
105 .type = MT_DEVICE
106 }, { /* Mem Ctl */
107 .virtual = 0xf6000000,
108 .pfn = __phys_to_pfn(0x48000000),
109 .length = 0x00100000,
110 .type = MT_DEVICE
111 }, { /* USB host */
112 .virtual = 0xf8000000,
113 .pfn = __phys_to_pfn(0x4c000000),
114 .length = 0x00100000,
115 .type = MT_DEVICE
116 }, { /* Camera */
117 .virtual = 0xfa000000,
118 .pfn = __phys_to_pfn(0x50000000),
119 .length = 0x00100000,
120 .type = MT_DEVICE
121 }, { /* IMem ctl */
122 .virtual = 0xfe000000,
123 .pfn = __phys_to_pfn(0x58000000),
124 .length = 0x00100000,
125 .type = MT_DEVICE
126 }, { /* UNCACHED_PHYS_0 */
127 .virtual = 0xff000000,
128 .pfn = __phys_to_pfn(0x00000000),
129 .length = 0x00100000,
130 .type = MT_DEVICE
131 }
103}; 132};
104 133
105void __init pxa_map_io(void) 134void __init pxa_map_io(void)
@@ -225,6 +254,10 @@ static struct platform_device stuart_device = {
225 .name = "pxa2xx-uart", 254 .name = "pxa2xx-uart",
226 .id = 2, 255 .id = 2,
227}; 256};
257static struct platform_device hwuart_device = {
258 .name = "pxa2xx-uart",
259 .id = 3,
260};
228 261
229static struct resource i2c_resources[] = { 262static struct resource i2c_resources[] = {
230 { 263 {
@@ -265,10 +298,26 @@ static struct resource i2s_resources[] = {
265static struct platform_device i2s_device = { 298static struct platform_device i2s_device = {
266 .name = "pxa2xx-i2s", 299 .name = "pxa2xx-i2s",
267 .id = -1, 300 .id = -1,
268 .resource = i2c_resources, 301 .resource = i2s_resources,
269 .num_resources = ARRAY_SIZE(i2s_resources), 302 .num_resources = ARRAY_SIZE(i2s_resources),
270}; 303};
271 304
305static u64 pxaficp_dmamask = ~(u32)0;
306
307static struct platform_device pxaficp_device = {
308 .name = "pxa2xx-ir",
309 .id = -1,
310 .dev = {
311 .dma_mask = &pxaficp_dmamask,
312 .coherent_dma_mask = 0xffffffff,
313 },
314};
315
316void __init pxa_set_ficp_info(struct pxaficp_platform_data *info)
317{
318 pxaficp_device.dev.platform_data = info;
319}
320
272static struct platform_device *devices[] __initdata = { 321static struct platform_device *devices[] __initdata = {
273 &pxamci_device, 322 &pxamci_device,
274 &udc_device, 323 &udc_device,
@@ -276,13 +325,26 @@ static struct platform_device *devices[] __initdata = {
276 &ffuart_device, 325 &ffuart_device,
277 &btuart_device, 326 &btuart_device,
278 &stuart_device, 327 &stuart_device,
328 &pxaficp_device,
279 &i2c_device, 329 &i2c_device,
280 &i2s_device, 330 &i2s_device,
281}; 331};
282 332
283static int __init pxa_init(void) 333static int __init pxa_init(void)
284{ 334{
285 return platform_add_devices(devices, ARRAY_SIZE(devices)); 335 int cpuid, ret;
336
337 ret = platform_add_devices(devices, ARRAY_SIZE(devices));
338 if (ret)
339 return ret;
340
341 /* Only add HWUART for PXA255/26x; PXA210/250/27x do not have it. */
342 cpuid = read_cpuid(CPUID_ID);
343 if (((cpuid >> 4) & 0xfff) == 0x2d0 ||
344 ((cpuid >> 4) & 0xfff) == 0x290)
345 ret = platform_device_register(&hwuart_device);
346
347 return ret;
286} 348}
287 349
288subsys_initcall(pxa_init); 350subsys_initcall(pxa_init);
diff --git a/arch/arm/mach-pxa/idp.c b/arch/arm/mach-pxa/idp.c
index 386e107b53cc..01a83ab09ac3 100644
--- a/arch/arm/mach-pxa/idp.c
+++ b/arch/arm/mach-pxa/idp.c
@@ -152,16 +152,17 @@ static void __init idp_init_irq(void)
152} 152}
153 153
154static struct map_desc idp_io_desc[] __initdata = { 154static struct map_desc idp_io_desc[] __initdata = {
155 /* virtual physical length type */ 155 {
156 156 .virtual = IDP_COREVOLT_VIRT,
157 { IDP_COREVOLT_VIRT, 157 .pfn = __phys_to_pfn(IDP_COREVOLT_PHYS),
158 IDP_COREVOLT_PHYS, 158 .length = IDP_COREVOLT_SIZE,
159 IDP_COREVOLT_SIZE, 159 .type = MT_DEVICE
160 MT_DEVICE }, 160 }, {
161 { IDP_CPLD_VIRT, 161 .virtual = IDP_CPLD_VIRT,
162 IDP_CPLD_PHYS, 162 .pfn = __phys_to_pfn(IDP_CPLD_PHYS),
163 IDP_CPLD_SIZE, 163 .length = IDP_CPLD_SIZE,
164 MT_DEVICE } 164 .type = MT_DEVICE
165 }
165}; 166};
166 167
167static void __init idp_map_io(void) 168static void __init idp_map_io(void)
diff --git a/arch/arm/mach-pxa/lubbock.c b/arch/arm/mach-pxa/lubbock.c
index 1f38033921e9..beccf455f796 100644
--- a/arch/arm/mach-pxa/lubbock.c
+++ b/arch/arm/mach-pxa/lubbock.c
@@ -35,6 +35,7 @@
35#include <asm/arch/pxa-regs.h> 35#include <asm/arch/pxa-regs.h>
36#include <asm/arch/lubbock.h> 36#include <asm/arch/lubbock.h>
37#include <asm/arch/udc.h> 37#include <asm/arch/udc.h>
38#include <asm/arch/irda.h>
38#include <asm/arch/pxafb.h> 39#include <asm/arch/pxafb.h>
39#include <asm/arch/mmc.h> 40#include <asm/arch/mmc.h>
40 41
@@ -237,16 +238,40 @@ static struct pxamci_platform_data lubbock_mci_platform_data = {
237 .init = lubbock_mci_init, 238 .init = lubbock_mci_init,
238}; 239};
239 240
241static void lubbock_irda_transceiver_mode(struct device *dev, int mode)
242{
243 unsigned long flags;
244
245 local_irq_save(flags);
246 if (mode & IR_SIRMODE) {
247 LUB_MISC_WR &= ~(1 << 4);
248 } else if (mode & IR_FIRMODE) {
249 LUB_MISC_WR |= 1 << 4;
250 }
251 local_irq_restore(flags);
252}
253
254static struct pxaficp_platform_data lubbock_ficp_platform_data = {
255 .transceiver_cap = IR_SIRMODE | IR_FIRMODE,
256 .transceiver_mode = lubbock_irda_transceiver_mode,
257};
258
240static void __init lubbock_init(void) 259static void __init lubbock_init(void)
241{ 260{
242 pxa_set_udc_info(&udc_info); 261 pxa_set_udc_info(&udc_info);
243 set_pxa_fb_info(&sharp_lm8v31); 262 set_pxa_fb_info(&sharp_lm8v31);
244 pxa_set_mci_info(&lubbock_mci_platform_data); 263 pxa_set_mci_info(&lubbock_mci_platform_data);
264 pxa_set_ficp_info(&lubbock_ficp_platform_data);
245 (void) platform_add_devices(devices, ARRAY_SIZE(devices)); 265 (void) platform_add_devices(devices, ARRAY_SIZE(devices));
246} 266}
247 267
248static struct map_desc lubbock_io_desc[] __initdata = { 268static struct map_desc lubbock_io_desc[] __initdata = {
249 { LUBBOCK_FPGA_VIRT, LUBBOCK_FPGA_PHYS, 0x00100000, MT_DEVICE }, /* CPLD */ 269 { /* CPLD */
270 .virtual = LUBBOCK_FPGA_VIRT,
271 .pfn = __phys_to_pfn(LUBBOCK_FPGA_PHYS),
272 .length = 0x00100000,
273 .type = MT_DEVICE
274 }
250}; 275};
251 276
252static void __init lubbock_map_io(void) 277static void __init lubbock_map_io(void)
diff --git a/arch/arm/mach-pxa/mainstone.c b/arch/arm/mach-pxa/mainstone.c
index 85fdb5b1470a..a48c64026e1f 100644
--- a/arch/arm/mach-pxa/mainstone.c
+++ b/arch/arm/mach-pxa/mainstone.c
@@ -37,6 +37,7 @@
37#include <asm/arch/audio.h> 37#include <asm/arch/audio.h>
38#include <asm/arch/pxafb.h> 38#include <asm/arch/pxafb.h>
39#include <asm/arch/mmc.h> 39#include <asm/arch/mmc.h>
40#include <asm/arch/irda.h>
40 41
41#include "generic.h" 42#include "generic.h"
42 43
@@ -294,6 +295,29 @@ static struct pxamci_platform_data mainstone_mci_platform_data = {
294 .exit = mainstone_mci_exit, 295 .exit = mainstone_mci_exit,
295}; 296};
296 297
298static void mainstone_irda_transceiver_mode(struct device *dev, int mode)
299{
300 unsigned long flags;
301
302 local_irq_save(flags);
303 if (mode & IR_SIRMODE) {
304 MST_MSCWR1 &= ~MST_MSCWR1_IRDA_FIR;
305 } else if (mode & IR_FIRMODE) {
306 MST_MSCWR1 |= MST_MSCWR1_IRDA_FIR;
307 }
308 if (mode & IR_OFF) {
309 MST_MSCWR1 = (MST_MSCWR1 & ~MST_MSCWR1_IRDA_MASK) | MST_MSCWR1_IRDA_OFF;
310 } else {
311 MST_MSCWR1 = (MST_MSCWR1 & ~MST_MSCWR1_IRDA_MASK) | MST_MSCWR1_IRDA_FULL;
312 }
313 local_irq_restore(flags);
314}
315
316static struct pxaficp_platform_data mainstone_ficp_platform_data = {
317 .transceiver_cap = IR_SIRMODE | IR_FIRMODE | IR_OFF,
318 .transceiver_mode = mainstone_irda_transceiver_mode,
319};
320
297static void __init mainstone_init(void) 321static void __init mainstone_init(void)
298{ 322{
299 /* 323 /*
@@ -313,11 +337,17 @@ static void __init mainstone_init(void)
313 set_pxa_fb_info(&toshiba_ltm035a776c); 337 set_pxa_fb_info(&toshiba_ltm035a776c);
314 338
315 pxa_set_mci_info(&mainstone_mci_platform_data); 339 pxa_set_mci_info(&mainstone_mci_platform_data);
340 pxa_set_ficp_info(&mainstone_ficp_platform_data);
316} 341}
317 342
318 343
319static struct map_desc mainstone_io_desc[] __initdata = { 344static struct map_desc mainstone_io_desc[] __initdata = {
320 { MST_FPGA_VIRT, MST_FPGA_PHYS, 0x00100000, MT_DEVICE }, /* CPLD */ 345 { /* CPLD */
346 .virtual = MST_FPGA_VIRT,
347 .pfn = __phys_to_pfn(MST_FPGA_PHYS),
348 .length = 0x00100000,
349 .type = MT_DEVICE
350 }
321}; 351};
322 352
323static void __init mainstone_map_io(void) 353static void __init mainstone_map_io(void)
diff --git a/arch/arm/mach-pxa/pxa25x.c b/arch/arm/mach-pxa/pxa25x.c
index 7869c3b4e62f..573a5758e781 100644
--- a/arch/arm/mach-pxa/pxa25x.c
+++ b/arch/arm/mach-pxa/pxa25x.c
@@ -129,7 +129,7 @@ void pxa_cpu_pm_enter(suspend_state_t state)
129 case PM_SUSPEND_MEM: 129 case PM_SUSPEND_MEM:
130 /* set resume return address */ 130 /* set resume return address */
131 PSPR = virt_to_phys(pxa_cpu_resume); 131 PSPR = virt_to_phys(pxa_cpu_resume);
132 pxa_cpu_suspend(3); 132 pxa_cpu_suspend(PWRMODE_SLEEP);
133 break; 133 break;
134 } 134 }
135} 135}
diff --git a/arch/arm/mach-pxa/pxa27x.c b/arch/arm/mach-pxa/pxa27x.c
index 9a791b07118d..09a5d593f04b 100644
--- a/arch/arm/mach-pxa/pxa27x.c
+++ b/arch/arm/mach-pxa/pxa27x.c
@@ -157,7 +157,7 @@ void pxa_cpu_pm_enter(suspend_state_t state)
157 case PM_SUSPEND_MEM: 157 case PM_SUSPEND_MEM:
158 /* set resume return address */ 158 /* set resume return address */
159 PSPR = virt_to_phys(pxa_cpu_resume); 159 PSPR = virt_to_phys(pxa_cpu_resume);
160 pxa_cpu_suspend(3); 160 pxa_cpu_suspend(PWRMODE_SLEEP);
161 break; 161 break;
162 } 162 }
163} 163}
diff --git a/arch/arm/mach-pxa/sleep.S b/arch/arm/mach-pxa/sleep.S
index 5786ccad938c..c9862688ff3d 100644
--- a/arch/arm/mach-pxa/sleep.S
+++ b/arch/arm/mach-pxa/sleep.S
@@ -28,7 +28,9 @@
28/* 28/*
29 * pxa_cpu_suspend() 29 * pxa_cpu_suspend()
30 * 30 *
31 * Forces CPU into sleep state 31 * Forces CPU into sleep state.
32 *
33 * r0 = value for PWRMODE M field for desired sleep state
32 */ 34 */
33 35
34ENTRY(pxa_cpu_suspend) 36ENTRY(pxa_cpu_suspend)
@@ -53,6 +55,7 @@ ENTRY(pxa_cpu_suspend)
53 mov r10, sp 55 mov r10, sp
54 stmfd sp!, {r3 - r10} 56 stmfd sp!, {r3 - r10}
55 57
58 mov r5, r0 @ save sleep mode
56 @ preserve phys address of stack 59 @ preserve phys address of stack
57 mov r0, sp 60 mov r0, sp
58 bl sleep_phys_sp 61 bl sleep_phys_sp
@@ -66,7 +69,7 @@ ENTRY(pxa_cpu_suspend)
66 @ (also workaround for sighting 28071) 69 @ (also workaround for sighting 28071)
67 70
68 @ prepare value for sleep mode 71 @ prepare value for sleep mode
69 mov r1, #3 @ sleep mode 72 mov r1, r5 @ sleep mode
70 73
71 @ prepare pointer to physical address 0 (virtual mapping in generic.c) 74 @ prepare pointer to physical address 0 (virtual mapping in generic.c)
72 mov r2, #UNCACHED_PHYS_0 75 mov r2, #UNCACHED_PHYS_0
diff --git a/arch/arm/mach-pxa/standby.S b/arch/arm/mach-pxa/standby.S
index 8a3f27b76784..6f6dbbd08021 100644
--- a/arch/arm/mach-pxa/standby.S
+++ b/arch/arm/mach-pxa/standby.S
@@ -21,7 +21,7 @@
21ENTRY(pxa_cpu_standby) 21ENTRY(pxa_cpu_standby)
22 ldr r0, =PSSR 22 ldr r0, =PSSR
23 mov r1, #(PSSR_PH | PSSR_STS) 23 mov r1, #(PSSR_PH | PSSR_STS)
24 mov r2, #2 24 mov r2, #PWRMODE_STANDBY
25 mov r3, #UNCACHED_PHYS_0 @ Read mem context in. 25 mov r3, #UNCACHED_PHYS_0 @ Read mem context in.
26 ldr ip, [r3] 26 ldr ip, [r3]
27 b 1f 27 b 1f