aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arc
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arc')
-rw-r--r--arch/arc/boot/.gitignore1
-rw-r--r--arch/arc/boot/dts/nsimosci.dts12
-rw-r--r--arch/arc/boot/dts/skeleton.dts10
-rw-r--r--arch/arc/configs/nsimosci_defconfig1
-rw-r--r--arch/arc/include/asm/linkage.h14
-rw-r--r--arch/arc/kernel/ctx_sw_asm.S2
-rw-r--r--arch/arc/kernel/entry.S52
-rw-r--r--arch/arc/kernel/head.S7
-rw-r--r--arch/arc/kernel/time.c37
-rw-r--r--arch/arc/lib/memcmp.S6
-rw-r--r--arch/arc/lib/memcpy-700.S6
-rw-r--r--arch/arc/lib/memset.S10
-rw-r--r--arch/arc/lib/strchr-700.S6
-rw-r--r--arch/arc/lib/strcmp.S6
-rw-r--r--arch/arc/lib/strcpy-700.S6
-rw-r--r--arch/arc/lib/strlen.S6
-rw-r--r--arch/arc/mm/cache_arc700.c3
-rw-r--r--arch/arc/mm/init.c27
-rw-r--r--arch/arc/mm/tlbex.S10
-rw-r--r--arch/arc/plat-arcfpga/Kconfig1
-rw-r--r--arch/arc/plat-arcfpga/platform.c6
21 files changed, 114 insertions, 115 deletions
diff --git a/arch/arc/boot/.gitignore b/arch/arc/boot/.gitignore
index 5d65b54bf17a..5246969a20c5 100644
--- a/arch/arc/boot/.gitignore
+++ b/arch/arc/boot/.gitignore
@@ -1 +1,2 @@
1*.dtb* 1*.dtb*
2uImage
diff --git a/arch/arc/boot/dts/nsimosci.dts b/arch/arc/boot/dts/nsimosci.dts
index ea16d782af58..4f31b2eb5cdf 100644
--- a/arch/arc/boot/dts/nsimosci.dts
+++ b/arch/arc/boot/dts/nsimosci.dts
@@ -11,13 +11,16 @@
11 11
12/ { 12/ {
13 compatible = "snps,nsimosci"; 13 compatible = "snps,nsimosci";
14 clock-frequency = <80000000>; /* 80 MHZ */ 14 clock-frequency = <20000000>; /* 20 MHZ */
15 #address-cells = <1>; 15 #address-cells = <1>;
16 #size-cells = <1>; 16 #size-cells = <1>;
17 interrupt-parent = <&intc>; 17 interrupt-parent = <&intc>;
18 18
19 chosen { 19 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";
21 }; 24 };
22 25
23 aliases { 26 aliases {
@@ -44,15 +47,14 @@
44 }; 47 };
45 48
46 uart0: serial@c0000000 { 49 uart0: serial@c0000000 {
47 compatible = "snps,dw-apb-uart"; 50 compatible = "ns8250";
48 reg = <0xc0000000 0x2000>; 51 reg = <0xc0000000 0x2000>;
49 interrupts = <11>; 52 interrupts = <11>;
50 #clock-frequency = <80000000>;
51 clock-frequency = <3686400>; 53 clock-frequency = <3686400>;
52 baud = <115200>; 54 baud = <115200>;
53 reg-shift = <2>; 55 reg-shift = <2>;
54 reg-io-width = <4>; 56 reg-io-width = <4>;
55 status = "okay"; 57 no-loopback-test = <1>;
56 }; 58 };
57 59
58 pgu0: pgu@c9000000 { 60 pgu0: pgu@c9000000 {
diff --git a/arch/arc/boot/dts/skeleton.dts b/arch/arc/boot/dts/skeleton.dts
deleted file mode 100644
index 25a84fb5b3dc..000000000000
--- a/arch/arc/boot/dts/skeleton.dts
+++ /dev/null
@@ -1,10 +0,0 @@
1/*
2 * Copyright (C) 2012 Synopsys, Inc. (www.synopsys.com)
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
7 */
8/dts-v1/;
9
10/include/ "skeleton.dtsi"
diff --git a/arch/arc/configs/nsimosci_defconfig b/arch/arc/configs/nsimosci_defconfig
index 451af30914f6..c01ba35a4eff 100644
--- a/arch/arc/configs/nsimosci_defconfig
+++ b/arch/arc/configs/nsimosci_defconfig
@@ -54,6 +54,7 @@ CONFIG_SERIO_ARC_PS2=y
54CONFIG_SERIAL_8250=y 54CONFIG_SERIAL_8250=y
55CONFIG_SERIAL_8250_CONSOLE=y 55CONFIG_SERIAL_8250_CONSOLE=y
56CONFIG_SERIAL_8250_DW=y 56CONFIG_SERIAL_8250_DW=y
57CONFIG_SERIAL_OF_PLATFORM=y
57CONFIG_SERIAL_ARC=y 58CONFIG_SERIAL_ARC=y
58CONFIG_SERIAL_ARC_CONSOLE=y 59CONFIG_SERIAL_ARC_CONSOLE=y
59# CONFIG_HW_RANDOM is not set 60# CONFIG_HW_RANDOM is not set
diff --git a/arch/arc/include/asm/linkage.h b/arch/arc/include/asm/linkage.h
index 66ee5527aefc..5faad17118b4 100644
--- a/arch/arc/include/asm/linkage.h
+++ b/arch/arc/include/asm/linkage.h
@@ -13,20 +13,6 @@
13 13
14#define ASM_NL ` /* use '`' to mark new line in macro */ 14#define ASM_NL ` /* use '`' to mark new line in macro */
15 15
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
30/* annotation for data we want in DCCM - if enabled in .config */ 16/* annotation for data we want in DCCM - if enabled in .config */
31.macro ARCFP_DATA nm 17.macro ARCFP_DATA nm
32#ifdef CONFIG_ARC_HAS_DCCM 18#ifdef CONFIG_ARC_HAS_DCCM
diff --git a/arch/arc/kernel/ctx_sw_asm.S b/arch/arc/kernel/ctx_sw_asm.S
index 65690e7fcc8c..2ff0347a2fd7 100644
--- a/arch/arc/kernel/ctx_sw_asm.S
+++ b/arch/arc/kernel/ctx_sw_asm.S
@@ -62,4 +62,4 @@ __switch_to:
62 ld.ab blink, [sp, 4] 62 ld.ab blink, [sp, 4]
63 j [blink] 63 j [blink]
64 64
65ARC_EXIT __switch_to 65END(__switch_to)
diff --git a/arch/arc/kernel/entry.S b/arch/arc/kernel/entry.S
index 47d09d07f093..819dd5f7eb05 100644
--- a/arch/arc/kernel/entry.S
+++ b/arch/arc/kernel/entry.S
@@ -141,7 +141,7 @@ VECTOR EV_Extension ; 0x130, Extn Intruction Excp (0x26)
141VECTOR reserved ; Reserved Exceptions 141VECTOR reserved ; Reserved Exceptions
142.endr 142.endr
143 143
144#include <linux/linkage.h> /* ARC_{EXTRY,EXIT} */ 144#include <linux/linkage.h> /* {EXTRY,EXIT} */
145#include <asm/entry.h> /* SAVE_ALL_{INT1,INT2,SYS...} */ 145#include <asm/entry.h> /* SAVE_ALL_{INT1,INT2,SYS...} */
146#include <asm/errno.h> 146#include <asm/errno.h>
147#include <asm/arcregs.h> 147#include <asm/arcregs.h>
@@ -184,7 +184,7 @@ reserved: ; processor restart
184; --------------------------------------------- 184; ---------------------------------------------
185; Level 2 ISR: Can interrupt a Level 1 ISR 185; Level 2 ISR: Can interrupt a Level 1 ISR
186; --------------------------------------------- 186; ---------------------------------------------
187ARC_ENTRY handle_interrupt_level2 187ENTRY(handle_interrupt_level2)
188 188
189 ; TODO-vineetg for SMP this wont work 189 ; TODO-vineetg for SMP this wont work
190 ; free up r9 as scratchpad 190 ; free up r9 as scratchpad
@@ -225,14 +225,14 @@ ARC_ENTRY handle_interrupt_level2
225 225
226 b ret_from_exception 226 b ret_from_exception
227 227
228ARC_EXIT handle_interrupt_level2 228END(handle_interrupt_level2)
229 229
230#endif 230#endif
231 231
232; --------------------------------------------- 232; ---------------------------------------------
233; Level 1 ISR 233; Level 1 ISR
234; --------------------------------------------- 234; ---------------------------------------------
235ARC_ENTRY handle_interrupt_level1 235ENTRY(handle_interrupt_level1)
236 236
237 /* free up r9 as scratchpad */ 237 /* free up r9 as scratchpad */
238#ifdef CONFIG_SMP 238#ifdef CONFIG_SMP
@@ -265,7 +265,7 @@ ARC_ENTRY handle_interrupt_level1
265 sr r8, [AUX_IRQ_LV12] ; clear bit in Sticky Status Reg 265 sr r8, [AUX_IRQ_LV12] ; clear bit in Sticky Status Reg
266 266
267 b ret_from_exception 267 b ret_from_exception
268ARC_EXIT handle_interrupt_level1 268END(handle_interrupt_level1)
269 269
270;################### Non TLB Exception Handling ############################# 270;################### Non TLB Exception Handling #############################
271 271
@@ -273,7 +273,7 @@ ARC_EXIT handle_interrupt_level1
273; Instruction Error Exception Handler 273; Instruction Error Exception Handler
274; --------------------------------------------- 274; ---------------------------------------------
275 275
276ARC_ENTRY instr_service 276ENTRY(instr_service)
277 277
278 EXCEPTION_PROLOGUE 278 EXCEPTION_PROLOGUE
279 279
@@ -284,13 +284,13 @@ ARC_ENTRY instr_service
284 284
285 bl do_insterror_or_kprobe 285 bl do_insterror_or_kprobe
286 b ret_from_exception 286 b ret_from_exception
287ARC_EXIT instr_service 287END(instr_service)
288 288
289; --------------------------------------------- 289; ---------------------------------------------
290; Memory Error Exception Handler 290; Memory Error Exception Handler
291; --------------------------------------------- 291; ---------------------------------------------
292 292
293ARC_ENTRY mem_service 293ENTRY(mem_service)
294 294
295 EXCEPTION_PROLOGUE 295 EXCEPTION_PROLOGUE
296 296
@@ -301,13 +301,13 @@ ARC_ENTRY mem_service
301 301
302 bl do_memory_error 302 bl do_memory_error
303 b ret_from_exception 303 b ret_from_exception
304ARC_EXIT mem_service 304END(mem_service)
305 305
306; --------------------------------------------- 306; ---------------------------------------------
307; Machine Check Exception Handler 307; Machine Check Exception Handler
308; --------------------------------------------- 308; ---------------------------------------------
309 309
310ARC_ENTRY EV_MachineCheck 310ENTRY(EV_MachineCheck)
311 311
312 EXCEPTION_PROLOGUE 312 EXCEPTION_PROLOGUE
313 313
@@ -331,13 +331,13 @@ ARC_ENTRY EV_MachineCheck
331 331
332 j do_machine_check_fault 332 j do_machine_check_fault
333 333
334ARC_EXIT EV_MachineCheck 334END(EV_MachineCheck)
335 335
336; --------------------------------------------- 336; ---------------------------------------------
337; Protection Violation Exception Handler 337; Protection Violation Exception Handler
338; --------------------------------------------- 338; ---------------------------------------------
339 339
340ARC_ENTRY EV_TLBProtV 340ENTRY(EV_TLBProtV)
341 341
342 EXCEPTION_PROLOGUE 342 EXCEPTION_PROLOGUE
343 343
@@ -385,12 +385,12 @@ ARC_ENTRY EV_TLBProtV
385 385
386 b ret_from_exception 386 b ret_from_exception
387 387
388ARC_EXIT EV_TLBProtV 388END(EV_TLBProtV)
389 389
390; --------------------------------------------- 390; ---------------------------------------------
391; Privilege Violation Exception Handler 391; Privilege Violation Exception Handler
392; --------------------------------------------- 392; ---------------------------------------------
393ARC_ENTRY EV_PrivilegeV 393ENTRY(EV_PrivilegeV)
394 394
395 EXCEPTION_PROLOGUE 395 EXCEPTION_PROLOGUE
396 396
@@ -401,12 +401,12 @@ ARC_ENTRY EV_PrivilegeV
401 401
402 bl do_privilege_fault 402 bl do_privilege_fault
403 b ret_from_exception 403 b ret_from_exception
404ARC_EXIT EV_PrivilegeV 404END(EV_PrivilegeV)
405 405
406; --------------------------------------------- 406; ---------------------------------------------
407; Extension Instruction Exception Handler 407; Extension Instruction Exception Handler
408; --------------------------------------------- 408; ---------------------------------------------
409ARC_ENTRY EV_Extension 409ENTRY(EV_Extension)
410 410
411 EXCEPTION_PROLOGUE 411 EXCEPTION_PROLOGUE
412 412
@@ -417,7 +417,7 @@ ARC_ENTRY EV_Extension
417 417
418 bl do_extension_fault 418 bl do_extension_fault
419 b ret_from_exception 419 b ret_from_exception
420ARC_EXIT EV_Extension 420END(EV_Extension)
421 421
422;######################### System Call Tracing ######################### 422;######################### System Call Tracing #########################
423 423
@@ -504,7 +504,7 @@ trap_with_param:
504; (2) Break Points 504; (2) Break Points
505;------------------------------------------------------------------ 505;------------------------------------------------------------------
506 506
507ARC_ENTRY EV_Trap 507ENTRY(EV_Trap)
508 508
509 EXCEPTION_PROLOGUE 509 EXCEPTION_PROLOGUE
510 510
@@ -534,9 +534,9 @@ ARC_ENTRY EV_Trap
534 jl [r9] ; Entry into Sys Call Handler 534 jl [r9] ; Entry into Sys Call Handler
535 535
536 ; fall through to ret_from_system_call 536 ; fall through to ret_from_system_call
537ARC_EXIT EV_Trap 537END(EV_Trap)
538 538
539ARC_ENTRY ret_from_system_call 539ENTRY(ret_from_system_call)
540 540
541 st r0, [sp, PT_r0] ; sys call return value in pt_regs 541 st r0, [sp, PT_r0] ; sys call return value in pt_regs
542 542
@@ -546,7 +546,7 @@ ARC_ENTRY ret_from_system_call
546; 546;
547; If ret to user mode do we need to handle signals, schedule() et al. 547; If ret to user mode do we need to handle signals, schedule() et al.
548 548
549ARC_ENTRY ret_from_exception 549ENTRY(ret_from_exception)
550 550
551 ; Pre-{IRQ,Trap,Exception} K/U mode from pt_regs->status32 551 ; Pre-{IRQ,Trap,Exception} K/U mode from pt_regs->status32
552 ld r8, [sp, PT_status32] ; returning to User/Kernel Mode 552 ld r8, [sp, PT_status32] ; returning to User/Kernel Mode
@@ -726,9 +726,9 @@ not_level1_interrupt:
726debug_marker_syscall: 726debug_marker_syscall:
727 rtie 727 rtie
728 728
729ARC_EXIT ret_from_exception 729END(ret_from_exception)
730 730
731ARC_ENTRY ret_from_fork 731ENTRY(ret_from_fork)
732 ; when the forked child comes here from the __switch_to function 732 ; when the forked child comes here from the __switch_to function
733 ; r0 has the last task pointer. 733 ; r0 has the last task pointer.
734 ; put last task in scheduler queue 734 ; put last task in scheduler queue
@@ -745,11 +745,11 @@ ARC_ENTRY ret_from_fork
745 ; special case of kernel_thread entry point returning back due to 745 ; special case of kernel_thread entry point returning back due to
746 ; kernel_execve() - pretend return from syscall to ret to userland 746 ; kernel_execve() - pretend return from syscall to ret to userland
747 b ret_from_exception 747 b ret_from_exception
748ARC_EXIT ret_from_fork 748END(ret_from_fork)
749 749
750;################### Special Sys Call Wrappers ########################## 750;################### Special Sys Call Wrappers ##########################
751 751
752ARC_ENTRY sys_clone_wrapper 752ENTRY(sys_clone_wrapper)
753 SAVE_CALLEE_SAVED_USER 753 SAVE_CALLEE_SAVED_USER
754 bl @sys_clone 754 bl @sys_clone
755 DISCARD_CALLEE_SAVED_USER 755 DISCARD_CALLEE_SAVED_USER
@@ -759,7 +759,7 @@ ARC_ENTRY sys_clone_wrapper
759 bnz tracesys_exit 759 bnz tracesys_exit
760 760
761 b ret_from_system_call 761 b ret_from_system_call
762ARC_EXIT sys_clone_wrapper 762END(sys_clone_wrapper)
763 763
764#ifdef CONFIG_ARC_DW2_UNWIND 764#ifdef CONFIG_ARC_DW2_UNWIND
765; Workaround for bug 94179 (STAR ): 765; Workaround for bug 94179 (STAR ):
diff --git a/arch/arc/kernel/head.S b/arch/arc/kernel/head.S
index 991997269d02..4ad04915dc6b 100644
--- a/arch/arc/kernel/head.S
+++ b/arch/arc/kernel/head.S
@@ -24,13 +24,13 @@
24 .globl stext 24 .globl stext
25stext: 25stext:
26 ;------------------------------------------------------------------- 26 ;-------------------------------------------------------------------
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
28 ;------------------------------------------------------------------- 28 ;-------------------------------------------------------------------
29 29
30 sr @_int_vec_base_lds, [AUX_INTR_VEC_BASE] 30 sr @_int_vec_base_lds, [AUX_INTR_VEC_BASE]
31 31
32#ifdef CONFIG_SMP 32#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
34 ; IDENTITY Reg [ 3 2 1 0 ] 34 ; IDENTITY Reg [ 3 2 1 0 ]
35 ; (cpu-id) ^^^ => Zero for UP ARC700 35 ; (cpu-id) ^^^ => Zero for UP ARC700
36 ; => #Core-ID if SMP (Master 0) 36 ; => #Core-ID if SMP (Master 0)
@@ -39,7 +39,8 @@ stext:
39 ; need to make sure only boot cpu takes this path. 39 ; need to make sure only boot cpu takes this path.
40 GET_CPU_ID r5 40 GET_CPU_ID r5
41 cmp r5, 0 41 cmp r5, 0
42 jnz arc_platform_smp_wait_to_boot 42 mov.ne r0, r5
43 jne arc_platform_smp_wait_to_boot
43#endif 44#endif
44 ; Clear BSS before updating any globals 45 ; Clear BSS before updating any globals
45 ; XXX: use ZOL here 46 ; XXX: use ZOL here
diff --git a/arch/arc/kernel/time.c b/arch/arc/kernel/time.c
index e5f3a837fb35..71c42521c77f 100644
--- a/arch/arc/kernel/time.c
+++ b/arch/arc/kernel/time.c
@@ -155,22 +155,6 @@ static void arc_timer_event_setup(unsigned int limit)
155 write_aux_reg(ARC_REG_TIMER0_CTRL, TIMER_CTRL_IE | TIMER_CTRL_NH); 155 write_aux_reg(ARC_REG_TIMER0_CTRL, TIMER_CTRL_IE | TIMER_CTRL_NH);
156} 156}
157 157
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 */
170static void arc_timer_event_ack(unsigned int irq_reenable)
171{
172 write_aux_reg(ARC_REG_TIMER0_CTRL, irq_reenable | TIMER_CTRL_NH);
173}
174 158
175static int arc_clkevent_set_next_event(unsigned long delta, 159static int arc_clkevent_set_next_event(unsigned long delta,
176 struct clock_event_device *dev) 160 struct clock_event_device *dev)
@@ -207,10 +191,22 @@ static DEFINE_PER_CPU(struct clock_event_device, arc_clockevent_device) = {
207 191
208static irqreturn_t timer_irq_handler(int irq, void *dev_id) 192static irqreturn_t timer_irq_handler(int irq, void *dev_id)
209{ 193{
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);
211 209
212 arc_timer_event_ack(clk->mode == CLOCK_EVT_MODE_PERIODIC);
213 clk->event_handler(clk);
214 return IRQ_HANDLED; 210 return IRQ_HANDLED;
215} 211}
216 212
@@ -222,9 +218,8 @@ static struct irqaction arc_timer_irq = {
222 218
223/* 219/*
224 * Setup the local event timer for @cpu 220 * Setup the local event timer for @cpu
225 * N.B. weak so that some exotic ARC SoCs can completely override it
226 */ 221 */
227void __weak arc_local_timer_setup(unsigned int cpu) 222void arc_local_timer_setup(unsigned int cpu)
228{ 223{
229 struct clock_event_device *clk = &per_cpu(arc_clockevent_device, cpu); 224 struct clock_event_device *clk = &per_cpu(arc_clockevent_device, cpu);
230 225
diff --git a/arch/arc/lib/memcmp.S b/arch/arc/lib/memcmp.S
index bc813d55b6c3..978bf8314dfb 100644
--- a/arch/arc/lib/memcmp.S
+++ b/arch/arc/lib/memcmp.S
@@ -6,7 +6,7 @@
6 * published by the Free Software Foundation. 6 * published by the Free Software Foundation.
7 */ 7 */
8 8
9#include <asm/linkage.h> 9#include <linux/linkage.h>
10 10
11#ifdef __LITTLE_ENDIAN__ 11#ifdef __LITTLE_ENDIAN__
12#define WORD2 r2 12#define WORD2 r2
@@ -16,7 +16,7 @@
16#define SHIFT r2 16#define SHIFT r2
17#endif 17#endif
18 18
19ARC_ENTRY memcmp 19ENTRY(memcmp)
20 or r12,r0,r1 20 or r12,r0,r1
21 asl_s r12,r12,30 21 asl_s r12,r12,30
22 sub r3,r2,1 22 sub r3,r2,1
@@ -121,4 +121,4 @@ ARC_ENTRY memcmp
121.Lnil: 121.Lnil:
122 j_s.d [blink] 122 j_s.d [blink]
123 mov r0,0 123 mov r0,0
124ARC_EXIT memcmp 124END(memcmp)
diff --git a/arch/arc/lib/memcpy-700.S b/arch/arc/lib/memcpy-700.S
index b64cc10ac918..3222573e50de 100644
--- a/arch/arc/lib/memcpy-700.S
+++ b/arch/arc/lib/memcpy-700.S
@@ -6,9 +6,9 @@
6 * published by the Free Software Foundation. 6 * published by the Free Software Foundation.
7 */ 7 */
8 8
9#include <asm/linkage.h> 9#include <linux/linkage.h>
10 10
11ARC_ENTRY memcpy 11ENTRY(memcpy)
12 or r3,r0,r1 12 or r3,r0,r1
13 asl_s r3,r3,30 13 asl_s r3,r3,30
14 mov_s r5,r0 14 mov_s r5,r0
@@ -63,4 +63,4 @@ ARC_ENTRY memcpy
63.Lendbloop: 63.Lendbloop:
64 j_s.d [blink] 64 j_s.d [blink]
65 stb r12,[r5,0] 65 stb r12,[r5,0]
66ARC_EXIT memcpy 66END(memcpy)
diff --git a/arch/arc/lib/memset.S b/arch/arc/lib/memset.S
index 9b2d88d2e141..d36bd43fc98d 100644
--- a/arch/arc/lib/memset.S
+++ b/arch/arc/lib/memset.S
@@ -6,11 +6,11 @@
6 * published by the Free Software Foundation. 6 * published by the Free Software Foundation.
7 */ 7 */
8 8
9#include <asm/linkage.h> 9#include <linux/linkage.h>
10 10
11#define SMALL 7 /* Must be at least 6 to deal with alignment/loop issues. */ 11#define SMALL 7 /* Must be at least 6 to deal with alignment/loop issues. */
12 12
13ARC_ENTRY memset 13ENTRY(memset)
14 mov_s r4,r0 14 mov_s r4,r0
15 or r12,r0,r2 15 or r12,r0,r2
16 bmsk.f r12,r12,1 16 bmsk.f r12,r12,1
@@ -46,14 +46,14 @@ ARC_ENTRY memset
46 stb.ab r1,[r4,1] 46 stb.ab r1,[r4,1]
47.Ltiny_end: 47.Ltiny_end:
48 j_s [blink] 48 j_s [blink]
49ARC_EXIT memset 49END(memset)
50 50
51; memzero: @r0 = mem, @r1 = size_t 51; memzero: @r0 = mem, @r1 = size_t
52; memset: @r0 = mem, @r1 = char, @r2 = size_t 52; memset: @r0 = mem, @r1 = char, @r2 = size_t
53 53
54ARC_ENTRY memzero 54ENTRY(memzero)
55 ; adjust bzero args to memset args 55 ; adjust bzero args to memset args
56 mov r2, r1 56 mov r2, r1
57 mov r1, 0 57 mov r1, 0
58 b memset ;tail call so need to tinker with blink 58 b memset ;tail call so need to tinker with blink
59ARC_EXIT memzero 59END(memzero)
diff --git a/arch/arc/lib/strchr-700.S b/arch/arc/lib/strchr-700.S
index 9c548c7cf001..b725d5862107 100644
--- a/arch/arc/lib/strchr-700.S
+++ b/arch/arc/lib/strchr-700.S
@@ -11,9 +11,9 @@
11 presence of the norm instruction makes it easier to operate on whole 11 presence of the norm instruction makes it easier to operate on whole
12 words branch-free. */ 12 words branch-free. */
13 13
14#include <asm/linkage.h> 14#include <linux/linkage.h>
15 15
16ARC_ENTRY strchr 16ENTRY(strchr)
17 extb_s r1,r1 17 extb_s r1,r1
18 asl r5,r1,8 18 asl r5,r1,8
19 bmsk r2,r0,1 19 bmsk r2,r0,1
@@ -130,4 +130,4 @@ ARC_ENTRY strchr
130 j_s.d [blink] 130 j_s.d [blink]
131 mov.mi r0,0 131 mov.mi r0,0
132#endif /* ENDIAN */ 132#endif /* ENDIAN */
133ARC_EXIT strchr 133END(strchr)
diff --git a/arch/arc/lib/strcmp.S b/arch/arc/lib/strcmp.S
index 5dc802b45cf3..3544600fefe6 100644
--- a/arch/arc/lib/strcmp.S
+++ b/arch/arc/lib/strcmp.S
@@ -13,9 +13,9 @@
13 source 1; however, that would increase the overhead for loop setup / finish, 13 source 1; however, that would increase the overhead for loop setup / finish,
14 and strcmp might often terminate early. */ 14 and strcmp might often terminate early. */
15 15
16#include <asm/linkage.h> 16#include <linux/linkage.h>
17 17
18ARC_ENTRY strcmp 18ENTRY(strcmp)
19 or r2,r0,r1 19 or r2,r0,r1
20 bmsk_s r2,r2,1 20 bmsk_s r2,r2,1
21 brne r2,0,.Lcharloop 21 brne r2,0,.Lcharloop
@@ -93,4 +93,4 @@ ARC_ENTRY strcmp
93.Lcmpend: 93.Lcmpend:
94 j_s.d [blink] 94 j_s.d [blink]
95 sub r0,r2,r3 95 sub r0,r2,r3
96ARC_EXIT strcmp 96END(strcmp)
diff --git a/arch/arc/lib/strcpy-700.S b/arch/arc/lib/strcpy-700.S
index b7ca4ae81d88..8422f38e1218 100644
--- a/arch/arc/lib/strcpy-700.S
+++ b/arch/arc/lib/strcpy-700.S
@@ -16,9 +16,9 @@
16 there, but the it is not likely to be taken often, and it 16 there, but the it is not likely to be taken often, and it
17 would also be likey to cost an unaligned mispredict at the next call. */ 17 would also be likey to cost an unaligned mispredict at the next call. */
18 18
19#include <asm/linkage.h> 19#include <linux/linkage.h>
20 20
21ARC_ENTRY strcpy 21ENTRY(strcpy)
22 or r2,r0,r1 22 or r2,r0,r1
23 bmsk_s r2,r2,1 23 bmsk_s r2,r2,1
24 brne.d r2,0,charloop 24 brne.d r2,0,charloop
@@ -67,4 +67,4 @@ charloop:
67 brne.d r3,0,charloop 67 brne.d r3,0,charloop
68 stb.ab r3,[r10,1] 68 stb.ab r3,[r10,1]
69 j [blink] 69 j [blink]
70ARC_EXIT strcpy 70END(strcpy)
diff --git a/arch/arc/lib/strlen.S b/arch/arc/lib/strlen.S
index 39759e099696..53cfd5685a5f 100644
--- a/arch/arc/lib/strlen.S
+++ b/arch/arc/lib/strlen.S
@@ -6,9 +6,9 @@
6 * published by the Free Software Foundation. 6 * published by the Free Software Foundation.
7 */ 7 */
8 8
9#include <asm/linkage.h> 9#include <linux/linkage.h>
10 10
11ARC_ENTRY strlen 11ENTRY(strlen)
12 or r3,r0,7 12 or r3,r0,7
13 ld r2,[r3,-7] 13 ld r2,[r3,-7]
14 ld.a r6,[r3,-3] 14 ld.a r6,[r3,-3]
@@ -80,4 +80,4 @@ ARC_ENTRY strlen
80.Learly_end: 80.Learly_end:
81 b.d .Lend 81 b.d .Lend
82 sub_s.ne r1,r1,r1 82 sub_s.ne r1,r1,r1
83ARC_EXIT strlen 83END(strlen)
diff --git a/arch/arc/mm/cache_arc700.c b/arch/arc/mm/cache_arc700.c
index 400c663b21c2..89edf7961a2f 100644
--- a/arch/arc/mm/cache_arc700.c
+++ b/arch/arc/mm/cache_arc700.c
@@ -100,10 +100,9 @@
100#define DC_CTRL_INV_MODE_FLUSH 0x40 100#define DC_CTRL_INV_MODE_FLUSH 0x40
101#define DC_CTRL_FLUSH_STATUS 0x100 101#define DC_CTRL_FLUSH_STATUS 0x100
102 102
103char *arc_cache_mumbojumbo(int cpu_id, char *buf, int len) 103char *arc_cache_mumbojumbo(int c, char *buf, int len)
104{ 104{
105 int n = 0; 105 int n = 0;
106 unsigned int c = smp_processor_id();
107 106
108#define PR_CACHE(p, enb, str) \ 107#define PR_CACHE(p, enb, str) \
109{ \ 108{ \
diff --git a/arch/arc/mm/init.c b/arch/arc/mm/init.c
index 55e0a85bea78..523412369f70 100644
--- a/arch/arc/mm/init.c
+++ b/arch/arc/mm/init.c
@@ -10,6 +10,9 @@
10#include <linux/mm.h> 10#include <linux/mm.h>
11#include <linux/bootmem.h> 11#include <linux/bootmem.h>
12#include <linux/memblock.h> 12#include <linux/memblock.h>
13#ifdef CONFIG_BLK_DEV_INITRD
14#include <linux/initrd.h>
15#endif
13#include <linux/swap.h> 16#include <linux/swap.h>
14#include <linux/module.h> 17#include <linux/module.h>
15#include <asm/page.h> 18#include <asm/page.h>
@@ -42,6 +45,24 @@ void __init early_init_dt_add_memory_arch(u64 base, u64 size)
42 pr_info("Memory size set via devicetree %ldM\n", TO_MB(arc_mem_sz)); 45 pr_info("Memory size set via devicetree %ldM\n", TO_MB(arc_mem_sz));
43} 46}
44 47
48#ifdef CONFIG_BLK_DEV_INITRD
49static int __init early_initrd(char *p)
50{
51 unsigned long start, size;
52 char *endp;
53
54 start = memparse(p, &endp);
55 if (*endp == ',') {
56 size = memparse(endp + 1, NULL);
57
58 initrd_start = (unsigned long)__va(start);
59 initrd_end = (unsigned long)__va(start + size);
60 }
61 return 0;
62}
63early_param("initrd", early_initrd);
64#endif
65
45/* 66/*
46 * First memory setup routine called from setup_arch() 67 * First memory setup routine called from setup_arch()
47 * 1. setup swapper's mm @init_mm 68 * 1. setup swapper's mm @init_mm
@@ -80,6 +101,12 @@ void __init setup_arch_memory(void)
80 memblock_reserve(CONFIG_LINUX_LINK_BASE, 101 memblock_reserve(CONFIG_LINUX_LINK_BASE,
81 __pa(_end) - CONFIG_LINUX_LINK_BASE); 102 __pa(_end) - CONFIG_LINUX_LINK_BASE);
82 103
104#ifdef CONFIG_BLK_DEV_INITRD
105 /*------------- reserve initrd image -----------------------*/
106 if (initrd_start)
107 memblock_reserve(__pa(initrd_start), initrd_end - initrd_start);
108#endif
109
83 memblock_dump_all(); 110 memblock_dump_all();
84 111
85 /*-------------- node setup --------------------------------*/ 112 /*-------------- node setup --------------------------------*/
diff --git a/arch/arc/mm/tlbex.S b/arch/arc/mm/tlbex.S
index 3fcfdb38d242..79bfc81358c9 100644
--- a/arch/arc/mm/tlbex.S
+++ b/arch/arc/mm/tlbex.S
@@ -260,7 +260,7 @@ ARCFP_CODE ;Fast Path Code, candidate for ICCM
260; I-TLB Miss Exception Handler 260; I-TLB Miss Exception Handler
261;----------------------------------------------------------------------------- 261;-----------------------------------------------------------------------------
262 262
263ARC_ENTRY EV_TLBMissI 263ENTRY(EV_TLBMissI)
264 264
265 TLBMISS_FREEUP_REGS 265 TLBMISS_FREEUP_REGS
266 266
@@ -293,13 +293,13 @@ ARC_ENTRY EV_TLBMissI
293 TLBMISS_RESTORE_REGS 293 TLBMISS_RESTORE_REGS
294 rtie 294 rtie
295 295
296ARC_EXIT EV_TLBMissI 296END(EV_TLBMissI)
297 297
298;----------------------------------------------------------------------------- 298;-----------------------------------------------------------------------------
299; D-TLB Miss Exception Handler 299; D-TLB Miss Exception Handler
300;----------------------------------------------------------------------------- 300;-----------------------------------------------------------------------------
301 301
302ARC_ENTRY EV_TLBMissD 302ENTRY(EV_TLBMissD)
303 303
304 TLBMISS_FREEUP_REGS 304 TLBMISS_FREEUP_REGS
305 305
@@ -381,6 +381,4 @@ do_slow_path_pf:
381 bl do_page_fault 381 bl do_page_fault
382 b ret_from_exception 382 b ret_from_exception
383 383
384ARC_EXIT EV_TLBMissD 384END(EV_TLBMissD)
385
386ARC_ENTRY EV_TLBMissB ; Bogus entry to measure sz of DTLBMiss hdlr
diff --git a/arch/arc/plat-arcfpga/Kconfig b/arch/arc/plat-arcfpga/Kconfig
index 295cefeb25d3..33058aa40e77 100644
--- a/arch/arc/plat-arcfpga/Kconfig
+++ b/arch/arc/plat-arcfpga/Kconfig
@@ -33,7 +33,6 @@ config ISS_SMP_EXTN
33 bool "ARC SMP Extensions (ISS Models only)" 33 bool "ARC SMP Extensions (ISS Models only)"
34 default n 34 default n
35 depends on SMP 35 depends on SMP
36 select ARC_HAS_COH_RTSC
37 help 36 help
38 SMP Extensions to ARC700, in a "simulation only" Model, supported in 37 SMP Extensions to ARC700, in a "simulation only" Model, supported in
39 ARC ISS (Instruction Set Simulator). 38 ARC ISS (Instruction Set Simulator).
diff --git a/arch/arc/plat-arcfpga/platform.c b/arch/arc/plat-arcfpga/platform.c
index d71f3c3bcf24..19b76b61f44b 100644
--- a/arch/arc/plat-arcfpga/platform.c
+++ b/arch/arc/plat-arcfpga/platform.c
@@ -201,7 +201,7 @@ static void __init plat_fpga_populate_dev(void)
201 * callback set, by matching the DT compatible name. 201 * callback set, by matching the DT compatible name.
202 */ 202 */
203 203
204static const char *aa4_compat[] __initdata = { 204static const char *aa4_compat[] __initconst = {
205 "snps,arc-angel4", 205 "snps,arc-angel4",
206 NULL, 206 NULL,
207}; 207};
@@ -216,7 +216,7 @@ MACHINE_START(ANGEL4, "angel4")
216#endif 216#endif
217MACHINE_END 217MACHINE_END
218 218
219static const char *ml509_compat[] __initdata = { 219static const char *ml509_compat[] __initconst = {
220 "snps,arc-ml509", 220 "snps,arc-ml509",
221 NULL, 221 NULL,
222}; 222};
@@ -231,7 +231,7 @@ MACHINE_START(ML509, "ml509")
231#endif 231#endif
232MACHINE_END 232MACHINE_END
233 233
234static const char *nsimosci_compat[] __initdata = { 234static const char *nsimosci_compat[] __initconst = {
235 "snps,nsimosci", 235 "snps,nsimosci",
236 NULL, 236 NULL,
237}; 237};