Skip to content

Commit 8b83369

Browse files
committed
Merge tag 'riscv-for-linus-5.12-mw0' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux
Pull RISC-V updates from Palmer Dabbelt: "A handful of new RISC-V related patches for this merge window: - A check to ensure drivers are properly using uaccess. This isn't manifesting with any of the drivers I'm currently using, but may catch errors in new drivers. - Some preliminary support for the FU740, along with the HiFive Unleashed it will appear on. - NUMA support for RISC-V, which involves making the arm64 code generic. - Support for kasan on the vmalloc region. - A handful of new drivers for the Kendryte K210, along with the DT plumbing required to boot on a handful of K210-based boards. - Support for allocating ASIDs. - Preliminary support for kernels larger than 128MiB. - Various other improvements to our KASAN support, including the utilization of huge pages when allocating the KASAN regions. We may have already found a bug with the KASAN_VMALLOC code, but it's passing my tests. There's a fix in the works, but that will probably miss the merge window. * tag 'riscv-for-linus-5.12-mw0' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux: (75 commits) riscv: Improve kasan population by using hugepages when possible riscv: Improve kasan population function riscv: Use KASAN_SHADOW_INIT define for kasan memory initialization riscv: Improve kasan definitions riscv: Get rid of MAX_EARLY_MAPPING_SIZE soc: canaan: Sort the Makefile alphabetically riscv: Disable KSAN_SANITIZE for vDSO riscv: Remove unnecessary declaration riscv: Add Canaan Kendryte K210 SD card defconfig riscv: Update Canaan Kendryte K210 defconfig riscv: Add Kendryte KD233 board device tree riscv: Add SiPeed MAIXDUINO board device tree riscv: Add SiPeed MAIX GO board device tree riscv: Add SiPeed MAIX DOCK board device tree riscv: Add SiPeed MAIX BiT board device tree riscv: Update Canaan Kendryte K210 device tree dt-bindings: add resets property to dw-apb-timer dt-bindings: fix sifive gpio properties dt-bindings: update sifive uart compatible string dt-bindings: update sifive clint compatible string ...
2 parents 8f47d75 + d7fbcf4 commit 8b83369

121 files changed

Lines changed: 7605 additions & 1040 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Documentation/devicetree/bindings/gpio/sifive,gpio.yaml

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,20 @@ maintainers:
1313
properties:
1414
compatible:
1515
items:
16-
- const: sifive,fu540-c000-gpio
16+
- enum:
17+
- sifive,fu540-c000-gpio
18+
- sifive,fu740-c000-gpio
19+
- canaan,k210-gpiohs
1720
- const: sifive,gpio0
1821

1922
reg:
2023
maxItems: 1
2124

2225
interrupts:
2326
description:
24-
interrupt mapping one per GPIO. Maximum 16 GPIOs.
27+
Interrupt mapping, one per GPIO. Maximum 32 GPIOs.
2528
minItems: 1
26-
maxItems: 16
29+
maxItems: 32
2730

2831
interrupt-controller: true
2932

@@ -36,6 +39,14 @@ properties:
3639
"#gpio-cells":
3740
const: 2
3841

42+
ngpios:
43+
description:
44+
The number of GPIOs available on the controller implementation.
45+
It is 16 for the SiFive SoCs and 32 for the Canaan K210.
46+
minimum: 1
47+
maximum: 32
48+
default: 16
49+
3950
gpio-controller: true
4051

4152
required:
@@ -44,10 +55,20 @@ required:
4455
- interrupts
4556
- interrupt-controller
4657
- "#interrupt-cells"
47-
- clocks
4858
- "#gpio-cells"
4959
- gpio-controller
5060

61+
if:
62+
properties:
63+
compatible:
64+
contains:
65+
enum:
66+
- sifive,fu540-c000-gpio
67+
- sifive,fu740-c000-gpio
68+
then:
69+
required:
70+
- clocks
71+
5172
additionalProperties: false
5273

