15 #include <linux/module.h>
16 #include <linux/kernel.h>
27 #include <asm/suspend.h>
28 #include <mach/hardware.h>
30 #include <mach/reset.h>
35 #include <mach/irqs.h>
41 #define PECR_IE(n) ((1 << ((n) * 2)) << 28)
42 #define PECR_IS(n) ((1 << ((n) * 2)) << 29)
46 static DEFINE_PXA3_CKEN(pxa3xx_ffuart,
FFUART, 14857000, 1);
47 static DEFINE_PXA3_CKEN(pxa3xx_btuart,
BTUART, 14857000, 1);
48 static DEFINE_PXA3_CKEN(pxa3xx_stuart,
STUART, 14857000, 1);
49 static DEFINE_PXA3_CKEN(pxa3xx_i2c,
I2C, 32842000, 0);
50 static DEFINE_PXA3_CKEN(pxa3xx_udc,
UDC, 48000000, 5);
51 static DEFINE_PXA3_CKEN(pxa3xx_usbh,
USBH, 48000000, 0);
52 static DEFINE_PXA3_CKEN(pxa3xx_u2d, USB2, 48000000, 0);
53 static DEFINE_PXA3_CKEN(pxa3xx_keypad, KEYPAD, 32768, 0);
54 static DEFINE_PXA3_CKEN(pxa3xx_ssp1,
SSP1, 13000000, 0);
55 static DEFINE_PXA3_CKEN(pxa3xx_ssp2,
SSP2, 13000000, 0);
56 static DEFINE_PXA3_CKEN(pxa3xx_ssp3,
SSP3, 13000000, 0);
57 static DEFINE_PXA3_CKEN(pxa3xx_ssp4, SSP4, 13000000, 0);
58 static DEFINE_PXA3_CKEN(pxa3xx_pwm0,
PWM0, 13000000, 0);
59 static DEFINE_PXA3_CKEN(pxa3xx_pwm1,
PWM1, 13000000, 0);
60 static DEFINE_PXA3_CKEN(pxa3xx_mmc1,
MMC1, 19500000, 0);
61 static DEFINE_PXA3_CKEN(pxa3xx_mmc2,
MMC2, 19500000, 0);
62 static DEFINE_PXA3_CKEN(pxa3xx_gpio,
GPIO, 13000000, 0);
80 INIT_CLKREG(&clk_pxa3xx_stuart,
"pxa2xx-ir",
"UARTCLK"),
101 #define ISRAM_START 0x5c000000
102 #define ISRAM_SIZE SZ_256K
105 static unsigned long wakeup_src;
115 static void pxa3xx_cpu_standby(
unsigned int pwrmode)
117 extern const char pm_enter_standby_start[], pm_enter_standby_end[];
121 pm_enter_standby_end - pm_enter_standby_start);
145 static void pxa3xx_cpu_pm_suspend(
void)
147 volatile unsigned long *
p = (
volatile void *)0xc0000000;
148 unsigned long saved_data = *
p;
149 #ifndef CONFIG_IWMMXT
152 asm volatile(
"mra %Q0, %R0, acc0" :
"=r" (acc0));
155 extern int pxa3xx_finish_suspend(
unsigned long);
168 PCFR &= ~((1
u << 12) | (1
u << 1));
181 #ifndef CONFIG_IWMMXT
182 asm volatile(
"mar acc0, %Q0, %R0" :
"=r" (acc0));
191 if (wakeup_src == 0) {
202 pxa3xx_cpu_pm_suspend();
213 .
valid = pxa3xx_cpu_pm_valid,
214 .enter = pxa3xx_cpu_pm_enter,
217 static void __init pxa3xx_init_pm(
void)
219 sram =
ioremap(ISRAM_START, ISRAM_SIZE);
221 printk(
KERN_ERR "Unable to map ISRAM: disabling standby/suspend\n");
334 static inline void pxa3xx_init_pm(
void) {}
335 #define pxa3xx_set_wake NULL
338 static void pxa_ack_ext_wakeup(
struct irq_data *d)
343 static void pxa_mask_ext_wakeup(
struct irq_data *d)
349 static void pxa_unmask_ext_wakeup(
struct irq_data *d)
355 static int pxa_set_ext_wakeup_type(
struct irq_data *d,
unsigned int flow_type)
366 static struct irq_chip pxa_ext_wakeup_chip = {
368 .irq_ack = pxa_ack_ext_wakeup,
369 .irq_mask = pxa_mask_ext_wakeup,
370 .irq_unmask = pxa_unmask_ext_wakeup,
371 .irq_set_type = pxa_set_ext_wakeup_type,
380 irq_set_chip_and_handler(irq, &pxa_ext_wakeup_chip,
388 static void __init __pxa3xx_init_irq(
void)
392 __asm__ __volatile__(
"mrc p15, 0, %0, c15, c1, 0\n":
"=r"(value));
394 __asm__ __volatile__(
"mcr p15, 0, %0, c15, c1, 0\n": :
"r"(value));
406 void __init pxa3xx_dt_init_irq(
void)
417 .length = 0x00200000,
458 static int __init pxa3xx_init(
void)
485 if (!of_have_populated_dt())