1 // SPDX-License-Identifier: GPL-2.0+
3 * (C) Copyright 2016 Toradex
12 #include <linux/printk.h>
14 static int spl_sdp_load_image(struct spl_image_info *spl_image,
15 struct spl_boot_device *bootdev)
17 const int controller_index = CONFIG_SPL_SDP_USB_DEV;
21 ret = udc_device_get_by_index(controller_index, &udc);
25 board_usb_init(controller_index, USB_INIT_DEVICE);
28 ret = g_dnl_register("usb_dnl_sdp");
30 pr_err("SDP dnl register failed: %d\n", ret);
36 pr_err("SDP init failed: %d\n", ret);
41 * This command either loads a legacy image, jumps and never returns,
42 * or it loads a FIT image and returns it to be handled by the SPL
45 ret = spl_sdp_handle(udc, spl_image, bootdev);
54 SPL_LOAD_IMAGE_METHOD("USB SDP", 0, BOOT_DEVICE_BOARD, spl_sdp_load_image);