5374
examples:

Documentation/devicetree/bindings/interrupt-controller/sifive,plic-1.0.0.yaml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,11 @@ $schema: http://devicetree.org/meta-schemas/core.yaml#
88
title: SiFive Platform-Level Interrupt Controller (PLIC)
99

1010
description:
11-
SiFive SOCs include an implementation of the Platform-Level Interrupt Controller
12-
(PLIC) high-level specification in the RISC-V Privileged Architecture
13-
specification. The PLIC connects all external interrupts in the system to all
14-
hart contexts in the system, via the external interrupt source in each hart.
11+
SiFive SoCs and other RISC-V SoCs include an implementation of the
12+
Platform-Level Interrupt Controller (PLIC) high-level specification in
13+
the RISC-V Privileged Architecture specification. The PLIC connects all
14+
external interrupts in the system to all hart contexts in the system, via
15+
the external interrupt source in each hart.
1516

1617
A hart context is a privilege mode in a hardware execution thread. For example,
1718
in an 4 core system with 2-way SMT, you have 8 harts and probably at least two
@@ -42,7 +43,9 @@ maintainers:
4243
properties:
4344
compatible:
4445
items:
45-
- const: sifive,fu540-c000-plic
46+
- enum:
47+
- sifive,fu540-c000-plic
48+
- canaan,k210-plic
4649
- const: sifive,plic-1.0.0
4750

