/***************************************************************************** * Copyright 2003 - 2008 Broadcom Corporation. All rights reserved. * * Unless you and Broadcom execute a separate written software license * agreement governing use of this software, this software is licensed to you * under the terms of the GNU General Public License version 2, available at * http://www.broadcom.com/licenses/GPLv2.php (the "GPL"). * * Notwithstanding the above, under no circumstances may you combine this * software in any way with any other Broadcom software provided under a * license other than the GPL, without Broadcom's express prior written * consent. *****************************************************************************/ #include #include __INIT /* * v7_l1_cache_invalidate * * Invalidate contents of L1 cache without flushing its contents * into outer cache and memory. This is needed when the contents * of the cache are unpredictable after power-up. * * corrupts r0-r6 */ ENTRY(v7_l1_cache_invalidate) mov r0, #0 mcr p15, 2, r0, c0, c0, 0 @ set cache level to 1 mrc p15, 1, r0, c0, c0, 0 @ read CLIDR ldr r1, =0x7fff and r2, r1, r0, lsr #13 @ get max # of index size ldr r1, =0x3ff and r3, r1, r0, lsr #3 @ NumWays - 1 add r2, r2, #1 @ NumSets and r0, r0, #0x7 add r0, r0, #4 @ SetShift clz r1, r3 @ WayShift add r4, r3, #1 @ NumWays 1: sub r2, r2, #1 @ NumSets-- mov r3, r4 @ Temp = NumWays 2: subs r3, r3, #1 @ Temp-- mov r5, r3, lsl r1 mov r6, r2, lsl r0 orr r5, r5, r6 @ Reg = (Temp<