From: "Alex G." <mr.nuke.me@gmail.com>
To: Patrick DELAUNAY <patrick.delaunay@foss.st.com>, u-boot@lists.denx.de
Cc: patrice.chotard@foss.st.com,
uboot-stm32@st-md-mailman.stormreply.com, marex@denx.de,
etienne.carriere@linaro.org
Subject: Re: [PATCH 0/3] stm32mp: Attempt to resolve unintended breakage with v2021.10-rc2
Date: Thu, 7 Oct 2021 12:13:11 -0500 [thread overview]
Message-ID: <ccf4d20e-907f-02f4-aafc-e6c75f0932a5@gmail.com> (raw)
In-Reply-To: <f517fc64-f8e2-f722-40f0-174bf709c145@foss.st.com>
Hi Patrick,
On 9/14/21 7:26 AM, Patrick DELAUNAY wrote:
> Hi Alexandru,
> I think you need to update arch/arm/mach-stm32mp/Kconfig
>
>
> something like:
>
>
> config STM32MP15x
> bool "Support STMicroelectronics STM32MP15x Soc"
> - select ARCH_SUPPORT_PSCI if !TFABOOT
> - select ARM_SMCCC if TFABOOT
> + select ARCH_SUPPORT_PSCI if !TFABOOT && !SPL_OPTEE_IMAGE
> + select ARM_SMCCC if TFABOOT || SPL_OPTEE_IMAGE
> select CPU_V7A
> - select CPU_V7_HAS_NONSEC if !TFABOOT
> + select CPU_V7_HAS_NONSEC if !TFABOOT && !SPL_OPTEE_IMAGE
> select CPU_V7_HAS_VIRT
> select OF_BOARD_SETUP
> select PINCTRL_STM32
> @@ -47,8 +47,8 @@ config STM32MP15x
> select STM32_SERIAL
> select SYS_ARCH_TIMER
> imply CMD_NVEDIT_INFO
> - imply SYSRESET_PSCI if TFABOOT
> - imply SYSRESET_SYSCON if !TFABOOT
> + imply SYSRESET_PSCI if TFABOOT || SPL_OPTEE_IMAGE
> + imply SYSRESET_SYSCON if !TFABOOT && !SPL_OPTEE_IMAGE
> help
> support of STMicroelectronics SOC STM32MP15x family
> STM32MP157, STM32MP153 or STM32MP151
> @@ -153,7 +153,7 @@ config NR_DRAM_BANKS
This is a terrible idea. We're trying to answer a few questions:
* Did the FSBL provide a PSCI secure monitor
* Is u-boot running in normal or secure world
But instead of clearly defining those answers, we're trying to infer
them from other config options. This is confusing to start with, but
it's also wrong.
For example, SPL_OPTEE_IMAGE means "we support OPTEE images in SPL". It
doesn't mean that we loaded an OP-TEE kernel at all. SPL with
SPL_OPTEE_IMAGE may as well boot a legacy uboot image -- nothing
prevents it. So to infer from this that u-boot runs in the normal world
is wrong.
Without loss of generality, any CONFIG that conflates u-boot options
with SPL options is likely to cause some changes down the line.
> So just introduce CONFIG_TFABOOT_FIP_CONTAINER don't solve all the
> issues....
>
>
> I think you need to manage CONFIG_SPL_OPTEE_IMAGE
> to handle specific case when OPTEE is running after SPL.
Sure, but I'd have to adjust this at runtime, not in Kconfig for the
reasons above.
> I try to experiment the OPTEE load by SPL but I don't see how
> the OP-TEE pager can be managed by SPL in the current code.
> It must loaded in SYRAM at 0x2ffc0000, with a risk to overwrite the SPL
> code loaded by rom code at 0x2ffc2500.
This consideration is not unique to SPL. I don't have that problem
because SPL loads OP-TEE to DRAM at 0xde000000. If OP-TEE wants to load
parts of itself to SYSRAM, that happens after SPL passed control, so the
conflict is not relevant.
> or how to manage several binary, see OP-TEE header v2 support in OP-TEE,
>
> Several file it is already supported in TF-A BL2 with FIP:
>
> tee-header_v2.bin
> tee-pager_v2.bin
> tee-pageable_v2.bin
I don't know how to use use the OP-TEE pager with SPL, so I elected not to:
EXTRA_OEMAKE = "PLATFORM=${OPTEE_PLATFORM} \
CFG_WITH_PAGER=n \
CFG_NS_ENTRY_ADDR=${KERNEL_UIMAGE_LOADADDRESS} \
CROSS_COMPILE=${HOST_PREFIX} \
CFG_TEE_CORE_DEBUG=y \
CFG_TEE_CORE_LOG_LEVEL=2 \
${TZDRAM_FLAGS} \
"
TZDRAM_FLAGS = "CFG_TZDRAM_START= 0xde000000\
CFG_DRAM_SIZE=0x20000000 "
Alex
next prev parent reply other threads:[~2021-10-07 17:13 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-09 14:55 [PATCH 0/3] stm32mp: Attempt to resolve unintended breakage with v2021.10-rc2 Alexandru Gagniuc
2021-09-09 14:55 ` [PATCH 1/3] stm32mp: Rename FIP config to stm32mp15_tfaboot_fip_defconig Alexandru Gagniuc
2021-09-09 14:55 ` [PATCH 2/3] arm: Kconfig: Introduce a TFABOOT_FIP_CONTAINER option Alexandru Gagniuc
2021-09-09 14:55 ` [PATCH 3/3] stm32mp1: Replace STM32MP15x_STM32IMAGE with TFABOOT_FIP_CONTAINER Alexandru Gagniuc
2021-09-14 12:26 ` [PATCH 0/3] stm32mp: Attempt to resolve unintended breakage with v2021.10-rc2 Patrick DELAUNAY
2021-10-07 17:13 ` Alex G. [this message]
2021-10-08 9:18 ` Patrick DELAUNAY
2021-10-08 11:28 ` Marek Vasut
2021-10-08 13:20 ` Patrick DELAUNAY
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=ccf4d20e-907f-02f4-aafc-e6c75f0932a5@gmail.com \
--to=mr.nuke.me@gmail.com \
--cc=etienne.carriere@linaro.org \
--cc=marex@denx.de \
--cc=patrice.chotard@foss.st.com \
--cc=patrick.delaunay@foss.st.com \
--cc=u-boot@lists.denx.de \
--cc=uboot-stm32@st-md-mailman.stormreply.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