mirror of
https://github.com/RT-Thread/rt-thread.git
synced 2026-11-17 07:05:31 +08:00
* [libcpu][risc-v] Refactor the RISC-V architecture port Introduce an opt-in unified RISC-V common layer for RV32 and RV64 while keeping existing BSPs on the legacy implementation during migration. - use ARCH_RISCV and ARCH_CPU_64BIT for architecture and XLEN selection - unify context, trap, MMU, cache, timer, SBI, SMP and ISA handling - add PLIC, CLIC, ACLINT, APLIC and IMSIC support - map physical hart IDs to contiguous logical CPU IDs - add T-Head vendor overrides while preserving legacy ports - migrate qemu-virt64-riscv with RV32 and RV64 support - update clock_time, MM, LWP, OFW, PCI and Rust integration Existing BSPs continue using legacy_common or common64 unless they select RT_USING_RISCV_NEW_COMMON. Signed-off-by: GuEe-GUI <2991707448@qq.com> * [libcpu][risc-v] skip disabled CPU nodes in early FDT walk Rbb666 noted that rt_hw_fdt_install_early() walked every /cpus child without checking status, so disabled cores still joined hart registration and MMU capability probing. Skip nodes that are not okay/ok via rt_fdt_device_is_available() before reading reg or mmu-type. Signed-off-by: seteiro <chenmoushun@163.com> * [libcpu][risc-v] Fix per-CPU page table mapping - reuse existing non-leaf page table entries when mapping per-CPU areas - reject leaf entry conflicts instead of overwriting mappings Signed-off-by: GuEe-GUI <2991707448@qq.com> --------- Signed-off-by: GuEe-GUI <2991707448@qq.com> Signed-off-by: seteiro <chenmoushun@163.com> Co-authored-by: seteiro <chenmoushun@163.com>
84 lines
2.0 KiB
Plaintext
84 lines
2.0 KiB
Plaintext
menu "RISC-V Architecture Configuration"
|
|
|
|
config RT_USING_RISCV_NEW_COMMON
|
|
bool
|
|
select RT_USING_CPU_FFS
|
|
select RT_USING_HW_ATOMIC if RT_USING_SMP
|
|
select RT_PAGE_MPR_SIZE_DYNAMIC if ARCH_MM_MMU
|
|
help
|
|
Select the unified RISC-V architecture implementation. BSPs that do
|
|
not select this option continue to use the legacy implementation while
|
|
the architecture migration is in progress.
|
|
|
|
if RT_USING_RISCV_NEW_COMMON
|
|
|
|
config ARCH_HAVE_EFFICIENT_UNALIGNED_ACCESS
|
|
bool
|
|
default n
|
|
|
|
config ARCH_RISCV_DISABLE_FENCE_I
|
|
bool
|
|
default n
|
|
|
|
config ARCH_RISCV_DISABLE_SFENCE_VMA_ASID
|
|
bool
|
|
default n
|
|
|
|
config ARCH_RISCV_M_MODE
|
|
bool
|
|
depends on !ARCH_MM_MMU
|
|
default n
|
|
|
|
config ARCH_RISCV_32E
|
|
bool
|
|
depends on ARCH_RISCV32
|
|
depends on !ARCH_MM_MMU
|
|
depends on !RT_USING_DM
|
|
|
|
config ARCH_RISCV_USING_IRQ_STACK
|
|
bool "Use a dedicated interrupt stack"
|
|
depends on !RT_USING_SMART
|
|
default y if ARCH_RISCV_M_MODE || !RT_USING_DM
|
|
help
|
|
Keep the saved exception frame on the interrupted thread stack, then
|
|
run C-level trap and interrupt handlers on a per-CPU interrupt stack.
|
|
This is recommended for MCU ports.
|
|
|
|
config ARCH_RISCV_IRQ_STACK_SIZE
|
|
int "Interrupt stack size per CPU"
|
|
depends on ARCH_RISCV_USING_IRQ_STACK
|
|
range 256 65536
|
|
default 1024
|
|
|
|
config RT_USING_USERSPACE_32BIT_LIMIT
|
|
bool "Enable userspace 32bit limit"
|
|
depends on ARCH_RISCV64
|
|
default n
|
|
|
|
config ARCH_TEXT_OFFSET
|
|
hex "Kernel image offset from RAM base"
|
|
default 0x200000 if ARCH_RISCV64
|
|
default 0x400000
|
|
|
|
config ARCH_RAM_OFFSET
|
|
hex "RAM base address"
|
|
default 0
|
|
|
|
config ARCH_SECONDARY_CPU_STACK_SIZE
|
|
int "Secondary CPU stack size"
|
|
depends on RT_USING_SMP
|
|
default 4096
|
|
|
|
config ARCH_HEAP_SIZE
|
|
hex "Size of system heap"
|
|
depends on RT_USING_DM
|
|
|
|
config ARCH_INIT_PAGE_SIZE
|
|
hex "Size of init page region"
|
|
depends on RT_USING_DM && ARCH_MM_MMU
|
|
default 0x200000
|
|
|
|
endif
|
|
|
|
endmenu
|