Hello, I'm using imx28 with wince. I need to be able to reboot and shutdown the system.
I'm can reboot the system with no problems, using: KernelIoControl(IOCTL_HAL_REBOOT, NULL, 0, NULL, 0, NULL);
However I'm having troubles shutting it down. I read power up sequence part of the RM, and aware of everything that makes system boot. I believe, that AUTO_RESTART is the only thing that makes system start. So I'm trying to clear it, and for some reason it doesn't clear.
Here is a code that I'm using to shut it down (I'm shutting it down form the keypad driver):
if (HW_RTC_PERSISTENT0_RD() & BM_RTC_PERSISTENT0_AUTO_RESTART) GREEN_LED();
KernelIoControl(IOCTL_HAL_REBOOT, NULL, 0, NULL, 0, NULL);
Basically, I'm trying to DISABLE_PSWITCH (even thou pin is pulled down to ground), then clear AUTO_RESATRT, then wait little bit, and check if AUTO_RESTART is set (and it is always set), then reboot. System always reboots after running this code.
Any suggestions on why AUTO_RESTART is not being cleared (and how to clear it)? Oh how to shut the system down, otherwise?