aboutsummaryrefslogtreecommitdiffstats
path: root/arch/xtensa
diff options
context:
space:
mode:
authorMax Filippov <jcmvbkbc@gmail.com>2012-11-18 22:00:41 -0500
committerChris Zankel <chris@zankel.net>2012-12-19 00:10:22 -0500
commitc622b29d1f38021411965b7e0170ab055551b257 (patch)
treef86875612ade331965b80abafb14cbd796924461 /arch/xtensa
parent733536b865441d9bad02c4711a4372d48ce21e54 (diff)
xtensa: initialize atomctl SR
In order to use S32C1I instruction on cores with ATOMCTL SR the register must be properly initialized. Signed-off-by: Max Filippov <jcmvbkbc@gmail.com> Signed-off-by: Chris Zankel <chris@zankel.net>
Diffstat (limited to 'arch/xtensa')
-rw-r--r--arch/xtensa/include/asm/initialize_mmu.h55
-rw-r--r--arch/xtensa/kernel/head.S3
2 files changed, 58 insertions, 0 deletions
diff --git a/arch/xtensa/include/asm/initialize_mmu.h b/arch/xtensa/include/asm/initialize_mmu.h
new file mode 100644
index 000000000000..e1f8ba4061ed
--- /dev/null
+++ b/arch/xtensa/include/asm/initialize_mmu.h
@@ -0,0 +1,55 @@
1/*
2 * arch/xtensa/include/asm/initialize_mmu.h
3 *
4 * Initializes MMU:
5 *
6 * For the new V3 MMU we remap the TLB from virtual == physical
7 * to the standard Linux mapping used in earlier MMU's.
8 *
9 * The the MMU we also support a new configuration register that
10 * specifies how the S32C1I instruction operates with the cache
11 * controller.
12 *
13 * This file is subject to the terms and conditions of the GNU General
14 * Public License. See the file "COPYING" in the main directory of
15 * this archive for more details.
16 *
17 * Copyright (C) 2008 - 2012 Tensilica, Inc.
18 *
19 * Marc Gauthier <marc@tensilica.com>
20 * Pete Delaney <piet@tensilica.com>
21 */
22
23#ifndef _XTENSA_INITIALIZE_MMU_H
24#define _XTENSA_INITIALIZE_MMU_H
25
26#ifdef __ASSEMBLY__
27
28#define XTENSA_HWVERSION_RC_2009_0 230000
29
30 .macro initialize_mmu
31
32#if XCHAL_HAVE_S32C1I && (XCHAL_HW_MIN_VERSION >= XTENSA_HWVERSION_RC_2009_0)
33/*
34 * We Have Atomic Operation Control (ATOMCTL) Register; Initialize it.
35 * For details see Documentation/xtensa/atomctl.txt
36 */
37#if XCHAL_DCACHE_IS_COHERENT
38 movi a3, 0x25 /* For SMP/MX -- internal for writeback,
39 * RCW otherwise
40 */
41#else
42 movi a3, 0x29 /* non-MX -- Most cores use Std Memory
43 * Controlers which usually can't use RCW
44 */
45#endif
46 wsr a3, atomctl
47#endif /* XCHAL_HAVE_S32C1I &&
48 * (XCHAL_HW_MIN_VERSION >= XTENSA_HWVERSION_RC_2009_0)
49 */
50
51 .endm
52
53#endif /*__ASSEMBLY__*/
54
55#endif /* _XTENSA_INITIALIZE_MMU_H */
diff --git a/arch/xtensa/kernel/head.S b/arch/xtensa/kernel/head.S
index 417998c02108..9013ae0174f8 100644
--- a/arch/xtensa/kernel/head.S
+++ b/arch/xtensa/kernel/head.S
@@ -18,6 +18,7 @@
18#include <asm/processor.h> 18#include <asm/processor.h>
19#include <asm/page.h> 19#include <asm/page.h>
20#include <asm/cacheasm.h> 20#include <asm/cacheasm.h>
21#include <asm/initialize_mmu.h>
21 22
22#include <linux/init.h> 23#include <linux/init.h>
23#include <linux/linkage.h> 24#include <linux/linkage.h>
@@ -155,6 +156,8 @@ ENTRY(_startup)
155 156
156 isync 157 isync
157 158
159 initialize_mmu
160
158 /* Unpack data sections 161 /* Unpack data sections
159 * 162 *
160 * The linker script used to build the Linux kernel image 163 * The linker script used to build the Linux kernel image