Because SDP directly jumps to next level boot image, we'd better
clean up the USB driver before it. Implement a weak callback function,
that spl sdp can use it to clean up USB driver.
Signed-off-by: Ye Li <ye.li@nxp.com>
(cherry picked from commit
1f6b3efc62cb277fd4316d8ed5115f47b09369a0)
#include <g_dnl.h>
#include <sdp.h>
+void board_sdp_cleanup(void)
+{
+ board_usb_cleanup(CONFIG_SPL_SDP_USB_DEV, USB_INIT_DEVICE);
+}
+
static int spl_sdp_load_image(struct spl_image_info *spl_image,
struct spl_boot_device *bootdev)
{
NULL,
};
+void __weak board_sdp_cleanup(void)
+{
+}
+
static inline void *sdp_ptr(u32 val)
{
return (void *)(uintptr_t)val;
(struct image_header *)(ulong)(sdp_func->jmp_address));
}
+ board_sdp_cleanup();
+
jump_to_image_no_args(&spl_image);
#else
/* In U-Boot, allow jumps to scripts */