2 * h4000 power management support for the original IPL in DoC G2
4 * Use consistent with the GNU GPL is permitted, provided that this
5 * copyright notice is preserved in its entirety in all copies and
8 * Copyright (C) 2005 Pawel Kolodziejski
13 #include <linux/kernel.h>
14 #include <linux/module.h>
15 #include <linux/device.h>
18 #include <asm/mach-types.h>
19 #include <asm/hardware.h>
20 #include <asm/arch/pxa-regs.h>
21 #include <asm/arch/pxa-pm_ll.h>
25 static u32
*addr_a0100000
;
26 static u32
*addr_a0100004
;
27 static u32
*addr_a0100008
;
28 static u32
*addr_a010000c
;
29 static u32 save_a0100000
;
30 static u32 save_a0100004
;
31 static u32 save_a0100008
;
32 static u32 save_a010000c
;
34 static void h4000_pxa_ll_pm_suspend(unsigned long resume_addr
)
36 save_a0100000
= *addr_a0100000
;
37 save_a0100004
= *addr_a0100004
;
38 save_a0100008
= *addr_a0100008
;
39 save_a010000c
= *addr_a010000c
;
41 *addr_a0100000
= 0xe3a00101; // mov r0, #0x40000000
42 *addr_a0100004
= 0xe380060f; // orr r0, r0, #0x0f000000
43 *addr_a0100008
= 0xe3800008; // orr r0, r0, #0x00000008
44 *addr_a010000c
= 0xe590f000; // ldr pc, [r0]
49 static void h4000_pxa_ll_pm_resume(void)
52 Memory/peripherals configuration, etc. should be actually
53 handled by bootloader. It is not preserved by the kernel
54 as generally you can't reach RAM unless you have setup it.
55 In case of h4000 though, we are lucky that reset defaults
56 work at least for SDRAM. We need correct values to access
57 ASIC3 and other controllers though.
63 *addr_a0100000
= save_a0100000
;
64 *addr_a0100004
= save_a0100004
;
65 *addr_a0100008
= save_a0100008
;
66 *addr_a010000c
= save_a010000c
;
69 static struct pxa_ll_pm_ops h4000_ll_pm_ops
= {
70 .suspend
= h4000_pxa_ll_pm_suspend
,
71 .resume
= h4000_pxa_ll_pm_resume
,
74 void h4000_ll_pm_init(void) {
75 addr_a0100000
= phys_to_virt(0xa0100000);
76 addr_a0100004
= phys_to_virt(0xa0100004);
77 addr_a0100008
= phys_to_virt(0xa0100008);
78 addr_a010000c
= phys_to_virt(0xa010000c);
80 pxa_pm_set_ll_ops(&h4000_ll_pm_ops
);
83 #endif /* CONFIG_PM */