diff --git a/src/main.c b/src/main.c index 51a34f9..7e5aaf8 100644 --- a/src/main.c +++ b/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)