mirror of
https://github.com/RT-Thread/rt-thread.git
synced 2026-11-16 01:05:15 +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>
48 lines
1.3 KiB
Python
48 lines
1.3 KiB
Python
import os
|
|
from building import *
|
|
|
|
Import('rtconfig')
|
|
|
|
cwd = GetCurrentDir()
|
|
|
|
group = []
|
|
build_clock_time = GetDepend('RT_USING_CLOCK_TIME')
|
|
|
|
if not build_clock_time:
|
|
Return('group')
|
|
|
|
src = [
|
|
'clock_time_core.c',
|
|
'clock_hrtimer.c',
|
|
'clock_boottime.c',
|
|
'clock_timer.c',
|
|
]
|
|
if GetDepend('RT_CLOCK_TIME_ARM_ARCH'):
|
|
src += ['clock_time_arm_arch.c']
|
|
|
|
arch_dir = os.path.join(cwd, 'arch')
|
|
if os.path.isdir(arch_dir):
|
|
arch_list = os.listdir(arch_dir)
|
|
if rtconfig.ARCH in arch_list:
|
|
cpu_dir = os.path.join(arch_dir, rtconfig.ARCH, rtconfig.CPU)
|
|
if rtconfig.ARCH == 'risc-v':
|
|
if GetDepend('RT_USING_RISCV_NEW_COMMON'):
|
|
src += Glob("arch/risc-v/*.c")
|
|
elif os.path.exists(cpu_dir):
|
|
src += Glob("arch/%s/%s/*.c" % (rtconfig.ARCH, rtconfig.CPU))
|
|
elif os.path.exists(cpu_dir):
|
|
src += Glob("arch/%s/%s/*.c" % (rtconfig.ARCH, rtconfig.CPU))
|
|
else:
|
|
src += Glob("arch/%s/*.c" % rtconfig.ARCH)
|
|
|
|
CPPPATH = [cwd, os.path.join(cwd, '..', 'include')]
|
|
LOCAL_CCFLAGS = ''
|
|
if rtconfig.PLATFORM in ['gcc', 'armclang']:
|
|
LOCAL_CCFLAGS += ' -std=gnu99'
|
|
elif rtconfig.PLATFORM in ['armcc']:
|
|
LOCAL_CCFLAGS += ' --c99 --gnu'
|
|
|
|
group = DefineGroup('DeviceDrivers', src, depend=[''], CPPPATH=CPPPATH, LOCAL_CCFLAGS=LOCAL_CCFLAGS)
|
|
|
|
Return('group')
|