Skip to content

Commit 69dac8e

Browse files
committed
Merge tag 'riscv-for-linus-5.20-mw2' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux
Pull more RISC-V updates from Palmer Dabbelt: "There's still a handful of new features in here, but there are a lot of fixes/cleanups as well: - Support for the Zicbom extension for explicit cache-block management, along with the necessary bits to make the non-standard cache management ops on the Allwinner D1 function - Support for the Zihintpause extension, which codifies a go-slow instruction used for cpu_relax() - Support for the Sstc extension for supervisor-mode timer/counter management - Many device tree fixes and cleanups, including a large set for the Canaan device trees - A handful of fixes and cleanups for the PMU driver" * tag 'riscv-for-linus-5.20-mw2' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux: (43 commits) dt-bindings: gpio: sifive: add gpio-line-names wireguard: selftests: set CONFIG_NONPORTABLE on riscv32 RISC-V: KVM: Support sstc extension RISC-V: Improve SBI definitions RISC-V: Move counter info definition to sbi header file RISC-V: Fix SBI PMU calls for RV32 RISC-V: Update user page mapping only once during start RISC-V: Fix counter restart during overflow for RV32 RISC-V: Prefer sstc extension if available RISC-V: Enable sstc extension parsing from DT RISC-V: Add SSTC extension CSR details riscv:uprobe fix SR_SPIE set/clear handling dt-bindings: riscv: fix SiFive l2-cache's cache-sets riscv: ensure cpu_ops_sbi is declared RISC-V: cpu_ops_spinwait.c should include head.h RISC-V: Declare cpu_ops_spinwait in <asm/cpu_ops.h> riscv: dts: starfive: correct number of external interrupts riscv: dts: sifive unmatched: Add PWM controlled LEDs riscv/purgatory: Omit use of bin2c riscv/purgatory: hard-code obj-y in Makefile ...
2 parents 6c833c0 + 5cef38d commit 69dac8e

Some content is hidden

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

54 files changed

+821
-143
lines changed

Documentation/devicetree/bindings/display/ilitek,ili9341.txt

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

Documentation/devicetree/bindings/display/panel/ilitek,ili9341.yaml

Lines changed: 35 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,10 @@ properties:
2121
compatible:
2222
items:
2323
- enum:
24+
- adafruit,yx240qv29
2425
# ili9341 240*320 Color on stm32f429-disco board
2526
- st,sf-tc240t-9370-t
27+
- canaan,kd233-tft
2628
- const: ilitek,ili9341
2729

2830
reg: true
@@ -47,31 +49,50 @@ properties:
4749
vddi-led-supply:
4850
description: Voltage supply for the LED driver (1.65 .. 3.3 V)
4951

50-
additionalProperties: false
52+
unevaluatedProperties: false
5153

5254
required:
5355
- compatible
5456
- reg
5557
- dc-gpios
56-
- port
58+
59+
if:
60+
properties:
61+
compatible:
62+
contains:
63+
enum:
64+
- st,sf-tc240t-9370-t
65+
then:
66+
required:
67+
- port
5768

5869
examples:
5970
- |+
71+
#include <dt-bindings/gpio/gpio.h>
6072
spi {
6173
#address-cells = <1>;
6274
#size-cells = <0>;
6375
panel: display@0 {
64-
compatible = "st,sf-tc240t-9370-t",
65-
"ilitek,ili9341";
66-
reg = <0>;
67-
spi-3wire;
68-
spi-max-frequency = <10000000>;
69-
dc-gpios = <&gpiod 13 0>;
70-
port {
71-
panel_in: endpoint {
72-
remote-endpoint = <&display_out>;
73-
};
74-
};
75-
};
76+
compatible = "st,sf-tc240t-9370-t",
77+
"ilitek,ili9341";
78+
reg = <0>;
79+
spi-3wire;
80+
spi-max-frequency = <10000000>;
81+
dc-gpios = <&gpiod 13 0>;
82+
port {
83+
panel_in: endpoint {
84+
remote-endpoint = <&display_out>;
85+
};
86+
};
87+
};
88+
display@1{
89+
compatible = "adafruit,yx240qv29", "ilitek,ili9341";
90+
reg = <1>;
91+
spi-max-frequency = <10000000>;
92+
dc-gpios = <&gpio0 9 GPIO_ACTIVE_HIGH>;
93+
reset-gpios = <&gpio0 8 GPIO_ACTIVE_HIGH>;
94+
rotation = <270>;
95+
backlight = <&backlight>;
7696
};
97+
};
7798
...

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,10 @@ properties:
4646
maximum: 32
4747
default: 16
4848