4851
reg:
Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/mfd/canaan,k210-sysctl.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: Canaan Kendryte K210 System Controller Device Tree Bindings
8+
9+
maintainers:
10+
- Damien Le Moal <damien.lemoal@wdc.com>
11+
12+
description:
13+
Canaan Inc. Kendryte K210 SoC system controller which provides a
14+
register map for controlling the clocks, reset signals and pin power
15+
domains of the SoC.
16+
17+
properties:
18+
compatible:
19+
items:
20+
- const: canaan,k210-sysctl
21+
- const: syscon
22+
- const: simple-mfd
23+
24+
clocks:
25+
maxItems: 1
26+
description:
27+
System controller Advanced Power Bus (APB) interface clock source.
28+
29+
clock-names:
30+
items:
31+
- const: pclk
32+
33+
reg:
34+
maxItems: 1
35+
36+
clock-controller:
37+
# Child node
38+
type: object
39+
$ref: "../clock/canaan,k210-clk.yaml"
40+
description:
41+
Clock controller for the SoC clocks. This child node definition
42+
should follow the bindings specified in
43+
Documentation/devicetree/bindings/clock/canaan,k210-clk.yaml.
44+
45+
reset-controller:
46+
# Child node
47+
type: object
48+
$ref: "../reset/canaan,k210-rst.yaml"
49+
description:
50+
Reset controller for the SoC. This child node definition
51+
should follow the bindings specified in
52+
Documentation/devicetree/bindings/reset/canaan,k210-rst.yaml.
53+
54+
syscon-reboot:
55+
# Child node
56+
type: object
57+
$ref: "../power/reset/syscon-reboot.yaml"
58+
description:
59+
Reboot method for the SoC. This child node definition
60+
should follow the bindings specified in
61+
Documentation/devicetree/bindings/power/reset/syscon-reboot.yaml.
62+
63+
required:
64+
- compatible
65+
- clocks
66+
- reg
67+
- clock-controller
68+
69+
additionalProperties: false
70+
71+
examples:
72+
- |
73+
#include <dt-bindings/clock/k210-clk.h>
74+
#include <dt-bindings/reset/k210-rst.h>
75+
76+
clocks {
77+
in0: oscllator {
78+
compatible = "fixed-clock";
79+
#clock-cells = <0>;
80+
clock-frequency = <26000000>;
81+
};
82+
};
83+
84+
sysctl: syscon@50440000 {
85+
compatible = "canaan,k210-sysctl",
86+
"syscon", "simple-mfd";
87+
reg = <0x50440000 0x100>;
88+
clocks = <&sysclk K210_CLK_APB1>;
89+
clock-names = "pclk";
90+
91+
sysclk: clock-controller {
92+
#clock-cells = <1>;
93+
compatible = "canaan,k210-clk";
94+
clocks = <&in0>;
95+
};
96+
97+
sysrst: reset-controller {
98+
compatible = "canaan,k210-rst";
99+
#reset-cells = <1>;
100+
};
101+
102+
reboot: syscon-reboot {
103+
compatible = "syscon-reboot";
104+
regmap = <&sysctl>;
105+
offset = <48>;
106+
mask = <1>;
107+
value = <1>;
108+
};
109+
};
Lines changed: 171 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,171 @@
1+
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/pinctrl/canaan,k210-fpioa.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: Canaan Kendryte K210 FPIOA Device Tree Bindings
8+
9+
maintainers:
10+
- Damien Le Moal <damien.lemoal@wdc.com>
11+
12+
description:
13+
The Canaan Kendryte K210 SoC Fully Programmable IO Array (FPIOA)
14+
controller allows assiging any of 256 possible functions to any of
15+
48 IO pins of the SoC. Pin function configuration is performed on
16+
a per-pin basis.
17+
18+
properties:
19+
compatible:
20+
const: canaan,k210-fpioa
21+
22+
reg:
23+
maxItems: 1
24+
description:
25+
Address and length of the register set for the FPIOA controller.
26+
27+
clocks:
28+
items:
29+
- description: Controller reference clock source
30+
- description: APB interface clock source
31+
32+
clock-names:
33+
items:
34+
- const: ref
35+
- const: pclk
36+
37+
resets:
38+
maxItems: 1
39+
40+
canaan,k210-sysctl-power:
41+
$ref: /schemas/types.yaml#/definitions/phandle-array
42+
description: |
43+
phandle of the K210 system controller node and offset of its
44+
power domain control register.
45+
46+
patternProperties:
47+
'-pinmux$':
48+
type: object
49+
$ref: /schemas/pinctrl/pinmux-node.yaml
50+
description:
51+
FPIOA client devices use sub-nodes to define the desired pin
52+
configuration. Client device sub-nodes use the pinux property
53+
below.
54+
55+
properties:
56+
pinmux:
57+
description:
58+
List of IO pins alternate functions. The values for each IO
59+
pin is a combination of an IO pin number (0 to 47) with the
60+
desired function for the IO pin. Functions are defined as
61+
macros in include/dt-bindings/pinctrl/k210-fpioa.h.
62+
The K210_FPIOA(IO pin, function) macro is provided to
63+
facilitate the combination of IO pin numbers and functions.
64+
65+
required:
66+
- pinmux
67+
68+
additionalProperties: false
69+
70+
'-pins$':
71+
type: object
72+
$ref: /schemas/pinctrl/pincfg-node.yaml
73+
description:
74+
FPIOA client devices use sub-nodes to define the desired
75+
configuration of pins. Client device sub-nodes use the
76+
properties below.
77+
78+
properties:
79+
pins:
80+
description:
81+
List of IO pins affected by the properties specified in this
82+
subnode. IO pins are identified using the pin names "IO_xx".
83+
Pin configuration nodes can also define the power domain to
84+
be used for the SoC pin groups A0 (IO pins 0-5),
85+
A1 (IO pins 6-11), A2 (IO pins 12-17), B0 (IO pins 18-23),
86+
B1 (IO pins 24-29), B2 (IO pins 30-35), B3 (IO pins 30-35),
87+
C0 (IO pins 36-41) and C1 (IO pins 42-47) using the
88+
power-source property.
89+
items:
90+
anyOf:
91+
- pattern: "^(IO_([0-9]*))|(A[0-2])|(B[3-5])|(C[6-7])$"
92+
- enum: [ IO_0, IO_1, IO_2, IO_3, IO_4, IO_5, IO_6, IO_7,
93+
IO_8, IO_9, IO_10, IO_11, IO_12, IO_13, IO_14,
94+
IO_15, IO_16, IO_17, IO_18, IO_19, IO_20, IO_21,
95+
IO_22, IO_23, IO_24, IO_25, IO_26, IO_27, IO_28,
96+
IO_29, IO_30, IO_31, IO_32, IO_33, IO_34, IO_35,
97+
IO_36, IO_37, IO_38, IO_39, IO_40, IO_41, IO_42,
98+
IO_43, IO_44, IO_45, IO_46, IO_47,
99+
A0, A1, A2, B3, B4, B5, C6, C7 ]
100+
bias-disable: true
101+
102+
bias-pull-down: true
103+
104+
bias-pull-up: true
105+
106+
drive-strength: true
107+
108+
drive-strength-microamp: true
109+
110+
input-enable: true
111+
112+
input-disable: true
113+
114+
input-schmitt-enable: true
115+
116+
input-schmitt-disable: true
117+
118+
input-polarity-invert:
119+
description:
120+
Enable or disable pin input polarity inversion.
121+
122+
output-enable: true
123+
124+
output-disable: true
125+
126+
output-high: true
127+
128+
output-low: true
129+
130+
output-polarity-invert:
131+
description:
132+
Enable or disable pin output polarity inversion.
133+
134+
slew-rate: true
135+
136+
power-source: true
137+
138+
additionalProperties: false
139+
140+
required:
141+
- compatible
142+
- reg
143+
- clocks
144+
- canaan,k210-sysctl-power
145+
146+
additionalProperties: false
147+
148+
examples:
149+
- |
150+
#include <dt-bindings/pinctrl/k210-fpioa.h>
151+
#include <dt-bindings/clock/k210-clk.h>
152+
#include <dt-bindings/reset/k210-rst.h>
153+
154+
fpioa: pinmux@502B0000 {
155+
compatible = "canaan,k210-fpioa";
156+
reg = <0x502B0000 0x100>;
157+
clocks = <&sysclk K210_CLK_FPIOA>,
158+
<&sysclk K210_CLK_APB0>;
159+
clock-names = "ref", "pclk";
160+
resets = <&sysrst K210_RST_FPIOA>;
161+
canaan,k210-sysctl-power = <&sysctl 108>;
162+
pinctrl-0 = <&jtag_pinctrl>;
163+
pinctrl-names = "default";
164+
165+
jtag_pinctrl: jtag-pinmux {
166+
pinmux = <K210_FPIOA(0, K210_PCF_JTAG_TCLK)>,
167+
<K210_FPIOA(1, K210_PCF_JTAG_TDI)>,
168+
<K210_FPIOA(2, K210_PCF_JTAG_TMS)>,
169+
<K210_FPIOA(3, K210_PCF_JTAG_TDO)>;
170+
};
171+
};

Documentation/devicetree/bindings/pwm/pwm-sifive.yaml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,15 @@ description:
2525
properties:
2626
compatible:
2727
items:
28-
- const: sifive,fu540-c000-pwm
28+
- enum:
29+
- sifive,fu540-c000-pwm
30+
- sifive,fu740-c000-pwm
2931
- const: sifive,pwm0
3032
description:
3133
Should be "sifive,<chip>-pwm" and "sifive,pwm<version>". Supported
32-
compatible strings are "sifive,fu540-c000-pwm" for the SiFive PWM v0
33-
as integrated onto the SiFive FU540 chip, and "sifive,pwm0" for the
34+
compatible strings are "sifive,fu540-c000-pwm" and
35+
"sifive,fu740-c000-pwm" for the SiFive PWM v0 as integrated onto the
36+
SiFive FU540 and FU740 chip respectively, and "sifive,pwm0" for the
3437
SiFive PWM v0 IP block with no chip integration tweaks.
3538
Please refer to sifive-blocks-ip-versioning.txt for details.
3639

0 commit comments

Comments
 (0)