diff options
author | Ye Li <ye.li@nxp.com> | 2019-01-03 00:46:09 -0800 |
---|---|---|
committer | Ye Li <ye.li@nxp.com> | 2019-01-08 21:46:31 -0800 |
commit | 1f6b3efc62cb277fd4316d8ed5115f47b09369a0 (patch) | |
tree | df657d3d201013c5638f6bc25ddb78194a0b1493 | |
parent | 6ca3fc0bbdbcc6d870ceffa9d38c47d2e4edfee4 (diff) |
MLK-20559-5 f_sdp: Add a callback to clean up USB driver
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>
-rw-r--r-- | common/spl/spl_sdp.c | 5 | ||||
-rw-r--r-- | drivers/usb/gadget/f_sdp.c | 6 |
2 files changed, 11 insertions, 0 deletions
diff --git a/common/spl/spl_sdp.c b/common/spl/spl_sdp.c index a3cafa5895a..d59ddc805bd 100644 --- a/common/spl/spl_sdp.c +++ b/common/spl/spl_sdp.c @@ -13,6 +13,11 @@ DECLARE_GLOBAL_DATA_PTR; +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) { diff --git a/drivers/usb/gadget/f_sdp.c b/drivers/usb/gadget/f_sdp.c index c06b11b3fb1..b69e3711e89 100644 --- a/drivers/usb/gadget/f_sdp.c +++ b/drivers/usb/gadget/f_sdp.c @@ -247,6 +247,10 @@ static struct usb_gadget_strings *sdp_generic_strings[] = { NULL, }; +void __weak board_sdp_cleanup(void) +{ +} + static inline void *sdp_ptr(u32 val) { return (void *)(uintptr_t)val; @@ -744,6 +748,8 @@ static void sdp_handle_in_ep(void) (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 */ |