From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tom Rini Date: Mon, 19 Nov 2012 15:48:53 -0500 Subject: [U-Boot] [PATCH 1/2] ARM: cache: introduce weak arm_setup_identity_mapping In-Reply-To: <1353337174-9858-2-git-send-email-v-stehle@ti.com> References: <20121116215251.471c148a@lilith> <1353337174-9858-1-git-send-email-v-stehle@ti.com> <1353337174-9858-2-git-send-email-v-stehle@ti.com> Message-ID: <20121119204853.GF9467@oliver-linux> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Mon, Nov 19, 2012 at 03:59:33PM +0100, Vincent Stehl? wrote: > Separate the MMU identity mapping for ARM in a weak function, to allow > redefinition with platform specific function. > > This is motivated by the need to unmap the region near address zero on HS OMAP > devices, to avoid speculative accesses. Accessing this region causes security > violations, which we want to avoid. > > Signed-off-by: Vincent Stehl? > --- > arch/arm/lib/cache-cp15.c | 18 +++++++++++++++--- > 1 file changed, 15 insertions(+), 3 deletions(-) > > diff --git a/arch/arm/lib/cache-cp15.c b/arch/arm/lib/cache-cp15.c > index 939de10..886fe5c 100644 > --- a/arch/arm/lib/cache-cp15.c > +++ b/arch/arm/lib/cache-cp15.c > @@ -40,6 +40,17 @@ void __arm_init_before_mmu(void) > void arm_init_before_mmu(void) > __attribute__((weak, alias("__arm_init_before_mmu"))); > > +void __arm_setup_identity_mapping(u32 *page_table) > +{ > + int i; > + > + /* Set up an identity-mapping for all 4GB, rw for everyone */ > + for (i = 0; i < 4096; i++) > + page_table[i] = i << 20 | (3 << 10) | 0x12; > +} > +void arm_setup_identity_mapping(u32 *page_table) > + __attribute__((weak, alias("__arm_setup_identity_mapping"))); Please use __weak as found in , thanks. -- Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 836 bytes Desc: Digital signature URL: