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>
diff --git a/drivers/usb/gadget/f_sdp.c b/drivers/usb/gadget/f_sdp.c
index e48aa2f..0fa7230 100644
--- a/drivers/usb/gadget/f_sdp.c
+++ b/drivers/usb/gadget/f_sdp.c
@@ -773,7 +773,8 @@
}
#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 @@
/* 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 @@
#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 @@
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();