Skip to content

Commit a36f767

Browse files
jimmyzhenashif
authored andcommitted
soc: andestech: ae350: add ae350/clic configuration
Add ae350/clic soc, which shares the same peripherials as AE350 PLIC platform but uses CLIC instead of PLIC, with different IRQ number. Signed-off-by: Jimmy Zheng <jimmyzhe@andestech.com>
1 parent 13e2125 commit a36f767

File tree

5 files changed

+43
-17
lines changed

5 files changed

+43
-17
lines changed

soc/andestech/ae350/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,6 @@ if(CONFIG_SOC_ANDES_V5_EXECIT)
2424
zephyr_ld_options(-Wl,--mexecit)
2525
endif()
2626

27-
if(CONFIG_SOC_ANDES_AE350)
27+
if(CONFIG_SOC_SERIES_ANDES_AE350)
2828
set(SOC_LINKER_SCRIPT ${CMAKE_CURRENT_SOURCE_DIR}/linker.ld CACHE INTERNAL "")
2929
endif()

soc/andestech/ae350/Kconfig

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,28 @@
44
config SOC_SERIES_ANDES_AE350
55
select RISCV
66
select RISCV_PRIVILEGED
7-
select RISCV_HAS_PLIC
7+
select RISCV_PMP
88
select RISCV_SOC_HAS_GP_RELATIVE_ADDRESSING
9-
imply XIP
10-
11-
config SOC_ANDES_AE350
12-
select ATOMIC_OPERATIONS_BUILTIN
13-
select INCLUDE_RESET_VECTOR
149
select RISCV_ISA_EXT_M
1510
select RISCV_ISA_EXT_A
1611
select RISCV_ISA_EXT_C
12+
select RISCV_ISA_EXT_ZICSR
13+
select RISCV_ISA_EXT_ZIFENCEI
14+
select ATOMIC_OPERATIONS_BUILTIN
15+
select INCLUDE_RESET_VECTOR
1716
select CPU_HAS_DCACHE
1817
select CPU_HAS_ICACHE
1918
select CACHE_MANAGEMENT if DCACHE
20-
select RISCV_PMP
19+
imply XIP
20+
21+
config SOC_ANDES_AE350
22+
select RISCV_HAS_PLIC
23+
24+
config SOC_ANDES_AE350_CLIC
25+
select RISCV_HAS_CLIC
26+
select CLIC_SMCLICSHV_EXT if RISCV_VECTORED_MODE
27+
select CLIC_SMCLICCONFIG_EXT
28+
select LEGACY_CLIC_MEMORYMAP_ACCESS
2129

2230
if SOC_SERIES_ANDES_AE350
2331

@@ -28,20 +36,14 @@ default RV32I_CPU
2836
config RV32I_CPU
2937
bool "RISCV32 CPU ISA"
3038
select RISCV_ISA_RV32I
31-
select RISCV_ISA_EXT_ZICSR
32-
select RISCV_ISA_EXT_ZIFENCEI
3339

3440
config RV32E_CPU
3541
bool "RISCV32E CPU ISA"
3642
select RISCV_ISA_RV32E
37-
select RISCV_ISA_EXT_ZICSR
38-
select RISCV_ISA_EXT_ZIFENCEI
3943

4044
config RV64I_CPU
4145
bool "RISCV64 CPU ISA"
4246
select RISCV_ISA_RV64I
43-
select RISCV_ISA_EXT_ZICSR
44-
select RISCV_ISA_EXT_ZIFENCEI
4547
select 64BIT
4648

4749
endchoice

soc/andestech/ae350/Kconfig.defconfig

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ config RISCV_GENERIC_TOOLCHAIN
2121
config RISCV_SOC_INTERRUPT_INIT
2222
default y
2323

24+
if RISCV_HAS_PLIC
25+
2426
config 2ND_LVL_ISR_TBL_OFFSET
2527
default 12
2628

@@ -39,6 +41,22 @@ config NUM_2ND_LEVEL_AGGREGATORS
3941
config NUM_IRQS
4042
default 116
4143

44+
endif # RISCV_HAS_PLIC
45+
46+
if RISCV_HAS_CLIC
47+
48+
config NUM_IRQS
49+
default 48
50+
51+
config RISCV_MCAUSE_EXCEPTION_MASK
52+
default 0xFFF
53+
54+
config ARCH_IRQ_VECTOR_TABLE_ALIGN
55+
default 512 if RISCV_ISA_RV64I
56+
default 256
57+
58+
endif # RISCV_HAS_CLIC
59+
4260
choice CACHE_TYPE
4361
default EXTERNAL_CACHE
4462
endchoice

soc/andestech/ae350/Kconfig.defconfig.ae350

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Copyright (c) 2021 Andes Technology Corporation
22
# SPDX-License-Identifier: Apache-2.0
33

4-
if SOC_ANDES_AE350
4+
if SOC_ANDES_AE350 || SOC_ANDES_AE350_CLIC
55

66
config SYS_CLOCK_TICKS_PER_SEC
77
default 100 if (!ICACHE || XIP)
@@ -22,4 +22,4 @@ config MP_MAX_NUM_CPUS
2222
default 1
2323
range 1 8
2424

25-
endif # SOC_ANDES_AE350
25+
endif # SOC_ANDES_AE350 || SOC_ANDES_AE350_CLIC

soc/andestech/ae350/Kconfig.soc

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,14 @@ config SOC_ANDES_AE350
1313
help
1414
Andes AE350 SoC implementation"
1515

16+
config SOC_ANDES_AE350_CLIC
17+
bool
18+
select SOC_SERIES_ANDES_AE350
19+
help
20+
Andes AE350 CLIC SoC implementation"
21+
1622
config SOC_SERIES
1723
default "ae350" if SOC_SERIES_ANDES_AE350
1824

1925
config SOC
20-
default "ae350" if SOC_ANDES_AE350
26+
default "ae350" if SOC_ANDES_AE350 || SOC_ANDES_AE350_CLIC

0 commit comments

Comments
 (0)