X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=common%2Fspl%2Fspl_sdp.c;h=806bf1327efe8197ac9daaf98757351b40f05228;hb=0352e878d2b80b2575e02310e891e936251b3992;hp=69390edcbaebe3542e14542cbe90ba527649c11b;hpb=abeb9d7897510533ce3a0a9515cac16db5bed834;p=platform%2Fkernel%2Fu-boot.git diff --git a/common/spl/spl_sdp.c b/common/spl/spl_sdp.c index 69390ed..806bf13 100644 --- a/common/spl/spl_sdp.c +++ b/common/spl/spl_sdp.c @@ -1,8 +1,7 @@ +// SPDX-License-Identifier: GPL-2.0+ /* * (C) Copyright 2016 Toradex * Author: Stefan Agner - * - * SPDX-License-Identifier: GPL-2.0+ */ #include @@ -18,7 +17,11 @@ static int spl_sdp_load_image(struct spl_image_info *spl_image, const int controller_index = 0; g_dnl_clear_detach(); - g_dnl_register("usb_dnl_sdp"); + ret = g_dnl_register("usb_dnl_sdp"); + if (ret) { + pr_err("SDP dnl register failed: %d\n", ret); + return ret; + } ret = sdp_init(controller_index); if (ret) { @@ -26,10 +29,14 @@ static int spl_sdp_load_image(struct spl_image_info *spl_image, return -ENODEV; } - /* This command typically does not return but jumps to an image */ - sdp_handle(controller_index); - pr_err("SDP ended\n"); + /* + * This command either loads a legacy image, jumps and never returns, + * or it loads a FIT image and returns it to be handled by the SPL + * code. + */ + ret = spl_sdp_handle(controller_index, spl_image); + debug("SDP ended\n"); - return -EINVAL; + return ret; } SPL_LOAD_IMAGE_METHOD("USB SDP", 0, BOOT_DEVICE_BOARD, spl_sdp_load_image);