mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2025-10-13 08:17:44 -04:00
The goal of this commit is to add the GCC/ARMClang non-MPU port variant for ARM Cortex-R82 processor which is ARMv8-R AArch64 based. The work done is inspired by the GCC ARM_AARCH64 FreeRTOS port. This port has the following features: * Uses single security state (non TrustZone). * Supports SMP (Symmetric multi-processing). * Doesn't support Hypervisor (EL2). * Doesn't support neither PMSA (MPU) nor VMSA (MMU). Signed-off-by: Ahmed Ismail <Ahmed.Ismail@arm.com> |
||
---|---|---|
.. | ||
port.c | ||
portASM.S | ||
portmacro.h | ||
README.md |
Arm Cortex-R82 FreeRTOS Kernel Port
Overview
- This directory contains the FreeRTOS Kernel port for Arm Cortex-R82 based on Armv8-R AArch64 architecture.
- It provides the portable layer required by the kernel to run on this architecture.
Supported toolchains
The port is supported and tested on the following toolchains:
- Arm Compiler for Embedded v6.23 (armclang).
- Arm GNU toolchain v14.2.
Cache Coherency
- This port assumes the hardware or model is fully cache coherent.
- The port does not perform cache maintenance for shared buffers.
- If your hardware or model doesn't support full cache coherency, you must handle cache clean/invalidate operations, memory attributes, and any additional barriers in your BSP/application (especially around shared-memory regions).
SMP Multicore Bring-up
For SMP systems using this port, the application only needs to start the scheduler on the primary core and issue an SVC from each secondary core once they are online. The kernel coordinates the rest and ensures all cores are properly managed.
- Developer-facing summary: call
vTaskStartScheduler()
on the primary core; each secondary core, in its reset handler, performs its local init and then issues an SVC (immediate value106
) to hand off to the kernel. The port will bring all cores under the scheduler.
Primary core flow:
- Perform core-specific and shared initialization (e.g., set EL1 stack pointer, zero-initialize
.bss
). - Jump to
main()
, create user tasks, optionally pin tasks to specific cores. - Call
vTaskStartScheduler()
which invokesxPortStartScheduler()
. xPortStartScheduler()
configures the primary core tick timer and signals secondary cores that shared init is complete using theucPrimaryCoreInitDoneFlag
variable.- Wait until all secondary cores report as brought up.
- Once all cores are up, call
vPortRestoreContext()
to schedule the first task on the primary core.
Secondary core flow (to be done in each core’s reset handler):
- Perform core-specific initialization (e.g., set EL1 stack pointer).
- Wait for the primary core's signal that shared initialization is complete (i.e.,
ucPrimaryCoreInitDoneFlag
set to 1). - Update
VBAR_EL1
from the boot vector table to the FreeRTOS vector table. - Initialize the GIC redistributor and enable SGIs so interrupts from the primary core are receivable; signal the primary that this secondary is online and ready by setting the its flag in the
ucSecondaryCoresReadyFlags
array. - Issue an SVC with immediate value
106
to enterFreeRTOS_SWI_Handler
, which will callvPortRestoreContext()
based on the SVC number to start scheduling on this core.