Skip to contentSkip to conversation

SPL: allow fall-back to SDP boot

RFC PATCH New Eric Nelson 1 participant 1 message Jan 20, 2018

lore
Share & tools
lore
#0 lore raw

RFC PATCH 1/1 SPL: allow fall-back to SDP boot

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.

---
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(+)
common/spl/spl.c +12 -0
index 76c1963..5bbd4ed 100644
@@ -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");
Signature · 1 line
2.7.4