.. | .. |
---|
70 | 70 | |
---|
71 | 71 | #include <asm/cacheflush.h> |
---|
72 | 72 | |
---|
73 | | -#include <mach/hardware.h> |
---|
74 | | -#include <mach/platform.h> |
---|
| 73 | +#include "lpc32xx.h" |
---|
75 | 74 | #include "common.h" |
---|
76 | 75 | |
---|
77 | 76 | #define TEMP_IRAM_AREA IO_ADDRESS(LPC32XX_IRAM_BASE) |
---|
.. | .. |
---|
86 | 85 | void *iram_swap_area; |
---|
87 | 86 | |
---|
88 | 87 | /* Allocate some space for temporary IRAM storage */ |
---|
89 | | - iram_swap_area = kmalloc(lpc32xx_sys_suspend_sz, GFP_KERNEL); |
---|
90 | | - if (!iram_swap_area) { |
---|
91 | | - printk(KERN_ERR |
---|
92 | | - "PM Suspend: cannot allocate memory to save portion " |
---|
93 | | - "of SRAM\n"); |
---|
| 88 | + iram_swap_area = kmemdup((void *)TEMP_IRAM_AREA, |
---|
| 89 | + lpc32xx_sys_suspend_sz, GFP_KERNEL); |
---|
| 90 | + if (!iram_swap_area) |
---|
94 | 91 | return -ENOMEM; |
---|
95 | | - } |
---|
96 | | - |
---|
97 | | - /* Backup a small area of IRAM used for the suspend code */ |
---|
98 | | - memcpy(iram_swap_area, (void *) TEMP_IRAM_AREA, |
---|
99 | | - lpc32xx_sys_suspend_sz); |
---|
100 | 92 | |
---|
101 | 93 | /* |
---|
102 | 94 | * Copy code to suspend system into IRAM. The suspend code |
---|