Skip to content

Commit

Permalink
Merge tag 'arc-v3.15-rc1' of git://git.kernel.org/pub/scm/linux/kerne…
Browse files Browse the repository at this point in the history
…l/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
  • Loading branch information
Linus Torvalds committed Apr 8, 2014
2 parents c8d9762 + 61fb4bf commit 3573d38
Show file tree
Hide file tree
Showing 21 changed files with 114 additions and 115 deletions.
1 change: 1 addition & 0 deletions arch/arc/boot/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
*.dtb*
uImage
12 changes: 7 additions & 5 deletions arch/arc/boot/dts/nsimosci.dts
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,16 @@

/ {
compatible = "snps,nsimosci";
clock-frequency = <80000000>; /* 80 MHZ */
clock-frequency = <20000000>; /* 20 MHZ */
#address-cells = <1>;
#size-cells = <1>;
interrupt-parent = <&intc>;

chosen {
bootargs = "console=tty0 consoleblank=0";
/* this is for console on PGU */
/* bootargs = "console=tty0 consoleblank=0"; */
/* this is for console on serial */
bootargs = "earlycon=uart8250,mmio32,0xc0000000,115200n8 console=ttyS0,115200n8 consoleblank=0 debug";
};

aliases {
Expand All @@ -44,15 +47,14 @@
};

uart0: serial@c0000000 {
compatible = "snps,dw-apb-uart";
compatible = "ns8250";
reg = <0xc0000000 0x2000>;
interrupts = <11>;
#clock-frequency = <80000000>;
clock-frequency = <3686400>;
baud = <115200>;
reg-shift = <2>;
reg-io-width = <4>;
status = "okay";
no-loopback-test = <1>;
};

pgu0: pgu@c9000000 {
Expand Down
10 changes: 0 additions & 10 deletions arch/arc/boot/dts/skeleton.dts

This file was deleted.

1 change: 1 addition & 0 deletions arch/arc/configs/nsimosci_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ CONFIG_SERIO_ARC_PS2=y
CONFIG_SERIAL_8250=y
CONFIG_SERIAL_8250_CONSOLE=y
CONFIG_SERIAL_8250_DW=y
CONFIG_SERIAL_OF_PLATFORM=y
CONFIG_SERIAL_ARC=y
CONFIG_SERIAL_ARC_CONSOLE=y
# CONFIG_HW_RANDOM is not set
Expand Down
14 changes: 0 additions & 14 deletions arch/arc/include/asm/linkage.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,6 @@

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

/* Can't use the ENTRY macro in linux/linkage.h
* gas considers ';' as comment vs. newline
*/
.macro ARC_ENTRY name
.global \name
.align 4
\name:
.endm

.macro ARC_EXIT name
#define ASM_PREV_SYM_ADDR(name) .-##name
.size \ name, ASM_PREV_SYM_ADDR(\name)
.endm

/* annotation for data we want in DCCM - if enabled in .config */
.macro ARCFP_DATA nm
#ifdef CONFIG_ARC_HAS_DCCM
Expand Down
2 changes: 1 addition & 1 deletion arch/arc/kernel/ctx_sw_asm.S
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,4 @@ __switch_to:
ld.ab blink, [sp, 4]
j [blink]

ARC_EXIT __switch_to
END(__switch_to)
52 changes: 26 additions & 26 deletions arch/arc/kernel/entry.S
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ VECTOR EV_Extension ; 0x130, Extn Intruction Excp (0x26)
VECTOR reserved ; Reserved Exceptions
.endr

#include <linux/linkage.h> /* ARC_{EXTRY,EXIT} */
#include <linux/linkage.h> /* {EXTRY,EXIT} */
#include <asm/entry.h> /* SAVE_ALL_{INT1,INT2,SYS...} */
#include <asm/errno.h>
#include <asm/arcregs.h>
Expand Down Expand Up @@ -184,7 +184,7 @@ reserved: ; processor restart
; ---------------------------------------------
; Level 2 ISR: Can interrupt a Level 1 ISR
; ---------------------------------------------
ARC_ENTRY handle_interrupt_level2
ENTRY(handle_interrupt_level2)

; TODO-vineetg for SMP this wont work
; free up r9 as scratchpad
Expand Down Expand Up @@ -225,14 +225,14 @@ ARC_ENTRY handle_interrupt_level2

b ret_from_exception

ARC_EXIT handle_interrupt_level2
END(handle_interrupt_level2)

#endif

; ---------------------------------------------
; Level 1 ISR
; ---------------------------------------------
ARC_ENTRY handle_interrupt_level1
ENTRY(handle_interrupt_level1)

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

b ret_from_exception
ARC_EXIT handle_interrupt_level1
END(handle_interrupt_level1)

;################### Non TLB Exception Handling #############################

; ---------------------------------------------
; Instruction Error Exception Handler
; ---------------------------------------------

ARC_ENTRY instr_service
ENTRY(instr_service)

EXCEPTION_PROLOGUE

Expand All @@ -284,13 +284,13 @@ ARC_ENTRY instr_service

bl do_insterror_or_kprobe
b ret_from_exception
ARC_EXIT instr_service
END(instr_service)

; ---------------------------------------------
; Memory Error Exception Handler
; ---------------------------------------------

ARC_ENTRY mem_service
ENTRY(mem_service)

EXCEPTION_PROLOGUE

Expand All @@ -301,13 +301,13 @@ ARC_ENTRY mem_service

bl do_memory_error
b ret_from_exception
ARC_EXIT mem_service
END(mem_service)

; ---------------------------------------------
; Machine Check Exception Handler
; ---------------------------------------------

ARC_ENTRY EV_MachineCheck
ENTRY(EV_MachineCheck)

EXCEPTION_PROLOGUE

Expand All @@ -331,13 +331,13 @@ ARC_ENTRY EV_MachineCheck

j do_machine_check_fault

ARC_EXIT EV_MachineCheck
END(EV_MachineCheck)

; ---------------------------------------------
; Protection Violation Exception Handler
; ---------------------------------------------

ARC_ENTRY EV_TLBProtV
ENTRY(EV_TLBProtV)

EXCEPTION_PROLOGUE

Expand Down Expand Up @@ -385,12 +385,12 @@ ARC_ENTRY EV_TLBProtV

b ret_from_exception

ARC_EXIT EV_TLBProtV
END(EV_TLBProtV)

; ---------------------------------------------
; Privilege Violation Exception Handler
; ---------------------------------------------
ARC_ENTRY EV_PrivilegeV
ENTRY(EV_PrivilegeV)

EXCEPTION_PROLOGUE

Expand All @@ -401,12 +401,12 @@ ARC_ENTRY EV_PrivilegeV

bl do_privilege_fault
b ret_from_exception
ARC_EXIT EV_PrivilegeV
END(EV_PrivilegeV)

; ---------------------------------------------
; Extension Instruction Exception Handler
; ---------------------------------------------
ARC_ENTRY EV_Extension
ENTRY(EV_Extension)

EXCEPTION_PROLOGUE

Expand All @@ -417,7 +417,7 @@ ARC_ENTRY EV_Extension

bl do_extension_fault
b ret_from_exception
ARC_EXIT EV_Extension
END(EV_Extension)

;######################### System Call Tracing #########################

Expand Down Expand Up @@ -504,7 +504,7 @@ trap_with_param:
; (2) Break Points
;------------------------------------------------------------------

ARC_ENTRY EV_Trap
ENTRY(EV_Trap)

EXCEPTION_PROLOGUE

Expand Down Expand Up @@ -534,9 +534,9 @@ ARC_ENTRY EV_Trap
jl [r9] ; Entry into Sys Call Handler

; fall through to ret_from_system_call
ARC_EXIT EV_Trap
END(EV_Trap)

ARC_ENTRY ret_from_system_call
ENTRY(ret_from_system_call)

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

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

ARC_ENTRY ret_from_exception
ENTRY(ret_from_exception)

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

ARC_EXIT ret_from_exception
END(ret_from_exception)

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

;################### Special Sys Call Wrappers ##########################

ARC_ENTRY sys_clone_wrapper
ENTRY(sys_clone_wrapper)
SAVE_CALLEE_SAVED_USER
bl @sys_clone
DISCARD_CALLEE_SAVED_USER
Expand All @@ -759,7 +759,7 @@ ARC_ENTRY sys_clone_wrapper
bnz tracesys_exit

b ret_from_system_call
ARC_EXIT sys_clone_wrapper
END(sys_clone_wrapper)

#ifdef CONFIG_ARC_DW2_UNWIND
; Workaround for bug 94179 (STAR ):
Expand Down
7 changes: 4 additions & 3 deletions arch/arc/kernel/head.S
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@
.globl stext
stext:
;-------------------------------------------------------------------
; Don't clobber r0-r4 yet. It might have bootloader provided info
; Don't clobber r0-r2 yet. It might have bootloader provided info
;-------------------------------------------------------------------

sr @_int_vec_base_lds, [AUX_INTR_VEC_BASE]

#ifdef CONFIG_SMP
; Only Boot (Master) proceeds. Others wait in platform dependent way
; Ensure Boot (Master) proceeds. Others wait in platform dependent way
; IDENTITY Reg [ 3 2 1 0 ]
; (cpu-id) ^^^ => Zero for UP ARC700
; => #Core-ID if SMP (Master 0)
Expand All @@ -39,7 +39,8 @@ stext:
; need to make sure only boot cpu takes this path.
GET_CPU_ID r5
cmp r5, 0
jnz arc_platform_smp_wait_to_boot
mov.ne r0, r5
jne arc_platform_smp_wait_to_boot
#endif
; Clear BSS before updating any globals
; XXX: use ZOL here
Expand Down
37 changes: 16 additions & 21 deletions arch/arc/kernel/time.c
Original file line number Diff line number Diff line change
Expand Up @@ -155,22 +155,6 @@ static void arc_timer_event_setup(unsigned int limit)
write_aux_reg(ARC_REG_TIMER0_CTRL, TIMER_CTRL_IE | TIMER_CTRL_NH);
}

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

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

static irqreturn_t timer_irq_handler(int irq, void *dev_id)
{
struct clock_event_device *clk = this_cpu_ptr(&arc_clockevent_device);
/*
* Note that generic IRQ core could have passed @evt for @dev_id if
* irq_set_chip_and_handler() asked for handle_percpu_devid_irq()
*/
struct clock_event_device *evt = this_cpu_ptr(&arc_clockevent_device);
int irq_reenable = evt->mode == CLOCK_EVT_MODE_PERIODIC;

/*
* Any write to CTRL reg ACks the interrupt, we rewrite the
* Count when [N]ot [H]alted bit.
* And re-arm it if perioid by [I]nterrupt [E]nable bit
*/
write_aux_reg(ARC_REG_TIMER0_CTRL, irq_reenable | TIMER_CTRL_NH);

evt->event_handler(evt);

arc_timer_event_ack(clk->mode == CLOCK_EVT_MODE_PERIODIC);
clk->event_handler(clk);
return IRQ_HANDLED;
}

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

/*
* Setup the local event timer for @cpu
* N.B. weak so that some exotic ARC SoCs can completely override it
*/
void __weak arc_local_timer_setup(unsigned int cpu)
void arc_local_timer_setup(unsigned int cpu)
{
struct clock_event_device *clk = &per_cpu(arc_clockevent_device, cpu);

Expand Down
Loading

0 comments on commit 3573d38

Please sign in to comment.