Skip to content

Commit 60f2b4b

Browse files
committed
ARC: [intc-compact] simplify code for 2 priority levels
ARC700 support for 2 interrupt priorities historically allowed even slow perpherals such as emac and uart to setup high priority interrupts which was wrong from the beginning as they could possibly delay the more critical timer interrupt. The hardware support for 2 level interrupts in ARCompact is less than ideal anyways (judging from the "hacks" in low level entry code and thus is not used in productions systems I know of. So reduce the scope of this to timer only, thereby reducing a bunch of complexity. Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
1 parent 49acadf commit 60f2b4b

3 files changed

Lines changed: 6 additions & 40 deletions

File tree

‎arch/arc/Kconfig‎

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -186,9 +186,6 @@ if SMP
186186
config ARC_HAS_COH_CACHES
187187
def_bool n
188188

189-
config ARC_HAS_REENTRANT_IRQ_LV2
190-
def_bool n
191-
192189
config ARC_MCIP
193190
bool "ARConnect Multicore IP (MCIP) Support "
194191
depends on ISA_ARCV2
@@ -366,25 +363,10 @@ config NODES_SHIFT
366363
if ISA_ARCOMPACT
367364

368365
config ARC_COMPACT_IRQ_LEVELS
369-
bool "ARCompact IRQ Priorities: High(2)/Low(1)"
366+
bool "Setup Timer IRQ as high Priority"
370367
default n
371-
# Timer HAS to be high priority, for any other high priority config
372-
select ARC_IRQ3_LV2
373368
# if SMP, LV2 enabled ONLY if ARC implementation has LV2 re-entrancy
374-
depends on !SMP || ARC_HAS_REENTRANT_IRQ_LV2
375-
376-
if ARC_COMPACT_IRQ_LEVELS
377-
378-
config ARC_IRQ3_LV2
379-
bool
380-
381-
config ARC_IRQ5_LV2
382-
bool
383-
384-
config ARC_IRQ6_LV2
385-
bool
386-
387-
endif #ARC_COMPACT_IRQ_LEVELS
369+
depends on !SMP
388370

389371
config ARC_FPU_SAVE_RESTORE
390372
bool "Enable FPU state persistence across context switch"

‎arch/arc/kernel/entry-compact.S‎

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -91,27 +91,13 @@ VECTOR mem_service ; 0x8, Mem exception (0x1)
9191
VECTOR instr_service ; 0x10, Instrn Error (0x2)
9292

9393
; ******************** Device ISRs **********************
94-
#ifdef CONFIG_ARC_IRQ3_LV2
95-
VECTOR handle_interrupt_level2
96-
#else
97-
VECTOR handle_interrupt_level1
98-
#endif
99-
100-
VECTOR handle_interrupt_level1
101-
102-
#ifdef CONFIG_ARC_IRQ5_LV2
103-
VECTOR handle_interrupt_level2
104-
#else
105-
VECTOR handle_interrupt_level1
106-
#endif
107-
108-
#ifdef CONFIG_ARC_IRQ6_LV2
94+
#ifdef CONFIG_ARC_COMPACT_IRQ_LEVELS
10995
VECTOR handle_interrupt_level2
11096
#else
11197
VECTOR handle_interrupt_level1
11298
#endif
11399

114-
.rept 25
100+
.rept 28
115101
VECTOR handle_interrupt_level1 ; Other devices
116102
.endr
117103

‎arch/arc/kernel/intc-compact.c‎

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,8 @@ void arc_init_IRQ(void)
2828
{
2929
int level_mask = 0;
3030

31-
/* setup any high priority Interrupts (Level2 in ARCompact jargon) */
32-
level_mask |= IS_ENABLED(CONFIG_ARC_IRQ3_LV2) << 3;
33-
level_mask |= IS_ENABLED(CONFIG_ARC_IRQ5_LV2) << 5;
34-
level_mask |= IS_ENABLED(CONFIG_ARC_IRQ6_LV2) << 6;
31+
/* Is timer high priority Interrupt (Level2 in ARCompact jargon) */
32+
level_mask |= IS_ENABLED(CONFIG_ARC_COMPACT_IRQ_LEVELS) << TIMER0_IRQ;
3533

3634
/*
3735
* Write to register, even if no LV2 IRQs configured to reset it

0 commit comments

Comments
 (0)