U-Boot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Marek Vasut <marex@denx.de>
To: "Alice Guo (OSS)" <alice.guo@oss.nxp.com>,
	"Tom Rini" <trini@konsulko.com>,
	"Lukasz Majewski" <lukma@denx.de>,
	"Sean Anderson" <seanga2@gmail.com>,
	"Simon Glass" <sjg@chromium.org>,
	"Stefano Babic" <sbabic@denx.de>,
	"Fabio Estevam" <festevam@gmail.com>,
	"NXP i.MX U-Boot Team" <uboot-imx@nxp.com>,
	"Alper Nebi Yasak" <alpernebiyasak@gmail.com>,
	"Alice Guo" <alice.guo@nxp.com>,
	"Lothar Waßmann" <LW@KARO-electronics.de>
Cc: u-boot@lists.denx.de, Ye Li <ye.li@nxp.com>, Peng Fan <peng.fan@nxp.com>
Subject: Re: [PATCH v8 11/19] spl: imx: use trampoline buffer to load images to secure region
Date: Sat, 22 Mar 2025 03:14:48 +0100	[thread overview]
Message-ID: <163ddf29-16cd-4a7c-a37a-142d692ad8d9@denx.de> (raw)
In-Reply-To: <20250321-imx95-v1-11-f2c8ba815f89@oss.nxp.com>

On 3/21/25 8:15 AM, Alice Guo (OSS) wrote:

[...]

