Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/interrupt-controller/andestech,plicsw.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Andes machine-level software interrupt controller

description:
In the Andes platform such as QiLai SoC, the PLIC module is instantiated a
second time with all interrupt sources tied to zero as the software interrupt
controller (PLIC_SW). PLIC_SW directly connects to the machine-mode
inter-processor interrupt lines of CPUs, so RISC-V per-CPU local interrupt
controller is the parent interrupt controller for PLIC_SW. PLIC_SW can
generate machine-mode inter-processor interrupts through programming its
registers.

maintainers:
- Ben Zong-You Xie <ben717@andestech.com>

properties:
compatible:
items:
- enum:
- andestech,qilai-plicsw
- const: andestech,plicsw

reg:
maxItems: 1

interrupts-extended:
minItems: 1
maxItems: 15872
description:
Specifies which harts are connected to the PLIC_SW. Each item must points
to a riscv,cpu-intc node, which has a riscv cpu node as parent.

additionalProperties: false

required:
- compatible
- reg
- interrupts-extended

examples:
- |
interrupt-controller@400000 {
compatible = "andestech,qilai-plicsw", "andestech,plicsw";
reg = <0x400000 0x400000>;
interrupts-extended = <&cpu0intc 3>,
<&cpu1intc 3>,
<&cpu2intc 3>,
<&cpu3intc 3>;
};
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ properties:
oneOf:
- items:
- enum:
- andestech,qilai-plic
- renesas,r9a07g043-plic
- const: andestech,nceplic100
- items:
Expand Down
25 changes: 25 additions & 0 deletions Documentation/devicetree/bindings/riscv/andes.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/riscv/andes.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Andes SoC-based boards

maintainers:
- Ben Zong-You Xie <ben717@andestech.com>

description:
Andes SoC-based boards

properties:
$nodename:
const: '/'
compatible:
oneOf:
- items:
- enum:
- andestech,voyager
- const: andestech,qilai

additionalProperties: true
53 changes: 53 additions & 0 deletions Documentation/devicetree/bindings/timer/andestech,plmt0.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/timer/andestech,plmt0.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Andes machine-level timer

description:
The Andes machine-level timer device (PLMT0) provides machine-level timer
functionality for a set of HARTs on a RISC-V platform. It has a single
fixed-frequency monotonic time counter (MTIME) register and a time compare
register (MTIMECMP) for each HART connected to the PLMT0. A timer interrupt is
generated if MTIME >= MTIMECMP.

maintainers:
- Ben Zong-You Xie <ben717@andestech.com>

properties:
compatible:
items:
- enum:
- andestech,qilai-plmt
- const: andestech,plmt0

reg:
maxItems: 1

interrupts-extended:
minItems: 1
maxItems: 32
description:
Specifies which harts are connected to the PLMT0. Each item must points
to a riscv,cpu-intc node, which has a riscv cpu node as parent. The
PLMT0 supports 1 hart up to 32 harts.

additionalProperties: false

required:
- compatible
- reg
- interrupts-extended

examples:
- |
interrupt-controller@100000 {
compatible = "andestech,qilai-plmt", "andestech,plmt0";
reg = <0x100000 0x100000>;
interrupts-extended = <&cpu0intc 7>,
<&cpu1intc 7>,
<&cpu2intc 7>,
<&cpu3intc 7>;
};
9 changes: 9 additions & 0 deletions MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -20809,6 +20809,15 @@ F: drivers/irqchip/irq-riscv-intc.c
F: include/linux/irqchip/riscv-aplic.h
F: include/linux/irqchip/riscv-imsic.h

RISC-V ANDES SoC Support
M: Ben Zong-You Xie <ben717@andestech.com>
S: Maintained
T: git: https://github.com/ben717-linux/linux
F: Documentation/devicetree/bindings/interrupt-controller/andestech,plicsw.yaml
F: Documentation/devicetree/bindings/riscv/andes.yaml
F: Documentation/devicetree/bindings/timer/andestech,plmt0.yaml
F: arch/riscv/boot/dts/andes/

RISC-V ARCHITECTURE
M: Paul Walmsley <paul.walmsley@sifive.com>
M: Palmer Dabbelt <palmer@dabbelt.com>
Expand Down
2 changes: 1 addition & 1 deletion arch/riscv/Kconfig.errata
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ config ERRATA_ANDES

config ERRATA_ANDES_CMO
bool "Apply Andes cache management errata"
depends on ERRATA_ANDES && ARCH_R9A07G043
depends on ERRATA_ANDES && (ARCH_R9A07G043 || ARCH_ANDES)
select RISCV_DMA_NONCOHERENT
default y
help
Expand Down
9 changes: 9 additions & 0 deletions arch/riscv/Kconfig.socs
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
menu "SoC selection"

config ARCH_ANDES
bool "Andes SoCs"
depends on MMU && !XIP_KERNEL
select ERRATA_ANDES
select ERRATA_ANDES_CMO
select AX45MP_L2_CACHE
help
This enables support for Andes SoC platform hardware.

config ARCH_MICROCHIP_POLARFIRE
def_bool ARCH_MICROCHIP

Expand Down
1 change: 1 addition & 0 deletions arch/riscv/boot/dts/Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# SPDX-License-Identifier: GPL-2.0
subdir-y += allwinner
subdir-y += andes
subdir-y += canaan
subdir-y += microchip
subdir-y += renesas
Expand Down
2 changes: 2 additions & 0 deletions arch/riscv/boot/dts/andes/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# SPDX-License-Identifier: GPL-2.0
dtb-$(CONFIG_ARCH_ANDES) += qilai-voyager.dtb
28 changes: 28 additions & 0 deletions arch/riscv/boot/dts/andes/qilai-voyager.dts
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
// SPDX-License-Identifier: GPL-2.0 OR MIT
/*
* Copyright (C) 2025 Andes Technology Corporation. All rights reserved.
*/

#include "qilai.dtsi"

/ {
model = "Voyager";
compatible = "andestech,voyager", "andestech,qilai";

aliases {
serial0 = &uart0;
};

chosen {
stdout-path = "serial0:115200n8";
};

memory@400000000 {
device_type = "memory";
reg = <0x4 0x00000000 0x4 0x00000000>;
};
};

&uart0 {
status = "okay";
};
Loading
Loading