Skip to content

Commit 296d05c

Browse files
committed
Merge tag 'riscv/for-v5.3-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux
Pull RISC-V updates from Paul Walmsley: "A few minor RISC-V updates for v5.3-rc4: - Remove __udivdi3() from the 32-bit Linux port, converting the only upstream user to use do_div(), per Linux policy - Convert the RISC-V standard clocksource away from per-cpu data structures, since only one is used by Linux, even on a multi-CPU system - A set of DT binding updates that remove an obsolete text binding in favor of a YAML binding, fix a bogus compatible string in the schema (thus fixing a "make dtbs_check" warning), and clarifies the future values expected in one of the RISC-V CPU properties" * tag 'riscv/for-v5.3-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux: dt-bindings: riscv: fix the schema compatible string for the HiFive Unleashed board dt-bindings: riscv: remove obsolete cpus.txt RISC-V: Remove udivdi3 riscv: delay: use do_div() instead of __udivdi3() dt-bindings: Update the riscv,isa string description RISC-V: Remove per cpu clocksource
2 parents 6d8f809 + b390e0b commit 296d05c

File tree

7 files changed

+24
-202
lines changed

7 files changed

+24
-202
lines changed

Documentation/devicetree/bindings/riscv/cpus.txt

Lines changed: 0 additions & 162 deletions
This file was deleted.

Documentation/devicetree/bindings/riscv/cpus.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,18 @@ maintainers:
1010
- Paul Walmsley <[email protected]>
1111
- Palmer Dabbelt <[email protected]>
1212

13+
description: |
14+
This document uses some terminology common to the RISC-V community
15+
that is not widely used, the definitions of which are listed here:
16+
17+
hart: A hardware execution context, which contains all the state
18+
mandated by the RISC-V ISA: a PC and some registers. This
19+
terminology is designed to disambiguate software's view of execution
20+
contexts from any particular microarchitectural implementation
21+
strategy. For example, an Intel laptop containing one socket with
22+
two cores, each of which has two hyperthreads, could be described as
23+
having four harts.
24+
1325
properties:
1426
compatible:
1527
items:
@@ -50,6 +62,10 @@ properties:
5062
User-Level ISA document, available from
5163
https://riscv.org/specifications/
5264

65+
While the isa strings in ISA specification are case
66+
insensitive, letters in the riscv,isa string must be all
67+
lowercase to simplify parsing.
68+
5369
timebase-frequency:
5470
type: integer
5571
minimum: 1

Documentation/devicetree/bindings/riscv/sifive.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ properties:
1919
compatible:
2020
items:
2121
- enum:
22-
- sifive,freedom-unleashed-a00
22+
- sifive,hifive-unleashed-a00
2323
- const: sifive,fu540-c000
2424
- const: sifive,fu540
2525
...

arch/riscv/lib/Makefile

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,3 @@ lib-y += memset.o
55
lib-y += uaccess.o
66

77
lib-$(CONFIG_64BIT) += tishift.o
8-
9-
lib-$(CONFIG_32BIT) += udivdi3.o

arch/riscv/lib/delay.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,13 @@ EXPORT_SYMBOL(__delay);
8181
void udelay(unsigned long usecs)
8282
{
8383
u64 ucycles = (u64)usecs * lpj_fine * UDELAY_MULT;
84+
u64 n;
8485

8586
if (unlikely(usecs > MAX_UDELAY_US)) {
86-
__delay((u64)usecs * riscv_timebase / 1000000ULL);
87+
n = (u64)usecs * riscv_timebase;
88+
do_div(n, 1000000);
89+
90+
__delay(n);
8791
return;
8892
}
8993

arch/riscv/lib/udivdi3.S

Lines changed: 0 additions & 32 deletions
This file was deleted.

drivers/clocksource/timer-riscv.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ static u64 riscv_sched_clock(void)
5555
return get_cycles64();
5656
}
5757

58-
static DEFINE_PER_CPU(struct clocksource, riscv_clocksource) = {
58+
static struct clocksource riscv_clocksource = {
5959
.name = "riscv_clocksource",
6060
.rating = 300,
6161
.mask = CLOCKSOURCE_MASK(64),
@@ -92,7 +92,6 @@ void riscv_timer_interrupt(void)
9292
static int __init riscv_timer_init_dt(struct device_node *n)
9393
{
9494
int cpuid, hartid, error;
95-
struct clocksource *cs;
9695

9796
hartid = riscv_of_processor_hartid(n);
9897
if (hartid < 0) {
@@ -112,8 +111,7 @@ static int __init riscv_timer_init_dt(struct device_node *n)
112111

113112
pr_info("%s: Registering clocksource cpuid [%d] hartid [%d]\n",
114113
__func__, cpuid, hartid);
115-
cs = per_cpu_ptr(&riscv_clocksource, cpuid);
116-
error = clocksource_register_hz(cs, riscv_timebase);
114+
error = clocksource_register_hz(&riscv_clocksource, riscv_timebase);
117115
if (error) {
118116
pr_err("RISCV timer register failed [%d] for cpu = [%d]\n",
119117
error, cpuid);

0 commit comments

Comments
 (0)