49+
gpio-line-names:
50+
minItems: 1
51+
maxItems: 32
52+
4953
gpio-controller: true
5054

5155
required:
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/memory-controllers/canaan,k210-sram.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: Canaan K210 SRAM memory controller
8+
9+
description:
10+
The Canaan K210 SRAM memory controller is responsible for the system's 8 MiB
11+
of SRAM. The controller is initialised by the bootloader, which configures
12+
its clocks, before OS bringup.
13+
14+
maintainers:
15+
- Conor Dooley <[email protected]>
16+
17+
properties:
18+
compatible:
19+
enum:
20+
- canaan,k210-sram
21+
22+
clocks:
23+
minItems: 1
24+
items:
25+
- description: sram0 clock
26+
- description: sram1 clock
27+
- description: aisram clock
28+
29+
clock-names:
30+
minItems: 1
31+
items:
32+
- const: sram0
33+
- const: sram1
34+
- const: aisram
35+
36+
required:
37+
- compatible
38+
- clocks
39+
- clock-names
40+
41+
additionalProperties: false
42+
43+
examples:
44+
- |
45+
#include <dt-bindings/clock/k210-clk.h>
46+
memory-controller {
47+
compatible = "canaan,k210-sram";
48+
clocks = <&sysclk K210_CLK_SRAM0>,
49+
<&sysclk K210_CLK_SRAM1>,
50+
<&sysclk K210_CLK_AI>;
51+
clock-names = "sram0", "sram1", "aisram";
52+
};

Documentation/devicetree/bindings/riscv/cpus.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,11 @@ properties:
6363
- riscv,sv48
6464
- riscv,none
6565

66+
riscv,cbom-block-size:
67+
$ref: /schemas/types.yaml#/definitions/uint32
68+
description:
69+
The blocksize in bytes for the Zicbom cache operations.
70+
6671
riscv,isa:
6772
description:
6873
Identifies the specific RISC-V instruction set architecture

Documentation/devicetree/bindings/riscv/sifive-l2-cache.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ properties:
4646
const: 2
4747

4848
cache-sets:
49-
const: 1024
49+
enum: [1024, 2048]
5050

5151
cache-size:
5252
const: 2097152
@@ -84,13 +84,17 @@ then:
8484
description: |
8585
Must contain entries for DirError, DataError and DataFail signals.
8686
maxItems: 3
87+
cache-sets:
88+
const: 1024
8789

8890
else:
8991
properties:
9092
interrupts:
9193
description: |
9294
Must contain entries for DirError, DataError, DataFail, DirFail signals.
9395
minItems: 4
96+
cache-sets:
97+
const: 2048
9498

9599
additionalProperties: false
96100

arch/riscv/Kconfig

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@ config RISCV
113113
select MODULES_USE_ELF_RELA if MODULES
114114
select MODULE_SECTIONS if MODULES
115115
select OF
116+
select OF_DMA_DEFAULT_COHERENT
116117
select OF_EARLY_FLATTREE
117118
select OF_IRQ
118119
select PCI_DOMAINS_GENERIC if PCI
@@ -218,6 +219,14 @@ config PGTABLE_LEVELS
218219
config LOCKDEP_SUPPORT
219220
def_bool y
220221

222+
config RISCV_DMA_NONCOHERENT
223+
bool
224+
select ARCH_HAS_DMA_PREP_COHERENT
225+
select ARCH_HAS_SYNC_DMA_FOR_DEVICE
226+
select ARCH_HAS_SYNC_DMA_FOR_CPU
227+
select ARCH_HAS_SETUP_DMA_OPS
228+
select DMA_DIRECT_REMAP
229+
221230
source "arch/riscv/Kconfig.socs"
222231
source "arch/riscv/Kconfig.erratas"
223232

@@ -392,6 +401,28 @@ config RISCV_ISA_SVPBMT
392401

393402
If you don't know what to do here, say Y.
394403

404+
config CC_HAS_ZICBOM
405+
bool
406+
default y if 64BIT && $(cc-option,-mabi=lp64 -march=rv64ima_zicbom)
407+
default y if 32BIT && $(cc-option,-mabi=ilp32 -march=rv32ima_zicbom)
408+
409+
config RISCV_ISA_ZICBOM
410+
bool "Zicbom extension support for non-coherent DMA operation"
411+
depends on CC_HAS_ZICBOM
412+
depends on !XIP_KERNEL && MMU
413+
select RISCV_DMA_NONCOHERENT
414+
select RISCV_ALTERNATIVE
415+
default y
416+
help
417+
Adds support to dynamically detect the presence of the ZICBOM
418+
extension (Cache Block Management Operations) and enable its
419+
usage.
420+
421+
The Zicbom extension can be used to handle for example
422+
non-coherent DMA support on devices that need it.
423+
424+
If you don't know what to do here, say Y.
425+
395426
config FPU
396427
bool "FPU support"
397428
default y
@@ -463,7 +494,6 @@ config KEXEC_FILE
463494

464495
config ARCH_HAS_KEXEC_PURGATORY
465496
def_bool KEXEC_FILE
466-
select BUILD_BIN2C
467497
depends on CRYPTO=y
468498
depends on CRYPTO_SHA256=y
469499

arch/riscv/Kconfig.erratas

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,4 +55,15 @@ config ERRATA_THEAD_PBMT
5555

5656
If you don't know what to do here, say "Y".
5757

58+
config ERRATA_THEAD_CMO
59+
bool "Apply T-Head cache management errata"
60+
depends on ERRATA_THEAD
61+
select RISCV_DMA_NONCOHERENT
62+
default y
63+
help
64+
This will apply the cache management errata to handle the
65+
non-standard handling on non-coherent operations on T-Head SoCs.
66+
67+
If you don't know what to do here, say "Y".
68+
5869
endmenu # "CPU errata selection"

arch/riscv/Makefile

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,14 @@ riscv-march-$(CONFIG_RISCV_ISA_C) := $(riscv-march-y)c
5656
toolchain-need-zicsr-zifencei := $(call cc-option-yn, -march=$(riscv-march-y)_zicsr_zifencei)
5757
riscv-march-$(toolchain-need-zicsr-zifencei) := $(riscv-march-y)_zicsr_zifencei
5858

59+
# Check if the toolchain supports Zicbom extension
60+
toolchain-supports-zicbom := $(call cc-option-yn, -march=$(riscv-march-y)_zicbom)
61+
riscv-march-$(toolchain-supports-zicbom) := $(riscv-march-y)_zicbom
62+
63+
# Check if the toolchain supports Zihintpause extension
64+
toolchain-supports-zihintpause := $(call cc-option-yn, -march=$(riscv-march-y)_zihintpause)
65+
riscv-march-$(toolchain-supports-zihintpause) := $(riscv-march-y)_zihintpause
66+
5967
KBUILD_CFLAGS += -march=$(subst fd,,$(riscv-march-y))
6068
KBUILD_AFLAGS += -march=$(riscv-march-y)
6169

arch/riscv/boot/dts/canaan/Makefile

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
11
# SPDX-License-Identifier: GPL-2.0
2-
dtb-$(CONFIG_SOC_CANAAN_K210_DTB_BUILTIN) += $(addsuffix .dtb, $(CONFIG_SOC_CANAAN_K210_DTB_SOURCE))
3-
obj-$(CONFIG_SOC_CANAAN_K210_DTB_BUILTIN) += $(addsuffix .o, $(dtb-y))
2+
dtb-$(CONFIG_SOC_CANAAN) += canaan_kd233.dtb
3+
dtb-$(CONFIG_SOC_CANAAN) += k210_generic.dtb
4+
dtb-$(CONFIG_SOC_CANAAN) += sipeed_maix_bit.dtb
5+
dtb-$(CONFIG_SOC_CANAAN) += sipeed_maix_dock.dtb
6+
dtb-$(CONFIG_SOC_CANAAN) += sipeed_maix_go.dtb
7+
dtb-$(CONFIG_SOC_CANAAN) += sipeed_maixduino.dtb
8+
9+
obj-$(CONFIG_SOC_CANAAN_K210_DTB_BUILTIN) += $(addsuffix .dtb.o, $(CONFIG_SOC_CANAAN_K210_DTB_SOURCE))

0 commit comments

Comments
 (0)