rbl: Make sure that the UBL is always flashed

In case bootmode=NAND but the RBL has loaded the UBL via UART we
would end up not flashing the UBL in case the NAND holds the U-Boot.
Fix it by doing the I_ME boot interruption, another option would be
to check if UBL is in flash, sadly the DM644x does not have any
information of how the system was started.
This commit is contained in:
Holger Hans Peter Freyther 2012-07-11 14:21:39 +02:00
parent 7d96e789af
commit 354c2e5665
1 changed files with 16 additions and 2 deletions

View File

@ -294,10 +294,24 @@ send_binary(const char *orig_file, const char *tmp_file, int format,
if (found != 1)
goto error_unhandled;
found = wait_for_message("BootMode = UART", NULL, NULL);
/*
* It is possible that bootmode=nand but the UBL partition is
* blank. In that case the RBL will load the UBL via the UART
* and we have just provided the UBL. Once UBL is started it
* will recognize that it is in bootmode=nand and attempts to
* load the U-Boot payload. If it is present U-Boot will be
* started and UBL will not be programmed to the nand.
*
* We are using the the I_ME feature to interrupt the boot.
*/
found = wait_for_message("BootMode = UART", "I_ME", NULL);
if (!found)
log_info("Warning: invalid boot mode !!");
//goto error_unhandled;
else if (found == 2) {
log_info("Sending interrupt command to UBL ($%08X)", 0x23);
send_message(" CMD\n");
send_number(0x23, 8);
}
found = wait_for_message("BOOTPSP", NULL, NULL);
if (!found)