From: Eric Nelson Date: Sat, 20 Jan 2018 07:38:53 -0700 Subject: [U-Boot] [RFC PATCH] SPL: allow fall-back to SDP boot Message-ID: <1516459133-10105-1-git-send-email-eric@nelint.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de When SDP is enabled, allow it to be invoked as a fall-back to allow re-programming a board with a full U-Boot loaded over USB. Signed-off-by: Eric Nelson --- Since SDP loading is triggered through BOOT_DEVICE_BOARD, I'm not sure if this should be specific to SDP. common/spl/spl.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/common/spl/spl.c b/common/spl/spl.c index 76c1963..5bbd4ed 100644 --- a/common/spl/spl.c +++ b/common/spl/spl.c @@ -373,6 +373,9 @@ static int boot_from_devices(struct spl_image_info *spl_image, void board_init_r(gd_t *dummy1, ulong dummy2) { +#ifdef CONFIG_SPL_USB_SDP_SUPPORT + int i; +#endif u32 spl_boot_list[] = { BOOT_DEVICE_NONE, BOOT_DEVICE_NONE, @@ -417,6 +420,15 @@ void board_init_r(gd_t *dummy1, ulong dummy2) #endif board_boot_order(spl_boot_list); +#ifdef CONFIG_SPL_USB_SDP_SUPPORT + for (i = 0; i < ARRAY_SIZE(spl_boot_list); i++) { + if (spl_boot_list[i] == BOOT_DEVICE_NONE) { + spl_boot_list[i] = BOOT_DEVICE_BOARD; + break; + } + } +#endif + if (boot_from_devices(&spl_image, spl_boot_list, ARRAY_SIZE(spl_boot_list))) { puts("SPL: failed to boot from all boot devices\n"); -- 2.7.4