| aeee5d74 | 30-May-2023 |
Alvin Chang <alvinga@andestech.com> |
core: riscv: Correct sp before boot_init_primary_late()
Fix the stack pointer according to mentioned commits. The sp should be assigned as thread#0's stack pointer, and the flag that indicates usage
core: riscv: Correct sp before boot_init_primary_late()
Fix the stack pointer according to mentioned commits. The sp should be assigned as thread#0's stack pointer, and the flag that indicates usage of the temporary stack must be cleared before boot_init_primary_late() is called. After boot_init_primary_late() is returned, we restore the previous sp and set the flag again.
Fixes: 59ac3801b756 ("core: split boot_init_primary()") Fixes: 1d88c0c03f3b ("core: clear temporary stack flag before entering boot_init_primary_late()")' 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>
show more ...
|
| e1aad7e9 | 24-May-2023 |
Etienne Carriere <etienne.carriere@linaro.org> |
core: riscv: fix interrupt_main_handler() reference
Fixes itr_core_handler() reference in RiscV architecture that was renamed interrupt_main_handler() in commit referred below.
Fixes: 358bf47c0612
core: riscv: fix interrupt_main_handler() reference
Fixes itr_core_handler() reference in RiscV architecture that was renamed interrupt_main_handler() in commit referred below.
Fixes: 358bf47c0612 ("core: interrupt: rename itr_core_handler()") Acked-by: Jens Wiklander <jens.wiklander@linaro.org> Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org>
show more ...
|
| c0b7e57a | 19-May-2023 |
Alvin Chang <alvinga@andestech.com> |
riscv: plat-virt: Override default platform ISA extensions
RV64 virtual platform on QEMU supports C(compressed), Zicsr, and Zifencei extensions. To specify the ISA extensions into RISC-V toolchain s
riscv: plat-virt: Override default platform ISA extensions
RV64 virtual platform on QEMU supports C(compressed), Zicsr, and Zifencei extensions. To specify the ISA extensions into RISC-V toolchain so that toolchain can generate the code correctly, these ISA extensions should be encoded into "-march" flag. This patch overrides the default ISA extensions which is defined in riscv.mk to specify the extension that the platform really supports.
Signed-off-by: Alvin Chang <alvinga@andestech.com> Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| f65415b3 | 19-May-2023 |
Alvin Chang <alvinga@andestech.com> |
core: riscv: Add default variables for platform ISA, ABI and code model
In RISC-V, each platform may have different supported ISA extensions, ABI, and code model. In this commit, we define the defau
core: riscv: Add default variables for platform ISA, ABI and code model
In RISC-V, each platform may have different supported ISA extensions, ABI, and code model. In this commit, we define the default variables of ISA extensions, ABI, and code model in RISC-V core Makefile. The platform can further overrides the values in their plat-*/conf.mk.
Signed-off-by: Alvin Chang <alvinga@andestech.com> Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 01980f3f | 16-May-2023 |
Etienne Carriere <etienne.carriere@linaro.org> |
core: interrupt: rename itr_init()
Renames itr_init() to interrupt_main_init() as a later change will modify interrupt chip API functions using interrupt_ as prefix.
Reviewed-by: Jens Wiklander <je
core: interrupt: rename itr_init()
Renames itr_init() to interrupt_main_init() as a later change will modify interrupt chip API functions using interrupt_ as prefix.
Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org> Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org>
show more ...
|
| fb9d0fd3 | 16-May-2023 |
Alvin Chang <alvinga@andestech.com> |
core: riscv: kernel: Add missing initialization for core local stacks
The thread core local stacks should be initialized when the primary core performs system initialization.
Fixes: ca8258906949 ("
core: riscv: kernel: Add missing initialization for core local stacks
The thread core local stacks should be initialized when the primary core performs system initialization.
Fixes: ca8258906949 ("core: split core/arch/arm/kernel/thread.c") Signed-off-by: Alvin Chang <alvinga@andestech.com> Acked-by: Jerome Forissier <jerome.forissier@linaro.org> Acked-by: Etienne Carriere <etienne.carriere@linaro.org>
show more ...
|
| 0cc8f3e4 | 11-May-2023 |
Alvin Chang <alvinga@andestech.com> |
core: riscv: kernel: Fix stack pointer initialization for each hart
The RISC-V privileged specification defines that at least one hart must have a hart ID of zero. Since at least one stack_tmp_strid
core: riscv: kernel: Fix stack pointer initialization for each hart
The RISC-V privileged specification defines that at least one hart must have a hart ID of zero. Since at least one stack_tmp_stride is required for calculating the initial SP value for each hart, the formula should be address of stack_tmp plus (hartid+1) multiplied by stack_tmp_stride.
This commit fixes the formula for initializing SP of each hart, otherwise the stack underflow happens to hart 0.
Fixes: 93e54a63925f ("riscv: kernel: entry.S: provide entry script") Signed-off-by: Alvin Chang <alvinga@andestech.com> Reviewed-by: Marouene Boubakri <marouene.boubakri@nxp.com> Acked-by: Jerome Forissier <jerome.forissier@linaro.org>
show more ...
|
| 921af96f | 10-May-2023 |
Alvin Chang <alvinga@andestech.com> |
core: riscv: Refactor macros for inline assembly of CSR operations
Current CSR macros with inline assembly will lead to compilation error, because they use pre-processor stringizing not value substi
core: riscv: Refactor macros for inline assembly of CSR operations
Current CSR macros with inline assembly will lead to compilation error, because they use pre-processor stringizing not value substitution. The definitions such as CSR_XSTATUS are not sustituted to CSR encoding in CSR macros and compiler generates: Error: unknown CSR `CSR_XSTATUS'.
This patch fixes it by making the given CSR to be an assembly input operand with constraint "i", which is used to indicate the operand is an immediate integer operand. Thus, the CSR encoding can be correctly compiled.
Signed-off-by: Alvin Chang <alvinga@andestech.com> Acked-by: Jens Wiklander <jens.wiklander@linaro.org> Acked-by: Jerome Forissier <jerome.forissier@linaro.org>
show more ...
|
| 42135d98 | 05-May-2023 |
Alvin Chang <alvinga@andestech.com> |
core: riscv: mm: Add missing return for TLB helpers
These functions should contain tailing ret instruction to return to caller.
Signed-off-by: Alvin Chang <alvinga@andestech.com> Acked-by: Jerome F
core: riscv: mm: Add missing return for TLB helpers
These functions should contain tailing ret instruction to return to caller.
Signed-off-by: Alvin Chang <alvinga@andestech.com> Acked-by: Jerome Forissier <jerome.forissier@linaro.org>
show more ...
|
| 1f8363e6 | 05-May-2023 |
Alvin Chang <alvinga@andestech.com> |
core: riscv: kernel: Fix compilation error with missing parameter
This patch adds "unsigned long tos_fw_config" as second parameter for RISC-V's boot_init_primary_late() to solve compilation error.
core: riscv: kernel: Fix compilation error with missing parameter
This patch adds "unsigned long tos_fw_config" as second parameter for RISC-V's boot_init_primary_late() to solve compilation error.
Fixes: 809fa817ae63 ("core: ffa: add TOS_FW_CONFIG handling") Signed-off-by: Alvin Chang <alvinga@andestech.com> Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org>
show more ...
|
| ee34e7ea | 11-Apr-2023 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: remove TEE_RAM_VA_START and TEE_TEXT_VA_START
TEE_RAM_VA_START and TEE_TEXT_VA_START are defined to exactly the same thing as TEE_RAM_START and TEE_LOAD_ADDR respectively. They don't deal with
core: remove TEE_RAM_VA_START and TEE_TEXT_VA_START
TEE_RAM_VA_START and TEE_TEXT_VA_START are defined to exactly the same thing as TEE_RAM_START and TEE_LOAD_ADDR respectively. They don't deal with virtual addresses as the names suggests, they too represent physical addresses. So remove TEE_RAM_VA_START and TEE_TEXT_VA_START to get rid of some redundancy.
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org> Acked-by: Etienne Carriere <etienne.carriere@linaro.org> Acked-by: Jerome Forissier <jerome.forissier@linaro.org>
show more ...
|
| c79fb6d4 | 11-Apr-2023 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: rename load_offset in struct core_mmu_config
Renames the field load_offset in struct core_mmu_config to the more accurate name map_offset.
Signed-off-by: Jens Wiklander <jens.wiklander@linaro
core: rename load_offset in struct core_mmu_config
Renames the field load_offset in struct core_mmu_config to the more accurate name map_offset.
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org> Acked-by: Etienne Carriere <etienne.carriere@linaro.org> Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org>
show more ...
|
| b76b2296 | 03-Feb-2023 |
Jerome Forissier <jerome.forissier@linaro.org> |
virt: rename CFG_VIRTUALIZATION to CFG_NS_VIRTUALIZATION
With the advent of virtualization support at S-EL2 in the Armv8.4-A architecture, CFG_VIRTUALIZATION has become ambiguous. Let's rename it to
virt: rename CFG_VIRTUALIZATION to CFG_NS_VIRTUALIZATION
With the advent of virtualization support at S-EL2 in the Armv8.4-A architecture, CFG_VIRTUALIZATION has become ambiguous. Let's rename it to CFG_NS_VIRTUALIZATION to indicate more clearly that it is about supporting virtualization on the non-secure side.
This commit is the result of the following command:
$ for f in $(git grep -l -w CFG_VIRTUALIZATION); do \ sed -i -e 's/CFG_VIRTUALIZATION/CFG_NS_VIRTUALIZATION/g' $f; \ done
...plus the compatibility line in mk/config.mk:
CFG_NS_VIRTUALIZATION ?= $(CFG_VIRTUALIZATION)
Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org> Acked-by: Jens Wiklander <jens.wiklander@linaro.org> Acked-by: Etienne Carriere <etienne.carriere@linaro.org> Acked-by: Volodymyr Babchuk <volodymyr_babchuk@epam.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 ...
|
| 50f17a34 | 19-Dec-2022 |
Marouene Boubakri <marouene.boubakri@nxp.com> |
core: riscv: provide arch_scall.h
Specifies what registers from thread_scall_regs are used for system calls. The syscall number is provided in t0 register. The syscall max args is provided in t1 reg
core: riscv: provide arch_scall.h
Specifies what registers from thread_scall_regs are used for system calls. The syscall number is provided in t0 register. The syscall max args is provided in t1 register. The return value is provided in a0 register. The panic and panic code are provided respectively in a1 and a2 registers.
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 ...
|
| 346358fb | 03-Jan-2023 |
Marouene Boubakri <marouene.boubakri@nxp.com> |
core: riscv: riscv.h: bind registers to their ABI names
For better readability of code, allow using register ABI names in ASM sources to match registers declarations in C files.
Signed-off-by: Maro
core: riscv: riscv.h: bind registers to their ABI names
For better readability of code, allow using register ABI names in ASM sources to match registers declarations in C files.
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 ...
|
| 50146535 | 19-Dec-2022 |
Marouene Boubakri <marouene.boubakri@nxp.com> |
core: riscv: kernel: add several modifications to thread_arch.h
This commits: - Adds 4 trampoline registers to thread_core_local to store arguments of __thread_enter_user_mode before jumping to U-Mo
core: riscv: kernel: add several modifications to thread_arch.h
This commits: - Adds 4 trampoline registers to thread_core_local to store arguments of __thread_enter_user_mode before jumping to U-Mode to be restored later after exiting U-Mode. - Populates thread_trap_regs with all registers available on RV 64/32, this holds the trap frame for trap handling. - Populates thread_ctx_regs with general purpose registers. - Makes generic definition of THREAD_EXCP_FOREIGN_INTR and THREAD_EXCP_NATIVE_INTR to work both on S-Mode and M-Mode. - Adds prototypes for Soft FP (to be implemented later) and RPC caches.
Signed-off-by: Marouene Boubakri <marouene.boubakri@nxp.com> Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| a5a2cd19 | 19-Dec-2022 |
Marouene Boubakri <marouene.boubakri@nxp.com> |
core: riscv: kernel: add thread_private_arch.h
Declares stacks sizes, thread_user_mode_rec structure to restore context after exiting from U-Mode. It also adds prototypes for thread_rv.s and thread_
core: riscv: kernel: add thread_private_arch.h
Declares stacks sizes, thread_user_mode_rec structure to restore context after exiting from U-Mode. It also adds prototypes for thread_rv.s and thread_arch.c
Signed-off-by: Marouene Boubakri <marouene.boubakri@nxp.com> Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| cbaab388 | 28-Dec-2022 |
Marouene Boubakri <marouene.boubakri@nxp.com> |
core: riscv: riscv.h: define generic CSRs to handle traps
Added xSTATUS and xIE related fields and flags for traps handling.
Signed-off-by: Marouene Boubakri <marouene.boubakri@nxp.com> Acked-by: J
core: riscv: riscv.h: define generic CSRs to handle traps
Added xSTATUS and xIE related fields and flags for traps handling.
Signed-off-by: Marouene Boubakri <marouene.boubakri@nxp.com> Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|