summaryrefslogtreecommitdiff
path: root/libcpu/risc-v/common
AgeCommit message (Collapse)Author
47 hours[libcpu][risc-v] Fix ticket spinlock stalls under SMP contentionGuEe-GUI
Eight-core boot on SpacemiT K1 could stall with one CPU in the unlock LR/SC loop, two CPUs allocating tickets, and the remaining CPUs waiting for the scheduler lock. Replace LR/SC ticket allocation with amoadd.w.aqrl and release the lock with a halfword owner update. Order critical-section accesses after acquiring ownership and before releasing it. Verified eight-core boot on K1 with temporary diagnostics and reservation-clearing changes removed. Signed-off-by: GuEe-GUI <[email protected]>
5 days[bsp][spacemit/k1] first version #11132GUI
7 days[ARCH/RISC-V] Next RISC-V (#10320)GUI
* [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 <[email protected]> * [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 <[email protected]> * [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 <[email protected]> --------- Signed-off-by: GuEe-GUI <[email protected]> Signed-off-by: seteiro <[email protected]> Co-authored-by: seteiro <[email protected]>
2026-02-25[bsp/gd32] fix gd32vw553 bspMuChenger
2025-12-11update: [libcpu][risc-v][common] allow overriding isr numbers for MCUFan YANG
- allow overriding the isr numbers via RT_HW_ISR_NUM macro Signed-off-by: Fan YANG <[email protected]>
2025-11-16Reorganize Group names in build system for clarity and IDE integration #10923Copilot
2025-05-30移除无用文件,该文件未被任何BSP使用Yaochenger
2025-05-30[libcpu/common] ↵Yaochenger
修正对RV32E的支持,RV32E不支持s2寄存器,修改为s1寄存器
2025-03-03[libcpu][riscv] add a doc for wch saving the irq stack as stack-512 (#10063)Kai
2025-01-29libcpu: riscv: common: fixed build warningsChen Wang
When building bsp/cvitek/c906_little, compiler warns: ``` .../rt-thread/libcpu/risc-v/common/trap_common.c: In function 'rt_hw_interrupt_install': .../rt-thread/libcpu/risc-v/common/trap_common.c:50:11: warning: unused variable 'user_param' [-Wunused-variable] 50 | void *user_param = param; | ^~~~~~~~~~ .../rt-thread/libcpu/risc-v/common/trap_common.c: In function 'rt_rv32_system_irq_handler': .../rt-thread/libcpu/risc-v/common/trap_common.c:77:25: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] 77 | s_stack_frame = (rt_hw_stack_frame_t *)mscratch; | ^ ``` Fixed these warnings as per indication from gcc. Signed-off-by: Chen Wang <[email protected]>
2024-10-08[libcpu][risc-v]add README for RV64zhangjing0303
2024-08-01[bsp][ch32] add eth driverYaochenger
2024-07-15Bugfix/fix weak handle trap in riscv common crash rv64 trap handling (#9189)Fan Yang
* [bsp][hpmicro] add weak handle_trap implementation - added weak handle_trap implementation Signed-off-by: Fan YANG <[email protected]> * [libcpu][risc-v][common] remove weak handle_trap function - removed weak handle_trap function from trap_common.c Signed-off-by: Fan YANG <[email protected]> --------- Signed-off-by: Fan YANG <[email protected]>
2024-04-30Fix compiling eror in hpmicro bsp (#8889)Fan Yang
- added 'DEVICE' to rtconfig.py - fixed compiling error cuased by change in interrupt_gcc.S Signed-off-by: Fan YANG <[email protected]>
2024-02-20[libcpu][SConscript]规范group名为libcpuMeco Man
2024-01-28add libcpu/risc-v/rv64 (#8511)flyingcys
2023-08-11[libcpu][risc-v][common] Fix application crash on risc-v soc if FPU isFan YANG
enabled - Defined ARCH_RISCV_FPU once the __riscv_flen macro was detected Signed-off-by: Fan YANG <[email protected]>
2023-08-09[libcpu][risc-v][common] Avoid using t0 before being savedFan YANG
- Fixed the issue that t0 was modified unexpectedly before being saved Signed-off-by: Fan YANG <[email protected]>
2023-08-08rt_hw_cpu_shutdown: implement default weak functionMeco Man
and remvoe duplicated default functions in each cpu/bsp level
2023-06-07[risc-v][libcpu] 删去无用局部变量 (#7634)Liu,Yuan
2023-05-20[atomic] add stdc atomic detection. (#7536)Bernard Xiong
2023-03-30[utest][atomic]添加返回值测试 (#7124)Yaochenger
* [utest][atomic]添加返回值测试
2023-03-29[bsp]fix esp32_c3 compile error (#7107)flyingcys
* fix rt_hw_interrupt_install return value * add __rt_rvstack
2023-03-23[atomic]添加arm与risc-v下的常用原子操作函数 (#7053)Yaochenger
* Update Kconfig * Update trap_gcc.S * Update bsp/hifive1/drivers/SConscript Co-authored-by: Man, Jianting (Meco) <[email protected]> * Update SConscript * [atomic]提交一份arm与risc-v架构下的常用原子操作函数 * 修改变量类型 * 更新rtatomic.h与atomic_port.c * 更新rt-thread\libcpu\arm\common\atomic_port.c * 更新include/rtatomic.h与libcpu/arm/common/SConscript * 更新include/rtatomic.h * 修正格式与Kconfig * 修正格式与文件结构 * 规范文件格式与文件重命名 * 添加测试用例与CI * 添加函数声明 * 修改virt64/SConscript 添加atomic_riscv.c * 1.规范代码风格 * 2.添加RISC-V64原子指令支持 解决在RV64下编译器将32-bit运算结果扩展为64-bit 导致判断错误 * 添加C11标准库原子操作测试 --------- Co-authored-by: Man, Jianting (Meco) <[email protected]>
2023-03-19[bsp] add bl808 lp core (#7069)flyingcys
* Add riscv_32e support * add bl808 lp core * update README.md
2023-03-01[libcpu][riscv]整合libcpu/riscv中的移植文件 ↵Yaochenger
提供一份公共代码于common (#6941) 整合libcpu/riscv中的移植文件 提供一份公共代码于common 在提交本pr时,除hpmicro的内核,rv32内核bsp已完成去除大部分的冗余,大部分代码采用common中的实现。本pr的作用是进一步统一common中的文件,从而提供一份公用代码,新移植的RV32内核的BSP可以全部使用common代码。 - 在common中提供一份公用文件:interrupt_gcc.S - 修改原有的文件,将原有的中断中上下文切换代码替换为interrupt_gcc.S - 基于上述修改,修改仓库中risc-v内核的BSP与移植相关的部分 (主要包含中断入口函数 中断栈等) - 在common中提供一份公用文件:trap_common.c;提供统一中断入口函数,中断入口函数初始化,中断入口注册等函数,并完善异常时的信息输出 - 在common中提供一份公用文件:rt_hw_stack_frame.h;将栈帧结构体剥离,供用户使用 - 在上述工作完成后,在上述工作的基础上测试仓库中risc-v内核的BSP - 完善函数中的命名,完善中断栈的获取 - 提供一份详细的基于现有common文件的移植指南 #### 在什么测试环境下测试通过 - 1.CH32V307V-R1-R0 - 2.CH32V208W-R0-1V4 - 3.HPM6750EVKMINI - 4.GD32VF103V-EVAL - 5.qemu(CORE-V-MCU ) > 与上述开发板使用同样芯片的BSP均测试通过 在CH32V307V-R1-R0与HPM6750EVKMINI上基于现有移植文件进行多线程复杂场景下的长时间测试,测试过程系统运行正常。
2023-01-08format Kconfig and sconscriptMeco Man
2023-01-04[libcpu][riscv]移除ch32中的冗余文件,使用common下的文件 (#6813)Yaochenger
* [libcpu][riscv]移除ch32中的冗余文件,使用common下的文件 * 修正cpuport.h宏定义 * 规范宏定义格式
2023-01-02[libcpu][riscv]移除cv32e40p中部分文件,采用common中的文件Yaochenger
2022-12-28[libcpu][riscv] 添加宏用于区别是否开启FPU,更新ch32v208v-r0 ↵Yaochenger
->ch32v208w-r0,更新注释
2022-12-11[rtdef] use lower-case to define attributes (#6728)Man, Jianting (Meco)
* [rtdef] rename RT_WEAK attribute as rt_weak * [rtdef] rename RT_USED attribute as rt_used * [rtdef] rename RT_SECTION attribute as rt_section * [rtdef] rename ALIGN attribute as rt_align * [legacy] add RT_USED ALIGN RT_SECTION RT_WEAK as legacy support
2022-12-03sync branch rt-smart. (#6641)guo
* Synchronize the code of the rt mart branch to the master branch. * TTY device * Add lwP code from rt-smart * Add vnode in DFS, but DFS will be re-write for rt-smart * There are three libcpu for rt-smart: * arm/cortex-a, arm/aarch64 * riscv64 Co-authored-by: Rbb666 <[email protected]> Co-authored-by: zhkag <[email protected]>
2022-07-30WCH CH569W-R0-1v0 evt board bsp port, first version (#6167)emuzit
WCH CH569W-R0-1v0 evt board bsp port, first version dev/test under Ubuntu 20.04 toolchain from MounRiver_Studio_Community_Linux_x64_V120 tested drivers : SysTick, gpio, gpio interrupt, uart1 (RX interrupt, TX polling) libcpu/risc-v/SConscript : group includes rtconfig.CPU only if folder exists libcpu/risc-v/common/cpuport.c/rt_hw_context_switch_interrupt() : make it RT_WEAK for customization
2022-04-20uniform code writing-disable interruptthewon86
2021-03-27[libcpu] auto formattedMeco Man
2020-12-28resolve Conflictsyangjie
bsp/nrf52832/board/Sconscript bsp/nrf52832/startups/Sconscript bsp/raspberry-pi/raspi4-32/driver/SConscript
2020-12-19[SConscript]update group nameyangjie
2020-12-03Merge pull request #4019 from bj-wanghz/devBernard Xiong
fix long call linker error with 'jal', 'j' or conditional branch instruction in .S files for k210
2020-11-30[SConscript] change libcpu to LIBARCH,and correcte letter caseyangjie11
2020-11-23Merge pull request #4043 from zhangsz0516/zhangsz_1120Bernard Xiong
[libcpu][update]重启与关机函数:rt_hw_cpu_shutdown、rt_hw_cpu_reset,补充WEAK属性
2020-11-20[libcpu/risc-v][K210] add FPU supporttangweikang
2020-11-20[SConscript]rename group nameyangjie11
2020-11-20[libcpu][update]重启与关机函数:rt_hw_cpu_shutdown、rt_hw_cpu_reset ↵张世争
,补充WEAK属性
2020-11-11fix long call linker error with 'jal', 'j' or conditional branch instructionwanghongzhu
2019-11-05修改了上下文切换退出时的bug,该bug会导致中断被提前打� ↵ZhangTao
��造成死锁
2019-05-11fix signals for k210shaojinchun
2019-01-07[libcpu] Add SConscript in libcpu.Bernard Xiong
2018-12-28add k210 SMP supportshaojinchun
2018-12-08[libcpu] Add unified RISC-V libcpu porting.Bernard Xiong