MIPS: Loongson-3: Fast TLB refill handler
[linux-2.6-block.git] / arch / mips / include / asm / mach-loongson64 / kernel-entry-init.h
CommitLineData
c4617318
HC
1/*
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
4 * for more details.
5 *
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)
10 */
30ad29bb
HC
11#ifndef __ASM_MACH_LOONGSON64_KERNEL_ENTRY_H
12#define __ASM_MACH_LOONGSON64_KERNEL_ENTRY_H
c4617318
HC
13
14/*
15 * Override macros used in arch/mips/kernel/head.S.
16 */
17 .macro kernel_entry_setup
18#ifdef CONFIG_CPU_LOONGSON3
19 .set push
20 .set mips64
21 /* Set LPA on LOONGSON3 config3 */
22 mfc0 t0, $16, 3
23 or t0, (0x1 << 7)
24 mtc0 t0, $16, 3
25 /* Set ELPA on LOONGSON3 pagegrain */
b2edcfc8
HC
26 mfc0 t0, $5, 1
27 or t0, (0x1 << 29)
c4617318
HC
28 mtc0 t0, $5, 1
29 _ehb
30 .set pop
31#endif
32 .endm
33
34/*
35 * Do SMP slave processor setup.
36 */
37 .macro smp_slave_setup
38#ifdef CONFIG_CPU_LOONGSON3
39 .set push
40 .set mips64
41 /* Set LPA on LOONGSON3 config3 */
42 mfc0 t0, $16, 3
43 or t0, (0x1 << 7)
44 mtc0 t0, $16, 3
45 /* Set ELPA on LOONGSON3 pagegrain */
b2edcfc8
HC
46 mfc0 t0, $5, 1
47 or t0, (0x1 << 29)
c4617318
HC
48 mtc0 t0, $5, 1
49 _ehb
50 .set pop
51#endif
52 .endm
53
30ad29bb 54#endif /* __ASM_MACH_LOONGSON64_KERNEL_ENTRY_H */