aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorJames Hogan <james.hogan@imgtec.com>2013-01-31 08:27:35 -0500
committerJames Hogan <james.hogan@imgtec.com>2013-03-02 15:09:58 -0500
commitc787c2d62fe0c482f5fb3e5b869cd262fe69b244 (patch)
treead3a653e8ce81536a9d2d57976f09a2211de4d80 /arch
parent82f0167aa4c4bbc06b5a2e1e83d252792f7c5754 (diff)
metag: make TXPRIVEXT bits explicit
Define PRIV_BITS using explicit constants from <asm/metag_regs.h> rather than with a hard coded value. This also adds a couple of missing definitions for the TXPRIVEXT priv bits for protecting writes to TXTIMER and the trace registers. Signed-off-by: James Hogan <james.hogan@imgtec.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/metag/include/asm/metag_regs.h4
-rw-r--r--arch/metag/kernel/setup.c34
2 files changed, 31 insertions, 7 deletions
diff --git a/arch/metag/include/asm/metag_regs.h b/arch/metag/include/asm/metag_regs.h
index 022fcad768f7..acf4b8e6e9d1 100644
--- a/arch/metag/include/asm/metag_regs.h
+++ b/arch/metag/include/asm/metag_regs.h
@@ -414,6 +414,10 @@
414#define TXPRIVEXT_REGNUM 29 414#define TXPRIVEXT_REGNUM 29
415#define TXPRIVEXT_COPRO_BITS 0xFF000000 /* Co-processor 0-7 */ 415#define TXPRIVEXT_COPRO_BITS 0xFF000000 /* Co-processor 0-7 */
416#define TXPRIVEXT_COPRO_S 24 416#define TXPRIVEXT_COPRO_S 24
417#ifndef METAC_1_2
418#define TXPRIVEXT_TXTIMER_BIT 0x00080000 /* TXTIMER priv */
419#define TXPRIVEXT_TRACE_BIT 0x00040000 /* TTEXEC|TTCTRL|GTEXEC */
420#endif
417#define TXPRIVEXT_TXTRIGGER_BIT 0x00020000 /* TXSTAT|TXMASK|TXPOLL */ 421#define TXPRIVEXT_TXTRIGGER_BIT 0x00020000 /* TXSTAT|TXMASK|TXPOLL */
418#define TXPRIVEXT_TXGBLCREG_BIT 0x00010000 /* Global common regs */ 422#define TXPRIVEXT_TXGBLCREG_BIT 0x00010000 /* Global common regs */
419#define TXPRIVEXT_CBPRIV_BIT 0x00008000 /* Mem i/f dump priv */ 423#define TXPRIVEXT_CBPRIV_BIT 0x00008000 /* Mem i/f dump priv */
diff --git a/arch/metag/kernel/setup.c b/arch/metag/kernel/setup.c
index aaebc56270ec..dcb1d6d51ce4 100644
--- a/arch/metag/kernel/setup.c
+++ b/arch/metag/kernel/setup.c
@@ -35,6 +35,7 @@
35#include <asm/hwthread.h> 35#include <asm/hwthread.h>
36#include <asm/l2cache.h> 36#include <asm/l2cache.h>
37#include <asm/mach/arch.h> 37#include <asm/mach/arch.h>
38#include <asm/metag_regs.h>
38#include <asm/mmu.h> 39#include <asm/mmu.h>
39#include <asm/mmzone.h> 40#include <asm/mmzone.h>
40#include <asm/processor.h> 41#include <asm/processor.h>
@@ -43,18 +44,37 @@
43#include <asm/setup.h> 44#include <asm/setup.h>
44#include <asm/traps.h> 45#include <asm/traps.h>
45 46
46/* PRIV protect as many registers as possible. */ 47/* Priv protect as many registers as possible. */
47#define DEFAULT_PRIV 0xff0f7f00 48#define DEFAULT_PRIV (TXPRIVEXT_COPRO_BITS | \
48 49 TXPRIVEXT_TXTRIGGER_BIT | \
49/* Enable unaligned access checking. */ 50 TXPRIVEXT_TXGBLCREG_BIT | \
50#define UNALIGNED_PRIV 0x00000010 51 TXPRIVEXT_ILOCK_BIT | \
52 TXPRIVEXT_TXITACCYC_BIT | \
53 TXPRIVEXT_TXDIVTIME_BIT | \
54 TXPRIVEXT_TXAMAREGX_BIT | \
55 TXPRIVEXT_TXTIMERI_BIT | \
56 TXPRIVEXT_TXSTATUS_BIT | \
57 TXPRIVEXT_TXDISABLE_BIT)
58
59/* Meta2 specific bits. */
60#ifdef CONFIG_METAG_META12
61#define META2_PRIV 0
62#else
63#define META2_PRIV (TXPRIVEXT_TXTIMER_BIT | \
64 TXPRIVEXT_TRACE_BIT)
65#endif
51 66
67/* Unaligned access checking bits. */
52#ifdef CONFIG_METAG_UNALIGNED 68#ifdef CONFIG_METAG_UNALIGNED
53#define PRIV_BITS (DEFAULT_PRIV | UNALIGNED_PRIV) 69#define UNALIGNED_PRIV TXPRIVEXT_ALIGNREW_BIT
54#else 70#else
55#define PRIV_BITS DEFAULT_PRIV 71#define UNALIGNED_PRIV 0
56#endif 72#endif
57 73
74#define PRIV_BITS (DEFAULT_PRIV | \
75 META2_PRIV | \
76 UNALIGNED_PRIV)
77
58extern char _heap_start[]; 78extern char _heap_start[];
59 79
60#ifdef CONFIG_METAG_BUILTIN_DTB 80#ifdef CONFIG_METAG_BUILTIN_DTB