public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Peng Fan <peng.fan@oss.nxp.com>
To: Marek Vasut <marex@denx.de>
Cc: Alice Guo <alice.guo@oss.nxp.com>, Tom Rini <trini@konsulko.com>,
	Stefano Babic <sbabic@denx.de>,
	Fabio Estevam <festevam@gmail.com>,
	"NXP i.MX U-Boot Team" <uboot-imx@nxp.com>,
	Lukasz Majewski <lukma@denx.de>,
	Sean Anderson <seanga2@gmail.com>, Simon Glass <sjg@chromium.org>,
	Alper Nebi Yasak <alpernebiyasak@gmail.com>,
	Alice Guo <alice.guo@nxp.com>,
	u-boot@lists.denx.de, tharvey@gateworks.com,
	Ye Li <ye.li@nxp.com>, Peng Fan <peng.fan@nxp.com>
Subject: Re: [PATCH v3 11/17] imx9: scmi: soc: Override h_spl_load_read with trampoline buffer
Date: Fri, 10 Jan 2025 17:49:41 +0800	[thread overview]
Message-ID: <20250110094941.GA23168@localhost.localdomain> (raw)
In-Reply-To: <e7f2e938-e6a1-4927-91d7-682ca9d683f9@denx.de>

On Sun, Jan 05, 2025 at 10:56:29PM +0100, Marek Vasut wrote:
>On 1/3/25 7:45 AM, Alice Guo wrote:
>> From: Ye Li <ye.li@nxp.com>
>> 
>> When SPL loading image to secure region, for example, ATF and tee to
>> DDR secure region. Because the USDHC controller is non-secure master,
>> it can't access this region and will cause loading issue.
>> 
>> So override h_spl_load_read to use a trampoline buffer in nonsecure
>> region, then use CPU to copy the image from trampoline buffer to
>> destination secure region.
>> 
>> Signed-off-by: Ye Li <ye.li@nxp.com>
>> Signed-off-by: Alice Guo <alice.guo@nxp.com>
>> Reviewed-by: Peng Fan <peng.fan@nxp.com>
>> ---
>>   arch/arm/mach-imx/imx9/scmi/soc.c | 40 +++++++++++++++++++++++++++++++++++++++
>>   common/spl/spl_mmc.c              |  2 +-
>>   2 files changed, 41 insertions(+), 1 deletion(-)
>> 
>> diff --git a/arch/arm/mach-imx/imx9/scmi/soc.c b/arch/arm/mach-imx/imx9/scmi/soc.c
>> index fefb1a6f4ca58722a5d93c39e4f6a7aaf85aa177..8a7df24afecc1d6d77b7162be639b56af95fd975 100644
>> --- a/arch/arm/mach-imx/imx9/scmi/soc.c
>> +++ b/arch/arm/mach-imx/imx9/scmi/soc.c
>> @@ -41,6 +41,8 @@
>>   #include <scmi_agent.h>
>>   #include <scmi_protocols.h>
>>   #endif
>> +#include <spl.h>
>> +#include <mmc.h>
>>   DECLARE_GLOBAL_DATA_PTR;
>> @@ -830,3 +832,41 @@ enum boot_device get_boot_device(void)
>>   	return boot_dev;
>>   }
>>   #endif
>> +
>> +ulong h_spl_load_read(struct spl_load_info *load, ulong off,
>> +		      ulong size, void *buf)
>
>Can you simply define spl_get_load_buffer() instead to make sure SPL loads
>your stuff into the correct location ?

spl_get_load_buffer does not help here, unless do a big change to spl_mmc.c
h_spl_load_read is set to info->read, info->read is not just for reading
headers, it also needs to read container image data.

>
>This hack in generic code is a NAK.

This is set it as __weak, and overwrite in soc code, there are many
similar code

Regards,
Peng

  reply	other threads:[~2025-01-10  8:44 UTC|newest]

