AMS(v2): fix system_reboot by re-enabling the internal ROM clock just before rebooting

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31196 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Bertrik Sikken 2011-12-10 11:28:00 +00:00
parent c9a8031695
commit 75f2e4551c
2 changed files with 5 additions and 1 deletions

View file

@ -223,6 +223,7 @@ CE lines
/* --- are disabled after reset --- */ /* --- are disabled after reset --- */
#define CGU_EXTMEM_CLOCK_ENABLE ( 1 << 27 ) /* external memory */ #define CGU_EXTMEM_CLOCK_ENABLE ( 1 << 27 ) /* external memory */
#define CGU_EXTMEMIF_CLOCK_ENABLE ( 1 << 26 ) /* ext mem AHB IF */ #define CGU_EXTMEMIF_CLOCK_ENABLE ( 1 << 26 ) /* ext mem AHB IF */
#define CGU_ROM_ENABLE ( 1 << 24 ) /* internal ROM */
#define CGU_DMA_CLOCK_ENABLE ( 1 << 22 ) /* dma */ #define CGU_DMA_CLOCK_ENABLE ( 1 << 22 ) /* dma */
#define CGU_USB_CLOCK_ENABLE ( 1 << 21 ) /* usb */ #define CGU_USB_CLOCK_ENABLE ( 1 << 21 ) /* usb */
#define CGU_I2SOUT_APB_CLOCK_ENABLE ( 1 << 20 ) /* i2sout */ #define CGU_I2SOUT_APB_CLOCK_ENABLE ( 1 << 20 ) /* i2sout */

View file

@ -224,7 +224,7 @@ void system_init(void)
CGU_PERI &= ~0x7f; /* pclk 24 MHz */ CGU_PERI &= ~0x7f; /* pclk 24 MHz */
#endif #endif
CGU_PERI &= ~(1<<24); /*disable built in boot rom clock*/ CGU_PERI &= ~CGU_ROM_ENABLE; /*disable built in boot rom clock*/
/* bits 31:30 should be set to 0 in arm926-ejs */ /* bits 31:30 should be set to 0 in arm926-ejs */
asm volatile( asm volatile(
@ -316,6 +316,9 @@ void system_reboot(void)
disable_irq(); disable_irq();
/* re-enable internal ROM */
CGU_PERI |= CGU_ROM_ENABLE;
/* use watchdog to reset */ /* use watchdog to reset */
CGU_PERI |= (CGU_WDOCNT_CLOCK_ENABLE | CGU_WDOIF_CLOCK_ENABLE); CGU_PERI |= (CGU_WDOCNT_CLOCK_ENABLE | CGU_WDOIF_CLOCK_ENABLE);
WDT_LOAD = 1; /* set counter to 1 */ WDT_LOAD = 1; /* set counter to 1 */