Skip to content

Commit

Permalink
Merge tag 'riscv-for-linus-5.20-mw2' of git://git.kernel.org/pub/scm/…
Browse files Browse the repository at this point in the history
…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
  ...
  • Loading branch information
Linus Torvalds committed Aug 13, 2022
2 parents 6c833c0 + 5cef38d commit 69dac8e
Show file tree
Hide file tree
Showing 54 changed files with 821 additions and 143 deletions.
27 changes: 0 additions & 27 deletions Documentation/devicetree/bindings/display/ilitek,ili9341.txt

This file was deleted.

49 changes: 35 additions & 14 deletions Documentation/devicetree/bindings/display/panel/ilitek,ili9341.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,10 @@ properties:
compatible:
items:
- enum:
- adafruit,yx240qv29
# ili9341 240*320 Color on stm32f429-disco board
- st,sf-tc240t-9370-t
- canaan,kd233-tft
- const: ilitek,ili9341

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

additionalProperties: false
unevaluatedProperties: false

required:
- compatible
- reg
- dc-gpios
- port

if:
properties:
compatible:
contains:
enum:
- st,sf-tc240t-9370-t
then:
required:
- port

examples:
- |+
#include <dt-bindings/gpio/gpio.h>
spi {
#address-cells = <1>;
#size-cells = <0>;
panel: display@0 {
compatible = "st,sf-tc240t-9370-t",
"ilitek,ili9341";
reg = <0>;
spi-3wire;
spi-max-frequency = <10000000>;
dc-gpios = <&gpiod 13 0>;
port {
panel_in: endpoint {
remote-endpoint = <&display_out>;
};
};
};
compatible = "st,sf-tc240t-9370-t",
"ilitek,ili9341";
reg = <0>;
spi-3wire;
spi-max-frequency = <10000000>;
dc-gpios = <&gpiod 13 0>;
port {
panel_in: endpoint {
remote-endpoint = <&display_out>;
};
};
};
display@1{
compatible = "adafruit,yx240qv29", "ilitek,ili9341";
reg = <1>;
spi-max-frequency = <10000000>;
dc-gpios = <&gpio0 9 GPIO_ACTIVE_HIGH>;
reset-gpios = <&gpio0 8 GPIO_ACTIVE_HIGH>;
rotation = <270>;
backlight = <&backlight>;
};
};
...
4 changes: 4 additions & 0 deletions Documentation/devicetree/bindings/gpio/sifive,gpio.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ properties:
maximum: 32
default: 16

gpio-line-names:
minItems: 1
maxItems: 32

gpio-controller: true

required:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/memory-controllers/canaan,k210-sram.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Canaan K210 SRAM memory controller

description:
The Canaan K210 SRAM memory controller is responsible for the system's 8 MiB
of SRAM. The controller is initialised by the bootloader, which configures
its clocks, before OS bringup.

maintainers:
- Conor Dooley <conor@kernel.org>

properties:
compatible:
enum:
- canaan,k210-sram

clocks:
minItems: 1
items:
- description: sram0 clock
- description: sram1 clock
- description: aisram clock

clock-names:
minItems: 1
items:
- const: sram0
- const: sram1
- const: aisram

required:
- compatible
- clocks
- clock-names

additionalProperties: false

examples:
- |
#include <dt-bindings/clock/k210-clk.h>
memory-controller {
compatible = "canaan,k210-sram";
clocks = <&sysclk K210_CLK_SRAM0>,
<&sysclk K210_CLK_SRAM1>,
<&sysclk K210_CLK_AI>;
clock-names = "sram0", "sram1", "aisram";
};
5 changes: 5 additions & 0 deletions Documentation/devicetree/bindings/riscv/cpus.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,11 @@ properties:
- riscv,sv48
- riscv,none

riscv,cbom-block-size:
$ref: /schemas/types.yaml#/definitions/uint32
description:
The blocksize in bytes for the Zicbom cache operations.

riscv,isa:
description:
Identifies the specific RISC-V instruction set architecture
Expand Down
6 changes: 5 additions & 1 deletion Documentation/devicetree/bindings/riscv/sifive-l2-cache.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ properties:
const: 2

cache-sets:
const: 1024
enum: [1024, 2048]

cache-size:
const: 2097152
Expand Down Expand Up @@ -84,13 +84,17 @@ then:
description: |
Must contain entries for DirError, DataError and DataFail signals.
maxItems: 3
cache-sets:
const: 1024

else:
properties:
interrupts:
description: |
Must contain entries for DirError, DataError, DataFail, DirFail signals.
minItems: 4
cache-sets:
const: 2048

additionalProperties: false

Expand Down
32 changes: 31 additions & 1 deletion arch/riscv/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ config RISCV
select MODULES_USE_ELF_RELA if MODULES
select MODULE_SECTIONS if MODULES
select OF
select OF_DMA_DEFAULT_COHERENT
select OF_EARLY_FLATTREE
select OF_IRQ
select PCI_DOMAINS_GENERIC if PCI
Expand Down Expand Up @@ -218,6 +219,14 @@ config PGTABLE_LEVELS
config LOCKDEP_SUPPORT
def_bool y

