Path: blob/master/arch/mips/netlogic/xlr/smpboot.S
10821 views
/*1* Copyright 2003-2011 NetLogic Microsystems, Inc. (NetLogic). All rights2* reserved.3*4* This software is available to you under a choice of one of two5* licenses. You may choose to be licensed under the terms of the GNU6* General Public License (GPL) Version 2, available from the file7* COPYING in the main directory of this source tree, or the NetLogic8* license below:9*10* Redistribution and use in source and binary forms, with or without11* modification, are permitted provided that the following conditions12* are met:13*14* 1. Redistributions of source code must retain the above copyright15* notice, this list of conditions and the following disclaimer.16* 2. Redistributions in binary form must reproduce the above copyright17* notice, this list of conditions and the following disclaimer in18* the documentation and/or other materials provided with the19* distribution.20*21* THIS SOFTWARE IS PROVIDED BY NETLOGIC ``AS IS'' AND ANY EXPRESS OR22* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED23* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE24* ARE DISCLAIMED. IN NO EVENT SHALL NETLOGIC OR CONTRIBUTORS BE LIABLE25* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR26* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF27* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR28* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,29* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE30* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN31* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.32*/3334#include <asm/asm.h>35#include <asm/asm-offsets.h>36#include <asm/regdef.h>37#include <asm/mipsregs.h>383940/* Don't jump to linux function from Bootloader stack. Change it41* here. Kernel might allocate bootloader memory before all the CPUs are42* brought up (eg: Inode cache region) and we better don't overwrite this43* memory44*/45NESTED(prom_pre_boot_secondary_cpus, 16, sp)46.set mips6447mfc0 t0, $15, 1 # read ebase48andi t0, 0x1f # t0 has the processor_id()49sll t0, 2 # offset in cpu array5051PTR_LA t1, nlm_cpu_ready # mark CPU ready52PTR_ADDU t1, t053li t2, 154sw t2, 0(t1)5556PTR_LA t1, nlm_cpu_unblock57PTR_ADDU t1, t0581: lw t2, 0(t1) # wait till unblocked59beqz t2, 1b60nop6162PTR_LA t1, nlm_next_sp63PTR_L sp, 0(t1)64PTR_LA t1, nlm_next_gp65PTR_L gp, 0(t1)6667PTR_LA t0, nlm_early_init_secondary68jalr t069nop7071PTR_LA t0, smp_bootstrap72jr t073nop74END(prom_pre_boot_secondary_cpus)7576NESTED(nlm_boot_smp_nmi, 0, sp)77.set push78.set noat79.set mips6480.set noreorder8182/* Clear the NMI and BEV bits */83MFC0 k0, CP0_STATUS84li k1, 0xffb7ffff85and k0, k0, k186MTC0 k0, CP0_STATUS8788PTR_LA k1, secondary_entry_point89PTR_L k0, 0(k1)90jr k091nop92.set pop93END(nlm_boot_smp_nmi)949596