aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arc/kernel
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2014-06-09 21:05:11 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2014-06-09 21:05:11 -0400
commit9b651cc2277b5e4883012ebab0fea2bcda4cbafa (patch)
treedd6744f80a07f72876e9307d854700019255218e /arch/arc/kernel
parent214b93132023cc9305d5801add812515bea4d7d0 (diff)
parentef680cdc24376f394841a3f19b3a7ef6d57a009d (diff)
Merge tag 'arc-v3.16-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/vgupta/arc
Pull ARC updates from Vineet Gupta: "Nothing too exciting here, just minor fixes/cleanup. Only noteworthy ones are: - Moving cache disabling to early boot - ARC UART enabled only if earlyprintk setup in cmdline" * tag 'arc-v3.16-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/vgupta/arc: ARC: Disable caches in early boot if so configured ARC: [arcfpga] Early ARC UART to be only activated by cmdline ARC: [arcfpga] Get rid of legacy BVCI latency unit support ARC: remove duplicate header exports ARC: arc_local_timer_setup() need not pass own cpu id ARC: Fixed spelling errors within comments ARC: make start_thread() out-of-line ARC: fix mmuv2 warning ARC: [SMP] ISS SMP extension bitrot
Diffstat (limited to 'arch/arc/kernel')
-rw-r--r--arch/arc/kernel/entry.S12
-rw-r--r--arch/arc/kernel/head.S38
-rw-r--r--arch/arc/kernel/irq.c18
-rw-r--r--arch/arc/kernel/process.c23
-rw-r--r--arch/arc/kernel/smp.c2
-rw-r--r--arch/arc/kernel/time.c11
6 files changed, 71 insertions, 33 deletions
diff --git a/arch/arc/kernel/entry.S b/arch/arc/kernel/entry.S
index 29b82adbf0b4..83a046a7cd06 100644
--- a/arch/arc/kernel/entry.S
+++ b/arch/arc/kernel/entry.S
@@ -156,7 +156,7 @@ ARCFP_DATA int1_saved_reg
156int1_saved_reg: 156int1_saved_reg:
157 .zero 4 157 .zero 4
158 158
159/* Each Interrupt level needs it's own scratch */ 159/* Each Interrupt level needs its own scratch */
160#ifdef CONFIG_ARC_COMPACT_IRQ_LEVELS 160#ifdef CONFIG_ARC_COMPACT_IRQ_LEVELS
161 161
162ARCFP_DATA int2_saved_reg 162ARCFP_DATA int2_saved_reg
@@ -473,7 +473,7 @@ trap_with_param:
473 lr r0, [efa] 473 lr r0, [efa]
474 mov r1, sp 474 mov r1, sp
475 475
476 ; Now that we have read EFA, its safe to do "fake" rtie 476 ; Now that we have read EFA, it is safe to do "fake" rtie
477 ; and get out of CPU exception mode 477 ; and get out of CPU exception mode
478 FAKE_RET_FROM_EXCPN r11 478 FAKE_RET_FROM_EXCPN r11
479 479
@@ -678,9 +678,9 @@ not_exception:
678 brne r9, event_IRQ2, 149f 678 brne r9, event_IRQ2, 149f
679 679
680 ;------------------------------------------------------------------ 680 ;------------------------------------------------------------------
681 ; if L2 IRQ interrupted a L1 ISR, we'd disbaled preemption earlier 681 ; if L2 IRQ interrupted an L1 ISR, we'd disabled preemption earlier
682 ; so that sched doesnt move to new task, causing L1 to be delayed 682 ; so that sched doesn't move to new task, causing L1 to be delayed
683 ; undeterministically. Now that we've achieved that, lets reset 683 ; undeterministically. Now that we've achieved that, let's reset
684 ; things to what they were, before returning from L2 context 684 ; things to what they were, before returning from L2 context
685 ;---------------------------------------------------------------- 685 ;----------------------------------------------------------------
686 686
@@ -736,7 +736,7 @@ ENTRY(ret_from_fork)
736 ; put last task in scheduler queue 736 ; put last task in scheduler queue
737 bl @schedule_tail 737 bl @schedule_tail
738 738
739 ; If kernel thread, jump to it's entry-point 739 ; If kernel thread, jump to its entry-point
740 ld r9, [sp, PT_status32] 740 ld r9, [sp, PT_status32]
741 brne r9, 0, 1f 741 brne r9, 0, 1f
742 742
diff --git a/arch/arc/kernel/head.S b/arch/arc/kernel/head.S
index 4ad04915dc6b..07a58f2d3077 100644
--- a/arch/arc/kernel/head.S
+++ b/arch/arc/kernel/head.S
@@ -12,10 +12,42 @@
12 * to skip certain things during boot on simulator 12 * to skip certain things during boot on simulator
13 */ 13 */
14 14
15#include <linux/linkage.h>
15#include <asm/asm-offsets.h> 16#include <asm/asm-offsets.h>
16#include <asm/entry.h> 17#include <asm/entry.h>
17#include <linux/linkage.h>
18#include <asm/arcregs.h> 18#include <asm/arcregs.h>
19#include <asm/cache.h>
20
21.macro CPU_EARLY_SETUP
22
23 ; Setting up Vectror Table (in case exception happens in early boot
24 sr @_int_vec_base_lds, [AUX_INTR_VEC_BASE]
25
26 ; Disable I-cache/D-cache if kernel so configured
27 lr r5, [ARC_REG_IC_BCR]
28 breq r5, 0, 1f ; I$ doesn't exist
29 lr r5, [ARC_REG_IC_CTRL]
30#ifdef CONFIG_ARC_HAS_ICACHE
31 bclr r5, r5, 0 ; 0 - Enable, 1 is Disable
32#else
33 bset r5, r5, 0 ; I$ exists, but is not used
34#endif
35 sr r5, [ARC_REG_IC_CTRL]
36
371:
38 lr r5, [ARC_REG_DC_BCR]
39 breq r5, 0, 1f ; D$ doesn't exist
40 lr r5, [ARC_REG_DC_CTRL]
41 bclr r5, r5, 6 ; Invalidate (discard w/o wback)
42#ifdef CONFIG_ARC_HAS_DCACHE
43 bclr r5, r5, 0 ; Enable (+Inv)
44#else
45 bset r5, r5, 0 ; Disable (+Inv)
46#endif
47 sr r5, [ARC_REG_DC_CTRL]
48
491:
50.endm
19 51
20 .cpu A7 52 .cpu A7
21 53
@@ -27,7 +59,7 @@ stext:
27 ; Don't clobber r0-r2 yet. It might have bootloader provided info 59 ; Don't clobber r0-r2 yet. It might have bootloader provided info
28 ;------------------------------------------------------------------- 60 ;-------------------------------------------------------------------
29 61
30 sr @_int_vec_base_lds, [AUX_INTR_VEC_BASE] 62 CPU_EARLY_SETUP
31 63
32#ifdef CONFIG_SMP 64#ifdef CONFIG_SMP
33 ; Ensure Boot (Master) proceeds. Others wait in platform dependent way 65 ; Ensure Boot (Master) proceeds. Others wait in platform dependent way
@@ -90,7 +122,7 @@ stext:
90 122
91first_lines_of_secondary: 123first_lines_of_secondary:
92 124
93 sr @_int_vec_base_lds, [AUX_INTR_VEC_BASE] 125 CPU_EARLY_SETUP
94 126
95 ; setup per-cpu idle task as "current" on this CPU 127 ; setup per-cpu idle task as "current" on this CPU
96 ld r0, [@secondary_idle_tsk] 128 ld r0, [@secondary_idle_tsk]
diff --git a/arch/arc/kernel/irq.c b/arch/arc/kernel/irq.c
index a4b141ee9a6a..7d653c0d0773 100644
--- a/arch/arc/kernel/irq.c
+++ b/arch/arc/kernel/irq.c
@@ -150,24 +150,6 @@ void arch_do_IRQ(unsigned int irq, struct pt_regs *regs)
150 set_irq_regs(old_regs); 150 set_irq_regs(old_regs);
151} 151}
152 152
153int get_hw_config_num_irq(void)
154{
155 uint32_t val = read_aux_reg(ARC_REG_VECBASE_BCR);
156
157 switch (val & 0x03) {
158 case 0:
159 return 16;
160 case 1:
161 return 32;
162 case 2:
163 return 8;
164 default:
165 return 0;
166 }
167
168 return 0;
169}
170
171/* 153/*
172 * arch_local_irq_enable - Enable interrupts. 154 * arch_local_irq_enable - Enable interrupts.
173 * 155 *
diff --git a/arch/arc/kernel/process.c b/arch/arc/kernel/process.c
index 07a3a968fe49..fdd89715d2d3 100644
--- a/arch/arc/kernel/process.c
+++ b/arch/arc/kernel/process.c
@@ -151,6 +151,29 @@ int copy_thread(unsigned long clone_flags,
151} 151}
152 152
153/* 153/*
154 * Do necessary setup to start up a new user task
155 */
156void start_thread(struct pt_regs * regs, unsigned long pc, unsigned long usp)
157{
158 set_fs(USER_DS); /* user space */
159
160 regs->sp = usp;
161 regs->ret = pc;
162
163 /*
164 * [U]ser Mode bit set
165 * [L] ZOL loop inhibited to begin with - cleared by a LP insn
166 * Interrupts enabled
167 */
168 regs->status32 = STATUS_U_MASK | STATUS_L_MASK |
169 STATUS_E1_MASK | STATUS_E2_MASK;
170
171 /* bogus seed values for debugging */
172 regs->lp_start = 0x10;
173 regs->lp_end = 0x80;
174}
175
176/*
154 * Some archs flush debug and FPU info here 177 * Some archs flush debug and FPU info here
155 */ 178 */
156void flush_thread(void) 179void flush_thread(void)
diff --git a/arch/arc/kernel/smp.c b/arch/arc/kernel/smp.c
index 40859e5619f9..cf90b6f4d3e0 100644
--- a/arch/arc/kernel/smp.c
+++ b/arch/arc/kernel/smp.c
@@ -138,7 +138,7 @@ void start_kernel_secondary(void)
138 if (machine_desc->init_smp) 138 if (machine_desc->init_smp)
139 machine_desc->init_smp(smp_processor_id()); 139 machine_desc->init_smp(smp_processor_id());
140 140
141 arc_local_timer_setup(cpu); 141 arc_local_timer_setup();
142 142
143 local_irq_enable(); 143 local_irq_enable();
144 preempt_disable(); 144 preempt_disable();
diff --git a/arch/arc/kernel/time.c b/arch/arc/kernel/time.c
index 71c42521c77f..36c2aa99436f 100644
--- a/arch/arc/kernel/time.c
+++ b/arch/arc/kernel/time.c
@@ -219,12 +219,13 @@ static struct irqaction arc_timer_irq = {
219/* 219/*
220 * Setup the local event timer for @cpu 220 * Setup the local event timer for @cpu
221 */ 221 */
222void arc_local_timer_setup(unsigned int cpu) 222void arc_local_timer_setup()
223{ 223{
224 struct clock_event_device *clk = &per_cpu(arc_clockevent_device, cpu); 224 struct clock_event_device *evt = this_cpu_ptr(&arc_clockevent_device);
225 int cpu = smp_processor_id();
225 226
226 clk->cpumask = cpumask_of(cpu); 227 evt->cpumask = cpumask_of(cpu);
227 clockevents_config_and_register(clk, arc_get_core_freq(), 228 clockevents_config_and_register(evt, arc_get_core_freq(),
228 0, ARC_TIMER_MAX); 229 0, ARC_TIMER_MAX);
229 230
230 /* 231 /*
@@ -261,7 +262,7 @@ void __init time_init(void)
261 clocksource_register_hz(&arc_counter, arc_get_core_freq()); 262 clocksource_register_hz(&arc_counter, arc_get_core_freq());
262 263
263 /* sets up the periodic event timer */ 264 /* sets up the periodic event timer */
264 arc_local_timer_setup(smp_processor_id()); 265 arc_local_timer_setup();
265 266
266 if (machine_desc->init_time) 267 if (machine_desc->init_time)
267 machine_desc->init_time(); 268 machine_desc->init_time();