From mboxrd@z Thu Jan 1 00:00:00 1970 From: Peng Fan Date: Mon, 8 Jul 2019 01:39:39 +0000 Subject: [U-Boot] [PATCH V2 24/51] imx8m: Configure trustzone region 0 for non-secure access In-Reply-To: <20190708015333.20411-1-peng.fan@nxp.com> References: <20190708015333.20411-1-peng.fan@nxp.com> Message-ID: <20190708015333.20411-25-peng.fan@nxp.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de From: Ye Li Set trustzone region 0 to allow both non-secure and secure access when trust zone is enabled. We found USB controller fails to access DDR if the default region 0 is secure access only. Signed-off-by: Ye Li Signed-off-by: Peng Fan --- arch/arm/mach-imx/imx8m/soc.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/arch/arm/mach-imx/imx8m/soc.c b/arch/arm/mach-imx/imx8m/soc.c index 9a90383f51..5b7300087d 100644 --- a/arch/arm/mach-imx/imx8m/soc.c +++ b/arch/arm/mach-imx/imx8m/soc.c @@ -61,6 +61,12 @@ void enable_tzc380(void) setbits_le32(&gpr->gpr[10], GPR_TZASC_EN_LOCK); if (IS_ENABLED(CONFIG_IMX8MM)) setbits_le32(&gpr->gpr[10], BIT(1)); + /* + * set Region 0 attribute to allow secure and non-secure + * read/write permission. Found some masters like usb dwc3 + * controllers can't work with secure memory. + */ + writel(0xf0000000, TZASC_BASE_ADDR + 0x108); } void set_wdog_reset(struct wdog_regs *wdog) -- 2.16.4