From 2e0429bcc1a9cf2c3b4cc0e8af7199f031a3b8e9 Mon Sep 17 00:00:00 2001 From: Pali Rohár Date: Fri, 14 Jan 2022 14:31:38 +0100 Subject: SPL: Add struct spl_boot_device parameter into spl_parse_board_header() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Signed-off-by: Marek Behún Reviewed-by: Stefan Roese --- drivers/usb/gadget/f_sdp.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'drivers/usb') diff --git a/drivers/usb/gadget/f_sdp.c b/drivers/usb/gadget/f_sdp.c index e48aa2f90df..0fa7230b992 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(); -- cgit v1.3.1