Hi All,
In my application, I need to switch the MX50 boot mode from SD1 to USB-HID by software reset. As an experiment, I add the following code segment in u-boot to reset i.MX50 by internal watchdog. After making this change, the i.MX508 board can reset itself automatically after printing the SCR_SMBR register value.
====================================
unsigned short U16;
unsigned int U32;
U32 = readl(0x53FD0004);
printf("SBMR: %08x\n", U32);
udelay(3000000);
// disable warm reset
U32 = readl(0x53FD0000);
U32&= 0xFFFFFFFE;
writel(U32, 0x53FD0000);
// assert internal wdog_rst
U16 = readw(0x53F98000);
U16 &= 0xFFEF;
writew(U16, 0x53F98000);
====================================
If I set the boot configuration switches to USB-HID during u-boot, I found that the board will still boot from SD1. The SCR_SMBR register value is always 0x10000048 regardless to the configuration of boot switches.
However, if I press the reset button on the MX508 RD3 board, it boot into USB-HID immediately. I think it is due to the difference between power on reset and software reset. Anyone can help?