summaryrefslogtreecommitdiff
path: root/drivers/usb/gadget
diff options
context:
space:
mode:
authorPali Rohár <pali@kernel.org>2022-01-14 16:31:38 +0300
committerStefan Roese <sr@denx.de>2022-01-20 13:35:29 +0300
commit2e0429bcc1a9cf2c3b4cc0e8af7199f031a3b8e9 (patch)
treeacf9804cf808bcacfec4984a8fbf63898fae28fe /drivers/usb/gadget
parent66f874855cc6e750e979a9e08bb96d0da38d534f (diff)
downloadu-boot-2e0429bcc1a9cf2c3b4cc0e8af7199f031a3b8e9.tar.xz
SPL: Add struct spl_boot_device parameter into spl_parse_board_header()
Add parameter spl_boot_device to spl_parse_board_header(), which allows the implementations to see from which device we are booting and do boot-device-specific checks of the image header. Signed-off-by: Pali Rohár <pali@kernel.org> Signed-off-by: Marek Behún <marek.behun@nic.cz> Reviewed-by: Stefan Roese <sr@denx.de>
Diffstat (limited to 'drivers/usb/gadget')
-rw-r--r--drivers/usb/gadget/f_sdp.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/drivers/usb/gadget/f_sdp.c b/drivers/usb/gadget/f_sdp.c
index e48aa2f90d..0fa7230b99 100644
--- a/drivers/usb/gadget/f_sdp.c
+++ b/drivers/usb/gadget/f_sdp.c
@@ -773,7 +773,8 @@ static ulong search_container_header(ulong p, int size)
}
#endif
-static int sdp_handle_in_ep(struct spl_image_info *spl_image)
+static int sdp_handle_in_ep(struct spl_image_info *spl_image,
+ struct spl_boot_device *bootdev)
{
u8 *data = sdp_func->in_req->buf;
u32 status;
@@ -862,7 +863,8 @@ static int sdp_handle_in_ep(struct spl_image_info *spl_image)
/* In SPL, allow jumps to U-Boot images */
struct spl_image_info spl_image = {};
- spl_parse_image_header(&spl_image, header);
+ struct spl_boot_device bootdev = {};
+ spl_parse_image_header(&spl_image, &bootdev, header);
jump_to_image_no_args(&spl_image);
#else
/* In U-Boot, allow jumps to scripts */
@@ -910,7 +912,8 @@ static void sdp_handle_out_ep(void)
#ifndef CONFIG_SPL_BUILD
int sdp_handle(int controller_index)
#else
-int spl_sdp_handle(int controller_index, struct spl_image_info *spl_image)
+int spl_sdp_handle(int controller_index, struct spl_image_info *spl_image,
+ struct spl_boot_device *bootdev)
#endif
{
int flag = 0;
@@ -928,9 +931,9 @@ int spl_sdp_handle(int controller_index, struct spl_image_info *spl_image)
usb_gadget_handle_interrupts(controller_index);
#ifdef CONFIG_SPL_BUILD
- flag = sdp_handle_in_ep(spl_image);
+ flag = sdp_handle_in_ep(spl_image, bootdev);
#else
- flag = sdp_handle_in_ep(NULL);
+ flag = sdp_handle_in_ep(NULL, NULL);
#endif
if (sdp_func->ep_int_enable)
sdp_handle_out_ep();