From: Marek Vasut <marex@denx.de>
To: u-boot@lists.denx.de
Cc: Marek Vasut <marex@denx.de>,
"Ariel D'Alessandro" <ariel.dalessandro@collabora.com>,
"NXP i.MX U-Boot Team" <uboot-imx@nxp.com>,
"Ying-Chun Liu (PaulLiu)" <paul.liu@linaro.org>,
Adam Ford <aford173@gmail.com>,
Andrejs Cainikovs <andrejs.cainikovs@toradex.com>,
Fabio Estevam <festevam@gmail.com>,
Manoj Sai <abbaraju.manojsai@amarulasolutions.com>,
Marcel Ziswiler <marcel.ziswiler@toradex.com>,
Michael Trimarchi <michael@amarulasolutions.com>,
Peng Fan <peng.fan@nxp.com>,
Ricardo Salveti <ricardo@foundries.io>,
Simon Glass <sjg@chromium.org>, Stefano Babic <sbabic@denx.de>,
Tim Harvey <tharvey@gateworks.com>, Ye Li <ye.li@nxp.com>
Subject: [PATCH 07/10] arm: imx: imx8m: Map RAM as NS if PSCI provider
Date: Thu, 22 Dec 2022 01:46:40 +0100 [thread overview]
Message-ID: <20221222004643.1013095-7-marex@denx.de> (raw)
In-Reply-To: <20221222004643.1013095-1-marex@denx.de>
In case U-Boot is a PSCI provider, map RAM explicitly as NS,
otherwise secondary cores crash with SError when attempting
to access RAM mapped as secure in EL2.
Signed-off-by: Marek Vasut <marex@denx.de>
---
Cc: "Ariel D'Alessandro" <ariel.dalessandro@collabora.com>
Cc: "NXP i.MX U-Boot Team" <uboot-imx@nxp.com>
Cc: "Ying-Chun Liu (PaulLiu)" <paul.liu@linaro.org>
Cc: Adam Ford <aford173@gmail.com>
Cc: Andrejs Cainikovs <andrejs.cainikovs@toradex.com>
Cc: Fabio Estevam <festevam@gmail.com>
Cc: Manoj Sai <abbaraju.manojsai@amarulasolutions.com>
Cc: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Cc: Michael Trimarchi <michael@amarulasolutions.com>
Cc: Peng Fan <peng.fan@nxp.com>
Cc: Ricardo Salveti <ricardo@foundries.io>
Cc: Simon Glass <sjg@chromium.org>
Cc: Stefano Babic <sbabic@denx.de>
Cc: Tim Harvey <tharvey@gateworks.com>
Cc: Ye Li <ye.li@nxp.com>
---
arch/arm/mach-imx/imx8m/soc.c | 16 +++++++++++-----
1 file changed, 11 insertions(+), 5 deletions(-)
diff --git a/arch/arm/mach-imx/imx8m/soc.c b/arch/arm/mach-imx/imx8m/soc.c
index 96c6e69aae4..706ba8509da 100644
--- a/arch/arm/mach-imx/imx8m/soc.c
+++ b/arch/arm/mach-imx/imx8m/soc.c
@@ -100,6 +100,12 @@ void set_wdog_reset(struct wdog_regs *wdog)
setbits_le16(&wdog->wcr, WDOG_WDT_MASK | WDOG_WDZST_MASK);
}
+#ifdef CONFIG_ARMV8_PSCI
+#define PTE_MAP_NS PTE_BLOCK_NS
+#else
+#define PTE_MAP_NS 0
+#endif
+
static struct mm_region imx8m_mem_map[] = {
{
/* ROM */
@@ -122,7 +128,7 @@ static struct mm_region imx8m_mem_map[] = {
.phys = 0x180000UL,
.size = 0x8000UL,
.attrs = PTE_BLOCK_MEMTYPE(MT_NORMAL) |
- PTE_BLOCK_OUTER_SHARE
+ PTE_BLOCK_OUTER_SHARE | PTE_MAP_NS
}, {
/* TCM */
.virt = 0x7C0000UL,
@@ -130,14 +136,14 @@ static struct mm_region imx8m_mem_map[] = {
.size = 0x80000UL,
.attrs = PTE_BLOCK_MEMTYPE(MT_DEVICE_NGNRNE) |
PTE_BLOCK_NON_SHARE |
- PTE_BLOCK_PXN | PTE_BLOCK_UXN
+ PTE_BLOCK_PXN | PTE_BLOCK_UXN | PTE_MAP_NS
}, {
/* OCRAM */
.virt = 0x900000UL,
.phys = 0x900000UL,
.size = 0x200000UL,
.attrs = PTE_BLOCK_MEMTYPE(MT_NORMAL) |
- PTE_BLOCK_OUTER_SHARE
+ PTE_BLOCK_OUTER_SHARE | PTE_MAP_NS
}, {
/* AIPS */
.virt = 0xB00000UL,
@@ -152,7 +158,7 @@ static struct mm_region imx8m_mem_map[] = {
.phys = 0x40000000UL,
.size = PHYS_SDRAM_SIZE,
.attrs = PTE_BLOCK_MEMTYPE(MT_NORMAL) |
- PTE_BLOCK_OUTER_SHARE
+ PTE_BLOCK_OUTER_SHARE | PTE_MAP_NS
#ifdef PHYS_SDRAM_2_SIZE
}, {
/* DRAM2 */
@@ -160,7 +166,7 @@ static struct mm_region imx8m_mem_map[] = {
.phys = 0x100000000UL,
.size = PHYS_SDRAM_2_SIZE,
.attrs = PTE_BLOCK_MEMTYPE(MT_NORMAL) |
- PTE_BLOCK_OUTER_SHARE
+ PTE_BLOCK_OUTER_SHARE | PTE_MAP_NS
#endif
}, {
/* empty entrie to split table entry 5 if needed when TEEs are used */
--
2.35.1
next prev parent reply other threads:[~2022-12-22 0:48 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-22 0:46 [PATCH 01/10] arm: psci: Add PSCI v1.1 macro Marek Vasut
2022-12-22 0:46 ` [PATCH 02/10] arm: psci: Fix RESET2 hook Marek Vasut
2023-01-31 16:52 ` sbabic
2022-12-22 0:46 ` [PATCH 03/10] arm: imx: Drop custom lowlevel_init Marek Vasut
2023-01-31 16:52 ` sbabic
2022-12-22 0:46 ` [PATCH 04/10] arm: dts: imx8m: Require ATF BL31 blob only if not PSCI provider Marek Vasut
2023-01-31 16:52 ` sbabic
2022-12-22 0:46 ` [PATCH 05/10] arm: imx: imx8m: Only use ROM pointers " Marek Vasut
2023-01-31 16:52 ` sbabic
2022-12-22 0:46 ` [PATCH 06/10] arm: imx: imx8m: Enable GICv3 support if " Marek Vasut
2023-01-31 16:52 ` sbabic
2022-12-22 0:46 ` Marek Vasut [this message]
2023-01-31 16:52 ` [PATCH 07/10] arm: imx: imx8m: Map RAM as NS " sbabic
2022-12-22 0:46 ` [PATCH 08/10] arm: imx: imx8m: Define trampoline location " Marek Vasut
2023-01-31 16:52 ` sbabic
2022-12-22 0:46 ` [PATCH 09/10] arm: imx: imx8m: Program CSU and TZASC " Marek Vasut
2023-01-31 16:53 ` sbabic
2022-12-22 0:46 ` [PATCH 10/10] arm: imx: imx8m: Add basic PSCI provider implementation Marek Vasut
2022-12-22 3:05 ` Adam Ford
2022-12-22 3:58 ` Marek Vasut
2023-01-02 16:44 ` Adam Ford
2023-01-02 23:41 ` Marek Vasut
2023-01-02 23:47 ` Adam Ford
2023-01-02 23:58 ` Marek Vasut
2023-01-03 1:05 ` Adam Ford
2023-01-03 9:38 ` Marek Vasut
2023-01-31 16:52 ` sbabic
2023-01-31 16:52 ` [PATCH 01/10] arm: psci: Add PSCI v1.1 macro sbabic
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=20221222004643.1013095-7-marex@denx.de \
--to=marex@denx.de \
--cc=abbaraju.manojsai@amarulasolutions.com \
--cc=aford173@gmail.com \
--cc=andrejs.cainikovs@toradex.com \
--cc=ariel.dalessandro@collabora.com \
--cc=festevam@gmail.com \
--cc=marcel.ziswiler@toradex.com \
--cc=michael@amarulasolutions.com \
--cc=paul.liu@linaro.org \
--cc=peng.fan@nxp.com \
--cc=ricardo@foundries.io \
--cc=sbabic@denx.de \
--cc=sjg@chromium.org \
--cc=tharvey@gateworks.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