2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
6 * Copyright (C) 2005 Embedded Alley Solutions, Inc
7 * Copyright (C) 2005 Ralf Baechle (ralf@linux-mips.org)
8 * Copyright (C) 2009 Jiajie Chen (chenjiajie@cse.buaa.edu.cn)
9 * Copyright (C) 2012 Huacai Chen (chenhc@lemote.com)
11 #ifndef __ASM_MACH_LOONGSON64_KERNEL_ENTRY_H
12 #define __ASM_MACH_LOONGSON64_KERNEL_ENTRY_H
17 * Override macros used in arch/mips/kernel/head.S.
19 .macro kernel_entry_setup
22 /* Set LPA on LOONGSON3 config3 */
26 /* Set ELPA on LOONGSON3 pagegrain */
27 mfc0 t0
, CP0_PAGEGRAIN
29 mtc0 t0
, CP0_PAGEGRAIN
30 /* Enable STFill Buffer */
33 andi t1
, t0
, PRID_IMP_MASK
34 li t2
, PRID_IMP_LOONGSON_64G
37 /* Loongson-3A R2/R3 */
38 andi t0
, (PRID_IMP_MASK
| PRID_REV_MASK
)
39 slti t0
, (PRID_IMP_LOONGSON_64C
| PRID_REV_LOONGSON3A_R2_0
)
52 * Do SMP slave processor setup.
54 .macro smp_slave_setup
57 /* Set LPA on LOONGSON3 config3 */
61 /* Set ELPA on LOONGSON3 pagegrain */
62 mfc0 t0
, CP0_PAGEGRAIN
64 mtc0 t0
, CP0_PAGEGRAIN
65 /* Enable STFill Buffer */
68 andi t1
, t0
, PRID_IMP_MASK
69 li t2
, PRID_IMP_LOONGSON_64G
72 /* Loongson-3A R2/R3 */
73 andi t0
, (PRID_IMP_MASK
| PRID_REV_MASK
)
74 slti t0
, (PRID_IMP_LOONGSON_64C
| PRID_REV_LOONGSON3A_R2_0
)
86 #endif /* __ASM_MACH_LOONGSON64_KERNEL_ENTRY_H */