> @@ -42,12 +53,30 @@ static struct boot_img_t *read_auth_image(struct spl_image_info *spl_image,
>   
>   	debug("%s: container: %p offset: %lu size: %lu\n", __func__,
>   	      container, offset, size);
> -	if (info->read(info, offset, size,
> -		       map_sysmem(images[image_index].dst - overhead,
> -				  images[image_index].size)) <
> -	    images[image_index].size) {
> -		printf("%s wrong\n", __func__);
> -		return NULL;
> +
> +	buf = map_sysmem(images[image_index].dst - overhead, images[image_index].size);
> +	if (IS_ENABLED(CONFIG_SPL_IMX_CONTAINER_USE_TRAMPOLINE) &&
> +	    arch_check_dst_in_secure(buf, size)) {
> +		trampoline = arch_get_container_trampoline();
> +		if (!trampoline) {
> +			printf("%s: trampoline size is zero\n", __func__);
> +			return NULL;
> +		}
> +
> +		if (info->read(info, offset, size, trampoline) < images[image_index].size) {
> +			printf("%s wrong\n", __func__);
> +			return NULL;
> +		}
> +
> +		memcpy(buf, trampoline, images[image_index].size);
> +	} else {
> +		if (info->read(info, offset, size,
> +			       map_sysmem(images[image_index].dst - overhead,
> +					  images[image_index].size)) <
> +		    images[image_index].size) {
> +			printf("%s wrong\n", __func__);

Can you please make those debug prints a bit more informative about the 
failure that occurred ?

  reply	other threads:[~2025-03-22  2:51 UTC|newest]

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-21  7:15 [PATCH v8 00/19] imx: add i.MX95 support Alice Guo (OSS)
2025-03-21  7:15 ` [PATCH v8 01/19] firmware: scmi: smt: Interrupt communication enable Alice Guo (OSS)
2025-03-22  0:38   ` Marek Vasut
2025-04-01  8:02     ` 回复: " Alice Guo (OSS)
2025-03-21  7:15 ` [PATCH v8 02/19] pinctrl: nxp: add a pin controller driver based on SCMI pin control protocol Alice Guo (OSS)
2025-03-22  0:46   ` Marek Vasut
2025-03-25  8:06     ` Peng Fan
2025-03-26  1:24       ` Marek Vasut
2025-03-26  1:52         ` Peng Fan
2025-03-26  3:00           ` Marek Vasut
2025-03-26  6:42             ` Peng Fan
2025-03-27 13:18               ` Marek Vasut
2025-04-01 10:57                 ` 回复: " Alice Guo (OSS)
2025-04-01 12:53                   ` Marek Vasut
2025-04-01 13:22                     ` 回复: " Alice Guo (OSS)
2025-04-01 13:27                     ` Fabio Estevam
2025-04-01  8:17     ` Alice Guo (OSS)
2025-03-21  7:15 ` [PATCH v8 03/19] firmware: scmi_agent: add SCMI pin control protocol support Alice Guo (OSS)
2025-03-22  1:55   ` Marek Vasut
2025-03-21  7:15 ` [PATCH v8 04/19] scmi_protocols: add SCMI misc protocol protocol_id and message_id for getting the ROM passover data Alice Guo (OSS)
2025-03-22  1:55   ` Marek Vasut
2025-03-21  7:15 ` [PATCH v8 05/19] scmi_protocols: add SCMI Performance domain management protocol message IDs Alice Guo (OSS)
2025-03-22  1:55   ` Marek Vasut
2025-03-21  7:15 ` [PATCH v8 06/19] clk: scmi: add the command CLOCK_PARENT_SET Alice Guo (OSS)
2025-03-22  1:57   ` Marek Vasut
2025-03-21  7:15 ` [PATCH v8 07/19] clk: scmi: check the clock state/parent/rate control permissions Alice Guo (OSS)
2025-03-22  2:02   ` Marek Vasut
2025-03-28 10:26     ` 回复: " Alice Guo (OSS)
2025-03-30 21:05       ` Marek Vasut
2025-03-21  7:15 ` [PATCH v8 08/19] sandbox: add SCMI clock control permissions to sandbox Alice Guo (OSS)
2025-03-21  7:15 ` [PATCH v8 09/19] scmi_protocols: update struct scmi_base_discover_list_protocols_out Alice Guo (OSS)
2025-03-22  2:10   ` Marek Vasut
2025-03-21  7:15 ` [PATCH v8 10/19] imx9: scmi: add i.MX95 SoC and clock related code Alice Guo (OSS)
2025-03-21  7:15 ` [PATCH v8 11/19] spl: imx: use trampoline buffer to load images to secure region Alice Guo (OSS)
2025-03-22  2:14   ` Marek Vasut [this message]
2025-03-21  7:15 ` [PATCH v8 12/19] imx9: add i.MX95 Kconfig and Makefile Alice Guo (OSS)
2025-03-21  7:15 ` [PATCH v8 13/19] imx: Kconfig: IMX8_ROMAPI is not configured for i.MX95 Alice Guo (OSS)
2025-03-22  2:15   ` Marek Vasut
2025-03-21  7:15 ` [PATCH v8 14/19] binman: add a new entry type for packing DDR PHY firmware images Alice Guo (OSS)
2025-03-21  7:15 ` [PATCH v8 15/19] tools: imx8image: add i.MX95 support Alice Guo (OSS)
2025-03-21  7:15 ` [PATCH v8 16/19] imx: container: add V2X container support for i.MX95 Alice Guo (OSS)
2025-03-21  7:15 ` [PATCH v8 17/19] doc: imx: add document for i.MX95 Image Container Format Alice Guo (OSS)
2025-03-21  7:15 ` [PATCH v8 18/19] imx95_evk: add i.MX95 19x19 EVK board basic support Alice Guo (OSS)
2025-03-21  7:15 ` [PATCH v8 19/19] Makefile: add some files to CLEAN_FILES Alice Guo (OSS)
2025-03-22  2:20 ` [PATCH v8 00/19] imx: add i.MX95 support Marek Vasut

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=163ddf29-16cd-4a7c-a37a-142d692ad8d9@denx.de \
    --to=marex@denx.de \
    --cc=LW@KARO-electronics.de \
    --cc=alice.guo@nxp.com \
    --cc=alice.guo@oss.nxp.com \
    --cc=alpernebiyasak@gmail.com \
    --cc=festevam@gmail.com \
    --cc=lukma@denx.de \
    --cc=peng.fan@nxp.com \
    --cc=sbabic@denx.de \
    --cc=seanga2@gmail.com \
    --cc=sjg@chromium.org \
    --cc=trini@konsulko.com \
    --cc=u-boot@lists.denx.de \
    --cc=uboot-imx@nxp.com \
    --cc=ye.li@nxp.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox