Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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

+158 -249
+1 -1
arch/arc/boot/dts/angel4.dts
··· 17 17 interrupt-parent = <&intc>; 18 18 19 19 chosen { 20 - bootargs = "console=ttyARC0,115200n8"; 20 + bootargs = "console=ttyARC0,115200n8 earlyprintk=ttyARC0"; 21 21 }; 22 22 23 23 aliases {
+27
arch/arc/include/asm/cache.h
··· 55 55 56 56 #endif /* !__ASSEMBLY__ */ 57 57 58 + /* Instruction cache related Auxiliary registers */ 59 + #define ARC_REG_IC_BCR 0x77 /* Build Config reg */ 60 + #define ARC_REG_IC_IVIC 0x10 61 + #define ARC_REG_IC_CTRL 0x11 62 + #define ARC_REG_IC_IVIL 0x19 63 + #if defined(CONFIG_ARC_MMU_V3) || defined (CONFIG_ARC_MMU_V4) 64 + #define ARC_REG_IC_PTAG 0x1E 65 + #endif 66 + 67 + /* Bit val in IC_CTRL */ 68 + #define IC_CTRL_CACHE_DISABLE 0x1 69 + 70 + /* Data cache related Auxiliary registers */ 71 + #define ARC_REG_DC_BCR 0x72 /* Build Config reg */ 72 + #define ARC_REG_DC_IVDC 0x47 73 + #define ARC_REG_DC_CTRL 0x48 74 + #define ARC_REG_DC_IVDL 0x4A 75 + #define ARC_REG_DC_FLSH 0x4B 76 + #define ARC_REG_DC_FLDL 0x4C 77 + #if defined(CONFIG_ARC_MMU_V3) || defined (CONFIG_ARC_MMU_V4) 78 + #define ARC_REG_DC_PTAG 0x5C 79 + #endif 80 + 81 + /* Bit val in DC_CTRL */ 82 + #define DC_CTRL_INV_MODE_FLUSH 0x40 83 + #define DC_CTRL_FLUSH_STATUS 0x100 84 + 58 85 #endif /* _ASM_CACHE_H */
+1 -3
arch/arc/include/asm/irq.h
··· 19 19 #include <asm-generic/irq.h> 20 20 21 21 extern void arc_init_IRQ(void); 22 - extern int get_hw_config_num_irq(void); 23 - 24 - void arc_local_timer_setup(unsigned int cpu); 22 + void arc_local_timer_setup(void); 25 23 26 24 #endif
+4 -25
arch/arc/include/asm/processor.h
··· 18 18 19 19 #ifndef __ASSEMBLY__ 20 20 21 - #include <asm/arcregs.h> /* for STATUS_E1_MASK et all */ 22 21 #include <asm/ptrace.h> 23 22 24 23 /* Arch specific stuff which needs to be saved per task. ··· 40 41 /* Forward declaration, a strange C thing */ 41 42 struct task_struct; 42 43 43 - /* 44 - * Return saved PC of a blocked thread. 45 - */ 44 + /* Return saved PC of a blocked thread */ 46 45 unsigned long thread_saved_pc(struct task_struct *t); 47 46 48 47 #define task_pt_regs(p) \ 49 48 ((struct pt_regs *)(THREAD_SIZE + (void *)task_stack_page(p)) - 1) 50 49 51 - /* Free all resources held by a thread. */ 50 + /* Free all resources held by a thread */ 52 51 #define release_thread(thread) do { } while (0) 53 52 54 53 /* Prepare to copy thread state - unlazy all lazy status */ ··· 79 82 #define KSTK_BLINK(tsk) KSTK_REG(tsk, 4) 80 83 #define KSTK_FP(tsk) KSTK_REG(tsk, 0) 81 84 82 - /* 83 - * Do necessary setup to start up a newly executed thread. 84 - * 85 - * E1,E2 so that Interrupts are enabled in user mode 86 - * L set, so Loop inhibited to begin with 87 - * lp_start and lp_end seeded with bogus non-zero values so to easily catch 88 - * the ARC700 sr to lp_start hardware bug 89 - */ 90 - #define start_thread(_regs, _pc, _usp) \ 91 - do { \ 92 - set_fs(USER_DS); /* reads from user space */ \ 93 - (_regs)->ret = (_pc); \ 94 - /* Interrupts enabled in User Mode */ \ 95 - (_regs)->status32 = STATUS_U_MASK | STATUS_L_MASK \ 96 - | STATUS_E1_MASK | STATUS_E2_MASK; \ 97 - (_regs)->sp = (_usp); \ 98 - /* bogus seed values for debugging */ \ 99 - (_regs)->lp_start = 0x10; \ 100 - (_regs)->lp_end = 0x80; \ 101 - } while (0) 85 + extern void start_thread(struct pt_regs * regs, unsigned long pc, 86 + unsigned long usp); 102 87 103 88 extern unsigned int get_wchan(struct task_struct *p); 104 89
-7
arch/arc/include/uapi/asm/Kbuild
··· 2 2 include include/uapi/asm-generic/Kbuild.asm 3 3 header-y += elf.h 4 4 header-y += page.h 5 - header-y += setup.h 6 - header-y += byteorder.h 7 5 header-y += cachectl.h 8 - header-y += ptrace.h 9 - header-y += sigcontext.h 10 - header-y += signal.h 11 - header-y += swab.h 12 - header-y += unistd.h
+6 -6
arch/arc/kernel/entry.S
··· 156 156 int1_saved_reg: 157 157 .zero 4 158 158 159 - /* Each Interrupt level needs it's own scratch */ 159 + /* Each Interrupt level needs its own scratch */ 160 160 #ifdef CONFIG_ARC_COMPACT_IRQ_LEVELS 161 161 162 162 ARCFP_DATA int2_saved_reg ··· 473 473 lr r0, [efa] 474 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 477 ; and get out of CPU exception mode 478 478 FAKE_RET_FROM_EXCPN r11 479 479 ··· 678 678 brne r9, event_IRQ2, 149f 679 679 680 680 ;------------------------------------------------------------------ 681 - ; if L2 IRQ interrupted a L1 ISR, we'd disbaled preemption earlier 682 - ; so that sched doesnt move to new task, causing L1 to be delayed 683 - ; undeterministically. Now that we've achieved that, lets reset 681 + ; if L2 IRQ interrupted an L1 ISR, we'd disabled preemption earlier 682 + ; so that sched doesn't move to new task, causing L1 to be delayed 683 + ; undeterministically. Now that we've achieved that, let's reset 684 684 ; things to what they were, before returning from L2 context 685 685 ;---------------------------------------------------------------- 686 686 ··· 736 736 ; put last task in scheduler queue 737 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 740 ld r9, [sp, PT_status32] 741 741 brne r9, 0, 1f 742 742
+35 -3
arch/arc/kernel/head.S
··· 12 12 * to skip certain things during boot on simulator 13 13 */ 14 14 15 + #include <linux/linkage.h> 15 16 #include <asm/asm-offsets.h> 16 17 #include <asm/entry.h> 17 - #include <linux/linkage.h> 18 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 + 37 + 1: 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 + 49 + 1: 50 + .endm 19 51 20 52 .cpu A7 21 53 ··· 59 27 ; Don't clobber r0-r2 yet. It might have bootloader provided info 60 28 ;------------------------------------------------------------------- 61 29 62 - sr @_int_vec_base_lds, [AUX_INTR_VEC_BASE] 30 + CPU_EARLY_SETUP 63 31 64 32 #ifdef CONFIG_SMP 65 33 ; Ensure Boot (Master) proceeds. Others wait in platform dependent way ··· 122 90 123 91 first_lines_of_secondary: 124 92 125 - sr @_int_vec_base_lds, [AUX_INTR_VEC_BASE] 93 + CPU_EARLY_SETUP 126 94 127 95 ; setup per-cpu idle task as "current" on this CPU 128 96 ld r0, [@secondary_idle_tsk]
-18
arch/arc/kernel/irq.c
··· 150 150 set_irq_regs(old_regs); 151 151 } 152 152 153 - int 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 154 * arch_local_irq_enable - Enable interrupts. 173 155 *
+23
arch/arc/kernel/process.c
··· 151 151 } 152 152 153 153 /* 154 + * Do necessary setup to start up a new user task 155 + */ 156 + void 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 177 * Some archs flush debug and FPU info here 155 178 */ 156 179 void flush_thread(void)
+1 -1
arch/arc/kernel/smp.c
··· 138 138 if (machine_desc->init_smp) 139 139 machine_desc->init_smp(smp_processor_id()); 140 140 141 - arc_local_timer_setup(cpu); 141 + arc_local_timer_setup(); 142 142 143 143 local_irq_enable(); 144 144 preempt_disable();
+6 -5
arch/arc/kernel/time.c
··· 219 219 /* 220 220 * Setup the local event timer for @cpu 221 221 */ 222 - void arc_local_timer_setup(unsigned int cpu) 222 + void 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 - clockevents_config_and_register(clk, arc_get_core_freq(), 227 + evt->cpumask = cpumask_of(cpu); 228 + clockevents_config_and_register(evt, arc_get_core_freq(), 228 229 0, ARC_TIMER_MAX); 229 230 230 231 /* ··· 262 261 clocksource_register_hz(&arc_counter, arc_get_core_freq()); 263 262 264 263 /* sets up the periodic event timer */ 265 - arc_local_timer_setup(smp_processor_id()); 264 + arc_local_timer_setup(); 266 265 267 266 if (machine_desc->init_time) 268 267 machine_desc->init_time();
+29 -81
arch/arc/mm/cache_arc700.c
··· 73 73 #include <asm/cachectl.h> 74 74 #include <asm/setup.h> 75 75 76 - /* Instruction cache related Auxiliary registers */ 77 - #define ARC_REG_IC_BCR 0x77 /* Build Config reg */ 78 - #define ARC_REG_IC_IVIC 0x10 79 - #define ARC_REG_IC_CTRL 0x11 80 - #define ARC_REG_IC_IVIL 0x19 81 - #if (CONFIG_ARC_MMU_VER > 2) 82 - #define ARC_REG_IC_PTAG 0x1E 83 - #endif 84 - 85 - /* Bit val in IC_CTRL */ 86 - #define IC_CTRL_CACHE_DISABLE 0x1 87 - 88 - /* Data cache related Auxiliary registers */ 89 - #define ARC_REG_DC_BCR 0x72 /* Build Config reg */ 90 - #define ARC_REG_DC_IVDC 0x47 91 - #define ARC_REG_DC_CTRL 0x48 92 - #define ARC_REG_DC_IVDL 0x4A 93 - #define ARC_REG_DC_FLSH 0x4B 94 - #define ARC_REG_DC_FLDL 0x4C 95 - #if (CONFIG_ARC_MMU_VER > 2) 96 - #define ARC_REG_DC_PTAG 0x5C 97 - #endif 98 - 99 - /* Bit val in DC_CTRL */ 100 - #define DC_CTRL_INV_MODE_FLUSH 0x40 101 - #define DC_CTRL_FLUSH_STATUS 0x100 102 - 103 76 char *arc_cache_mumbojumbo(int c, char *buf, int len) 104 77 { 105 78 int n = 0; ··· 141 168 */ 142 169 void arc_cache_init(void) 143 170 { 144 - unsigned int cpu = smp_processor_id(); 145 - struct cpuinfo_arc_cache *ic = &cpuinfo_arc700[cpu].icache; 146 - struct cpuinfo_arc_cache *dc = &cpuinfo_arc700[cpu].dcache; 147 - unsigned int dcache_does_alias, temp; 171 + unsigned int __maybe_unused cpu = smp_processor_id(); 172 + struct cpuinfo_arc_cache __maybe_unused *ic, __maybe_unused *dc; 148 173 char str[256]; 149 174 150 175 printk(arc_cache_mumbojumbo(0, str, sizeof(str))); 151 176 152 - if (!ic->ver) 153 - goto chk_dc; 154 - 155 177 #ifdef CONFIG_ARC_HAS_ICACHE 156 - /* 1. Confirm some of I-cache params which Linux assumes */ 157 - if (ic->line_len != L1_CACHE_BYTES) 158 - panic("Cache H/W doesn't match kernel Config"); 178 + ic = &cpuinfo_arc700[cpu].icache; 179 + if (ic->ver) { 180 + if (ic->line_len != L1_CACHE_BYTES) 181 + panic("ICache line [%d] != kernel Config [%d]", 182 + ic->line_len, L1_CACHE_BYTES); 159 183 160 - if (ic->ver != CONFIG_ARC_MMU_VER) 161 - panic("Cache ver doesn't match MMU ver\n"); 184 + if (ic->ver != CONFIG_ARC_MMU_VER) 185 + panic("Cache ver [%d] doesn't match MMU ver [%d]\n", 186 + ic->ver, CONFIG_ARC_MMU_VER); 187 + } 162 188 #endif 163 - 164 - /* Enable/disable I-Cache */ 165 - temp = read_aux_reg(ARC_REG_IC_CTRL); 166 - 167 - #ifdef CONFIG_ARC_HAS_ICACHE 168 - temp &= ~IC_CTRL_CACHE_DISABLE; 169 - #else 170 - temp |= IC_CTRL_CACHE_DISABLE; 171 - #endif 172 - 173 - write_aux_reg(ARC_REG_IC_CTRL, temp); 174 - 175 - chk_dc: 176 - if (!dc->ver) 177 - return; 178 189 179 190 #ifdef CONFIG_ARC_HAS_DCACHE 180 - if (dc->line_len != L1_CACHE_BYTES) 181 - panic("Cache H/W doesn't match kernel Config"); 191 + dc = &cpuinfo_arc700[cpu].dcache; 192 + if (dc->ver) { 193 + unsigned int dcache_does_alias; 182 194 183 - /* check for D-Cache aliasing */ 184 - dcache_does_alias = (dc->sz / dc->assoc) > PAGE_SIZE; 195 + if (dc->line_len != L1_CACHE_BYTES) 196 + panic("DCache line [%d] != kernel Config [%d]", 197 + dc->line_len, L1_CACHE_BYTES); 185 198 186 - if (dcache_does_alias && !cache_is_vipt_aliasing()) 187 - panic("Enable CONFIG_ARC_CACHE_VIPT_ALIASING\n"); 188 - else if (!dcache_does_alias && cache_is_vipt_aliasing()) 189 - panic("Don't need CONFIG_ARC_CACHE_VIPT_ALIASING\n"); 199 + /* check for D-Cache aliasing */ 200 + dcache_does_alias = (dc->sz / dc->assoc) > PAGE_SIZE; 201 + 202 + if (dcache_does_alias && !cache_is_vipt_aliasing()) 203 + panic("Enable CONFIG_ARC_CACHE_VIPT_ALIASING\n"); 204 + else if (!dcache_does_alias && cache_is_vipt_aliasing()) 205 + panic("Don't need CONFIG_ARC_CACHE_VIPT_ALIASING\n"); 206 + } 190 207 #endif 191 - 192 - /* Set the default Invalidate Mode to "simpy discard dirty lines" 193 - * as this is more frequent then flush before invalidate 194 - * Ofcourse we toggle this default behviour when desired 195 - */ 196 - temp = read_aux_reg(ARC_REG_DC_CTRL); 197 - temp &= ~DC_CTRL_INV_MODE_FLUSH; 198 - 199 - #ifdef CONFIG_ARC_HAS_DCACHE 200 - /* Enable D-Cache: Clear Bit 0 */ 201 - write_aux_reg(ARC_REG_DC_CTRL, temp & ~IC_CTRL_CACHE_DISABLE); 202 - #else 203 - /* Flush D cache */ 204 - write_aux_reg(ARC_REG_DC_FLSH, 0x1); 205 - /* Disable D cache */ 206 - write_aux_reg(ARC_REG_DC_CTRL, temp | IC_CTRL_CACHE_DISABLE); 207 - #endif 208 - 209 - return; 210 208 } 211 209 212 210 #define OP_INV 0x1 ··· 197 253 198 254 if (cacheop == OP_INV_IC) { 199 255 aux_cmd = ARC_REG_IC_IVIL; 256 + #if (CONFIG_ARC_MMU_VER > 2) 200 257 aux_tag = ARC_REG_IC_PTAG; 258 + #endif 201 259 } 202 260 else { 203 261 /* d$ cmd: INV (discard or wback-n-discard) OR FLUSH (wback) */ 204 262 aux_cmd = cacheop & OP_INV ? ARC_REG_DC_IVDL : ARC_REG_DC_FLDL; 263 + #if (CONFIG_ARC_MMU_VER > 2) 205 264 aux_tag = ARC_REG_DC_PTAG; 265 + #endif 206 266 } 207 267 208 268 /* Ensure we properly floor/ceil the non-line aligned/sized requests
-32
arch/arc/plat-arcfpga/Kconfig
··· 48 48 help 49 49 Baud rate for the ARC UART 50 50 51 - menuconfig ARC_HAS_BVCI_LAT_UNIT 52 - bool "BVCI Bus Latency Unit" 53 - depends on ARC_BOARD_ML509 || ARC_BOARD_ANGEL4 54 - help 55 - IP to add artificial latency to BVCI Bus Based FPGA builds. 56 - The default latency (even worst case) for FPGA is non-realistic 57 - (~10 SDRAM, ~5 SSRAM). 58 - 59 - config BVCI_LAT_UNITS 60 - hex "Latency Unit(s) Bitmap" 61 - default "0x0" 62 - depends on ARC_HAS_BVCI_LAT_UNIT 63 - help 64 - There are multiple Latency Units corresponding to the many 65 - interfaces of the system bus arbiter (both CPU side as well as 66 - the peripheral side). 67 - To add latency to ALL memory transaction, choose Unit 0, otherwise 68 - for finer grainer - interface wise latency, specify a bitmap (1 bit 69 - per unit) of all units. e.g. 1,2,12 will be 0x1003 70 - 71 - Unit 0 - System Arb and Mem Controller 72 - Unit 1 - I$ and System Bus 73 - Unit 2 - D$ and System Bus 74 - .. 75 - Unit 12 - IDE Disk controller and System Bus 76 - 77 - config BVCI_LAT_CYCLES 78 - int "Latency Value in cycles" 79 - range 0 63 80 - default "30" 81 - depends on ARC_HAS_BVCI_LAT_UNIT 82 - 83 51 endif
+1 -1
arch/arc/plat-arcfpga/Makefile
··· 9 9 KBUILD_CFLAGS += -Iarch/arc/plat-arcfpga/include 10 10 11 11 obj-y := platform.o irq.o 12 - obj-$(CONFIG_SMP) += smp.o 12 + obj-$(CONFIG_ISS_SMP_EXTN) += smp.o
+6 -66
arch/arc/plat-arcfpga/platform.c
··· 22 22 #include <plat/smp.h> 23 23 #include <plat/irq.h> 24 24 25 - /*-----------------------BVCI Latency Unit -----------------------------*/ 26 - 27 - #ifdef CONFIG_ARC_HAS_BVCI_LAT_UNIT 28 - 29 - int lat_cycles = CONFIG_BVCI_LAT_CYCLES; 30 - 31 - /* BVCI Bus Profiler: Latency Unit */ 32 - static void __init setup_bvci_lat_unit(void) 33 - { 34 - #define MAX_BVCI_UNITS 12 35 - 36 - unsigned int i; 37 - unsigned int *base = (unsigned int *)BVCI_LAT_UNIT_BASE; 38 - const unsigned long units_req = CONFIG_BVCI_LAT_UNITS; 39 - const unsigned int REG_UNIT = 21; 40 - const unsigned int REG_VAL = 22; 41 - 42 - /* 43 - * There are multiple Latency Units corresponding to the many 44 - * interfaces of the system bus arbiter (both CPU side as well as 45 - * the peripheral side). 46 - * 47 - * Unit 0 - System Arb and Mem Controller - adds latency to all 48 - * memory trasactions 49 - * Unit 1 - I$ and System Bus 50 - * Unit 2 - D$ and System Bus 51 - * .. 52 - * Unit 12 - IDE Disk controller and System Bus 53 - * 54 - * The programmers model requires writing to lat_unit reg first 55 - * and then the latency value (cycles) to lat_value reg 56 - */ 57 - 58 - if (CONFIG_BVCI_LAT_UNITS == 0) { 59 - writel(0, base + REG_UNIT); 60 - writel(lat_cycles, base + REG_VAL); 61 - pr_info("BVCI Latency for all Memory Transactions %d cycles\n", 62 - lat_cycles); 63 - } else { 64 - for_each_set_bit(i, &units_req, MAX_BVCI_UNITS) { 65 - writel(i + 1, base + REG_UNIT); /* loop is 0 based */ 66 - writel(lat_cycles, base + REG_VAL); 67 - pr_info("BVCI Latency for Unit[%d] = %d cycles\n", 68 - (i + 1), lat_cycles); 69 - } 70 - } 71 - } 72 - #else 73 - static void __init setup_bvci_lat_unit(void) 74 - { 75 - } 76 - #endif 77 - 78 25 /*----------------------- Platform Devices -----------------------------*/ 79 26 80 27 #if IS_ENABLED(CONFIG_SERIAL_ARC) ··· 79 132 ARRAY_SIZE(fpga_early_devs)); 80 133 81 134 /* 82 - * ARC console driver registers itself as an early platform driver 83 - * of class "earlyprintk". 84 - * Install it here, followed by probe of devices. 85 - * The installation here doesn't require earlyprintk in command line 86 - * To do so however, replace the lines below with 87 - * parse_early_param(); 88 - * early_platform_driver_probe("earlyprintk", 1, 1); 89 - * ^^ 135 + * ARC console driver registers (build time) as an early platform driver 136 + * of class "earlyprintk". However it needs explicit cmdline toggle 137 + * "earlyprintk=ttyARC0" to be successfuly runtime registered. 138 + * Otherwise the early probe below fails to find the driver 90 139 */ 91 - early_platform_driver_register_all("earlyprintk"); 92 140 early_platform_driver_probe("earlyprintk", 1, 0); 93 141 94 142 /* ··· 107 165 { 108 166 pr_info("[plat-arcfpga]: registering early dev resources\n"); 109 167 110 - setup_bvci_lat_unit(); 111 - 112 168 arc_fpga_serial_init(); 113 169 114 - #ifdef CONFIG_SMP 170 + #ifdef CONFIG_ISS_SMP_EXTN 115 171 iss_model_init_early_smp(); 116 172 #endif 117 173 } ··· 151 211 .init_early = plat_fpga_early_init, 152 212 .init_machine = plat_fpga_populate_dev, 153 213 .init_irq = plat_fpga_init_IRQ, 154 - #ifdef CONFIG_SMP 214 + #ifdef CONFIG_ISS_SMP_EXTN 155 215 .init_smp = iss_model_init_smp, 156 216 #endif 157 217 MACHINE_END
+18
arch/arc/plat-arcfpga/smp.c
··· 42 42 43 43 } 44 44 45 + static inline int get_hw_config_num_irq(void) 46 + { 47 + uint32_t val = read_aux_reg(ARC_REG_VECBASE_BCR); 48 + 49 + switch (val & 0x03) { 50 + case 0: 51 + return 16; 52 + case 1: 53 + return 32; 54 + case 2: 55 + return 8; 56 + default: 57 + return 0; 58 + } 59 + 60 + return 0; 61 + } 62 + 45 63 /* 46 64 * Any SMP specific init any CPU does when it comes up. 47 65 * Here we setup the CPU to enable Inter-Processor-Interrupts