aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arc
diff options
context:
space:
mode:
authorVineet Gupta <vgupta@synopsys.com>2013-05-14 03:58:17 -0400
committerVineet Gupta <vgupta@synopsys.com>2013-06-22 04:16:42 -0400
commitda1677b02d3ef674dfd8a4ba1ed32153dc717fa2 (patch)
tree109d07ee350a94a85f9447af3f488623f989b6fa /arch/arc
parent18437347b976b81e616a57fb36922a240e71a6de (diff)
ARC: Disintegrate arcregs.h
* Move the various sub-system defines/types into relevant files/functions (reduces compilation time) * move CPU specific stuff out of asm/tlb.h into asm/mmu.h Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
Diffstat (limited to 'arch/arc')
-rw-r--r--arch/arc/include/asm/arcregs.h116
-rw-r--r--arch/arc/include/asm/cache.h19
-rw-r--r--arch/arc/include/asm/irqflags.h20
-rw-r--r--arch/arc/include/asm/mmu.h36
-rw-r--r--arch/arc/include/asm/pgtable.h6
-rw-r--r--arch/arc/include/asm/tlb-mmu1.h1
-rw-r--r--arch/arc/include/asm/tlb.h26
-rw-r--r--arch/arc/kernel/time.c11
-rw-r--r--arch/arc/mm/cache_arc700.c39
-rw-r--r--arch/arc/mm/fault.c1
-rw-r--r--arch/arc/mm/tlb.c24
-rw-r--r--arch/arc/mm/tlbex.S2
12 files changed, 139 insertions, 162 deletions
diff --git a/arch/arc/include/asm/arcregs.h b/arch/arc/include/asm/arcregs.h
index 1b907c465666..20002c46e3bc 100644
--- a/arch/arc/include/asm/arcregs.h
+++ b/arch/arc/include/asm/arcregs.h
@@ -20,7 +20,6 @@
20#define ARC_REG_PERIBASE_BCR 0x69 20#define ARC_REG_PERIBASE_BCR 0x69
21#define ARC_REG_FP_BCR 0x6B /* Single-Precision FPU */ 21#define ARC_REG_FP_BCR 0x6B /* Single-Precision FPU */
22#define ARC_REG_DPFP_BCR 0x6C /* Dbl Precision FPU */ 22#define ARC_REG_DPFP_BCR 0x6C /* Dbl Precision FPU */
23#define ARC_REG_MMU_BCR 0x6f
24#define ARC_REG_DCCM_BCR 0x74 /* DCCM Present + SZ */ 23#define ARC_REG_DCCM_BCR 0x74 /* DCCM Present + SZ */
25#define ARC_REG_TIMERS_BCR 0x75 24#define ARC_REG_TIMERS_BCR 0x75
26#define ARC_REG_ICCM_BCR 0x78 25#define ARC_REG_ICCM_BCR 0x78
@@ -34,22 +33,12 @@
34#define ARC_REG_D_UNCACH_BCR 0x6A 33#define ARC_REG_D_UNCACH_BCR 0x6A
35 34
36/* status32 Bits Positions */ 35/* status32 Bits Positions */
37#define STATUS_H_BIT 0 /* CPU Halted */
38#define STATUS_E1_BIT 1 /* Int 1 enable */
39#define STATUS_E2_BIT 2 /* Int 2 enable */
40#define STATUS_A1_BIT 3 /* Int 1 active */
41#define STATUS_A2_BIT 4 /* Int 2 active */
42#define STATUS_AE_BIT 5 /* Exception active */ 36#define STATUS_AE_BIT 5 /* Exception active */
43#define STATUS_DE_BIT 6 /* PC is in delay slot */ 37#define STATUS_DE_BIT 6 /* PC is in delay slot */
44#define STATUS_U_BIT 7 /* User/Kernel mode */ 38#define STATUS_U_BIT 7 /* User/Kernel mode */
45#define STATUS_L_BIT 12 /* Loop inhibit */ 39#define STATUS_L_BIT 12 /* Loop inhibit */
46 40
47/* These masks correspond to the status word(STATUS_32) bits */ 41/* These masks correspond to the status word(STATUS_32) bits */
48#define STATUS_H_MASK (1<<STATUS_H_BIT)
49#define STATUS_E1_MASK (1<<STATUS_E1_BIT)
50#define STATUS_E2_MASK (1<<STATUS_E2_BIT)
51#define STATUS_A1_MASK (1<<STATUS_A1_BIT)
52#define STATUS_A2_MASK (1<<STATUS_A2_BIT)
53#define STATUS_AE_MASK (1<<STATUS_AE_BIT) 42#define STATUS_AE_MASK (1<<STATUS_AE_BIT)
54#define STATUS_DE_MASK (1<<STATUS_DE_BIT) 43#define STATUS_DE_MASK (1<<STATUS_DE_BIT)
55#define STATUS_U_MASK (1<<STATUS_U_BIT) 44#define STATUS_U_MASK (1<<STATUS_U_BIT)
@@ -87,86 +76,7 @@
87/* Auxiliary registers */ 76/* Auxiliary registers */
88#define AUX_IDENTITY 4 77#define AUX_IDENTITY 4
89#define AUX_INTR_VEC_BASE 0x25 78#define AUX_INTR_VEC_BASE 0x25
90#define AUX_IRQ_LEV 0x200 /* IRQ Priority: L1 or L2 */
91#define AUX_IRQ_HINT 0x201 /* For generating Soft Interrupts */
92#define AUX_IRQ_LV12 0x43 /* interrupt level register */
93
94#define AUX_IENABLE 0x40c
95#define AUX_ITRIGGER 0x40d
96#define AUX_IPULSE 0x415
97
98/* Timer related Aux registers */
99#define ARC_REG_TIMER0_LIMIT 0x23 /* timer 0 limit */
100#define ARC_REG_TIMER0_CTRL 0x22 /* timer 0 control */
101#define ARC_REG_TIMER0_CNT 0x21 /* timer 0 count */
102#define ARC_REG_TIMER1_LIMIT 0x102 /* timer 1 limit */
103#define ARC_REG_TIMER1_CTRL 0x101 /* timer 1 control */
104#define ARC_REG_TIMER1_CNT 0x100 /* timer 1 count */
105
106#define TIMER_CTRL_IE (1 << 0) /* Interupt when Count reachs limit */
107#define TIMER_CTRL_NH (1 << 1) /* Count only when CPU NOT halted */
108
109/* MMU Management regs */
110#define ARC_REG_TLBPD0 0x405
111#define ARC_REG_TLBPD1 0x406
112#define ARC_REG_TLBINDEX 0x407
113#define ARC_REG_TLBCOMMAND 0x408
114#define ARC_REG_PID 0x409
115#define ARC_REG_SCRATCH_DATA0 0x418
116
117/* Bits in MMU PID register */
118#define MMU_ENABLE (1 << 31) /* Enable MMU for process */
119
120/* Error code if probe fails */
121#define TLB_LKUP_ERR 0x80000000
122
123/* TLB Commands */
124#define TLBWrite 0x1
125#define TLBRead 0x2
126#define TLBGetIndex 0x3
127#define TLBProbe 0x4
128
129#if (CONFIG_ARC_MMU_VER >= 2)
130#define TLBWriteNI 0x5 /* write JTLB without inv uTLBs */
131#define TLBIVUTLB 0x6 /* explicitly inv uTLBs */
132#else
133#undef TLBWriteNI /* These cmds don't exist on older MMU */
134#undef TLBIVUTLB
135#endif
136
137/* Instruction cache related Auxiliary registers */
138#define ARC_REG_IC_BCR 0x77 /* Build Config reg */
139#define ARC_REG_IC_IVIC 0x10
140#define ARC_REG_IC_CTRL 0x11
141#define ARC_REG_IC_IVIL 0x19
142#if (CONFIG_ARC_MMU_VER > 2)
143#define ARC_REG_IC_PTAG 0x1E
144#endif
145
146/* Bit val in IC_CTRL */
147#define IC_CTRL_CACHE_DISABLE 0x1
148
149/* Data cache related Auxiliary registers */
150#define ARC_REG_DC_BCR 0x72
151#define ARC_REG_DC_IVDC 0x47
152#define ARC_REG_DC_CTRL 0x48
153#define ARC_REG_DC_IVDL 0x4A
154#define ARC_REG_DC_FLSH 0x4B
155#define ARC_REG_DC_FLDL 0x4C
156#if (CONFIG_ARC_MMU_VER > 2)
157#define ARC_REG_DC_PTAG 0x5C
158#endif
159 79
160/* Bit val in DC_CTRL */
161#define DC_CTRL_INV_MODE_FLUSH 0x40
162#define DC_CTRL_FLUSH_STATUS 0x100
163
164/* MMU Management regs */
165#define ARC_REG_PID 0x409
166#define ARC_REG_SCRATCH_DATA0 0x418
167
168/* Bits in MMU PID register */
169#define MMU_ENABLE (1 << 31) /* Enable MMU for process */
170 80
171/* 81/*
172 * Floating Pt Registers 82 * Floating Pt Registers
@@ -293,24 +203,6 @@ struct bcr_identity {
293#endif 203#endif
294}; 204};
295 205
296struct bcr_mmu_1_2 {
297#ifdef CONFIG_CPU_BIG_ENDIAN
298 unsigned int ver:8, ways:4, sets:4, u_itlb:8, u_dtlb:8;
299#else
300 unsigned int u_dtlb:8, u_itlb:8, sets:4, ways:4, ver:8;
301#endif
302};
303
304struct bcr_mmu_3 {
305#ifdef CONFIG_CPU_BIG_ENDIAN
306 unsigned int ver:8, ways:4, sets:4, osm:1, reserv:3, pg_sz:4,
307 u_itlb:4, u_dtlb:4;
308#else
309 unsigned int u_dtlb:4, u_itlb:4, pg_sz:4, reserv:3, osm:1, sets:4,
310 ways:4, ver:8;
311#endif
312};
313
314#define EXTN_SWAP_VALID 0x1 206#define EXTN_SWAP_VALID 0x1
315#define EXTN_NORM_VALID 0x2 207#define EXTN_NORM_VALID 0x2
316#define EXTN_MINMAX_VALID 0x2 208#define EXTN_MINMAX_VALID 0x2
@@ -343,14 +235,6 @@ struct bcr_extn_xymem {
343#endif 235#endif
344}; 236};
345 237
346struct bcr_cache {
347#ifdef CONFIG_CPU_BIG_ENDIAN
348 unsigned int pad:12, line_len:4, sz:4, config:4, ver:8;
349#else
350 unsigned int ver:8, config:4, sz:4, line_len:4, pad:12;
351#endif
352};
353
354struct bcr_perip { 238struct bcr_perip {
355#ifdef CONFIG_CPU_BIG_ENDIAN 239#ifdef CONFIG_CPU_BIG_ENDIAN
356 unsigned int start:8, pad2:8, sz:8, pad:8; 240 unsigned int start:8, pad2:8, sz:8, pad:8;
diff --git a/arch/arc/include/asm/cache.h b/arch/arc/include/asm/cache.h
index 2fe8e41a551c..44eb07eb92e5 100644
--- a/arch/arc/include/asm/cache.h
+++ b/arch/arc/include/asm/cache.h
@@ -9,8 +9,6 @@
9#ifndef __ARC_ASM_CACHE_H 9#ifndef __ARC_ASM_CACHE_H
10#define __ARC_ASM_CACHE_H 10#define __ARC_ASM_CACHE_H
11 11
12#include <asm/mmu.h> /* some of cache registers depend on MMU ver */
13
14/* In case $$ not config, setup a dummy number for rest of kernel */ 12/* In case $$ not config, setup a dummy number for rest of kernel */
15#ifndef CONFIG_ARC_CACHE_LINE_SHIFT 13#ifndef CONFIG_ARC_CACHE_LINE_SHIFT
16#define L1_CACHE_SHIFT 6 14#define L1_CACHE_SHIFT 6
@@ -36,6 +34,13 @@
36#define is_not_cache_aligned(p) ((unsigned long)p & (~DCACHE_LINE_MASK)) 34#define is_not_cache_aligned(p) ((unsigned long)p & (~DCACHE_LINE_MASK))
37#endif 35#endif
38 36
37/*
38 * ARC700 doesn't cache any access in top 256M.
39 * Ideal for wiring memory mapped peripherals as we don't need to do
40 * explicit uncached accesses (LD.di/ST.di) hence more portable drivers
41 */
42#define ARC_UNCACHED_ADDR_SPACE 0xc0000000
43
39#ifndef __ASSEMBLY__ 44#ifndef __ASSEMBLY__
40 45
41/* Uncached access macros */ 46/* Uncached access macros */
@@ -59,16 +64,10 @@
59 64
60#define ARCH_DMA_MINALIGN L1_CACHE_BYTES 65#define ARCH_DMA_MINALIGN L1_CACHE_BYTES
61 66
62/*
63 * ARC700 doesn't cache any access in top 256M.
64 * Ideal for wiring memory mapped peripherals as we don't need to do
65 * explicit uncached accesses (LD.di/ST.di) hence more portable drivers
66 */
67#define ARC_UNCACHED_ADDR_SPACE 0xc0000000
68
69extern void arc_cache_init(void); 67extern void arc_cache_init(void);
70extern char *arc_cache_mumbojumbo(int cpu_id, char *buf, int len); 68extern char *arc_cache_mumbojumbo(int cpu_id, char *buf, int len);
71extern void __init read_decode_cache_bcr(void); 69extern void __init read_decode_cache_bcr(void);
72#endif 70
71#endif /* !__ASSEMBLY__ */
73 72
74#endif /* _ASM_CACHE_H */ 73#endif /* _ASM_CACHE_H */
diff --git a/arch/arc/include/asm/irqflags.h b/arch/arc/include/asm/irqflags.h
index eac071668201..d99f79bcf865 100644
--- a/arch/arc/include/asm/irqflags.h
+++ b/arch/arc/include/asm/irqflags.h
@@ -19,6 +19,26 @@
19 19
20#include <asm/arcregs.h> 20#include <asm/arcregs.h>
21 21
22/* status32 Reg bits related to Interrupt Handling */
23#define STATUS_E1_BIT 1 /* Int 1 enable */
24#define STATUS_E2_BIT 2 /* Int 2 enable */
25#define STATUS_A1_BIT 3 /* Int 1 active */
26#define STATUS_A2_BIT 4 /* Int 2 active */
27
28#define STATUS_E1_MASK (1<<STATUS_E1_BIT)
29#define STATUS_E2_MASK (1<<STATUS_E2_BIT)
30#define STATUS_A1_MASK (1<<STATUS_A1_BIT)
31#define STATUS_A2_MASK (1<<STATUS_A2_BIT)
32
33/* Other Interrupt Handling related Aux regs */
34#define AUX_IRQ_LEV 0x200 /* IRQ Priority: L1 or L2 */
35#define AUX_IRQ_HINT 0x201 /* For generating Soft Interrupts */
36#define AUX_IRQ_LV12 0x43 /* interrupt level register */
37
38#define AUX_IENABLE 0x40c
39#define AUX_ITRIGGER 0x40d
40#define AUX_IPULSE 0x415
41
22#ifndef __ASSEMBLY__ 42#ifndef __ASSEMBLY__
23 43
24/****************************************************************** 44/******************************************************************
diff --git a/arch/arc/include/asm/mmu.h b/arch/arc/include/asm/mmu.h
index 33548f975cd2..7c03fe61759c 100644
--- a/arch/arc/include/asm/mmu.h
+++ b/arch/arc/include/asm/mmu.h
@@ -17,6 +17,32 @@
17#define CONFIG_ARC_MMU_VER 3 17#define CONFIG_ARC_MMU_VER 3
18#endif 18#endif
19 19
20/* MMU Management regs */
21#define ARC_REG_MMU_BCR 0x06f
22#define ARC_REG_TLBPD0 0x405
23#define ARC_REG_TLBPD1 0x406
24#define ARC_REG_TLBINDEX 0x407
25#define ARC_REG_TLBCOMMAND 0x408
26#define ARC_REG_PID 0x409
27#define ARC_REG_SCRATCH_DATA0 0x418
28
29/* Bits in MMU PID register */
30#define MMU_ENABLE (1 << 31) /* Enable MMU for process */
31
32/* Error code if probe fails */
33#define TLB_LKUP_ERR 0x80000000
34
35/* TLB Commands */
36#define TLBWrite 0x1
37#define TLBRead 0x2
38#define TLBGetIndex 0x3
39#define TLBProbe 0x4
40
41#if (CONFIG_ARC_MMU_VER >= 2)
42#define TLBWriteNI 0x5 /* write JTLB without inv uTLBs */
43#define TLBIVUTLB 0x6 /* explicitly inv uTLBs */
44#endif
45
20#ifndef __ASSEMBLY__ 46#ifndef __ASSEMBLY__
21 47
22typedef struct { 48typedef struct {
@@ -26,6 +52,16 @@ typedef struct {
26#endif 52#endif
27} mm_context_t; 53} mm_context_t;
28 54
55#ifdef CONFIG_ARC_DBG_TLB_PARANOIA
56void tlb_paranoid_check(unsigned int pid_sw, unsigned long address);
57#else
58#define tlb_paranoid_check(a, b)
29#endif 59#endif
30 60
61void arc_mmu_init(void);
62extern char *arc_mmu_mumbojumbo(int cpu_id, char *buf, int len);
63void __init read_decode_mmu_bcr(void);
64
65#endif /* !__ASSEMBLY__ */
66
31#endif 67#endif
diff --git a/arch/arc/include/asm/pgtable.h b/arch/arc/include/asm/pgtable.h
index 95b1522212a7..f31dc817fe12 100644
--- a/arch/arc/include/asm/pgtable.h
+++ b/arch/arc/include/asm/pgtable.h
@@ -135,6 +135,12 @@
135/* ioremap */ 135/* ioremap */
136#define PAGE_KERNEL_NO_CACHE __pgprot(_K_PAGE_PERMS) 136#define PAGE_KERNEL_NO_CACHE __pgprot(_K_PAGE_PERMS)
137 137
138/* Masks for actual TLB "PD"s */
139#define PTE_BITS_IN_PD0 (_PAGE_GLOBAL | _PAGE_PRESENT)
140#define PTE_BITS_IN_PD1 (PAGE_MASK | _PAGE_CACHEABLE | \
141 _PAGE_U_EXECUTE | _PAGE_U_WRITE | _PAGE_U_READ | \
142 _PAGE_K_EXECUTE | _PAGE_K_WRITE | _PAGE_K_READ)
143
138/************************************************************************** 144/**************************************************************************
139 * Mapping of vm_flags (Generic VM) to PTE flags (arch specific) 145 * Mapping of vm_flags (Generic VM) to PTE flags (arch specific)
140 * 146 *
diff --git a/arch/arc/include/asm/tlb-mmu1.h b/arch/arc/include/asm/tlb-mmu1.h
index 351ae6568d0a..8a1ec96012ae 100644
--- a/arch/arc/include/asm/tlb-mmu1.h
+++ b/arch/arc/include/asm/tlb-mmu1.h
@@ -10,7 +10,6 @@
10#define __ASM_TLB_MMU_V1_H__ 10#define __ASM_TLB_MMU_V1_H__
11 11
12#include <asm/mmu.h> 12#include <asm/mmu.h>
13#include <asm/tlb.h>
14 13
15#if defined(__ASSEMBLY__) && (CONFIG_ARC_MMU_VER == 1) 14#if defined(__ASSEMBLY__) && (CONFIG_ARC_MMU_VER == 1)
16 15
diff --git a/arch/arc/include/asm/tlb.h b/arch/arc/include/asm/tlb.h
index cb0c708ca665..a9db5f62aaf3 100644
--- a/arch/arc/include/asm/tlb.h
+++ b/arch/arc/include/asm/tlb.h
@@ -9,18 +9,6 @@
9#ifndef _ASM_ARC_TLB_H 9#ifndef _ASM_ARC_TLB_H
10#define _ASM_ARC_TLB_H 10#define _ASM_ARC_TLB_H
11 11
12#ifdef __KERNEL__
13
14#include <asm/pgtable.h>
15
16/* Masks for actual TLB "PD"s */
17#define PTE_BITS_IN_PD0 (_PAGE_GLOBAL | _PAGE_PRESENT)
18#define PTE_BITS_IN_PD1 (PAGE_MASK | _PAGE_CACHEABLE | \
19 _PAGE_U_EXECUTE | _PAGE_U_WRITE | _PAGE_U_READ | \
20 _PAGE_K_EXECUTE | _PAGE_K_WRITE | _PAGE_K_READ)
21
22#ifndef __ASSEMBLY__
23
24#define tlb_flush(tlb) \ 12#define tlb_flush(tlb) \
25do { \ 13do { \
26 if (tlb->fullmm) \ 14 if (tlb->fullmm) \
@@ -56,18 +44,4 @@ do { \
56#include <linux/pagemap.h> 44#include <linux/pagemap.h>
57#include <asm-generic/tlb.h> 45#include <asm-generic/tlb.h>
58 46
59#ifdef CONFIG_ARC_DBG_TLB_PARANOIA
60void tlb_paranoid_check(unsigned int pid_sw, unsigned long address);
61#else
62#define tlb_paranoid_check(a, b)
63#endif
64
65void arc_mmu_init(void);
66extern char *arc_mmu_mumbojumbo(int cpu_id, char *buf, int len);
67void __init read_decode_mmu_bcr(void);
68
69#endif /* __ASSEMBLY__ */
70
71#endif /* __KERNEL__ */
72
73#endif /* _ASM_ARC_TLB_H */ 47#endif /* _ASM_ARC_TLB_H */
diff --git a/arch/arc/kernel/time.c b/arch/arc/kernel/time.c
index 09f4309aa2c0..32afa54a585d 100644
--- a/arch/arc/kernel/time.c
+++ b/arch/arc/kernel/time.c
@@ -44,6 +44,17 @@
44#include <asm/clk.h> 44#include <asm/clk.h>
45#include <asm/mach_desc.h> 45#include <asm/mach_desc.h>
46 46
47/* Timer related Aux registers */
48#define ARC_REG_TIMER0_LIMIT 0x23 /* timer 0 limit */
49#define ARC_REG_TIMER0_CTRL 0x22 /* timer 0 control */
50#define ARC_REG_TIMER0_CNT 0x21 /* timer 0 count */
51#define ARC_REG_TIMER1_LIMIT 0x102 /* timer 1 limit */
52#define ARC_REG_TIMER1_CTRL 0x101 /* timer 1 control */
53#define ARC_REG_TIMER1_CNT 0x100 /* timer 1 count */
54
55#define TIMER_CTRL_IE (1 << 0) /* Interupt when Count reachs limit */
56#define TIMER_CTRL_NH (1 << 1) /* Count only when CPU NOT halted */
57
47#define ARC_TIMER_MAX 0xFFFFFFFF 58#define ARC_TIMER_MAX 0xFFFFFFFF
48 59
49/********** Clock Source Device *********/ 60/********** Clock Source Device *********/
diff --git a/arch/arc/mm/cache_arc700.c b/arch/arc/mm/cache_arc700.c
index 28007d25066e..e9c7a66817ca 100644
--- a/arch/arc/mm/cache_arc700.c
+++ b/arch/arc/mm/cache_arc700.c
@@ -73,6 +73,33 @@
73#include <asm/cachectl.h> 73#include <asm/cachectl.h>
74#include <asm/setup.h> 74#include <asm/setup.h>
75 75
76/* Instruction cache related Auxiliary registers */
77#define ARC_REG_IC_BCR 0x77 /* Build Config reg */
78#define ARC_REG_IC_IVIC 0x10
79#define ARC_REG_IC_CTRL 0x11
80#define ARC_REG_IC_IVIL 0x19
81#if (CONFIG_ARC_MMU_VER > 2)
82#define ARC_REG_IC_PTAG 0x1E
83#endif
84
85/* Bit val in IC_CTRL */
86#define IC_CTRL_CACHE_DISABLE 0x1
87
88/* Data cache related Auxiliary registers */
89#define ARC_REG_DC_BCR 0x72 /* Build Config reg */
90#define ARC_REG_DC_IVDC 0x47
91#define ARC_REG_DC_CTRL 0x48
92#define ARC_REG_DC_IVDL 0x4A
93#define ARC_REG_DC_FLSH 0x4B
94#define ARC_REG_DC_FLDL 0x4C
95#if (CONFIG_ARC_MMU_VER > 2)
96#define ARC_REG_DC_PTAG 0x5C
97#endif
98
99/* Bit val in DC_CTRL */
100#define DC_CTRL_INV_MODE_FLUSH 0x40
101#define DC_CTRL_FLUSH_STATUS 0x100
102
76char *arc_cache_mumbojumbo(int cpu_id, char *buf, int len) 103char *arc_cache_mumbojumbo(int cpu_id, char *buf, int len)
77{ 104{
78 int n = 0; 105 int n = 0;
@@ -104,9 +131,15 @@ char *arc_cache_mumbojumbo(int cpu_id, char *buf, int len)
104 */ 131 */
105void __cpuinit read_decode_cache_bcr(void) 132void __cpuinit read_decode_cache_bcr(void)
106{ 133{
107 struct bcr_cache ibcr, dbcr;
108 struct cpuinfo_arc_cache *p_ic, *p_dc; 134 struct cpuinfo_arc_cache *p_ic, *p_dc;
109 unsigned int cpu = smp_processor_id(); 135 unsigned int cpu = smp_processor_id();
136 struct bcr_cache {
137#ifdef CONFIG_CPU_BIG_ENDIAN
138 unsigned int pad:12, line_len:4, sz:4, config:4, ver:8;
139#else
140 unsigned int ver:8, config:4, sz:4, line_len:4, pad:12;
141#endif
142 } ibcr, dbcr;
110 143
111 p_ic = &cpuinfo_arc700[cpu].icache; 144 p_ic = &cpuinfo_arc700[cpu].icache;
112 READ_BCR(ARC_REG_IC_BCR, ibcr); 145 READ_BCR(ARC_REG_IC_BCR, ibcr);
@@ -136,12 +169,10 @@ void __cpuinit read_decode_cache_bcr(void)
136 */ 169 */
137void __cpuinit arc_cache_init(void) 170void __cpuinit arc_cache_init(void)
138{ 171{
139 unsigned int temp;
140 unsigned int cpu = smp_processor_id(); 172 unsigned int cpu = smp_processor_id();
141 struct cpuinfo_arc_cache *ic = &cpuinfo_arc700[cpu].icache; 173 struct cpuinfo_arc_cache *ic = &cpuinfo_arc700[cpu].icache;
142 struct cpuinfo_arc_cache *dc = &cpuinfo_arc700[cpu].dcache; 174 struct cpuinfo_arc_cache *dc = &cpuinfo_arc700[cpu].dcache;
143 int way_pg_ratio = way_pg_ratio; 175 unsigned int dcache_does_alias, temp;
144 int dcache_does_alias;
145 char str[256]; 176 char str[256];
146 177
147 printk(arc_cache_mumbojumbo(0, str, sizeof(str))); 178 printk(arc_cache_mumbojumbo(0, str, sizeof(str)));
diff --git a/arch/arc/mm/fault.c b/arch/arc/mm/fault.c
index 689ffd86d5e9..c0decc1f8d22 100644
--- a/arch/arc/mm/fault.c
+++ b/arch/arc/mm/fault.c
@@ -15,6 +15,7 @@
15#include <linux/uaccess.h> 15#include <linux/uaccess.h>
16#include <linux/kdebug.h> 16#include <linux/kdebug.h>
17#include <asm/pgalloc.h> 17#include <asm/pgalloc.h>
18#include <asm/mmu.h>
18 19
19static int handle_vmalloc_fault(struct mm_struct *mm, unsigned long address) 20static int handle_vmalloc_fault(struct mm_struct *mm, unsigned long address)
20{ 21{
diff --git a/arch/arc/mm/tlb.c b/arch/arc/mm/tlb.c
index 1ced5f18e6b3..f60807c2683d 100644
--- a/arch/arc/mm/tlb.c
+++ b/arch/arc/mm/tlb.c
@@ -55,7 +55,7 @@
55#include <asm/arcregs.h> 55#include <asm/arcregs.h>
56#include <asm/setup.h> 56#include <asm/setup.h>
57#include <asm/mmu_context.h> 57#include <asm/mmu_context.h>
58#include <asm/tlb.h> 58#include <asm/mmu.h>
59 59
60/* Need for ARC MMU v2 60/* Need for ARC MMU v2
61 * 61 *
@@ -97,6 +97,7 @@
97 * J-TLB entry got evicted/replaced. 97 * J-TLB entry got evicted/replaced.
98 */ 98 */
99 99
100
100/* A copy of the ASID from the PID reg is kept in asid_cache */ 101/* A copy of the ASID from the PID reg is kept in asid_cache */
101int asid_cache = FIRST_ASID; 102int asid_cache = FIRST_ASID;
102 103
@@ -466,10 +467,25 @@ void update_mmu_cache(struct vm_area_struct *vma, unsigned long vaddr_unaligned,
466 */ 467 */
467void __cpuinit read_decode_mmu_bcr(void) 468void __cpuinit read_decode_mmu_bcr(void)
468{ 469{
469 unsigned int tmp;
470 struct bcr_mmu_1_2 *mmu2; /* encoded MMU2 attr */
471 struct bcr_mmu_3 *mmu3; /* encoded MMU3 attr */
472 struct cpuinfo_arc_mmu *mmu = &cpuinfo_arc700[smp_processor_id()].mmu; 470 struct cpuinfo_arc_mmu *mmu = &cpuinfo_arc700[smp_processor_id()].mmu;
471 unsigned int tmp;
472 struct bcr_mmu_1_2 {
473#ifdef CONFIG_CPU_BIG_ENDIAN
474 unsigned int ver:8, ways:4, sets:4, u_itlb:8, u_dtlb:8;
475#else
476 unsigned int u_dtlb:8, u_itlb:8, sets:4, ways:4, ver:8;
477#endif
478 } *mmu2;
479
480 struct bcr_mmu_3 {
481#ifdef CONFIG_CPU_BIG_ENDIAN
482 unsigned int ver:8, ways:4, sets:4, osm:1, reserv:3, pg_sz:4,
483 u_itlb:4, u_dtlb:4;
484#else
485 unsigned int u_dtlb:4, u_itlb:4, pg_sz:4, reserv:3, osm:1, sets:4,
486 ways:4, ver:8;
487#endif
488 } *mmu3;
473 489
474 tmp = read_aux_reg(ARC_REG_MMU_BCR); 490 tmp = read_aux_reg(ARC_REG_MMU_BCR);
475 mmu->ver = (tmp >> 24); 491 mmu->ver = (tmp >> 24);
diff --git a/arch/arc/mm/tlbex.S b/arch/arc/mm/tlbex.S
index 3357d26ffe54..7bf811d51af8 100644
--- a/arch/arc/mm/tlbex.S
+++ b/arch/arc/mm/tlbex.S
@@ -39,7 +39,7 @@
39 39
40#include <linux/linkage.h> 40#include <linux/linkage.h>
41#include <asm/entry.h> 41#include <asm/entry.h>
42#include <asm/tlb.h> 42#include <asm/mmu.h>
43#include <asm/pgtable.h> 43#include <asm/pgtable.h>
44#include <asm/arcregs.h> 44#include <asm/arcregs.h>
45#include <asm/cache.h> 45#include <asm/cache.h>