config RISCV_DMA_NONCOHERENT
bool
select ARCH_HAS_DMA_PREP_COHERENT
select ARCH_HAS_SYNC_DMA_FOR_DEVICE
select ARCH_HAS_SYNC_DMA_FOR_CPU
select ARCH_HAS_SETUP_DMA_OPS
select DMA_DIRECT_REMAP

source "arch/riscv/Kconfig.socs"
source "arch/riscv/Kconfig.erratas"

Expand Down Expand Up @@ -392,6 +401,28 @@ config RISCV_ISA_SVPBMT

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

config CC_HAS_ZICBOM
bool
default y if 64BIT && $(cc-option,-mabi=lp64 -march=rv64ima_zicbom)
default y if 32BIT && $(cc-option,-mabi=ilp32 -march=rv32ima_zicbom)

config RISCV_ISA_ZICBOM
bool "Zicbom extension support for non-coherent DMA operation"
depends on CC_HAS_ZICBOM
depends on !XIP_KERNEL && MMU
select RISCV_DMA_NONCOHERENT
select RISCV_ALTERNATIVE
default y
help
Adds support to dynamically detect the presence of the ZICBOM
extension (Cache Block Management Operations) and enable its
usage.

The Zicbom extension can be used to handle for example
non-coherent DMA support on devices that need it.

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

config FPU
bool "FPU support"
default y
Expand Down Expand Up @@ -463,7 +494,6 @@ config KEXEC_FILE

config ARCH_HAS_KEXEC_PURGATORY
def_bool KEXEC_FILE
select BUILD_BIN2C
depends on CRYPTO=y
depends on CRYPTO_SHA256=y

Expand Down
11 changes: 11 additions & 0 deletions arch/riscv/Kconfig.erratas
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,15 @@ config ERRATA_THEAD_PBMT

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

config ERRATA_THEAD_CMO
bool "Apply T-Head cache management errata"
depends on ERRATA_THEAD
select RISCV_DMA_NONCOHERENT
default y
help
This will apply the cache management errata to handle the
non-standard handling on non-coherent operations on T-Head SoCs.

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

endmenu # "CPU errata selection"
8 changes: 8 additions & 0 deletions arch/riscv/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,14 @@ riscv-march-$(CONFIG_RISCV_ISA_C) := $(riscv-march-y)c
toolchain-need-zicsr-zifencei := $(call cc-option-yn, -march=$(riscv-march-y)_zicsr_zifencei)
riscv-march-$(toolchain-need-zicsr-zifencei) := $(riscv-march-y)_zicsr_zifencei

# Check if the toolchain supports Zicbom extension
toolchain-supports-zicbom := $(call cc-option-yn, -march=$(riscv-march-y)_zicbom)
riscv-march-$(toolchain-supports-zicbom) := $(riscv-march-y)_zicbom

# Check if the toolchain supports Zihintpause extension
toolchain-supports-zihintpause := $(call cc-option-yn, -march=$(riscv-march-y)_zihintpause)
riscv-march-$(toolchain-supports-zihintpause) := $(riscv-march-y)_zihintpause

KBUILD_CFLAGS += -march=$(subst fd,,$(riscv-march-y))
KBUILD_AFLAGS += -march=$(riscv-march-y)

Expand Down
10 changes: 8 additions & 2 deletions arch/riscv/boot/dts/canaan/Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# SPDX-License-Identifier: GPL-2.0
dtb-$(CONFIG_SOC_CANAAN_K210_DTB_BUILTIN) += $(addsuffix .dtb, $(CONFIG_SOC_CANAAN_K210_DTB_SOURCE))
obj-$(CONFIG_SOC_CANAAN_K210_DTB_BUILTIN) += $(addsuffix .o, $(dtb-y))
dtb-$(CONFIG_SOC_CANAAN) += canaan_kd233.dtb
dtb-$(CONFIG_SOC_CANAAN) += k210_generic.dtb
dtb-$(CONFIG_SOC_CANAAN) += sipeed_maix_bit.dtb
dtb-$(CONFIG_SOC_CANAAN) += sipeed_maix_dock.dtb
dtb-$(CONFIG_SOC_CANAAN) += sipeed_maix_go.dtb
dtb-$(CONFIG_SOC_CANAAN) += sipeed_maixduino.dtb

obj-$(CONFIG_SOC_CANAAN_K210_DTB_BUILTIN) += $(addsuffix .dtb.o, $(CONFIG_SOC_CANAAN_K210_DTB_SOURCE))
6 changes: 3 additions & 3 deletions arch/riscv/boot/dts/canaan/canaan_kd233.dts
Original file line number Diff line number Diff line change
Expand Up @@ -127,10 +127,10 @@
cs-gpios = <&gpio0 20 GPIO_ACTIVE_HIGH>;

panel@0 {
compatible = "ilitek,ili9341";
compatible = "canaan,kd233-tft", "ilitek,ili9341";
reg = <0>;
dc-gpios = <&gpio0 21 GPIO_ACTIVE_HIGH>;
spi-max-frequency = <15000000>;
spi-max-frequency = <10000000>;
status = "disabled";
};
};
Expand All @@ -142,7 +142,7 @@
cs-gpios = <&gpio0 16 GPIO_ACTIVE_LOW>;
status = "okay";

slot@0 {
mmc@0 {
compatible = "mmc-spi-slot";
reg = <0>;
voltage-ranges = <3300 3300>;
Expand Down
Loading

0 comments on commit 69dac8e

Please sign in to comment.