aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2016-02-13 11:18:21 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2016-02-13 11:18:21 -0500
commite835a65f7ab143acf9aee6f9a98ef1c7afd2a835 (patch)
tree298e2dfb1737508f2f7f2cd026ca50d86387e628
parent0cbb0b92689a1c4e0ac55f6188be563a813ac808 (diff)
parent37eda9df5bd8444263418495632ea6ec750f03f9 (diff)
Merge tag 'arc-4.5-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/vgupta/arc
Pull ARC fixes from Vineet Gupta: "I've been sitting on some of these fixes for a while. - Corner case of returning to delay slot from interrupt - Changing default interrupt prioiry level - Kconfig'ize support for super pages - Other minor fixes" * tag 'arc-4.5-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/vgupta/arc: ARC: mm: Introduce explicit super page size support ARCv2: intc: Allow interruption by lowest priority interrupt ARCv2: Check for LL-SC livelock only if LLSC is enabled ARC: shrink cpuinfo by not saving full timer BCR ARCv2: clocksource: Rename GRTC -> GFRC ... ARCv2: STAR 9000950267: Handle return from intr to Delay Slot #2
-rw-r--r--arch/arc/Kconfig21
-rw-r--r--arch/arc/configs/vdk_hs38_smp_defconfig2
-rw-r--r--arch/arc/include/asm/arcregs.h3
-rw-r--r--arch/arc/include/asm/irqflags-arcv2.h7
-rw-r--r--arch/arc/include/asm/mcip.h4
-rw-r--r--arch/arc/include/asm/pgtable.h45
-rw-r--r--arch/arc/kernel/entry-arcv2.S19
-rw-r--r--arch/arc/kernel/intc-arcv2.c41
-rw-r--r--arch/arc/kernel/mcip.c10
-rw-r--r--arch/arc/kernel/setup.c20
-rw-r--r--arch/arc/kernel/time.c8
11 files changed, 119 insertions, 61 deletions
diff --git a/arch/arc/Kconfig b/arch/arc/Kconfig
index 76dde9db7934..0655495470ad 100644
--- a/arch/arc/Kconfig
+++ b/arch/arc/Kconfig
@@ -338,6 +338,19 @@ config ARC_PAGE_SIZE_4K
338 338
339endchoice 339endchoice
340 340
341choice
342 prompt "MMU Super Page Size"
343 depends on ISA_ARCV2 && TRANSPARENT_HUGEPAGE
344 default ARC_HUGEPAGE_2M
345
346config ARC_HUGEPAGE_2M
347 bool "2MB"
348
349config ARC_HUGEPAGE_16M
350 bool "16MB"
351
352endchoice
353
341if ISA_ARCOMPACT 354if ISA_ARCOMPACT
342 355
343config ARC_COMPACT_IRQ_LEVELS 356config ARC_COMPACT_IRQ_LEVELS
@@ -410,7 +423,7 @@ config ARC_HAS_RTC
410 default n 423 default n
411 depends on !SMP 424 depends on !SMP
412 425
413config ARC_HAS_GRTC 426config ARC_HAS_GFRC
414 bool "SMP synchronized 64-bit cycle counter" 427 bool "SMP synchronized 64-bit cycle counter"
415 default y 428 default y
416 depends on SMP 429 depends on SMP
@@ -566,6 +579,12 @@ endmenu
566endmenu # "ARC Architecture Configuration" 579endmenu # "ARC Architecture Configuration"
567 580
568source "mm/Kconfig" 581source "mm/Kconfig"
582
583config FORCE_MAX_ZONEORDER
584 int "Maximum zone order"
585 default "12" if ARC_HUGEPAGE_16M
586 default "11"
587
569source "net/Kconfig" 588source "net/Kconfig"
570source "drivers/Kconfig" 589source "drivers/Kconfig"
571source "fs/Kconfig" 590source "fs/Kconfig"
diff --git a/arch/arc/configs/vdk_hs38_smp_defconfig b/arch/arc/configs/vdk_hs38_smp_defconfig
index f36c047b33ca..735985974a31 100644
--- a/arch/arc/configs/vdk_hs38_smp_defconfig
+++ b/arch/arc/configs/vdk_hs38_smp_defconfig
@@ -16,7 +16,7 @@ CONFIG_ARC_PLAT_AXS10X=y
16CONFIG_AXS103=y 16CONFIG_AXS103=y
17CONFIG_ISA_ARCV2=y 17CONFIG_ISA_ARCV2=y
18CONFIG_SMP=y 18CONFIG_SMP=y
19# CONFIG_ARC_HAS_GRTC is not set 19# CONFIG_ARC_HAS_GFRC is not set
20CONFIG_ARC_UBOOT_SUPPORT=y 20CONFIG_ARC_UBOOT_SUPPORT=y
21CONFIG_ARC_BUILTIN_DTB_NAME="vdk_hs38_smp" 21CONFIG_ARC_BUILTIN_DTB_NAME="vdk_hs38_smp"
22CONFIG_PREEMPT=y 22CONFIG_PREEMPT=y
diff --git a/arch/arc/include/asm/arcregs.h b/arch/arc/include/asm/arcregs.h
index 7fac7d85ed6a..fdc5be5b1029 100644
--- a/arch/arc/include/asm/arcregs.h
+++ b/arch/arc/include/asm/arcregs.h
@@ -349,14 +349,13 @@ struct cpuinfo_arc {
349 struct cpuinfo_arc_bpu bpu; 349 struct cpuinfo_arc_bpu bpu;
350 struct bcr_identity core; 350 struct bcr_identity core;
351 struct bcr_isa isa; 351 struct bcr_isa isa;
352 struct bcr_timer timers;
353 unsigned int vec_base; 352 unsigned int vec_base;
354 struct cpuinfo_arc_ccm iccm, dccm; 353 struct cpuinfo_arc_ccm iccm, dccm;
355 struct { 354 struct {
356 unsigned int swap:1, norm:1, minmax:1, barrel:1, crc:1, pad1:3, 355 unsigned int swap:1, norm:1, minmax:1, barrel:1, crc:1, pad1:3,
357 fpu_sp:1, fpu_dp:1, pad2:6, 356 fpu_sp:1, fpu_dp:1, pad2:6,
358 debug:1, ap:1, smart:1, rtt:1, pad3:4, 357 debug:1, ap:1, smart:1, rtt:1, pad3:4,
359 pad4:8; 358 timer0:1, timer1:1, rtc:1, gfrc:1, pad4:4;
360 } extn; 359 } extn;
361 struct bcr_mpy extn_mpy; 360 struct bcr_mpy extn_mpy;
362 struct bcr_extn_xymem extn_xymem; 361 struct bcr_extn_xymem extn_xymem;
diff --git a/arch/arc/include/asm/irqflags-arcv2.h b/arch/arc/include/asm/irqflags-arcv2.h
index 258b0e5ad332..1fc18ee06cf2 100644
--- a/arch/arc/include/asm/irqflags-arcv2.h
+++ b/arch/arc/include/asm/irqflags-arcv2.h
@@ -30,8 +30,11 @@
30/* Was Intr taken in User Mode */ 30/* Was Intr taken in User Mode */
31#define AUX_IRQ_ACT_BIT_U 31 31#define AUX_IRQ_ACT_BIT_U 31
32 32
33/* 0 is highest level, but taken by FIRQs, if present in design */ 33/*
34#define ARCV2_IRQ_DEF_PRIO 0 34 * User space should be interruptable even by lowest prio interrupt
35 * Safe even if actual interrupt priorities is fewer or even one
36 */
37#define ARCV2_IRQ_DEF_PRIO 15
35 38
36/* seed value for status register */ 39/* seed value for status register */
37#define ISA_INIT_STATUS_BITS (STATUS_IE_MASK | STATUS_AD_MASK | \ 40#define ISA_INIT_STATUS_BITS (STATUS_IE_MASK | STATUS_AD_MASK | \
diff --git a/arch/arc/include/asm/mcip.h b/arch/arc/include/asm/mcip.h
index 46f4e5351b2a..847e3bbe387f 100644
--- a/arch/arc/include/asm/mcip.h
+++ b/arch/arc/include/asm/mcip.h
@@ -39,8 +39,8 @@ struct mcip_cmd {
39#define CMD_DEBUG_SET_MASK 0x34 39#define CMD_DEBUG_SET_MASK 0x34
40#define CMD_DEBUG_SET_SELECT 0x36 40#define CMD_DEBUG_SET_SELECT 0x36
41 41
42#define CMD_GRTC_READ_LO 0x42 42#define CMD_GFRC_READ_LO 0x42
43#define CMD_GRTC_READ_HI 0x43 43#define CMD_GFRC_READ_HI 0x43
44 44
45#define CMD_IDU_ENABLE 0x71 45#define CMD_IDU_ENABLE 0x71
46#define CMD_IDU_DISABLE 0x72 46#define CMD_IDU_DISABLE 0x72
diff --git a/arch/arc/include/asm/pgtable.h b/arch/arc/include/asm/pgtable.h
index 57af2f05ae84..d426d4215513 100644
--- a/arch/arc/include/asm/pgtable.h
+++ b/arch/arc/include/asm/pgtable.h
@@ -179,37 +179,44 @@
179#define __S111 PAGE_U_X_W_R 179#define __S111 PAGE_U_X_W_R
180 180
181/**************************************************************** 181/****************************************************************
182 * Page Table Lookup split 182 * 2 tier (PGD:PTE) software page walker
183 * 183 *
184 * We implement 2 tier paging and since this is all software, we are free 184 * [31] 32 bit virtual address [0]
185 * to customize the span of a PGD / PTE entry to suit us
186 *
187 * 32 bit virtual address
188 * ------------------------------------------------------- 185 * -------------------------------------------------------
189 * | BITS_FOR_PGD | BITS_FOR_PTE | BITS_IN_PAGE | 186 * | | <------------ PGDIR_SHIFT ----------> |
187 * | | |
188 * | BITS_FOR_PGD | BITS_FOR_PTE | <-- PAGE_SHIFT --> |
190 * ------------------------------------------------------- 189 * -------------------------------------------------------
191 * | | | 190 * | | |
192 * | | --> off in page frame 191 * | | --> off in page frame
193 * | |
194 * | ---> index into Page Table 192 * | ---> index into Page Table
195 * |
196 * ----> index into Page Directory 193 * ----> index into Page Directory
194 *
195 * In a single page size configuration, only PAGE_SHIFT is fixed
196 * So both PGD and PTE sizing can be tweaked
197 * e.g. 8K page (PAGE_SHIFT 13) can have
198 * - PGDIR_SHIFT 21 -> 11:8:13 address split
199 * - PGDIR_SHIFT 24 -> 8:11:13 address split
200 *
201 * If Super Page is configured, PGDIR_SHIFT becomes fixed too,
202 * so the sizing flexibility is gone.
197 */ 203 */
198 204
199#define BITS_IN_PAGE PAGE_SHIFT 205#if defined(CONFIG_ARC_HUGEPAGE_16M)
200 206#define PGDIR_SHIFT 24
201/* Optimal Sizing of Pg Tbl - based on MMU page size */ 207#elif defined(CONFIG_ARC_HUGEPAGE_2M)
202#if defined(CONFIG_ARC_PAGE_SIZE_8K) 208#define PGDIR_SHIFT 21
203#define BITS_FOR_PTE 8 /* 11:8:13 */ 209#else
204#elif defined(CONFIG_ARC_PAGE_SIZE_16K) 210/*
205#define BITS_FOR_PTE 8 /* 10:8:14 */ 211 * Only Normal page support so "hackable" (see comment above)
206#elif defined(CONFIG_ARC_PAGE_SIZE_4K) 212 * Default value provides 11:8:13 (8K), 11:9:12 (4K)
207#define BITS_FOR_PTE 9 /* 11:9:12 */ 213 */
214#define PGDIR_SHIFT 21
208#endif 215#endif
209 216
210#define BITS_FOR_PGD (32 - BITS_FOR_PTE - BITS_IN_PAGE) 217#define BITS_FOR_PTE (PGDIR_SHIFT - PAGE_SHIFT)
218#define BITS_FOR_PGD (32 - PGDIR_SHIFT)
211 219
212#define PGDIR_SHIFT (32 - BITS_FOR_PGD)
213#define PGDIR_SIZE (1UL << PGDIR_SHIFT) /* vaddr span, not PDG sz */ 220#define PGDIR_SIZE (1UL << PGDIR_SHIFT) /* vaddr span, not PDG sz */
214#define PGDIR_MASK (~(PGDIR_SIZE-1)) 221#define PGDIR_MASK (~(PGDIR_SIZE-1))
215 222
diff --git a/arch/arc/kernel/entry-arcv2.S b/arch/arc/kernel/entry-arcv2.S
index cbfec79137bf..b17830294706 100644
--- a/arch/arc/kernel/entry-arcv2.S
+++ b/arch/arc/kernel/entry-arcv2.S
@@ -211,7 +211,11 @@ debug_marker_syscall:
211; (since IRQ NOT allowed in DS in ARCv2, this can only happen if orig 211; (since IRQ NOT allowed in DS in ARCv2, this can only happen if orig
212; entry was via Exception in DS which got preempted in kernel). 212; entry was via Exception in DS which got preempted in kernel).
213; 213;
214; IRQ RTIE won't reliably restore DE bit and/or BTA, needs handling 214; IRQ RTIE won't reliably restore DE bit and/or BTA, needs workaround
215;
216; Solution is return from Intr w/o any delay slot quirks into a kernel trampoline
217; and from pure kernel mode return to delay slot which handles DS bit/BTA correctly
218
215.Lintr_ret_to_delay_slot: 219.Lintr_ret_to_delay_slot:
216debug_marker_ds: 220debug_marker_ds:
217 221
@@ -222,18 +226,23 @@ debug_marker_ds:
222 ld r2, [sp, PT_ret] 226 ld r2, [sp, PT_ret]
223 ld r3, [sp, PT_status32] 227 ld r3, [sp, PT_status32]
224 228
229 ; STAT32 for Int return created from scratch
230 ; (No delay dlot, disable Further intr in trampoline)
231
225 bic r0, r3, STATUS_U_MASK|STATUS_DE_MASK|STATUS_IE_MASK|STATUS_L_MASK 232 bic r0, r3, STATUS_U_MASK|STATUS_DE_MASK|STATUS_IE_MASK|STATUS_L_MASK
226 st r0, [sp, PT_status32] 233 st r0, [sp, PT_status32]
227 234
228 mov r1, .Lintr_ret_to_delay_slot_2 235 mov r1, .Lintr_ret_to_delay_slot_2
229 st r1, [sp, PT_ret] 236 st r1, [sp, PT_ret]
230 237
238 ; Orig exception PC/STAT32 safekept @orig_r0 and @event stack slots
231 st r2, [sp, 0] 239 st r2, [sp, 0]
232 st r3, [sp, 4] 240 st r3, [sp, 4]
233 241
234 b .Lisr_ret_fast_path 242 b .Lisr_ret_fast_path
235 243
236.Lintr_ret_to_delay_slot_2: 244.Lintr_ret_to_delay_slot_2:
245 ; Trampoline to restore orig exception PC/STAT32/BTA/AUX_USER_SP
237 sub sp, sp, SZ_PT_REGS 246 sub sp, sp, SZ_PT_REGS
238 st r9, [sp, -4] 247 st r9, [sp, -4]
239 248
@@ -243,11 +252,19 @@ debug_marker_ds:
243 ld r9, [sp, 4] 252 ld r9, [sp, 4]
244 sr r9, [erstatus] 253 sr r9, [erstatus]
245 254
255 ; restore AUX_USER_SP if returning to U mode
256 bbit0 r9, STATUS_U_BIT, 1f
257 ld r9, [sp, PT_sp]
258 sr r9, [AUX_USER_SP]
259
2601:
246 ld r9, [sp, 8] 261 ld r9, [sp, 8]
247 sr r9, [erbta] 262 sr r9, [erbta]
248 263
249 ld r9, [sp, -4] 264 ld r9, [sp, -4]
250 add sp, sp, SZ_PT_REGS 265 add sp, sp, SZ_PT_REGS
266
267 ; return from pure kernel mode to delay slot
251 rtie 268 rtie
252 269
253END(ret_from_exception) 270END(ret_from_exception)
diff --git a/arch/arc/kernel/intc-arcv2.c b/arch/arc/kernel/intc-arcv2.c
index 0394f9f61b46..942526322ae7 100644
--- a/arch/arc/kernel/intc-arcv2.c
+++ b/arch/arc/kernel/intc-arcv2.c
@@ -14,6 +14,8 @@
14#include <linux/irqchip.h> 14#include <linux/irqchip.h>
15#include <asm/irq.h> 15#include <asm/irq.h>
16 16
17static int irq_prio;
18
17/* 19/*
18 * Early Hardware specific Interrupt setup 20 * Early Hardware specific Interrupt setup
19 * -Called very early (start_kernel -> setup_arch -> setup_processor) 21 * -Called very early (start_kernel -> setup_arch -> setup_processor)
@@ -24,6 +26,14 @@ void arc_init_IRQ(void)
24{ 26{
25 unsigned int tmp; 27 unsigned int tmp;
26 28
29 struct irq_build {
30#ifdef CONFIG_CPU_BIG_ENDIAN
31 unsigned int pad:3, firq:1, prio:4, exts:8, irqs:8, ver:8;
32#else
33 unsigned int ver:8, irqs:8, exts:8, prio:4, firq:1, pad:3;
34#endif
35 } irq_bcr;
36
27 struct aux_irq_ctrl { 37 struct aux_irq_ctrl {
28#ifdef CONFIG_CPU_BIG_ENDIAN 38#ifdef CONFIG_CPU_BIG_ENDIAN
29 unsigned int res3:18, save_idx_regs:1, res2:1, 39 unsigned int res3:18, save_idx_regs:1, res2:1,
@@ -46,28 +56,25 @@ void arc_init_IRQ(void)
46 56
47 WRITE_AUX(AUX_IRQ_CTRL, ictrl); 57 WRITE_AUX(AUX_IRQ_CTRL, ictrl);
48 58
49 /* setup status32, don't enable intr yet as kernel doesn't want */
50 tmp = read_aux_reg(0xa);
51 tmp |= ISA_INIT_STATUS_BITS;
52 tmp &= ~STATUS_IE_MASK;
53 asm volatile("flag %0 \n"::"r"(tmp));
54
55 /* 59 /*
56 * ARCv2 core intc provides multiple interrupt priorities (upto 16). 60 * ARCv2 core intc provides multiple interrupt priorities (upto 16).
57 * Typical builds though have only two levels (0-high, 1-low) 61 * Typical builds though have only two levels (0-high, 1-low)
58 * Linux by default uses lower prio 1 for most irqs, reserving 0 for 62 * Linux by default uses lower prio 1 for most irqs, reserving 0 for
59 * NMI style interrupts in future (say perf) 63 * NMI style interrupts in future (say perf)
60 *
61 * Read the intc BCR to confirm that Linux default priority is avail
62 * in h/w
63 *
64 * Note:
65 * IRQ_BCR[27..24] contains N-1 (for N priority levels) and prio level
66 * is 0 based.
67 */ 64 */
68 tmp = (read_aux_reg(ARC_REG_IRQ_BCR) >> 24 ) & 0xF; 65
69 if (ARCV2_IRQ_DEF_PRIO > tmp) 66 READ_BCR(ARC_REG_IRQ_BCR, irq_bcr);
70 panic("Linux default irq prio incorrect\n"); 67
68 irq_prio = irq_bcr.prio; /* Encoded as N-1 for N levels */
69 pr_info("archs-intc\t: %d priority levels (default %d)%s\n",
70 irq_prio + 1, irq_prio,
71 irq_bcr.firq ? " FIRQ (not used)":"");
72
73 /* setup status32, don't enable intr yet as kernel doesn't want */
74 tmp = read_aux_reg(0xa);
75 tmp |= STATUS_AD_MASK | (irq_prio << 1);
76 tmp &= ~STATUS_IE_MASK;
77 asm volatile("flag %0 \n"::"r"(tmp));
71} 78}
72 79
73static void arcv2_irq_mask(struct irq_data *data) 80static void arcv2_irq_mask(struct irq_data *data)
@@ -86,7 +93,7 @@ void arcv2_irq_enable(struct irq_data *data)
86{ 93{
87 /* set default priority */ 94 /* set default priority */
88 write_aux_reg(AUX_IRQ_SELECT, data->irq); 95 write_aux_reg(AUX_IRQ_SELECT, data->irq);
89 write_aux_reg(AUX_IRQ_PRIORITY, ARCV2_IRQ_DEF_PRIO); 96 write_aux_reg(AUX_IRQ_PRIORITY, irq_prio);
90 97
91 /* 98 /*
92 * hw auto enables (linux unmask) all by default 99 * hw auto enables (linux unmask) all by default
diff --git a/arch/arc/kernel/mcip.c b/arch/arc/kernel/mcip.c
index bd237acdf4f2..bc771f58fefb 100644
--- a/arch/arc/kernel/mcip.c
+++ b/arch/arc/kernel/mcip.c
@@ -96,13 +96,13 @@ static void mcip_probe_n_setup(void)
96#ifdef CONFIG_CPU_BIG_ENDIAN 96#ifdef CONFIG_CPU_BIG_ENDIAN
97 unsigned int pad3:8, 97 unsigned int pad3:8,
98 idu:1, llm:1, num_cores:6, 98 idu:1, llm:1, num_cores:6,
99 iocoh:1, grtc:1, dbg:1, pad2:1, 99 iocoh:1, gfrc:1, dbg:1, pad2:1,
100 msg:1, sem:1, ipi:1, pad:1, 100 msg:1, sem:1, ipi:1, pad:1,
101 ver:8; 101 ver:8;
102#else 102#else
103 unsigned int ver:8, 103 unsigned int ver:8,
104 pad:1, ipi:1, sem:1, msg:1, 104 pad:1, ipi:1, sem:1, msg:1,
105 pad2:1, dbg:1, grtc:1, iocoh:1, 105 pad2:1, dbg:1, gfrc:1, iocoh:1,
106 num_cores:6, llm:1, idu:1, 106 num_cores:6, llm:1, idu:1,
107 pad3:8; 107 pad3:8;
108#endif 108#endif
@@ -116,7 +116,7 @@ static void mcip_probe_n_setup(void)
116 IS_AVAIL1(mp.ipi, "IPI "), 116 IS_AVAIL1(mp.ipi, "IPI "),
117 IS_AVAIL1(mp.idu, "IDU "), 117 IS_AVAIL1(mp.idu, "IDU "),
118 IS_AVAIL1(mp.dbg, "DEBUG "), 118 IS_AVAIL1(mp.dbg, "DEBUG "),
119 IS_AVAIL1(mp.grtc, "GRTC")); 119 IS_AVAIL1(mp.gfrc, "GFRC"));
120 120
121 idu_detected = mp.idu; 121 idu_detected = mp.idu;
122 122
@@ -125,8 +125,8 @@ static void mcip_probe_n_setup(void)
125 __mcip_cmd_data(CMD_DEBUG_SET_MASK, 0xf, 0xf); 125 __mcip_cmd_data(CMD_DEBUG_SET_MASK, 0xf, 0xf);
126 } 126 }
127 127
128 if (IS_ENABLED(CONFIG_ARC_HAS_GRTC) && !mp.grtc) 128 if (IS_ENABLED(CONFIG_ARC_HAS_GFRC) && !mp.gfrc)
129 panic("kernel trying to use non-existent GRTC\n"); 129 panic("kernel trying to use non-existent GFRC\n");
130} 130}
131 131
132struct plat_smp_ops plat_smp_ops = { 132struct plat_smp_ops plat_smp_ops = {
diff --git a/arch/arc/kernel/setup.c b/arch/arc/kernel/setup.c
index e1b87444ea9a..a7edceba5f84 100644
--- a/arch/arc/kernel/setup.c
+++ b/arch/arc/kernel/setup.c
@@ -45,6 +45,7 @@ struct cpuinfo_arc cpuinfo_arc700[NR_CPUS];
45static void read_arc_build_cfg_regs(void) 45static void read_arc_build_cfg_regs(void)
46{ 46{
47 struct bcr_perip uncached_space; 47 struct bcr_perip uncached_space;
48 struct bcr_timer timer;
48 struct bcr_generic bcr; 49 struct bcr_generic bcr;
49 struct cpuinfo_arc *cpu = &cpuinfo_arc700[smp_processor_id()]; 50 struct cpuinfo_arc *cpu = &cpuinfo_arc700[smp_processor_id()];
50 unsigned long perip_space; 51 unsigned long perip_space;
@@ -53,7 +54,11 @@ static void read_arc_build_cfg_regs(void)
53 READ_BCR(AUX_IDENTITY, cpu->core); 54 READ_BCR(AUX_IDENTITY, cpu->core);
54 READ_BCR(ARC_REG_ISA_CFG_BCR, cpu->isa); 55 READ_BCR(ARC_REG_ISA_CFG_BCR, cpu->isa);
55 56
56 READ_BCR(ARC_REG_TIMERS_BCR, cpu->timers); 57 READ_BCR(ARC_REG_TIMERS_BCR, timer);
58 cpu->extn.timer0 = timer.t0;
59 cpu->extn.timer1 = timer.t1;
60 cpu->extn.rtc = timer.rtc;
61
57 cpu->vec_base = read_aux_reg(AUX_INTR_VEC_BASE); 62 cpu->vec_base = read_aux_reg(AUX_INTR_VEC_BASE);
58 63
59 READ_BCR(ARC_REG_D_UNCACH_BCR, uncached_space); 64 READ_BCR(ARC_REG_D_UNCACH_BCR, uncached_space);
@@ -208,9 +213,9 @@ static char *arc_cpu_mumbojumbo(int cpu_id, char *buf, int len)
208 (unsigned int)(arc_get_core_freq() / 10000) % 100); 213 (unsigned int)(arc_get_core_freq() / 10000) % 100);
209 214
210 n += scnprintf(buf + n, len - n, "Timers\t\t: %s%s%s%s\nISA Extn\t: ", 215 n += scnprintf(buf + n, len - n, "Timers\t\t: %s%s%s%s\nISA Extn\t: ",
211 IS_AVAIL1(cpu->timers.t0, "Timer0 "), 216 IS_AVAIL1(cpu->extn.timer0, "Timer0 "),
212 IS_AVAIL1(cpu->timers.t1, "Timer1 "), 217 IS_AVAIL1(cpu->extn.timer1, "Timer1 "),
213 IS_AVAIL2(cpu->timers.rtc, "64-bit RTC ", 218 IS_AVAIL2(cpu->extn.rtc, "Local-64-bit-Ctr ",
214 CONFIG_ARC_HAS_RTC)); 219 CONFIG_ARC_HAS_RTC));
215 220
216 n += i = scnprintf(buf + n, len - n, "%s%s%s%s%s", 221 n += i = scnprintf(buf + n, len - n, "%s%s%s%s%s",
@@ -293,13 +298,13 @@ static void arc_chk_core_config(void)
293 struct cpuinfo_arc *cpu = &cpuinfo_arc700[smp_processor_id()]; 298 struct cpuinfo_arc *cpu = &cpuinfo_arc700[smp_processor_id()];
294 int fpu_enabled; 299 int fpu_enabled;
295 300
296 if (!cpu->timers.t0) 301 if (!cpu->extn.timer0)
297 panic("Timer0 is not present!\n"); 302 panic("Timer0 is not present!\n");
298 303
299 if (!cpu->timers.t1) 304 if (!cpu->extn.timer1)
300 panic("Timer1 is not present!\n"); 305 panic("Timer1 is not present!\n");
301 306
302 if (IS_ENABLED(CONFIG_ARC_HAS_RTC) && !cpu->timers.rtc) 307 if (IS_ENABLED(CONFIG_ARC_HAS_RTC) && !cpu->extn.rtc)
303 panic("RTC is not present\n"); 308 panic("RTC is not present\n");
304 309
305#ifdef CONFIG_ARC_HAS_DCCM 310#ifdef CONFIG_ARC_HAS_DCCM
@@ -334,6 +339,7 @@ static void arc_chk_core_config(void)
334 panic("FPU non-existent, disable CONFIG_ARC_FPU_SAVE_RESTORE\n"); 339 panic("FPU non-existent, disable CONFIG_ARC_FPU_SAVE_RESTORE\n");
335 340
336 if (is_isa_arcv2() && IS_ENABLED(CONFIG_SMP) && cpu->isa.atomic && 341 if (is_isa_arcv2() && IS_ENABLED(CONFIG_SMP) && cpu->isa.atomic &&
342 IS_ENABLED(CONFIG_ARC_HAS_LLSC) &&
337 !IS_ENABLED(CONFIG_ARC_STAR_9000923308)) 343 !IS_ENABLED(CONFIG_ARC_STAR_9000923308))
338 panic("llock/scond livelock workaround missing\n"); 344 panic("llock/scond livelock workaround missing\n");
339} 345}
diff --git a/arch/arc/kernel/time.c b/arch/arc/kernel/time.c
index dfad287f1db1..156d9833ff84 100644
--- a/arch/arc/kernel/time.c
+++ b/arch/arc/kernel/time.c
@@ -62,7 +62,7 @@
62 62
63/********** Clock Source Device *********/ 63/********** Clock Source Device *********/
64 64
65#ifdef CONFIG_ARC_HAS_GRTC 65#ifdef CONFIG_ARC_HAS_GFRC
66 66
67static int arc_counter_setup(void) 67static int arc_counter_setup(void)
68{ 68{
@@ -83,10 +83,10 @@ static cycle_t arc_counter_read(struct clocksource *cs)
83 83
84 local_irq_save(flags); 84 local_irq_save(flags);
85 85
86 __mcip_cmd(CMD_GRTC_READ_LO, 0); 86 __mcip_cmd(CMD_GFRC_READ_LO, 0);
87 stamp.l = read_aux_reg(ARC_REG_MCIP_READBACK); 87 stamp.l = read_aux_reg(ARC_REG_MCIP_READBACK);
88 88
89 __mcip_cmd(CMD_GRTC_READ_HI, 0); 89 __mcip_cmd(CMD_GFRC_READ_HI, 0);
90 stamp.h = read_aux_reg(ARC_REG_MCIP_READBACK); 90 stamp.h = read_aux_reg(ARC_REG_MCIP_READBACK);
91 91
92 local_irq_restore(flags); 92 local_irq_restore(flags);
@@ -95,7 +95,7 @@ static cycle_t arc_counter_read(struct clocksource *cs)
95} 95}
96 96
97static struct clocksource arc_counter = { 97static struct clocksource arc_counter = {
98 .name = "ARConnect GRTC", 98 .name = "ARConnect GFRC",
99 .rating = 400, 99 .rating = 400,
100 .read = arc_counter_read, 100 .read = arc_counter_read,
101 .mask = CLOCKSOURCE_MASK(64), 101 .mask = CLOCKSOURCE_MASK(64),