spl: sdp: Add DM gadget support for sdp
authorSherry Sun <sherry.sun@nxp.com>
Wed, 29 Apr 2020 02:35:14 +0000 (10:35 +0800)
committerStefano Babic <sbabic@denx.de>
Sun, 3 May 2020 13:31:54 +0000 (15:31 +0200)
When enable CONFG_SPL_DM_USB_GADGET, sdp should use
usb_gadget_initialize() and usb_gadget_release() to
support DM gadget driver.

Signed-off-by: Sherry Sun <sherry.sun@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
common/spl/spl_sdp.c

index d150951b86b67dc8f6bacd77b8afb6f0eefaad45..644dfa8cc3e775a0c84171990a94955c8cd54366 100644 (file)
@@ -16,7 +16,7 @@ static int spl_sdp_load_image(struct spl_image_info *spl_image,
        int ret;
        const int controller_index = CONFIG_SPL_SDP_USB_DEV;
 
-       board_usb_init(controller_index, USB_INIT_DEVICE);
+       usb_gadget_initialize(controller_index);
 
        g_dnl_clear_detach();
        ret = g_dnl_register("usb_dnl_sdp");
@@ -39,7 +39,7 @@ static int spl_sdp_load_image(struct spl_image_info *spl_image,
        ret = spl_sdp_handle(controller_index, spl_image);
        debug("SDP ended\n");
 
-       board_usb_cleanup(controller_index, USB_INIT_DEVICE);
+       usb_gadget_release(controller_index);
        return ret;
 }
 SPL_LOAD_IMAGE_METHOD("USB SDP", 0, BOOT_DEVICE_BOARD, spl_sdp_load_image);