diff options
author | Sam Ravnborg <sam@ravnborg.org> | 2012-05-25 17:20:12 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-05-28 02:52:45 -0400 |
commit | 93bb32f632c90be00d9e5d69091ada201f619c18 (patch) | |
tree | d07b58d35aef8fdd3ae3cb3d60441bcfc965d71c /arch/sparc | |
parent | d87d8c11f347e743f0223d16c8ec57ef7e0274b2 (diff) |
sparc32,leon: clean up leon.h
- Drop unused stuff accumulated over time
- Drop non-leon stuff
- Include almost all of the header unconditionally
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Cc: Daniel Hellstrom <daniel@gaisler.com>
Cc: Konrad Eisele <konrad@gaisler.com>
Diffstat (limited to 'arch/sparc')
-rw-r--r-- | arch/sparc/include/asm/leon.h | 67 | ||||
-rw-r--r-- | arch/sparc/include/asm/pgtsrmmu.h | 1 | ||||
-rw-r--r-- | arch/sparc/kernel/leon_kernel.c | 1 |
3 files changed, 4 insertions, 65 deletions
diff --git a/arch/sparc/include/asm/leon.h b/arch/sparc/include/asm/leon.h index 07659124c14..00530a599c1 100644 --- a/arch/sparc/include/asm/leon.h +++ b/arch/sparc/include/asm/leon.h | |||
@@ -8,8 +8,6 @@ | |||
8 | #ifndef LEON_H_INCLUDE | 8 | #ifndef LEON_H_INCLUDE |
9 | #define LEON_H_INCLUDE | 9 | #define LEON_H_INCLUDE |
10 | 10 | ||
11 | #ifdef CONFIG_SPARC_LEON | ||
12 | |||
13 | /* mmu register access, ASI_LEON_MMUREGS */ | 11 | /* mmu register access, ASI_LEON_MMUREGS */ |
14 | #define LEON_CNR_CTRL 0x000 | 12 | #define LEON_CNR_CTRL 0x000 |
15 | #define LEON_CNR_CTXP 0x100 | 13 | #define LEON_CNR_CTXP 0x100 |
@@ -62,15 +60,6 @@ | |||
62 | 60 | ||
63 | #ifndef __ASSEMBLY__ | 61 | #ifndef __ASSEMBLY__ |
64 | 62 | ||
65 | /* do a virtual address read without cache */ | ||
66 | static inline unsigned long leon_readnobuffer_reg(unsigned long paddr) | ||
67 | { | ||
68 | unsigned long retval; | ||
69 | __asm__ __volatile__("lda [%1] %2, %0\n\t" : | ||
70 | "=r"(retval) : "r"(paddr), "i"(ASI_LEON_NOCACHE)); | ||
71 | return retval; | ||
72 | } | ||
73 | |||
74 | /* do a physical address bypass write, i.e. for 0x80000000 */ | 63 | /* do a physical address bypass write, i.e. for 0x80000000 */ |
75 | static inline void leon_store_reg(unsigned long paddr, unsigned long value) | 64 | static inline void leon_store_reg(unsigned long paddr, unsigned long value) |
76 | { | 65 | { |
@@ -87,47 +76,16 @@ static inline unsigned long leon_load_reg(unsigned long paddr) | |||
87 | return retval; | 76 | return retval; |
88 | } | 77 | } |
89 | 78 | ||
90 | static inline void leon_srmmu_disabletlb(void) | ||
91 | { | ||
92 | unsigned int retval; | ||
93 | __asm__ __volatile__("lda [%%g0] %2, %0\n\t" : "=r"(retval) : "r"(0), | ||
94 | "i"(ASI_LEON_MMUREGS)); | ||
95 | retval |= LEON_CNR_CTRL_TLBDIS; | ||
96 | __asm__ __volatile__("sta %0, [%%g0] %2\n\t" : : "r"(retval), "r"(0), | ||
97 | "i"(ASI_LEON_MMUREGS) : "memory"); | ||
98 | } | ||
99 | |||
100 | static inline void leon_srmmu_enabletlb(void) | ||
101 | { | ||
102 | unsigned int retval; | ||
103 | __asm__ __volatile__("lda [%%g0] %2, %0\n\t" : "=r"(retval) : "r"(0), | ||
104 | "i"(ASI_LEON_MMUREGS)); | ||
105 | retval = retval & ~LEON_CNR_CTRL_TLBDIS; | ||
106 | __asm__ __volatile__("sta %0, [%%g0] %2\n\t" : : "r"(retval), "r"(0), | ||
107 | "i"(ASI_LEON_MMUREGS) : "memory"); | ||
108 | } | ||
109 | |||
110 | /* macro access for leon_load_reg() and leon_store_reg() */ | 79 | /* macro access for leon_load_reg() and leon_store_reg() */ |
111 | #define LEON3_BYPASS_LOAD_PA(x) (leon_load_reg((unsigned long)(x))) | 80 | #define LEON3_BYPASS_LOAD_PA(x) (leon_load_reg((unsigned long)(x))) |
112 | #define LEON3_BYPASS_STORE_PA(x, v) (leon_store_reg((unsigned long)(x), (unsigned long)(v))) | 81 | #define LEON3_BYPASS_STORE_PA(x, v) (leon_store_reg((unsigned long)(x), (unsigned long)(v))) |
113 | #define LEON3_BYPASS_ANDIN_PA(x, v) LEON3_BYPASS_STORE_PA(x, LEON3_BYPASS_LOAD_PA(x) & v) | ||
114 | #define LEON3_BYPASS_ORIN_PA(x, v) LEON3_BYPASS_STORE_PA(x, LEON3_BYPASS_LOAD_PA(x) | v) | ||
115 | #define LEON_BYPASS_LOAD_PA(x) leon_load_reg((unsigned long)(x)) | 82 | #define LEON_BYPASS_LOAD_PA(x) leon_load_reg((unsigned long)(x)) |
116 | #define LEON_BYPASS_STORE_PA(x, v) leon_store_reg((unsigned long)(x), (unsigned long)(v)) | 83 | #define LEON_BYPASS_STORE_PA(x, v) leon_store_reg((unsigned long)(x), (unsigned long)(v)) |
117 | #define LEON_REGLOAD_PA(x) leon_load_reg((unsigned long)(x)+LEON_PREGS) | ||
118 | #define LEON_REGSTORE_PA(x, v) leon_store_reg((unsigned long)(x)+LEON_PREGS, (unsigned long)(v)) | ||
119 | #define LEON_REGSTORE_OR_PA(x, v) LEON_REGSTORE_PA(x, LEON_REGLOAD_PA(x) | (unsigned long)(v)) | ||
120 | #define LEON_REGSTORE_AND_PA(x, v) LEON_REGSTORE_PA(x, LEON_REGLOAD_PA(x) & (unsigned long)(v)) | ||
121 | |||
122 | /* macro access for leon_readnobuffer_reg() */ | ||
123 | #define LEON_BYPASSCACHE_LOAD_VA(x) leon_readnobuffer_reg((unsigned long)(x)) | ||
124 | 84 | ||
125 | extern void leon_init(void); | 85 | extern void leon_init(void); |
126 | extern void leon_switch_mm(void); | 86 | extern void leon_switch_mm(void); |
127 | extern void leon_init_IRQ(void); | 87 | extern void leon_init_IRQ(void); |
128 | 88 | ||
129 | extern unsigned long last_valid_pfn; | ||
130 | |||
131 | static inline unsigned long sparc_leon3_get_dcachecfg(void) | 89 | static inline unsigned long sparc_leon3_get_dcachecfg(void) |
132 | { | 90 | { |
133 | unsigned int retval; | 91 | unsigned int retval; |
@@ -230,9 +188,6 @@ static inline int sparc_leon3_cpuid(void) | |||
230 | #error cannot determine LEON_PAGE_SIZE_LEON | 188 | #error cannot determine LEON_PAGE_SIZE_LEON |
231 | #endif | 189 | #endif |
232 | 190 | ||
233 | #define PAGE_MIN_SHIFT (12) | ||
234 | #define PAGE_MIN_SIZE (1UL << PAGE_MIN_SHIFT) | ||
235 | |||
236 | #define LEON3_XCCR_SETS_MASK 0x07000000UL | 191 | #define LEON3_XCCR_SETS_MASK 0x07000000UL |
237 | #define LEON3_XCCR_SSIZE_MASK 0x00f00000UL | 192 | #define LEON3_XCCR_SSIZE_MASK 0x00f00000UL |
238 | 193 | ||
@@ -258,15 +213,6 @@ struct leon3_cacheregs { | |||
258 | unsigned long dccr; /* 0x0c - Data Cache Configuration Register */ | 213 | unsigned long dccr; /* 0x0c - Data Cache Configuration Register */ |
259 | }; | 214 | }; |
260 | 215 | ||
261 | /* struct that hold LEON2 cache configuration register | ||
262 | * & configuration register | ||
263 | */ | ||
264 | struct leon2_cacheregs { | ||
265 | unsigned long ccr, cfg; | ||
266 | }; | ||
267 | |||
268 | #ifdef __KERNEL__ | ||
269 | |||
270 | #include <linux/interrupt.h> | 216 | #include <linux/interrupt.h> |
271 | 217 | ||
272 | struct device_node; | 218 | struct device_node; |
@@ -292,24 +238,15 @@ extern void leon_smp_done(void); | |||
292 | extern void leon_boot_cpus(void); | 238 | extern void leon_boot_cpus(void); |
293 | extern int leon_boot_one_cpu(int i, struct task_struct *); | 239 | extern int leon_boot_one_cpu(int i, struct task_struct *); |
294 | void leon_init_smp(void); | 240 | void leon_init_smp(void); |
295 | extern void cpu_idle(void); | ||
296 | extern void init_IRQ(void); | ||
297 | extern void cpu_panic(void); | ||
298 | extern int __leon_processor_id(void); | ||
299 | void leon_enable_irq_cpu(unsigned int irq_nr, unsigned int cpu); | 241 | void leon_enable_irq_cpu(unsigned int irq_nr, unsigned int cpu); |
300 | extern irqreturn_t leon_percpu_timer_interrupt(int irq, void *unused); | 242 | extern irqreturn_t leon_percpu_timer_interrupt(int irq, void *unused); |
301 | 243 | ||
302 | extern unsigned int real_irq_entry[]; | ||
303 | extern unsigned int smpleon_ipi[]; | 244 | extern unsigned int smpleon_ipi[]; |
304 | extern unsigned int patchme_maybe_smp_msg[]; | 245 | extern unsigned int linux_trap_ipi15_leon[]; |
305 | extern unsigned int t_nmi[], linux_trap_ipi15_leon[]; | ||
306 | extern unsigned int linux_trap_ipi15_sun4m[]; | ||
307 | extern int leon_ipi_irq; | 246 | extern int leon_ipi_irq; |
308 | 247 | ||
309 | #endif /* CONFIG_SMP */ | 248 | #endif /* CONFIG_SMP */ |
310 | 249 | ||
311 | #endif /* __KERNEL__ */ | ||
312 | |||
313 | #endif /* __ASSEMBLY__ */ | 250 | #endif /* __ASSEMBLY__ */ |
314 | 251 | ||
315 | /* macros used in leon_mm.c */ | 252 | /* macros used in leon_mm.c */ |
@@ -317,7 +254,7 @@ extern int leon_ipi_irq; | |||
317 | #define _pfn_valid(pfn) ((pfn < last_valid_pfn) && (pfn >= PFN(phys_base))) | 254 | #define _pfn_valid(pfn) ((pfn < last_valid_pfn) && (pfn >= PFN(phys_base))) |
318 | #define _SRMMU_PTE_PMASK_LEON 0xffffffff | 255 | #define _SRMMU_PTE_PMASK_LEON 0xffffffff |
319 | 256 | ||
320 | #else /* defined(CONFIG_SPARC_LEON) */ | 257 | #ifndef CONFIG_SPARC_LEON |
321 | 258 | ||
322 | /* nop definitions for !LEON case */ | 259 | /* nop definitions for !LEON case */ |
323 | #define leon_init() do {} while (0) | 260 | #define leon_init() do {} while (0) |
diff --git a/arch/sparc/include/asm/pgtsrmmu.h b/arch/sparc/include/asm/pgtsrmmu.h index cb828703a63..394fe25e79d 100644 --- a/arch/sparc/include/asm/pgtsrmmu.h +++ b/arch/sparc/include/asm/pgtsrmmu.h | |||
@@ -139,6 +139,7 @@ | |||
139 | restore %g0, %g0, %g0; | 139 | restore %g0, %g0, %g0; |
140 | 140 | ||
141 | #ifndef __ASSEMBLY__ | 141 | #ifndef __ASSEMBLY__ |
142 | extern unsigned long last_valid_pfn; | ||
142 | 143 | ||
143 | /* This makes sense. Honest it does - Anton */ | 144 | /* This makes sense. Honest it does - Anton */ |
144 | /* XXX Yes but it's ugly as sin. FIXME. -KMW */ | 145 | /* XXX Yes but it's ugly as sin. FIXME. -KMW */ |
diff --git a/arch/sparc/kernel/leon_kernel.c b/arch/sparc/kernel/leon_kernel.c index 77c1b916e4d..e34e2c40c06 100644 --- a/arch/sparc/kernel/leon_kernel.c +++ b/arch/sparc/kernel/leon_kernel.c | |||
@@ -23,6 +23,7 @@ | |||
23 | #include <asm/smp.h> | 23 | #include <asm/smp.h> |
24 | #include <asm/setup.h> | 24 | #include <asm/setup.h> |
25 | 25 | ||
26 | #include "kernel.h" | ||
26 | #include "prom.h" | 27 | #include "prom.h" |
27 | #include "irq.h" | 28 | #include "irq.h" |
28 | 29 | ||