From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sherry Sun Date: Thu, 22 Aug 2019 01:46:24 +0000 Subject: [U-Boot] [PATCH v3 4/4] SDP: Call usb_gadget_initialize and usb_gadget_release to support UDC In-Reply-To: <20190822134455.32366-1-sherry.sun@nxp.com> References: <20190822134455.32366-1-sherry.sun@nxp.com> Message-ID: <20190822134455.32366-5-sherry.sun@nxp.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Need initialize UDC before run sdp download and release it at the end of sdp. Signed-off-by: Sherry Sun Signed-off-by: Frank Li Reviewed-by: Lukasz Majewski --- common/spl/spl_sdp.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/common/spl/spl_sdp.c b/common/spl/spl_sdp.c index 806bf1327e..7b0a213d4c 100644 --- a/common/spl/spl_sdp.c +++ b/common/spl/spl_sdp.c @@ -16,6 +16,8 @@ static int spl_sdp_load_image(struct spl_image_info *spl_image, int ret; const int controller_index = 0; + usb_gadget_initialize(controller_index); + g_dnl_clear_detach(); ret = g_dnl_register("usb_dnl_sdp"); if (ret) { @@ -37,6 +39,8 @@ static int spl_sdp_load_image(struct spl_image_info *spl_image, ret = spl_sdp_handle(controller_index, spl_image); debug("SDP ended\n"); + usb_gadget_release(controller_index); + return ret; } SPL_LOAD_IMAGE_METHOD("USB SDP", 0, BOOT_DEVICE_BOARD, spl_sdp_load_image); -- 2.17.1