From: Andrew F. Davis Date: Tue, 6 Sep 2016 15:41:47 -0500 Subject: [U-Boot] [PATCH 3/5] ARM: DRA7: Add secure emif setup calls In-Reply-To: <1472794824-6032-4-git-send-email-d-allred@ti.com> References: <1472794824-6032-1-git-send-email-d-allred@ti.com> <1472794824-6032-4-git-send-email-d-allred@ti.com> Message-ID: <37b35312-3458-ba40-a696-71cd4dfef244@ti.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 09/02/2016 12:40 AM, Daniel Allred wrote: > After EMIF DRAM is configured, but before it is used, > calls are made on secure devices to reserve any configured > memory region needed by the secure world and then to lock the > EMIF firewall configuration. If any other firewall > configuration needs to be applied, it must happen before the > lock call. > > Signed-off-by: Daniel Allred > --- > arch/arm/cpu/armv7/omap-common/emif-common.c | 15 +++++++++++++++ > 1 file changed, 15 insertions(+) > > diff --git a/arch/arm/cpu/armv7/omap-common/emif-common.c b/arch/arm/cpu/armv7/omap-common/emif-common.c > index 2b79010..b26984e 100644 > --- a/arch/arm/cpu/armv7/omap-common/emif-common.c > +++ b/arch/arm/cpu/armv7/omap-common/emif-common.c > @@ -14,6 +14,7 @@ > #include > #include > #include > +#include > #include > #include > > @@ -1477,6 +1478,20 @@ void sdram_init(void) > debug("get_ram_size() successful"); > } > > +#if defined(CONFIG_TI_SECURE_DEVICE) > + /* > + * On HS devices, do static EMIF firewall configuration > + * but only do it if not already running in SDRAM > + */ > + if (!in_sdram) Should we hang in this case? > + if (0 != secure_emif_reserve()) "0 != " could be removed here and below. > + hang(); > + > + /* On HS devices, ensure static EMIF firewall APIs are locked */ > + if (0 != secure_emif_firewall_lock()) > + hang(); > +#endif > + > if (sdram_type == EMIF_SDRAM_TYPE_DDR3 && > (!in_sdram && !warm_reset()) && (!is_dra7xx())) { > if (emif1_enabled) >