From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jan Kiszka Date: Wed, 18 Feb 2015 08:24:57 +0100 Subject: [U-Boot] [PATCH v2 11/12] tegra124: Reserve secure RAM using MC_SECURITY_CFG{0, 1}_0 In-Reply-To: <54E3AD6F.1000305@wwwdotorg.org> References: <1a2463987464ef637b09316a4dbb440b7831b07e.1424091289.git.jan.kiszka@siemens.com> <54E3AD6F.1000305@wwwdotorg.org> Message-ID: <54E43E49.1060004@siemens.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 2015-02-17 22:06, Stephen Warren wrote: > On 02/16/2015 05:54 AM, Jan Kiszka wrote: >> From: Ian Campbell >> >> These registers can be used to prevent non-secure world from accessing a >> megabyte aligned region of RAM, use them to protect the u-boot secure >> monitor >> code. >> >> At first I tried to do this from s_init(), however this inexplicably >> causes >> u-boot's networking (e.g. DHCP) to fail, while networking under Linux >> was fine. >> >> So instead I have added a new weak arch function protect_secure_section() >> called from relocate_secure_section() and reserved the region there. >> This is >> better overall since it defers the reservation until after the sec vs. >> non-sec >> decision (which can be influenced by an envvar) has been made when >> booting the >> os. > >> diff --git a/arch/arm/cpu/tegra-common/ap.c >> b/arch/arm/cpu/tegra-common/ap.c > >> +void protect_secure_section(void) > >> + writel(CONFIG_ARMV7_SECURE_BASE, &mc->mc_security_cfg0); >> + writel(CONFIG_ARMV7_SECURE_RESERVE_SIZE>>20, &mc->mc_security_cfg1); > > Spaces around the >> ? Fixed for v3. Thanks, Jan -- Siemens AG, Corporate Technology, CT RTC ITP SES-DE Corporate Competence Center Embedded Linux