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:
parent
7d96e789af
commit
354c2e5665
18
src/main.c
18
src/main.c
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue