/* * arch/arm/mach-tegra/headsmp.S * * SMP initialization routines for Tegra SoCs * * Copyright (c) 2009-2010, NVIDIA Corporation. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include #include #include #include #include #include #include #include #include "power-macros.S" #define TTB_FLAGS 0x6A @ IRGN_WBWA, OC_RGN_WBWA, S, NOS #define PMC_DPD_SAMPLE 0x20 #define PMC_DPD_ENABLE 0x24 #define PMC_SCRATCH1 0x54 #define PMC_SCRATCH39 0x138 #define RST_DEVICES_U 0xc /* .section ".cpuinit.text", "ax"*/ .macro poke_ev, val, tmp mov32 \tmp, (TEGRA_EXCEPTION_VECTORS_BASE + 0x100) str \val, [\tmp] .endm /* * __invalidate_l1 * * Invalidates the L1 data cache (no clean) during initial boot of * a secondary processor * * Corrupted registers: r0-r6 */ __invalidate_l1: mov r0, #0 mcr p15, 2, r0, c0, c0, 0 mrc p15, 1, r0, c0, c0, 0 movw r1, #0x7fff and r2, r1, r0, lsr #13 movw 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<