| #
8e17e072 |
| 15-Jul-2025 |
Marouene Boubakri <marouene.boubakri@nxp.com> |
core: riscv: add build config for MPXY/RPMI support
Enable compilation of MPXY/RPMI support by introducing the build option `CFG_RISCV_SBI_MPXY_RPMI`.
This commit: - Adds sbi_mpxy_rpmi.c to the bui
core: riscv: add build config for MPXY/RPMI support
Enable compilation of MPXY/RPMI support by introducing the build option `CFG_RISCV_SBI_MPXY_RPMI`.
This commit: - Adds sbi_mpxy_rpmi.c to the build when the option is enabled - Forces `CFG_RISCV_SBI_MPXY` when MPXY/RPMI is selected - Enables CFG_RISCV_SBI_MPXY_RPMI in plat-virt by default
Signed-off-by: Marouene Boubakri <marouene.boubakri@nxp.com> Reviewed-by: Alvin Chang <alvinga@andestech.com>
show more ...
|
| #
00eea924 |
| 15-Jul-2025 |
Marouene Boubakri <marouene.boubakri@nxp.com> |
core: riscv: introduce CFG_RISCV_SBI_MPXY flag for MPXY SBI support
Add a new build-time configuration flag CFG_RISCV_SBI_MPXY to enable compilation of MPXY SBI extension support in OP-TEE. When ena
core: riscv: introduce CFG_RISCV_SBI_MPXY flag for MPXY SBI support
Add a new build-time configuration flag CFG_RISCV_SBI_MPXY to enable compilation of MPXY SBI extension support in OP-TEE. When enabled, this automatically forces CFG_RISCV_SBI to ensure the SBI infrastructure is included.
Also update the build system to conditionally compile sbi_mpxy.c based on this flag.
Enable CFG_RISCV_SBI_MPXY by default for the virt platform.
Signed-off-by: Marouene Boubakri <marouene.boubakri@nxp.com> Reviewed-by: Yu-Chien Peter Lin <peter.lin@sifive.com> Reviewed-by: Alvin Chang <alvinga@andestech.com>
show more ...
|
| #
e10bcf3b |
| 07-Apr-2024 |
Alvin Chang <alvinga@andestech.com> |
core: riscv: Add seed CSR detection helper
Any attempted access to unimplemented or restricted CSRs will raise an illegal instruction, so we can set up a temporary trap handler to validate if the us
core: riscv: Add seed CSR detection helper
Any attempted access to unimplemented or restricted CSRs will raise an illegal instruction, so we can set up a temporary trap handler to validate if the use of CSRs is allowed in the privileged mode where OP-TEE OS is running. Add a helper for this specific purpose.
Signed-off-by: Alvin Chang <alvinga@andestech.com> Reviewed-by: Yu Chien Peter Lin <peterlin@andestech.com> Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| #
6d716a4b |
| 21-Feb-2024 |
Alvin Chang <alvinga@andestech.com> |
core: riscv: Add semihosting.S for semihosting instructions
RISC-V architecture has defined the semihosting binary interface, which consists of a special trap instruction sequence, in: https://githu
core: riscv: Add semihosting.S for semihosting instructions
RISC-V architecture has defined the semihosting binary interface, which consists of a special trap instruction sequence, in: https://github.com/riscv-non-isa/riscv-semihosting
Add semihosting.S into RISC-V kernel folder to implement the trap instruction sequence.
Signed-off-by: Alvin Chang <alvinga@andestech.com> Acked-by: Jerome Forissier <jerome.forissier@linaro.org> Acked-by: Etienne Carriere <etienne.carriere@foss.st.com> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| #
5cc48b15 |
| 29-Aug-2023 |
Marouene Boubakri <marouene.boubakri@nxp.com> |
core: riscv: add thread_optee_abi.c
This commit just copies thread_optee_smc.c from ARM and renames smc/SMC to abi/ABI.
Signed-off-by: Marouene Boubakri <marouene.boubakri@nxp.com> Reviewed-by: Alv
core: riscv: add thread_optee_abi.c
This commit just copies thread_optee_smc.c from ARM and renames smc/SMC to abi/ABI.
Signed-off-by: Marouene Boubakri <marouene.boubakri@nxp.com> Reviewed-by: Alvin Chang <alvinga@andestech.com> Tested-by: Alvin Chang <alvinga@andestech.com>
show more ...
|
| #
a2efa71b |
| 29-Aug-2023 |
Marouene Boubakri <marouene.boubakri@nxp.com> |
core: riscv: move TEE ABI handlers from thread_rv.S to thread_optee_abi_rv.S
This commits moves the following functions from thread_rv.S to a separate file thread_optee_abi_rv.S:
- thread_return_fr
core: riscv: move TEE ABI handlers from thread_rv.S to thread_optee_abi_rv.S
This commits moves the following functions from thread_rv.S to a separate file thread_optee_abi_rv.S:
- thread_return_from_nsec_call() - thread_std_smc_entry() -> renamed to thread_std_abi_entry() - thread_rpc()
Signed-off-by: Marouene Boubakri <marouene.boubakri@nxp.com> Reviewed-by: Alvin Chang <alvinga@andestech.com> Tested-by: Alvin Chang <alvinga@andestech.com>
show more ...
|
| #
cabb8df3 |
| 20-Jun-2023 |
Alvin Chang <alvinga@andestech.com> |
core: riscv: Add cflags for excluding source files from ftrace
Some C source files may lead to incorrect behaviors in ftrace. Exclude them when the system is compiled with ftrace support.
Signed-of
core: riscv: Add cflags for excluding source files from ftrace
Some C source files may lead to incorrect behaviors in ftrace. Exclude them when the system is compiled with ftrace support.
Signed-off-by: Alvin Chang <alvinga@andestech.com> Acked-by: Jerome Forissier <jerome.forissier@linaro.org> Acked-by: Sumit Garg <sumit.garg@linaro.org> Reviewed-by: Marouene Boubakri <marouene.boubakri@nxp.com>
show more ...
|
| #
2e5a3b0d |
| 26-May-2023 |
Alvin Chang <alvinga@andestech.com> |
core: riscv: Implement function to print kernel stack
Implement the function to print the kernel stack. The code is referenced from ARM architecture.
Signed-off-by: Alvin Chang <alvinga@andestech.c
core: riscv: Implement function to print kernel stack
Implement the function to print the kernel stack. The code is referenced from ARM architecture.
Signed-off-by: Alvin Chang <alvinga@andestech.com> Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> Acked-by: Etienne Carriere <etienne.carriere@foss.st.com>
show more ...
|
| #
9d484c44 |
| 26-Dec-2022 |
Marouene Boubakri <marouene.boubakri@nxp.com> |
core: riscv: provide cache_helpers_rv.S
Simple implementation of instruction cache and data cache operations that relies on RISC-V's fence and fence.i instructions.
Signed-off-by: Marouene Boubakri
core: riscv: provide cache_helpers_rv.S
Simple implementation of instruction cache and data cache operations that relies on RISC-V's fence and fence.i instructions.
Signed-off-by: Marouene Boubakri <marouene.boubakri@nxp.com> Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| #
2c5f3d16 |
| 20-Dec-2022 |
Marouene Boubakri <marouene.boubakri@nxp.com> |
core: riscv: provide arch_scall_rv.S
Provide an implementation of scall_do_call(), syscall_sys_return() and syscall_panic().
Signed-off-by: Marouene Boubakri <marouene.boubakri@nxp.com> Acked-by: J
core: riscv: provide arch_scall_rv.S
Provide an implementation of scall_do_call(), syscall_sys_return() and syscall_panic().
Signed-off-by: Marouene Boubakri <marouene.boubakri@nxp.com> Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| #
76a38f4f |
| 19-Dec-2022 |
Marouene Boubakri <marouene.boubakri@nxp.com> |
core: riscv: arch_scall.c: implement scall_save_panic_stack()
Provide an implementation of scall_save_panic_stack() needed by scall_sys_return_helper().
Signed-off-by: Marouene Boubakri <marouene.b
core: riscv: arch_scall.c: implement scall_save_panic_stack()
Provide an implementation of scall_save_panic_stack() needed by scall_sys_return_helper().
Signed-off-by: Marouene Boubakri <marouene.boubakri@nxp.com> Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| #
fdb66914 |
| 19-Dec-2022 |
Marouene Boubakri <marouene.boubakri@nxp.com> |
core: riscv: implement thread management routines in thread_arch.c
This commit implements an initial thread management for RISC-V. It covers the following routines:
- Exceptions un/masking - Trap h
core: riscv: implement thread management routines in thread_arch.c
This commit implements an initial thread management for RISC-V. It covers the following routines:
- Exceptions un/masking - Trap handling, including syscalls handling. - Thread allocation, execution, suspension, freeing with slight changes to set RISC-V registers such as CSRs. - RPC.
Pending routines: - Floatting point support F/D/Q/L extensions and software FP. - Abort mode.
Signed-off-by: Marouene Boubakri <marouene.boubakri@nxp.com> Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| #
992b72f1 |
| 06-Jan-2023 |
Marouene Boubakri <marouene.boubakri@nxp.com> |
core: riscv: provide abort.c
Initial implementation of abort handler for RISC-V.
Signed-off-by: Marouene Boubakri <marouene.boubakri@nxp.com> Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
|
| #
9b1a3bbe |
| 19-Dec-2022 |
Marouene Boubakri <marouene.boubakri@nxp.com> |
core: riscv: add thread manager assembly code in thread_rv.S
This commit implements: - An entry point of trap handler in non-vectored mode. - thread_unwind_user_mode() and thread_exit_user_mode() to
core: riscv: add thread manager assembly code in thread_rv.S
This commit implements: - An entry point of trap handler in non-vectored mode. - thread_unwind_user_mode() and thread_exit_user_mode() to return from U-Mode. - __thread_enter_user_mode() to jump to U-Mode from S-Mode or M-Mode. - thread_std_smc_entry(), thread_resume() and thread_rpc().
Signed-off-by: Marouene Boubakri <marouene.boubakri@nxp.com> Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| #
2727b643 |
| 19-Dec-2022 |
Marouene Boubakri <marouene.boubakri@nxp.com> |
core: riscv: asm-defines.c: create and populate with thread-related defines
Create core/arch/riscv/kernel/asm-defines.c and add defines for thread_ctx, thread_core_local, thread_ctx_regs, thread_use
core: riscv: asm-defines.c: create and populate with thread-related defines
Create core/arch/riscv/kernel/asm-defines.c and add defines for thread_ctx, thread_core_local, thread_ctx_regs, thread_user_mode_rec, thread_trap_regs and thread_scall_regs.
Signed-off-by: Marouene Boubakri <marouene.boubakri@nxp.com> Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| #
93e54a63 |
| 20-Dec-2022 |
Marouene Boubakri <marouene.boubakri@nxp.com> |
riscv: kernel: entry.S: provide entry script
Provide core's single entry point for RV32/RV64 in S/M Modes. For now it performs: booting primary and secondary harts. Setting stack pointer, thread poi
riscv: kernel: entry.S: provide entry script
Provide core's single entry point for RV32/RV64 in S/M Modes. For now it performs: booting primary and secondary harts. Setting stack pointer, thread pointer (to thread_core_local), supervisor address translation and protection register, clearing BSS...etc and calls to appropriate functions to initialize the MMU and continue to boot flow from boot.c.
Signed-off-by: Marouene Boubakri <marouene.boubakri@nxp.com> Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| #
3c47d087 |
| 20-Dec-2022 |
Marouene Boubakri <marouene.boubakri@nxp.com> |
riscv: kernel: implement boot flow in boot.c
Provide an implementation of init_tee_runtime(), plat_primary_init_early() boot_init_primary_early(), boot_init_primary_late(), boot_init_secondary() and
riscv: kernel: implement boot flow in boot.c
Provide an implementation of init_tee_runtime(), plat_primary_init_early() boot_init_primary_early(), boot_init_primary_late(), boot_init_secondary() and helper functions. For now init_sec_mon() is kept to be replaced later by a routine to initialize SBI implementation (to for example, probe for available SBI extensions).
Signed-off-by: Marouene Boubakri <marouene.boubakri@nxp.com> Acked-by: Jens Wiklander <jens.wiklander@linaro.org> Acked-by: Etienne Carriere <etienne.carriere@linaro.org>
show more ...
|
| #
6454758b |
| 01-Dec-2022 |
Marouene Boubakri <marouene.boubakri@nxp.com> |
core: riscv: add time source based on time registers
Implement a TEE time source based on CSR_TIME and CSR_HTIME for S-Mode and CLINT MTIME register for M-Mode. CFG_RISCV_TIME_SOURCE_RDTIME flag to
core: riscv: add time source based on time registers
Implement a TEE time source based on CSR_TIME and CSR_HTIME for S-Mode and CLINT MTIME register for M-Mode. CFG_RISCV_TIME_SOURCE_RDTIME flag to enable or not building the time source. CFG_RISCV_MTIME_RATE defines the timer rate, default to 10MHz.
Signed-off-by: Marouene Boubakri <marouene.boubakri@nxp.com> Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| #
9afe87e0 |
| 14-Nov-2022 |
Marouene Boubakri <marouene.boubakri@nxp.com> |
riscv: kernel: add console driver for S-Mode using SBI
Implements a generic console driver using legacy SBI extension. This introduces a flag CFG_RISCV_SBI_CONSOLE to decide building the driver or n
riscv: kernel: add console driver for S-Mode using SBI
Implements a generic console driver using legacy SBI extension. This introduces a flag CFG_RISCV_SBI_CONSOLE to decide building the driver or not. This allows using another UART driver instead.
Signed-off-by: Marouene Boubakri <marouene.boubakri@nxp.com> Acked-by: Jerome Forissier <jerome.forissier@linaro.org> Acked-by: Jens Wiklander <jens.wiklander@linaro.org> [jf: set author to be same as Signed-off-by:] Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
show more ...
|
| #
3cdf0b24 |
| 11-Nov-2022 |
Marouene Boubakri <marouene.boubakri@nxp.com> |
riscv: kernel: sbi: add RISC-V SBI interface
Allow OP-TEE core running in S-Mode (supervisor) to interface with Supervisor Execution Environment (SEE) through environmental calls (ecall). Adds CFG_R
riscv: kernel: sbi: add RISC-V SBI interface
Allow OP-TEE core running in S-Mode (supervisor) to interface with Supervisor Execution Environment (SEE) through environmental calls (ecall). Adds CFG_RISCV_SBI flag to enable or disable it.
Signed-off-by: Marouene Boubakri <marouene.boubakri@nxp.com> Acked-by: Jerome Forissier <jerome.forissier@linaro.org> Acked-by: Jens Wiklander <jens.wiklander@linaro.org> [jf: set author to be same as Signed-off-by:] Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
show more ...
|
| #
c560e97f |
| 01-Nov-2022 |
Marouene Boubakri <marouene.boubakri@nxp.com> |
riscv: kernel: add stub for tee_time_get_sys_time()
A stub implementation which returns TEE_ERROR_NOT_IMPLEMENTED for now.
Signed-off-by: Marouene Boubakri <marouene.boubakri@nxp.com> Acked-by: Jen
riscv: kernel: add stub for tee_time_get_sys_time()
A stub implementation which returns TEE_ERROR_NOT_IMPLEMENTED for now.
Signed-off-by: Marouene Boubakri <marouene.boubakri@nxp.com> Acked-by: Jens Wiklander <jens.wiklander@linaro.org> Acked-by: Jerome Forissier <jerome.forissier@linaro.org>
show more ...
|
| #
46a20318 |
| 01-Nov-2022 |
Marouene Boubakri <marouene.boubakri@nxp.com> |
riscv: kernel: idle.c: implement cpu_idle()
Required by panic() to abort current execution. It ensures memory operations were complete and stalls the hart.
Signed-off-by: Marouene Boubakri <marouen
riscv: kernel: idle.c: implement cpu_idle()
Required by panic() to abort current execution. It ensures memory operations were complete and stalls the hart.
Signed-off-by: Marouene Boubakri <marouene.boubakri@nxp.com> Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| #
5320579d |
| 30-Dec-2021 |
Marouene Boubakri <marouene.boubakri@nxp.com> |
core: riscv: spinlock.c: implement spin-locking primitives
Implement __cpu_spin_lock(), __cpu_spin_unlock() and __cpu_spin_trylock() Use atomic-instruction amoswap in "A" extension for locks and ens
core: riscv: spinlock.c: implement spin-locking primitives
Implement __cpu_spin_lock(), __cpu_spin_unlock() and __cpu_spin_trylock() Use atomic-instruction amoswap in "A" extension for locks and ensure memory ordering using fence instruction.
Signed-off-by: Marouene Boubakri <marouene.boubakri@nxp.com> Acked-by: Etienne Carriere <etienne.carriere@linaro.org>
show more ...
|
| #
ad0ae800 |
| 27-Dec-2021 |
Marouene Boubakri <marouene.boubakri@nxp.com> |
riscv: create makefiles and directories tree for riscv
This commits creates the very first makefiles, directories and subdirectories for RISC-V port. It also creates a new platform flavor named plat
riscv: create makefiles and directories tree for riscv
This commits creates the very first makefiles, directories and subdirectories for RISC-V port. It also creates a new platform flavor named plat-spike. Spike is a reference functional RISC-V ISA simulator which provides full system emulation and it is developed alongside the RISC-V toolchain.
Signed-off-by: Marouene Boubakri <marouene.boubakri@nxp.com> Acked-by: Jens Wiklander <jens.wiklander@linaro.org> Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org>
show more ...
|