summaryrefslogtreecommitdiff
path: root/libcpu/aarch64
AgeCommit message (Collapse)Author
2025-10-23aarch64: document the CNTFRQ_EL0Yonggang Luo
Signed-off-by: Yonggang Luo <[email protected]>
2025-10-21[aarch64] Fix rt_aspace_init error when KERNEL_VADDR_START >= 0x80000000Siwei Xu
2025-10-13Remove unused rt_hw_set_gtimer_frqYonggang Luo
2025-10-10[CPU/AARCH64] 增加 libcpu/aarch64 KERNEL_ASPACE_START 配置 #10757zhangyan
针对不同的 Aarch64 BSP 针对 KERNEL_VADDR_START 宏定义进行区分
2025-07-16[ARCH/AARCH64] Update Hypercall APIGuEe-GUI
Signed-off-by: GuEe-GUI <[email protected]>
2025-07-08[aarch64]Fixup linker warning #10466GUI
2025-07-07Fixup the boot EL checkGuEe-GUI
The boot EL will save in x0, when current EL is EL3, kernel will jump to the EL2 after EL3. But the x0 value is **3**, The init for EL2 will not work. To fix it: the EL3 should jump to the EL2 init branch with not check, and when SoC boot in EL2, kernel will jump to the EL2 test branch. Link: https://club.rt-thread.org/ask/question/ec320a6765389f67.html Signed-off-by: wusongjie <[email protected]>
2025-07-04[CPU/AARCH64] Fixup MMUGuEe-GUI
1. Configure the kernel default vaddr by RAM and TEXT offset. 2. Check the p_addr 2M align when set the stride in `rt_hw_mmu_map`. Signed-off-by: GuEe-GUI <[email protected]>
2025-04-28import rercitach
2025-04-28Fix Aarch64 architecture runtime issuesrcitach
该问题由5b3320624da5149fc21c2d3e1f321d855e3d0dfe引入,导致工具链编译时加上了 -std=gnu99,其他架构是否出问题暂时未知
2025-04-13libcpu: aarch64: Fix NORMAL_NOCACHE_MEM attr (#10180)mouch6131
Signed-off-by: Cliff Chen <[email protected]> Signed-off-by: mouch6131 <[email protected]> Co-authored-by: Cliff Chen <[email protected]>
2025-04-11libcpu: cleanup undefined rt_hw_mmu_kernel_map_init (#10177)Chen Wang
* libcpu: cleanup undefined rt_hw_mmu_kernel_map_init rt_hw_mmu_kernel_map_init() is declared in header files but no definition found, cleanup the code. Signed-off-by: Chen Wang <[email protected]> * bsp: allwinner: d1: remove calling of rt_hw_mmu_kernel_map_init rt_hw_mmu_kernel_map_init is an undefined function, calling it is meaningless. Signed-off-by: Chen Wang <[email protected]> --------- Signed-off-by: Chen Wang <[email protected]>
2025-03-28[libcpu][aarch64]fix gicv3 mpidr table (#9284)zms123456
* fix gicv3 mpidr error * phytium should support rt_cpu_mpidr_table by using common_setup
2025-02-25feat: mm: added affinity pages allocatorShell
This patch introduces a tagged pages allocator to address the existing problems of page aliasing on specific platforms and the requirement of page coloring. It implements an affinity-id aware page manager by separating the runtime page list into two types: a normal single linked-list and a multi-dimensional affinity-list. Changes: - Introduced tagged pages allocator and managing algorithm for affinity pages list - Modified components to support affinity-id list management - Updated page allocation and freeing functions to handle tagged pages - Added configuration options for page affinity block size and debugging - Modified mmap and elf loading to respect affinity settings - Enhanced page list management to support multi-dimensional affinity-list Signed-off-by: Shell <[email protected]>
2025-02-11[AARCH64] Update kernel's boot link for ARM64GuEe-GUI
Signed-off-by: GuEe-GUI <[email protected]>
2024-12-13feat: arm64: mmu: auto-sensing of best paging strideShell
Improves the memory mapping process by dynamically selecting the optimal paging stride (4K or 2M) based on virtual address alignment and mapping size. This eliminates the need for upfront stride determination, enhancing flexibility and maintainability in memory management. Changes: - Replaced fixed stride selection logic with a dynamic decision loop. - Removed `npages` calculation and replaced with `remaining_sz` to track unprocessed memory size. - Added assertions to ensure `size` is properly aligned to the smallest page size. - Adjusted loop to dynamically determine and apply the appropriate stride (4K or 2M) for each mapping iteration. - Updated virtual and physical address increments to use the dynamically selected stride. Signed-off-by: Shell <[email protected]>
2024-12-13[FIXUP] __rt_clz loss in aarch64GuEe-GUI
Signed-off-by: GuEe-GUI <[email protected]>
2024-11-24feat: Kconfig: moving the arm64 specified configs to sub-menuShell
Just for better readability. Signed-off-by: Shell <[email protected]>
2024-11-24feat: arm64 ASID supportShell
Support for ARM64 ASID to enhance virtual memory management efficiency by reducing the need for TLB flushes during address space switches. These changes improve performance especially for multi-process systems. Changes: - Added `ARCH_USING_ASID` configuration in `libcpu/aarch64/Kconfig`. - Defined ASID-related constants in `mmu.h`. - Updated `TLBI_ARG` macro to include ASID manipulation. - Implemented ASID allocation mechanism with spinlock synchronization. - Enhanced TLB invalidation to support ASID-specific operations. - Modified `rt_hw_aspace_switch` to use ASIDs when switching address spaces. - Adjusted debug logging and function documentation to reflect ASID usage. - Refactored AArch64 MMU and TLB handling for ASID integration. Signed-off-by: Shell <[email protected]>
2024-11-18[DM/FIXUP] remove some redundant INIT_EXPORTGuEe-GUI
Signed-off-by: GuEe-GUI <[email protected]>
2024-11-17[libcpu] fix No memory higher than 1 GB is mappedzhujiale
2024-11-17[libcpu] fix No memory higher than 1 GB is mappedzhujiale
2024-11-03:truck: renaming: move `smp` to `smp_call`Shell
2024-11-03feat: smp_call: added signaling call_reqShell
This patch introduces `rt_smp_call_request` API to handle queued requests across cores with user provided data buffer, which provides a way to request IPI through a non-blocking pattern. It also resolved several issues in the old implementation: - Multiple requests from different cores can not be queued in the work object of the target core. - Data racing on `rt_smp_work` of same core. If multiple requests came in turns, or if the call is used by the target cpu, while a new request is coming, the value will be overwrite. - Memory vulnerability. The rt_smp_event is allocated on stack, though the caller may not wait until the call is done. - API naming problem. Actually we don't provide a way to issue an IPI to ANY core in mask. What the API do is aligned to MANY pattern. - FUNC_IPI registering to PIC. Changes: - Declared and configured the new `RT_SMP_CALL_IPI` to support functional IPIs for task requests across cores. - Replaced the single `rt_smp_work` array with `call_req_cores` to manage per-core call requests safely. - Added `_call_req_take` and `_call_req_release` functions for atomic handling of request lifetimes, preventing data race conditions. - Replaced single event handling with a queue-based approach (`call_queue`) for efficient multi-request processing per core. - Introduced `rt_smp_call_ipi_handler` to process queued requests, reducing IPI contention by only sending new requests when needed. - Implemented `_smp_call_remote_request` to handle remote requests with specific flags, enabling more flexible core-to-core task signaling. - Refined `rt_smp_call_req_init` to initialize and track requests with atomic usage flags, mitigating potential memory vulnerabilities. Signed-off-by: Shell <[email protected]>
2024-11-03feat: Added rt_interrupt_context* family for nested interrupt handlingShell
These changes introduce the rt_interrupt_context family, providing a mechanism for managing nested interrupts. The context management ensures proper storage and retrieval of interrupt states, improving reliability in nested interrupt scenarios by enabling context tracking across different interrupt levels. This enhancement is essential for platforms where nested interrupt handling is crucial, such as in real- time or multi-threaded applications. Changes: - Defined rt_interrupt_context structure with context and node fields in `rtdef.h` to support nested interrupts. - Added rt_slist_pop function in `rtservice.h` for simplified node removal in singly linked lists. - Declared rt_interrupt_context_push, rt_interrupt_context_pop, and rt_interrupt_context_get functions in `rtthread.h` to manage the interrupt/exception stack. - Modified AArch64 CPU support in `cpuport.h` to include rt_hw_show_register for debugging registers. - Refactored `_rt_hw_trap_irq` in `trap.c` for context-aware IRQ handling, with stack push/pop logic to handle nested contexts. - Implemented interrupt context push, pop, and retrieval logic in `irq.c` to manage context at the CPU level. Signed-off-by: Shell <[email protected]>
2024-10-11feat: arm64: update thread self on sp-switchShell
This patch improves the atomicity of context switching by ensuring that the stack pointer (sp) and thread self updates occur simultaneously. This enhancement is crucial for maintaining thread safety and preventing potential inconsistencies during context switches. Changes: - Modified `cpuport.h` to use `ARM64_THREAD_REG` for thread self access. - Added an `update_tidr` macro in `context_gcc.S` to streamline thread ID updates. - Adjusted `rt_hw_context_switch_to` and `rt_hw_context_switch` to call `update_tidr`, ensuring atomic updates during context switches. - Cleaned up `scheduler_mp.c` by removing redundant thread self assignments. Signed-off-by: Shell <[email protected]>
2024-09-24smpzhujiale
2024-09-24SMPzhujiale
2024-09-24smp_ipizhujiale
2024-09-19feat: smart: user space context optimizationShell
This patch optimizes the user-space context handling in the ARM64 architecture, specifically improving how the context is saved and restored during system calls and interrupts. The changes make the code more efficient and easier to maintain, while ensuring proper preservation of user context during system transitions. Changes: - Introduced a parameter for context saving to improve flexibility. - Replaced hardcoded stack pointer operations with frame-relative references for better readability and code reuse. - Simplified context restoration, removing redundant operations like loading/storing floating-point registers. Signed-off-by: Shell <[email protected]>
2024-09-06[DM] Extended drivers MISC interfaceGuEe-GUI
1. RT_FIELD_PREP: prepare a bitfield element. 2. RT_FIELD_GET: extract a bitfield element. 3. rt_offsetof: member offset of a struct 4. rt_upper_32_bits: high 32 bits of value. 5. rt_lower_32_bits: lower 32 bits of value. 6. rt_upper_16_bits: high 16 bits of value. 7. rt_lower_16_bits: lower 16 bits of value. 8. rt_max_t: fix type of max(...). 9. rt_ilog2: integer logarithm base 2. Signed-off-by: GuEe-GUI <[email protected]>
2024-09-03[libcpu/aarch64]修改atomic实现zhangyan
2024-08-27[BSP][Phytium] add support for mainbranch cherryusb (xhci host + pusb2 ↵zhugengyu
device/host)
2024-08-27feat: arm64: generic implementation of vector irq (#9336)Shell
feat: overall implementation of vector irq This patch generalize the irq handling on up/mp system by adding the `rt_hw_irq_exit()` & `rt_hw_vector_irq_sched()` API. Changes: - Added `rt_hw_irq_exit()` and `rt_hw_vector_irq_sched()` APIs for unified IRQ management. - Refactored assembly code for both UP and MP systems to use the new IRQ handling flow. - Removed redundant code and optimized exception handling paths. Signed-off-by: Shell <[email protected]>
2024-07-25Merge pull request #9228 from messigogogo/masterBernard Xiong
[BSP/Phytium]适配最新驱动
2024-07-25Merge pull request #9236 from polarvid/shell/arm64-headerBernard Xiong
quality: include the essential only to avoid recursion
2024-07-24quality: include the essential only to avoid recursionShell
The rtdef.h is a big header with multiple dependency inside, which makes it easier to introduce recursion dependency. Signed-off-by: Shell <[email protected]>
2024-07-22[BSP/Phytium]适配最新裸机驱动张衍
2024-07-18[libcpu/arm64] feat: Trimming General ContextShell
This patch focuses on the ARM64 general context handling code. The modifications are aimed at enhancing performance by simplifying context save/restore operations. Changes include: - Adjusted stack alignment in `arch_set_thread_context` function. - Updated `lwp_gcc.S` to reset frame pointer and link register. - Refined `rt_hw_backtrace_frame_unwind` to handle user space address checks. - Added `GET_THREAD_SELF` macro in `asm-generic.h`. - Simplified context saving/restoring in `context_gcc.h` and related files. - Optimized `rt_hw_context_switch_interrupt` and related assembly routines. Signed-off-by: Shell <[email protected]>
2024-07-17[libcpu] quality: call PV_OFFSET on entry for onceShell
This patch improves the efficiency and readability of the AArch64 common setup code by calculating the `PV_OFFSET` once at the start and reusing the value. This change reduces redundant calculations. Signed-off-by: Shell <[email protected]>
2024-07-16[libcpu][setup]fix fdt_ptr error (#9138)zms123456
fix fdt_ptr error
2024-07-15[lwp][vdso] Add VDSO functionality under the aarch64 architecture (#9176)rcitachi
Add VDSO functionality under the aarch64 architecture
2024-06-28[format] cleanup libcpu/aarch64 (#8950)Shell
* [dfs] fixup compiler warning Signed-off-by: Shell <[email protected]> * [format] libcpu/arm64: separate context switching codes Signed-off-by: Shell <[email protected]> * [format] libcpu/arm64: separate vector Signed-off-by: Shell <[email protected]> * [format] libcpu/arm64: separate context_gcc.S Signed-off-by: Shell <[email protected]> * [format] libcpu/arm64: moving headers to include directory Signed-off-by: Shell <[email protected]> * style: replace tab with space --------- Signed-off-by: Shell <[email protected]>
2024-06-26[libcpu][aarch64]mmu log fixup (#9078)zms123456
mmu log fixup
2024-06-26[libcpu][aarch64]memory setup using memblock (#9092)zms123456
* memory setup using memblock * map pages later
2024-06-16[bsp/phytium]c++支持,gpio,qspi驱动修改 (#9059)zhangyan
* GPIO驱动与QSPI驱动适配 * C++支持 * update --------- Co-authored-by: 张衍 <[email protected]>
2024-06-13[kservice] Enhance support for backtrace service (#9037)Shell
[feat] Enhance support for backtrace service rt_backtrace_formatted_print() and rt_backtrace_to_buffer() to help debug routines. Also, following modification are included: - make rt_backtrace_frame patchable with weak attr - replace lwp backtrace with sync output Signed-off-by: Shell <[email protected]>
2024-06-11[libcpu] arm64: implement cpuid get by assembly (#9052)Shell
2024-06-07[mm] precise & readable mm fault type (#9047)Shell
* [smart] fixup: precise mm fault type Also, fixup arm64 read access fault * arm64: using meaningful macro on trap * fixup: renaming macro
2024-05-28[arm64] add hw thread self (#8942)Shell
* [libcpu] arm64: Add hardware thread_self support This patch introduces hardware-based thread self-identification for the AArch64 architecture. It optimizes thread management by using hardware registers to store and access the current thread's pointer, reducing overhead and improving overall performance. Changes include: - Added `ARCH_USING_HW_THREAD_SELF` configuration option. - Modified `rtdef.h`, `rtsched.h` to conditionally include `critical_switch_flag` based on the new config. - Updated context management in `context_gcc.S`, `cpuport.h` to support hardware-based thread self. - Enhanced `scheduler_mp.c` and `thread.c` to leverage the new hardware thread self feature. These modifications ensure better scheduling and thread handling, particularly in multi-core environments, by minimizing the software overhead associated with thread management. Signed-off-by: Shell <[email protected]> * fixup: address suggestion * fixup: rt_current_thread as global * scheduler: add cpu object for UP scheduler Also, maintain the rt_current_thread in cpu object on UP scheduler. --------- Signed-off-by: Shell <[email protected]>