diff options
Diffstat (limited to 'arch/arm/mach-pxa/pxa3xx.c')
-rw-r--r-- | arch/arm/mach-pxa/pxa3xx.c | 47 |
1 files changed, 44 insertions, 3 deletions
diff --git a/arch/arm/mach-pxa/pxa3xx.c b/arch/arm/mach-pxa/pxa3xx.c index 09b7b1a10cad..fcb0721f4669 100644 --- a/arch/arm/mach-pxa/pxa3xx.c +++ b/arch/arm/mach-pxa/pxa3xx.c | |||
@@ -30,6 +30,7 @@ | |||
30 | #include <mach/pm.h> | 30 | #include <mach/pm.h> |
31 | #include <mach/dma.h> | 31 | #include <mach/dma.h> |
32 | #include <mach/ssp.h> | 32 | #include <mach/ssp.h> |
33 | #include <mach/regs-intc.h> | ||
33 | #include <plat/i2c.h> | 34 | #include <plat/i2c.h> |
34 | 35 | ||
35 | #include "generic.h" | 36 | #include "generic.h" |
@@ -45,6 +46,9 @@ | |||
45 | #define ACCR_D0CS (1 << 26) | 46 | #define ACCR_D0CS (1 << 26) |
46 | #define ACCR_PCCE (1 << 11) | 47 | #define ACCR_PCCE (1 << 11) |
47 | 48 | ||
49 | #define PECR_IE(n) ((1 << ((n) * 2)) << 28) | ||
50 | #define PECR_IS(n) ((1 << ((n) * 2)) << 29) | ||
51 | |||
48 | /* crystal frequency to static memory controller multiplier (SMCFS) */ | 52 | /* crystal frequency to static memory controller multiplier (SMCFS) */ |
49 | static unsigned char smcfs_mult[8] = { 6, 0, 8, 0, 0, 16, }; | 53 | static unsigned char smcfs_mult[8] = { 6, 0, 8, 0, 0, 16, }; |
50 | 54 | ||
@@ -237,6 +241,7 @@ static DEFINE_PXA3_CKEN(pxa3xx_stuart, STUART, 14857000, 1); | |||
237 | static DEFINE_PXA3_CKEN(pxa3xx_i2c, I2C, 32842000, 0); | 241 | static DEFINE_PXA3_CKEN(pxa3xx_i2c, I2C, 32842000, 0); |
238 | static DEFINE_PXA3_CKEN(pxa3xx_udc, UDC, 48000000, 5); | 242 | static DEFINE_PXA3_CKEN(pxa3xx_udc, UDC, 48000000, 5); |
239 | static DEFINE_PXA3_CKEN(pxa3xx_usbh, USBH, 48000000, 0); | 243 | static DEFINE_PXA3_CKEN(pxa3xx_usbh, USBH, 48000000, 0); |
244 | static DEFINE_PXA3_CKEN(pxa3xx_u2d, USB2, 48000000, 0); | ||
240 | static DEFINE_PXA3_CKEN(pxa3xx_keypad, KEYPAD, 32768, 0); | 245 | static DEFINE_PXA3_CKEN(pxa3xx_keypad, KEYPAD, 32768, 0); |
241 | static DEFINE_PXA3_CKEN(pxa3xx_ssp1, SSP1, 13000000, 0); | 246 | static DEFINE_PXA3_CKEN(pxa3xx_ssp1, SSP1, 13000000, 0); |
242 | static DEFINE_PXA3_CKEN(pxa3xx_ssp2, SSP2, 13000000, 0); | 247 | static DEFINE_PXA3_CKEN(pxa3xx_ssp2, SSP2, 13000000, 0); |
@@ -261,6 +266,7 @@ static struct clk_lookup pxa3xx_clkregs[] = { | |||
261 | INIT_CLKREG(&clk_pxa3xx_i2c, "pxa2xx-i2c.0", NULL), | 266 | INIT_CLKREG(&clk_pxa3xx_i2c, "pxa2xx-i2c.0", NULL), |
262 | INIT_CLKREG(&clk_pxa3xx_udc, "pxa27x-udc", NULL), | 267 | INIT_CLKREG(&clk_pxa3xx_udc, "pxa27x-udc", NULL), |
263 | INIT_CLKREG(&clk_pxa3xx_usbh, "pxa27x-ohci", NULL), | 268 | INIT_CLKREG(&clk_pxa3xx_usbh, "pxa27x-ohci", NULL), |
269 | INIT_CLKREG(&clk_pxa3xx_u2d, NULL, "U2DCLK"), | ||
264 | INIT_CLKREG(&clk_pxa3xx_keypad, "pxa27x-keypad", NULL), | 270 | INIT_CLKREG(&clk_pxa3xx_keypad, "pxa27x-keypad", NULL), |
265 | INIT_CLKREG(&clk_pxa3xx_ssp1, "pxa27x-ssp.0", NULL), | 271 | INIT_CLKREG(&clk_pxa3xx_ssp1, "pxa27x-ssp.0", NULL), |
266 | INIT_CLKREG(&clk_pxa3xx_ssp2, "pxa27x-ssp.1", NULL), | 272 | INIT_CLKREG(&clk_pxa3xx_ssp2, "pxa27x-ssp.1", NULL), |
@@ -530,6 +536,43 @@ static inline void pxa3xx_init_pm(void) {} | |||
530 | #define pxa3xx_set_wake NULL | 536 | #define pxa3xx_set_wake NULL |
531 | #endif | 537 | #endif |
532 | 538 | ||
539 | static void pxa_ack_ext_wakeup(unsigned int irq) | ||
540 | { | ||
541 | PECR |= PECR_IS(irq - IRQ_WAKEUP0); | ||
542 | } | ||
543 | |||
544 | static void pxa_mask_ext_wakeup(unsigned int irq) | ||
545 | { | ||
546 | ICMR2 &= ~(1 << ((irq - PXA_IRQ(0)) & 0x1f)); | ||
547 | PECR &= ~PECR_IE(irq - IRQ_WAKEUP0); | ||
548 | } | ||
549 | |||
550 | static void pxa_unmask_ext_wakeup(unsigned int irq) | ||
551 | { | ||
552 | ICMR2 |= 1 << ((irq - PXA_IRQ(0)) & 0x1f); | ||
553 | PECR |= PECR_IE(irq - IRQ_WAKEUP0); | ||
554 | } | ||
555 | |||
556 | static struct irq_chip pxa_ext_wakeup_chip = { | ||
557 | .name = "WAKEUP", | ||
558 | .ack = pxa_ack_ext_wakeup, | ||
559 | .mask = pxa_mask_ext_wakeup, | ||
560 | .unmask = pxa_unmask_ext_wakeup, | ||
561 | }; | ||
562 | |||
563 | static void __init pxa_init_ext_wakeup_irq(set_wake_t fn) | ||
564 | { | ||
565 | int irq; | ||
566 | |||
567 | for (irq = IRQ_WAKEUP0; irq <= IRQ_WAKEUP1; irq++) { | ||
568 | set_irq_chip(irq, &pxa_ext_wakeup_chip); | ||
569 | set_irq_handler(irq, handle_edge_irq); | ||
570 | set_irq_flags(irq, IRQF_VALID); | ||
571 | } | ||
572 | |||
573 | pxa_ext_wakeup_chip.set_wake = fn; | ||
574 | } | ||
575 | |||
533 | void __init pxa3xx_init_irq(void) | 576 | void __init pxa3xx_init_irq(void) |
534 | { | 577 | { |
535 | /* enable CP6 access */ | 578 | /* enable CP6 access */ |
@@ -539,6 +582,7 @@ void __init pxa3xx_init_irq(void) | |||
539 | __asm__ __volatile__("mcr p15, 0, %0, c15, c1, 0\n": :"r"(value)); | 582 | __asm__ __volatile__("mcr p15, 0, %0, c15, c1, 0\n": :"r"(value)); |
540 | 583 | ||
541 | pxa_init_irq(56, pxa3xx_set_wake); | 584 | pxa_init_irq(56, pxa3xx_set_wake); |
585 | pxa_init_ext_wakeup_irq(pxa3xx_set_wake); | ||
542 | pxa_init_gpio(IRQ_GPIO_2_x, 2, 127, NULL); | 586 | pxa_init_gpio(IRQ_GPIO_2_x, 2, 127, NULL); |
543 | } | 587 | } |
544 | 588 | ||
@@ -553,9 +597,6 @@ void __init pxa3xx_set_i2c_power_info(struct i2c_pxa_platform_data *info) | |||
553 | 597 | ||
554 | static struct platform_device *devices[] __initdata = { | 598 | static struct platform_device *devices[] __initdata = { |
555 | &pxa27x_device_udc, | 599 | &pxa27x_device_udc, |
556 | &pxa_device_ffuart, | ||
557 | &pxa_device_btuart, | ||
558 | &pxa_device_stuart, | ||
559 | &pxa_device_i2s, | 600 | &pxa_device_i2s, |
560 | &sa1100_device_rtc, | 601 | &sa1100_device_rtc, |
561 | &pxa_device_rtc, | 602 | &pxa_device_rtc, |