summaryrefslogtreecommitdiff
path: root/include/sbi/fw_dynamic.h
AgeCommit message (Collapse)Author
2025-04-15lib: sbi: Simplify structure member offset checkingXiang W
Add a macro assert_member_offset() to perform structure member offset checking. Signed-off-by: Xiang W <[email protected]> Reviewed-by: Anup Patel <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Anup Patel <[email protected]>
2022-03-27include: Use static asserts for FW_DYNAMIC_INFO_xxx_OFFSET definesXiang W
Add static detection to prevent the modification of struct fw_dynamic_info from forgetting the modification of FW_DYNAMIC_INFO_xxx_OFFSET Signed-off-by: Xiang W <[email protected]> Reviewed-by: Anup Patel <[email protected]>
2021-07-17firmware: use __SIZEOF_LONG__ for field offsets in fw_dynamic.hAlex Richardson
The fields are of type unsigned long and are not pointers. While this happens to be the same for RV32/RV64, it is not correct when compiling for a CHERI-RISC-V system where pointers are twice the size of long. Signed-off-by: Alex Richardson <[email protected]> Reviewed-by: Bin Meng <[email protected]> Reviewed-by: Anup Patel <[email protected]>
2021-07-11firmware: Define a macro for version of struct fw_dynamic_infoBin Meng
Avoid using a magic number, instead use a macro for the version of struct fw_dynamic_info. Signed-off-by: Bin Meng <[email protected]> Reviewed-by: Xiang W <[email protected]> Reviewed-by: Anup Patel <[email protected]>
2021-03-22include: headers: Replace __ASSEMBLY__ with __ASSEMBLER__Marouene Boubakri
GCC has already a predefined macro __ASSEMBLER__ therefore, it can be used without the need to define a new flag with -D__ASSEMBLY__. This is useful when adding the library to projects having a build system such one can build without the need to make changes. THe build system does not use the Makefile in the sources tree. Signed-off-by: Marouene Boubakri <[email protected]> Signed-off-by: Anup Patel <[email protected]>
2019-11-15firmware: Add preferred boot HART field in struct fw_dynamic_infoAnup Patel
It has been reported that link address range of previous booting stage (such as U-Boot SPL) can overlap the link address rage of FW_DYNAMIC. This means self-relocation in FW_DYNAMIC can potentially corrupt previous booting stage if any of the secondary HART enter FW_DYNAMIC before primary HART. To tackle this, we add preferred boot HART field (i.e boot_hart) in struct fw_dyanmic_info. We use this field to force secondary HARTs into relocation wait loop till preferred/primary boot HART enters FW_DYNAMIC completes self-relocation. If preferred boot HART is not available then we fall back to relocation lottery approach. Signed-off-by: Anup Patel <[email protected]> Reviewed-by: Atish Patra <[email protected]>
2019-05-10firmware: Add fw_dynamic firmwareAnup Patel
This patch provides first-cut implementation of fw_dynamic firmware. As compared to fw_jump and fw_payload, the fw_dynamic obtains next address, next mode and OpenSBI options from struct fw_dynamic_info. The previous booting stage can create struct fw_dynamic_info in memory and pass address of struct fw_dynamic_info in 'a2' register. Also, the struct fw_dynamic_info has versioning as well so changes to the struct fw_dynamic_info can be done in a backward compatible manner. Signed-off-by: Anup Patel <[email protected]> Reviewed-by: Atish Patra <[email protected]>