Thread overview: 65+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-03  6:45 [PATCH v3 00/17] imx: add i.MX95 support Alice Guo
2025-01-03  6:45 ` [PATCH v3 01/17] mailbox: add i.MX95 Messaging Unit (MU) driver Alice Guo
2025-01-05 20:56   ` Marek Vasut
2025-01-06  5:27     ` 回复: [EXT] " Alice Guo (OSS)
2025-01-06 20:39       ` Marek Vasut
2025-01-07  5:01         ` Peng Fan
2025-01-07 11:10           ` Marek Vasut
2025-01-07 12:12             ` Peng Fan
2025-01-03  6:45 ` [PATCH v3 02/17] firmware: scmi: smt: Interrupt communication enable Alice Guo
2025-01-05 20:59   ` Marek Vasut
2025-01-06  6:17     ` 回复: [EXT] " Alice Guo (OSS)
2025-01-06 20:42       ` Marek Vasut
2025-01-07  3:24         ` 回复: " Alice Guo (OSS)
2025-01-07 11:10           ` Marek Vasut
2025-01-08  2:55             ` 回复: " Alice Guo (OSS)
2025-01-08 18:38               ` Marek Vasut
2025-01-09  0:49                 ` Peng Fan
2025-01-09 20:03                   ` Marek Vasut
2025-01-10  9:59                 ` Peng Fan
2025-01-12 22:03                   ` Marek Vasut
2025-01-03  6:45 ` [PATCH v3 03/17] pinctrl: nxp: add SCMI pin control protocol driver Alice Guo
2025-01-05 21:05   ` Marek Vasut
2025-01-06  9:56     ` 回复: [EXT] " Alice Guo (OSS)
2025-01-06 20:46       ` Marek Vasut
2025-01-07  6:39         ` 回复: " Alice Guo (OSS)
2025-01-07 11:16           ` Marek Vasut
2025-01-07 12:11             ` Peng Fan
2025-01-07 12:37               ` Marek Vasut
2025-01-10  9:54                 ` Peng Fan
2025-01-03  6:45 ` [PATCH v3 04/17] scmi_protocols: add SCMI misc protocol protocol_id and message_id for getting the ROM passover data Alice Guo
2025-01-03  6:45 ` [PATCH v3 05/17] scmi_protocols: add SCMI Performance domain management protocol message IDs Alice Guo
2025-01-03  6:45 ` [PATCH v3 06/17] clk: scmi: add the command CLOCK_PARENT_SET Alice Guo
2025-01-03  6:45 ` [PATCH v3 07/17] clk: scmi: check the clock state/parent/rate control permissions Alice Guo
2025-01-05 21:07   ` Marek Vasut
2025-01-07  8:00     ` 回复: [EXT] " Alice Guo (OSS)
2025-01-07 11:08       ` Marek Vasut
2025-01-03  6:45 ` [PATCH v3 08/17] scmi_protocols: update struct scmi_base_discover_list_protocols_out Alice Guo
2025-01-05 21:08   ` Marek Vasut
2025-01-06 10:41     ` 回复: [EXT] " Alice Guo (OSS)
2025-01-06 20:46       ` Marek Vasut
2025-01-03  6:45 ` [PATCH v3 09/17] imx9: scmi: add i.MX95 SoC and clock related code Alice Guo
2025-01-05 21:29   ` Marek Vasut
2025-01-03  6:45 ` [PATCH v3 10/17] imx9: add i.MX95 Kconfig and Makefile Alice Guo
2025-01-05 21:30   ` Marek Vasut
2025-01-03  6:45 ` [PATCH v3 11/17] imx9: scmi: soc: Override h_spl_load_read with trampoline buffer Alice Guo
2025-01-05 21:43   ` Marek Vasut
2025-01-07 10:04     ` 回复: [EXT] " Alice Guo (OSS)
2025-01-07 11:21       ` Marek Vasut
2025-01-05 21:56   ` Marek Vasut
2025-01-10  9:49     ` Peng Fan [this message]
2025-01-12 21:50       ` Marek Vasut
2025-01-03  6:45 ` [PATCH v3 12/17] scmi: add the macro SCMI_MSG Alice Guo
2025-01-03  6:45 ` [PATCH v3 13/17] imx: Kconfig: IMX8_ROMAPI is not configured for i.MX95 Alice Guo
2025-01-03  6:45 ` [PATCH v3 14/17] binman: add a new entry type for packing DDR PHY firmware images Alice Guo
2025-01-05 21:52   ` Marek Vasut
2025-01-03  6:45 ` [PATCH v3 15/17] tools: imx8image: add i.MX95 support Alice Guo
2025-01-05 21:59   ` Marek Vasut
2025-01-03  6:45 ` [PATCH v3 16/17] imx: add V2X container support on i.MX95 Alice Guo
2025-01-03  6:45 ` [PATCH v3 17/17] imx95_evk: add i.MX95 19x19 EVK board basic support Alice Guo
2025-01-05 22:07   ` Marek Vasut
2025-01-14 22:34   ` Tim Harvey
2025-01-14 23:28     ` Marek Vasut
2025-01-15 17:10       ` Tim Harvey
2025-01-15 19:07         ` Marek Vasut
2025-01-15  1:31     ` 回复: [EXT] " Alice Guo (OSS)

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=20250110094941.GA23168@localhost.localdomain \
    --to=peng.fan@oss.nxp.com \
    --cc=alice.guo@nxp.com \
    --cc=alice.guo@oss.nxp.com \
    --cc=alpernebiyasak@gmail.com \
    --cc=festevam@gmail.com \
    --cc=lukma@denx.de \
    --cc=marex@denx.de \
    --cc=peng.fan@nxp.com \
    --cc=sbabic@denx.de \
    --cc=seanga2@gmail.com \
    --cc=sjg@chromium.org \
    --cc=tharvey@gateworks.com \
    --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