ARM1136 suspend CPU and DDR2 in Linux
What's the correct way to suspend an ARM1136 CPU (i.MX35) and its external DDR2 memory in Linux? I tried the following sequence:
1. reserve space in the CPU's internal memory, copy the core assembler function there and jump to it
2. disable interrupts (cpsid if) and I/D cache
3. set the SDRAM controller into precharge power down mode
4. execute a precharge all command and access memory with A10 high (e.g. 0x400) to effectively close all banks
5. suspend the CPU by executing a WFI instruction
Everything works as expected, I can verify code execution with the JTAG debugger. But at the point where memory is accessed with a dummy write, a data abort exception occurs and the CPU gets lost. If I leave this part out, the DDR2 doesn't seem to be put into low power mode, because the current consumption doesn't go down. I also tried to disable the MMU and work with physical addresses, but then the CPU gets lost immediately.
Now I'm totally stuck and out of ideas here. Could someone please give me a hint what I'm doing wrong or what I'm missing?
Thanks a lot!