AE350 SMP support RISC-V
v4 cover AE350 SMP support RISC-V
From: Rick Chen <[email protected]>
Changes in v4:
Patch 1
- Drop the empty comment line
- Check return value after cpu_get_count()
- Rename nds_plic as andes_plic
- Fix checkpatch error issues
Patch 2
- Rename nds_plmt as andes_plmt
Patch 3 riscv: ae350: disable ATCPIT100 timer
Patch 4 riscv: ax25: Add platform-specific Kconfig options
- Squash as patch 3 riscv: ax25: Add platform-specific Kconfig options
Changes in v3:
Patch 1
- Rename plic_init() as enable_ipi()
- Remove PLIC_BASE_GET() from enable_ipi()
Patch 2
- Add a space before (PLMT)
Patch 6
- Fix some mis-alignments
- Recovery isa string of CPU1
Changes in v2:
- Drop patch1 and replace by simple-bus driver
- Rename nds_plic as andes_plic
- Move initialize plic to PLIC_BASE_GET() and called automatically
- Rename nds_plmt as andes_plmt
- Recovery dts isa string
Rick Chen (6):
riscv: Add a SYSCON driver for Andestech's PLIC
riscv: Add a SYSCON driver for Andestech's PLMT
riscv: ax25: Add platform-specific Kconfig options
riscv: ax25: Andes specific cache shall only support in M-mode
riscv: dts: ae350 support SMP
riscv: ae350: enable SMP
arch/riscv/Kconfig | 18 ++++++ arch/riscv/cpu/ax25/Kconfig | 7 +++ arch/riscv/dts/ae350_32.dts | 81 ++++++++++++++++++------- arch/riscv/dts/ae350_64.dts | 81 ++++++++++++++++++------- arch/riscv/include/asm/global_data.h | 6 ++ arch/riscv/include/asm/syscon.h | 4 +- arch/riscv/lib/Makefile | 2 + arch/riscv/lib/andes_plic.c | 113 +++++++++++++++++++++++++++++++++++ arch/riscv/lib/andes_plmt.c | 53 ++++++++++++++++ board/AndesTech/ax25-ae350/Kconfig | 1 + configs/ae350_rv32_defconfig | 1 - configs/ae350_rv64_defconfig | 1 - 12 files changed, 320 insertions(+), 48 deletions(-) create mode 100644 arch/riscv/lib/andes_plic.c create mode 100644 arch/riscv/lib/andes_plmt.c
Signature · 1 line
2.7.4
PATCH v4 1/6 riscv: Add a SYSCON driver for Andestech's PLIC
From: Rick Chen <[email protected]>
The Platform-Level Interrupt Controller (PLIC) block holds memory-mapped claim and pending registers associated with software interrupt. It is required for handling IPI.
---
Changes in V4:
- Drop the empty comment line
- Check return value after cpu_get_count()
- Rename nds_plic as andes_plic
- Fix checkpatch error issues
arch/riscv/Kconfig | 9 +++ arch/riscv/include/asm/global_data.h | 3 + arch/riscv/include/asm/syscon.h | 3 +- arch/riscv/lib/Makefile | 1 + arch/riscv/lib/andes_plic.c | 113 +++++++++++++++++++++++++++++++++++ 5 files changed, 127 insertions(+), 2 deletions(-) create mode 100644 arch/riscv/lib/andes_plic.c
arch/riscv/Kconfig +9 -0
@@ -109,6 +109,15 @@ config SIFIVE_CLINT The SiFive CLINT block holds memory-mapped control and status registers associated with software and timer interrupts. +config ANDES_PLIC + bool + depends on RISCV_MMODE + select REGMAP + select SYSCON + help + The Andes PLIC block holds memory-mapped claim and pending registers + associated with software interrupt. + config RISCV_RDTIME bool default y if RISCV_SMODE
arch/riscv/include/asm/global_data.h +3 -0
@@ -18,6 +18,9 @@ struct arch_global_data {#ifdef CONFIG_SIFIVE_CLINT void __iomem *clint;/* clint base address */ #endif +#ifdef CONFIG_ANDES_PLIC +void __iomem *plic;/* plic base address */ +#endif #ifdef CONFIG_SMP struct ipi_data ipi[CONFIG_NR_CPUS ];#endif
arch/riscv/include/asm/syscon.h +1 -2
@@ -8,12 +8,11 @@/* * System controllers in a RISC-V system -* -* So far only SiFive's Core Local Interruptor (CLINT) is defined. */ enum {RISCV_NONE ,RISCV_SYSCON_CLINT ,/* Core Local Interruptor (CLINT) */ +RISCV_SYSCON_PLIC ,/* Platform Level Interrupt Controller (PLIC) */ };#endif /* _ASM_SYSCON_H */
arch/riscv/lib/Makefile +1 -0
@@ -11,6 +11,7 @@ obj-$(CONFIG_CMD_GO) += boot.o obj-y += cache.o obj-$(CONFIG_RISCV_RDTIME) += rdtime.o obj-$(CONFIG_SIFIVE_CLINT) += sifive_clint.o +obj-$(CONFIG_ANDES_PLIC) += andes_plic.o obj-y += interrupts.o obj-y += reset.o obj-$(CONFIG_SBI_IPI) += sbi_ipi.o
arch/riscv/lib/andes_plic.c new file +113 -0
113 lines not on this page · raw message
Signature · 1 line
2.7.4
Auer
PATCH v4 1/6 riscv: Add a SYSCON driver for Andestech's PLIC
Quoted 17 lines · Andes
From: Rick Chen <[email protected]>
The Platform-Level Interrupt Controller (PLIC) block holds memory-mapped claim and pending registers associated with software interrupt. It is required for handling IPI.
Signed-off-by Rick Chen <[email protected]>Cc Greentime Hu <[email protected]>Reviewed-by Bin Meng <[email protected]>---
Changes in V4:
- Drop the empty comment line
- Check return value aftercpu_get_count()
- Renamends_plicasandes_plic
- Fix checkpatch error issues
Quoted 8 lines
arch/riscv/Kconfig | 9 +++ arch/riscv/include/asm/global_data.h | 3 + arch/riscv/include/asm/syscon.h | 3 +- arch/riscv/lib/Makefile | 1 + arch/riscv/lib/andes_plic.c | 113 +++++++++++++++++++++++++++++++++++ 5 files changed, 127 insertions(+), 2 deletions(-) create mode 100644 arch/riscv/lib/andes_plic.c
Looks good now, thanks!
PATCH v4 2/6 riscv: Add a SYSCON driver for Andestech's PLMT
In reply to AndesFrom: Rick Chen <[email protected]>
The platform-Level Machine Timer (PLMT) block
holds memory-mapped mtime register associated
with timer tick.
This driver implements the riscv_get_time() which
is required by the generic RISC-V timer driver.
---
Changes in v4:
- Rename nds_plmt as andes_plmt
arch/riscv/Kconfig | 9 ++++++ arch/riscv/include/asm/global_data.h | 3 ++ arch/riscv/include/asm/syscon.h | 1 + arch/riscv/lib/Makefile | 1 + arch/riscv/lib/andes_plmt.c | 53 ++++++++++++++++++++++++++++++++++++ 5 files changed, 67 insertions(+) create mode 100644 arch/riscv/lib/andes_plmt.c
arch/riscv/Kconfig +9 -0
@@ -118,6 +118,15 @@ config ANDES_PLIC The Andes PLIC block holds memory-mapped claim and pending registers associated with software interrupt. +config ANDES_PLMT + bool + depends on RISCV_MMODE + select REGMAP + select SYSCON + help + The Andes PLMT block holds memory-mapped mtime register + associated with timer tick. + config RISCV_RDTIME bool default y if RISCV_SMODE
arch/riscv/include/asm/global_data.h +3 -0
@@ -21,6 +21,9 @@ struct arch_global_data {#ifdef CONFIG_ANDES_PLIC void __iomem *plic;/* plic base address */ #endif +#ifdef CONFIG_ANDES_PLMT +void __iomem *plmt;/* plmt base address */ +#endif #ifdef CONFIG_SMP struct ipi_data ipi[CONFIG_NR_CPUS ];#endif
arch/riscv/include/asm/syscon.h +1 -0
@@ -13,6 +13,7 @@ enum {RISCV_NONE ,RISCV_SYSCON_CLINT ,/* Core Local Interruptor (CLINT) */ RISCV_SYSCON_PLIC ,/* Platform Level Interrupt Controller (PLIC) */ + RISCV_SYSCON_PLMT, /* Platform Level Machine Timer (PLMT) */ };#endif /* _ASM_SYSCON_H */
arch/riscv/lib/Makefile +1 -0
@@ -12,6 +12,7 @@ obj-y += cache.o obj-$(CONFIG_RISCV_RDTIME) += rdtime.o obj-$(CONFIG_SIFIVE_CLINT) += sifive_clint.o obj-$(CONFIG_ANDES_PLIC) += andes_plic.o +obj-$(CONFIG_ANDES_PLMT) += andes_plmt.o obj-y += interrupts.o obj-y += reset.o obj-$(CONFIG_SBI_IPI) += sbi_ipi.o
arch/riscv/lib/andes_plmt.c new file +53 -0
53 lines not on this page · raw message
Signature · 1 line
2.7.4
Auer
PATCH v4 2/6 riscv: Add a SYSCON driver for Andestech's PLMT
Quoted 16 lines · Andes
From: Rick Chen <[email protected]>
The platform-Level Machine Timer (PLMT) block holds memory-mapped mtime register associated with timer tick.
This driver implements the
riscv_get_time()which is required by the generic RISC-V timer driver.Signed-off-by Rick Chen <[email protected]>Cc Greentime Hu <[email protected]>Reviewed-by Bin Meng <[email protected]>---
Changes in v4:
- Renamends_plmtasandes_plmt
Quoted 8 lines
arch/riscv/Kconfig | 9 ++++++ arch/riscv/include/asm/global_data.h | 3 ++ arch/riscv/include/asm/syscon.h | 1 + arch/riscv/lib/Makefile | 1 + arch/riscv/lib/andes_plmt.c | 53 ++++++++++++++++++++++++++++++++++++ 5 files changed, 67 insertions(+) create mode 100644 arch/riscv/lib/andes_plmt.c
PATCH v4 3/6 riscv: ax25: Add platform-specific Kconfig options
In reply to AndesFrom: Rick Chen <[email protected]>
Add ax25 RISC-V platform-specific Kconfig options, to include CPU and timer drivers. Also disable ATCPIT100 SoC timer and replace by PLMT.
---
Changes in v4:
- Squash disable ATCPIT100 timer as
patch 3 riscv: ax25: Add platform-specific Kconfig options
arch/riscv/cpu/ax25/Kconfig | 6 ++++++ configs/ae350_rv32_defconfig | 1 - configs/ae350_rv64_defconfig | 1 - 3 files changed, 6 insertions(+), 2 deletions(-)
arch/riscv/cpu/ax25/Kconfig +6 -0
@@ -1,5 +1,11 @@ config RISCV_NDS bool + select ARCH_EARLY_INIT_R + imply CPU + imply CPU_RISCV + imply RISCV_TIMER + imply ANDES_PLIC if RISCV_MMODE + imply ANDES_PLMT if RISCV_MMODE help Run U-Boot on AndeStar V5 platforms and use some specific features which are provided by Andes Technology AndeStar V5 families.
configs/ae350_rv32_defconfig +0 -1
@@ -33,4 +33,3 @@ CONFIG_BAUDRATE=38400 CONFIG_SYS_NS16550=y CONFIG_SPI=y CONFIG_ATCSPI200_SPI=y -CONFIG_ATCPIT100_TIMER=y
configs/ae350_rv64_defconfig +0 -1
@@ -34,4 +34,3 @@ CONFIG_BAUDRATE=38400 CONFIG_SYS_NS16550=y CONFIG_SPI=y CONFIG_ATCSPI200_SPI=y -CONFIG_ATCPIT100_TIMER=y
Signature · 1 line
2.7.4
PATCH v4 4/6 riscv: ax25: Andes specific cache shall only support in M-mode
In reply to AndesFrom: Rick Chen <[email protected]>
Limit the cache configuration only can be supported in M mode. It can not be manipulated in S mode.
--- arch/riscv/cpu/ax25/Kconfig | 1 + 1 file changed, 1 insertion(+)
arch/riscv/cpu/ax25/Kconfig +1 -0
@@ -14,6 +14,7 @@ if RISCV_NDS config RISCV_NDS_CACHE bool "AndeStar V5 families specific cache support" + depends on RISCV_MMODE help Provide Andes Technology AndeStar V5 families specific cache support.
Signature · 1 line
2.7.4
PATCH v4 5/6 riscv: dts: ae350 support SMP
In reply to AndesFrom: Rick Chen <[email protected]>
--- arch/riscv/dts/ae350_32.dts | 81 +++++++++++++++++++++++++++++++++------------ arch/riscv/dts/ae350_64.dts | 81 +++++++++++++++++++++++++++++++++------------ 2 files changed, 118 insertions(+), 44 deletions(-)
arch/riscv/dts/ae350_32.dts +59 -22
@@ -26,16 +26,49 @@ status = "okay"; compatible = "riscv"; riscv,isa = "rv32imafdc"; + riscv,priv-major = <1>; + riscv,priv-minor = <10>; mmu-type = "riscv,sv32"; clock-frequency = <60000000>; + i-cache-size = <0x8000>; + i-cache-line-size = <32>; d-cache-size = <0x8000>; d-cache-line-size = <32>; + next-level-cache = <&L2>; CPU0_intc: interrupt-controller { #interrupt-cells = <1>; interrupt-controller; compatible = "riscv,cpu-intc"; }; }; + CPU1: cpu at 1 { + device_type = "cpu"; + reg = <1>; + status = "okay"; + compatible = "riscv"; + riscv,isa = "rv32imafdc"; + riscv,priv-major = <1>; + riscv,priv-minor = <10>; + mmu-type = "riscv,sv32"; + clock-frequency = <60000000>; + i-cache-size = <0x8000>; + i-cache-line-size = <32>; + d-cache-size = <0x8000>; + d-cache-line-size = <32>; + next-level-cache = <&L2>; + CPU1_intc: interrupt-controller { + #interrupt-cells = <1>; + interrupt-controller; + compatible = "riscv,cpu-intc"; + }; + }; + + L2: l2-cache at e0500000 { + compatible = "cache"; + cache-level = <2>; + cache-size = <0x40000>; + reg = <0x0 0xe0500000 0x0 0x40000>; + }; }; memory at 0 {
@@ -46,32 +79,32 @@ soc { #address-cells = <1>; #size-cells = <1>; - compatible = "andestech,riscv-ae350-soc"; + compatible = "simple-bus"; ranges; - plic0: interrupt-controller at e4000000 { - compatible = "riscv,plic0"; - #address-cells = <1>; - #interrupt-cells = <1>; - interrupt-controller; - reg = <0xe4000000 0x2000000>; - riscv,ndev=<71>; - interrupts-extended = <&CPU0_intc 11 &CPU0_intc 9>; - }; + plic0: interrupt-controller at e4000000 { + compatible = "riscv,plic0"; + #address-cells = <1>; + #interrupt-cells = <1>; + interrupt-controller; + reg = <0xe4000000 0x2000000>; + riscv,ndev=<71>; + interrupts-extended = <&CPU0_intc 11 &CPU0_intc 9 &CPU1_intc 11 &CPU1_intc 9>; + }; - plic1: interrupt-controller at e6400000 { - compatible = "riscv,plic1"; - #address-cells = <1>; - #interrupt-cells = <1>; - interrupt-controller; - reg = <0xe6400000 0x400000>; - riscv,ndev=<1>; - interrupts-extended = <&CPU0_intc 3>; - }; + plic1: interrupt-controller at e6400000 { + compatible = "riscv,plic1"; + #address-cells = <1>; + #interrupt-cells = <1>; + interrupt-controller; + reg = <0xe6400000 0x400000>; + riscv,ndev=<2>; + interrupts-extended = <&CPU0_intc 3 &CPU1_intc 3>; + }; - plmt0 at e6000000 { - compatible = "riscv,plmt0"; - interrupts-extended = <&CPU0_intc 7>; + plmt0 at e6000000 { + compatible = "riscv,plmt0"; + interrupts-extended = <&CPU0_intc 7 &CPU1_intc 7>; reg = <0xe6000000 0x100000>; }; };
@@ -146,6 +179,10 @@ interrupt-parent = <&plic0>; }; + pmu { + compatible = "riscv,base-pmu"; + }; + virtio_mmio at fe007000 { interrupts = <0x17 0x4>; interrupt-parent = <0x2>;
arch/riscv/dts/ae350_64.dts +59 -22
113 lines not on this page · raw message
Signature · 1 line
2.7.4
PATCH v4 6/6 riscv: ae350: enable SMP
In reply to AndesFrom: Rick Chen <[email protected]>
--- board/AndesTech/ax25-ae350/Kconfig | 1 + 1 file changed, 1 insertion(+)
board/AndesTech/ax25-ae350/Kconfig +1 -0
@@ -24,5 +24,6 @@ config ENV_OFFSET config BOARD_SPECIFIC_OPTIONS # dummy def_bool y select RISCV_NDS + imply SMP endif
Signature · 1 line
2.7.4