Skip to content

Commit 3573d38

Browse files
committed
Merge tag 'arc-v3.15-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/vgupta/arc
Pull ARC changes from Vineet Gupta: - Support for external initrd from Noam - Fix broken serial console in nsimosci Virtual Platform - Reuse of ENTRY/END assembler macros across hand asm code - Other minor fixes here and there * tag 'arc-v3.15-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/vgupta/arc: ARC: [nsimosci] Unbork console ARC: [nsimosci] Change .dts to use generic 8250 UART ARC: [SMP] General Fixes ARC: Remove unused DT template file ARC: [clockevent] simplify timer ISR ARC: [clockevent] can't be SoC specific ARC: Remove ARC_HAS_COH_RTSC ARC: switch to generic ENTRY/END assembler annotations ARC: support external initrd ARC: add uImage to .gitignore ARC: [arcfpga] Fix __initconst data const-correctness
2 parents c8d9762 + 61fb4bf commit 3573d38

21 files changed

Lines changed: 114 additions & 115 deletions

File tree

‎arch/arc/boot/.gitignore‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
*.dtb*
2+
uImage

‎arch/arc/boot/dts/nsimosci.dts‎

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,16 @@
1111

1212
/ {
1313
compatible = "snps,nsimosci";
14-
clock-frequency = <80000000>; /* 80 MHZ */
14+
clock-frequency = <20000000>; /* 20 MHZ */
1515
#address-cells = <1>;
1616
#size-cells = <1>;
1717
interrupt-parent = <&intc>;
1818

1919
chosen {
20-
bootargs = "console=tty0 consoleblank=0";
20+
/* this is for console on PGU */
21+
/* bootargs = "console=tty0 consoleblank=0"; */
22+
/* this is for console on serial */
23+
bootargs = "earlycon=uart8250,mmio32,0xc0000000,115200n8 console=ttyS0,115200n8 consoleblank=0 debug";
2124
};
2225

2326
aliases {
@@ -44,15 +47,14 @@
4447
};
4548

4649
uart0: serial@c0000000 {
47-
compatible = "snps,dw-apb-uart";
50+
compatible = "ns8250";
4851
reg = <0xc0000000 0x2000>;
4952
interrupts = <11>;
50-
#clock-frequency = <80000000>;
5153
clock-frequency = <3686400>;
5254
baud = <115200>;
5355
reg-shift = <2>;
5456
reg-io-width = <4>;
55-
status = "okay";
57+
no-loopback-test = <1>;
5658
};
5759

5860
pgu0: pgu@c9000000 {

‎arch/arc/boot/dts/skeleton.dts‎

Lines changed: 0 additions & 10 deletions
This file was deleted.

‎arch/arc/configs/nsimosci_defconfig‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ CONFIG_SERIO_ARC_PS2=y
5454
CONFIG_SERIAL_8250=y
5555
CONFIG_SERIAL_8250_CONSOLE=y
5656
CONFIG_SERIAL_8250_DW=y
57+
CONFIG_SERIAL_OF_PLATFORM=y
5758
CONFIG_SERIAL_ARC=y
5859
CONFIG_SERIAL_ARC_CONSOLE=y
5960
# CONFIG_HW_RANDOM is not set

‎arch/arc/include/asm/linkage.h‎

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -13,20 +13,6 @@
1313

1414
#define ASM_NL ` /* use '`' to mark new line in macro */
1515

16-
/* Can't use the ENTRY macro in linux/linkage.h
17-
* gas considers ';' as comment vs. newline
18-
*/
19-
.macro ARC_ENTRY name
20-
.global \name
21-
.align 4
22-
\name:
23-
.endm
24-
25-
.macro ARC_EXIT name
26-
#define ASM_PREV_SYM_ADDR(name) .-##name
27-
.size \ name, ASM_PREV_SYM_ADDR(\name)
28-
.endm
29-
3016
/* annotation for data we want in DCCM - if enabled in .config */
3117
.macro ARCFP_DATA nm
3218
#ifdef CONFIG_ARC_HAS_DCCM

‎arch/arc/kernel/ctx_sw_asm.S‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,4 +62,4 @@ __switch_to:
6262
ld.ab blink, [sp, 4]
6363
j [blink]
6464

65-
ARC_EXIT __switch_to
65+
END(__switch_to)

‎arch/arc/kernel/entry.S‎

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ VECTOR EV_Extension ; 0x130, Extn Intruction Excp (0x26)
141141
VECTOR reserved ; Reserved Exceptions
142142
.endr
143143

144-
#include <linux/linkage.h> /* ARC_{EXTRY,EXIT} */
144+
#include <linux/linkage.h> /* {EXTRY,EXIT} */
145145
#include <asm/entry.h> /* SAVE_ALL_{INT1,INT2,SYS...} */
146146
#include <asm/errno.h>
147147
#include <asm/arcregs.h>
@@ -184,7 +184,7 @@ reserved: ; processor restart
184184
; ---------------------------------------------
185185
; Level 2 ISR: Can interrupt a Level 1 ISR
186186
; ---------------------------------------------
187-
ARC_ENTRY handle_interrupt_level2
187+
ENTRY(handle_interrupt_level2)
188188

189189
; TODO-vineetg for SMP this wont work
190190
; free up r9 as scratchpad
@@ -225,14 +225,14 @@ ARC_ENTRY handle_interrupt_level2
225225

226226
b ret_from_exception
227227

228-
ARC_EXIT handle_interrupt_level2
228+
END(handle_interrupt_level2)
229229

230230
#endif
231231

232232
; ---------------------------------------------
233233
; Level 1 ISR
234234
; ---------------------------------------------
235-
ARC_ENTRY handle_interrupt_level1
235+
ENTRY(handle_interrupt_level1)
236236

237237
/* free up r9 as scratchpad */
238238
#ifdef CONFIG_SMP
@@ -265,15 +265,15 @@ ARC_ENTRY handle_interrupt_level1
265265
sr r8, [AUX_IRQ_LV12] ; clear bit in Sticky Status Reg
266266

267267
b ret_from_exception
268-
ARC_EXIT handle_interrupt_level1
268+
END(handle_interrupt_level1)
269269

270270
;################### Non TLB Exception Handling #############################
271271

272272
; ---------------------------------------------
273273
; Instruction Error Exception Handler
274274
; ---------------------------------------------
275275

276-
ARC_ENTRY instr_service
276+
ENTRY(instr_service)
277277

278278
EXCEPTION_PROLOGUE
279279

@@ -284,13 +284,13 @@ ARC_ENTRY instr_service
284284

285285
bl do_insterror_or_kprobe
286286
b ret_from_exception
287-
ARC_EXIT instr_service
287+
END(instr_service)
288288

289289
; ---------------------------------------------
290290
; Memory Error Exception Handler
291291
; ---------------------------------------------
292292

293-
ARC_ENTRY mem_service
293+
ENTRY(mem_service)
294294

295295
EXCEPTION_PROLOGUE
296296

@@ -301,13 +301,13 @@ ARC_ENTRY mem_service
301301

302302
bl do_memory_error
303303
b ret_from_exception
304-
ARC_EXIT mem_service
304+
END(mem_service)
305305

306306
; ---------------------------------------------
307307
; Machine Check Exception Handler
308308
; ---------------------------------------------
309309

310-
ARC_ENTRY EV_MachineCheck
310+
ENTRY(EV_MachineCheck)
311311

312312
EXCEPTION_PROLOGUE
313313

@@ -331,13 +331,13 @@ ARC_ENTRY EV_MachineCheck
331331

332332
j do_machine_check_fault
333333

334-
ARC_EXIT EV_MachineCheck
334+
END(EV_MachineCheck)
335335

336336
; ---------------------------------------------
337337
; Protection Violation Exception Handler
338338
; ---------------------------------------------
339339

340-
ARC_ENTRY EV_TLBProtV
340+
ENTRY(EV_TLBProtV)
341341

342342
EXCEPTION_PROLOGUE
343343

@@ -385,12 +385,12 @@ ARC_ENTRY EV_TLBProtV
385385

386386
b ret_from_exception
387387

388-
ARC_EXIT EV_TLBProtV
388+
END(EV_TLBProtV)
389389

390390
; ---------------------------------------------
391391
; Privilege Violation Exception Handler
392392
; ---------------------------------------------
393-
ARC_ENTRY EV_PrivilegeV
393+
ENTRY(EV_PrivilegeV)
394394

395395
EXCEPTION_PROLOGUE
396396

@@ -401,12 +401,12 @@ ARC_ENTRY EV_PrivilegeV
401401

402402
bl do_privilege_fault
403403
b ret_from_exception
404-
ARC_EXIT EV_PrivilegeV
404+
END(EV_PrivilegeV)
405405

406406
; ---------------------------------------------
407407
; Extension Instruction Exception Handler
408408
; ---------------------------------------------
409-
ARC_ENTRY EV_Extension
409+
ENTRY(EV_Extension)
410410

411411
EXCEPTION_PROLOGUE
412412

@@ -417,7 +417,7 @@ ARC_ENTRY EV_Extension
417417

418418
bl do_extension_fault
419419
b ret_from_exception
420-
ARC_EXIT EV_Extension
420+
END(EV_Extension)
421421

422422
;######################### System Call Tracing #########################
423423

@@ -504,7 +504,7 @@ trap_with_param:
504504
; (2) Break Points
505505
;------------------------------------------------------------------
506506

507-
ARC_ENTRY EV_Trap
507+
ENTRY(EV_Trap)
508508

509509
EXCEPTION_PROLOGUE
510510

@@ -534,9 +534,9 @@ ARC_ENTRY EV_Trap
534534
jl [r9] ; Entry into Sys Call Handler
535535

536536
; fall through to ret_from_system_call
537-
ARC_EXIT EV_Trap
537+
END(EV_Trap)
538538

539-
ARC_ENTRY ret_from_system_call
539+
ENTRY(ret_from_system_call)
540540

541541
st r0, [sp, PT_r0] ; sys call return value in pt_regs
542542

@@ -546,7 +546,7 @@ ARC_ENTRY ret_from_system_call
546546
;
547547
; If ret to user mode do we need to handle signals, schedule() et al.
548548

549-
ARC_ENTRY ret_from_exception
549+
ENTRY(ret_from_exception)
550550

551551
; Pre-{IRQ,Trap,Exception} K/U mode from pt_regs->status32
552552
ld r8, [sp, PT_status32] ; returning to User/Kernel Mode
@@ -726,9 +726,9 @@ not_level1_interrupt:
726726
debug_marker_syscall:
727727
rtie
728728

729-
ARC_EXIT ret_from_exception
729+
END(ret_from_exception)
730730

731-
ARC_ENTRY ret_from_fork
731+
ENTRY(ret_from_fork)
732732
; when the forked child comes here from the __switch_to function
733733
; r0 has the last task pointer.
734734
; put last task in scheduler queue
@@ -745,11 +745,11 @@ ARC_ENTRY ret_from_fork
745745
; special case of kernel_thread entry point returning back due to
746746
; kernel_execve() - pretend return from syscall to ret to userland
747747
b ret_from_exception
748-
ARC_EXIT ret_from_fork
748+
END(ret_from_fork)
749749

750750
;################### Special Sys Call Wrappers ##########################
751751

752-
ARC_ENTRY sys_clone_wrapper
752+
ENTRY(sys_clone_wrapper)
753753
SAVE_CALLEE_SAVED_USER
754754
bl @sys_clone
755755
DISCARD_CALLEE_SAVED_USER
@@ -759,7 +759,7 @@ ARC_ENTRY sys_clone_wrapper
759759
bnz tracesys_exit
760760

761761
b ret_from_system_call
762-
ARC_EXIT sys_clone_wrapper
762+
END(sys_clone_wrapper)
763763

764764
#ifdef CONFIG_ARC_DW2_UNWIND
765765
; Workaround for bug 94179 (STAR ):

‎arch/arc/kernel/head.S‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,13 @@
2424
.globl stext
2525
stext:
2626
;-------------------------------------------------------------------
27-
; Don't clobber r0-r4 yet. It might have bootloader provided info
27+
; Don't clobber r0-r2 yet. It might have bootloader provided info
2828
;-------------------------------------------------------------------
2929

3030
sr @_int_vec_base_lds, [AUX_INTR_VEC_BASE]
3131

3232
#ifdef CONFIG_SMP
33-
; Only Boot (Master) proceeds. Others wait in platform dependent way
33+
; Ensure Boot (Master) proceeds. Others wait in platform dependent way
3434
; IDENTITY Reg [ 3 2 1 0 ]
3535
; (cpu-id) ^^^ => Zero for UP ARC700
3636
; => #Core-ID if SMP (Master 0)
@@ -39,7 +39,8 @@ stext:
3939
; need to make sure only boot cpu takes this path.
4040
GET_CPU_ID r5
4141
cmp r5, 0
42-
jnz arc_platform_smp_wait_to_boot
42+
mov.ne r0, r5
43+
jne arc_platform_smp_wait_to_boot
4344
#endif
4445
; Clear BSS before updating any globals
4546
; XXX: use ZOL here

‎arch/arc/kernel/time.c‎

Lines changed: 16 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -155,22 +155,6 @@ static void arc_timer_event_setup(unsigned int limit)
155155
write_aux_reg(ARC_REG_TIMER0_CTRL, TIMER_CTRL_IE | TIMER_CTRL_NH);
156156
}
157157

158-
/*
159-
* Acknowledge the interrupt (oneshot) and optionally re-arm it (periodic)
160-
* -Any write to CTRL Reg will ack the intr (NH bit: Count when not halted)
161-
* -Rearming is done by setting the IE bit
162-
*
163-
* Small optimisation: Normal code would have been
164-
* if (irq_reenable)
165-
* CTRL_REG = (IE | NH);
166-
* else
167-
* CTRL_REG = NH;
168-
* However since IE is BIT0 we can fold the branch
169-
*/
170-
static void arc_timer_event_ack(unsigned int irq_reenable)
171-
{
172-
write_aux_reg(ARC_REG_TIMER0_CTRL, irq_reenable | TIMER_CTRL_NH);
173-
}
174158

175159
static int arc_clkevent_set_next_event(unsigned long delta,
176160
struct clock_event_device *dev)
@@ -207,10 +191,22 @@ static DEFINE_PER_CPU(struct clock_event_device, arc_clockevent_device) = {
207191

208192
static irqreturn_t timer_irq_handler(int irq, void *dev_id)
209193
{
210-
struct clock_event_device *clk = this_cpu_ptr(&arc_clockevent_device);
194+
/*
195+
* Note that generic IRQ core could have passed @evt for @dev_id if
196+
* irq_set_chip_and_handler() asked for handle_percpu_devid_irq()
197+
*/
198+
struct clock_event_device *evt = this_cpu_ptr(&arc_clockevent_device);
199+
int irq_reenable = evt->mode == CLOCK_EVT_MODE_PERIODIC;
200+
201+
/*
202+
* Any write to CTRL reg ACks the interrupt, we rewrite the
203+
* Count when [N]ot [H]alted bit.
204+
* And re-arm it if perioid by [I]nterrupt [E]nable bit
205+
*/
206+
write_aux_reg(ARC_REG_TIMER0_CTRL, irq_reenable | TIMER_CTRL_NH);
207+
208+
evt->event_handler(evt);
211209

212-
arc_timer_event_ack(clk->mode == CLOCK_EVT_MODE_PERIODIC);
213-
clk->event_handler(clk);
214210
return IRQ_HANDLED;
215211
}
216212

@@ -222,9 +218,8 @@ static struct irqaction arc_timer_irq = {
222218

223219
/*
224220
* Setup the local event timer for @cpu
225-
* N.B. weak so that some exotic ARC SoCs can completely override it
226221
*/
227-
void __weak arc_local_timer_setup(unsigned int cpu)
222+
void arc_local_timer_setup(unsigned int cpu)
228223
{
229224
struct clock_event_device *clk = &per_cpu(arc_clockevent_device, cpu);
230225

0 commit comments

Comments
 (0)