summaryrefslogtreecommitdiff
path: root/platform/generic/include/platform_override.h
AgeCommit message (Collapse)AuthorFilesLines
2024-08-24platform: generic: Pass FDT to early/final_init overridesSamuel Holland1-2/+2
Several of these override functions access the FDT blob. Explicitly indicate which callbacks are allowed to modify the FDT blob by passing the parameter as a possibly-const pointer. This also reduces code size by deduplicating the call to fdt_get_address(). Signed-off-by: Samuel Holland <samuel.holland@sifive.com> Reviewed-by: Andrew Jones <ajones@ventanamicro.com> Reviewed-by: Anup Patel <anup@brainfault.org>
2024-08-24platform: generic: Constify FDT pointers in fw_platform_init()Samuel Holland1-1/+1
Indicate that none of these functions modify the devicetree by constifying the parameter type. Signed-off-by: Samuel Holland <samuel.holland@sifive.com> Reviewed-by: Andrew Jones <ajones@ventanamicro.com> Reviewed-by: Anup Patel <anup@brainfault.org>
2023-12-19lib: sbi: Allow ecall handlers to directly update register stateAnup Patel1-3/+3
Some of the upcoming SBI extensions (such as SSE) will directly update register state so improve the prototype of ecall handler to accommodate this. Further, this flexibility allows us to push the trap redirection from sbi_ecall_handler() to the sbi_ecall_legacy_handler(). Signed-off-by: Anup Patel <apatel@ventanamicro.com>
2023-12-06platform: generic: Introduce pmu_init() platform overrideYu Chien Peter Lin1-0/+1
Add pmu_init() platform override, which will be used to register PMU device and populate event mappings. Signed-off-by: Yu Chien Peter Lin <peterlin@andestech.com> Reviewed-by: Atish Patra <atishp@rivosinc.com> Reviewed-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> Reviewed-by: Anup Patel <anup@brainfault.org>
2023-09-10platform: Allow platforms to specify the size of tlb fifoXiang W1-0/+1
For some platforms with a particularly high number of harts, if the tlb fifo is too small, it case harts to wait. Platforms should be allowed to specify the size of the tlb fifo. Signed-off-by: Xiang W <wxjstz@126.com> Signed-off-by: Xing Xiaoguang <xiaoguang.xing@sophgo.com> Reviewed-by: Anup Patel <anup@brainfault.org>
2023-02-27include: sbi: Remove extid parameter from vendor_ext_provider() callbackAnup Patel1-1/+1
The extid parameter of vendor_ext_provider() is redundant so let us remove it. Signed-off-by: Anup Patel <apatel@ventanamicro.com>
2023-02-27lib: sbi: Align SBI vendor extension id with mvendorid CSRAnup Patel1-1/+0
As-per the SBI specification, the lower 24bits of the SBI vendor extension id is same as lower 24bits of the mvendorid CSR. We update the SBI vendor extension id checking based on above. Signed-off-by: Anup Patel <apatel@ventanamicro.com>
2023-01-07platform: generic: Allow platform_override to perform firmware initWei Liang Lim1-0/+1
We add a generic platform override callback to allow platform specific firmware init. Signed-off-by: Wei Liang Lim <weiliang.lim@starfivetech.com> Reviewed-by: Chee Hong Ang <cheehong.ang@starfivetech.com> Reviewed-by: Jun Liang Tan <junliang.tan@starfivetech.com> Reviewed-by: Anup Patel <anup@brainfault.org>
2023-01-07platform: generic: Allow platform_override to select cold boot HARTAnup Patel1-0/+1
We add a generic platform override callback to allow platform specific selection of cold boot HART. Signed-off-by: Anup Patel <apatel@ventanamicro.com>
2022-10-13platform: generic: add extensions_init handler and platform-overrideHeiko Stuebner1-0/+3
Init of non-standard extensions is a platform-specific thing, so allow generic platforms to do this via a platform-override. Reviewed-by: Andrew Jones <ajones@ventanamicro.com> Reviewed-by: Guo Ren <guoren@kernel.org> Reviewed-by: Anup Patel <anup@brainfault.org> Signed-off-by: Heiko Stuebner <heiko@sntech.de>
2022-06-13platform: generic: add overrides for vendor extensionsMayuresh Chitale1-0/+7
Allow the vendor_ext_check and vendor_ext_provider APIs of the generic platform to be overridden by other platforms Signed-off-by: Mayuresh Chitale <mchitale@ventanamicro.com> Reviewed-by: Anup Patel <anup@brainfault.org>
2021-04-28lib: sbi: Simplify system reset platform operationsAnup Patel1-4/+0
Instead of having system_reset_check() and system_reset() callbacks in platform operations, it will be much simpler for reset driver to directly register these operations as a device to the sbi_system implementation. Signed-off-by: Anup Patel <anup.patel@wdc.com> Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
2020-12-01lib: sbi: Improve system reset platform operationsAnup Patel1-1/+4
To implement the SBI SRST extension, we need two platform operations for system reset: 1) system_reset_check() - This operation will check whether given reset type and reason are supported by the platform 2) system_reset() - This operation will do the actual platform system reset and it will not return if reset type and reason are supported by the platform This patch updates system reset related code everywhere as-per above. Signed-off-by: Anup Patel <anup.patel@wdc.com> Reviewed-by: Atish Patra <atish.patra@wdc.com>
2020-06-15platform/lib: Allow the OS to map the regions that are protected by PMPAlexandre Ghiti1-0/+1
This is achieved by removing the 'no-map' property from the 'reserved-memory' node when PMP is present, otherwise we keep it as it offers a small protection if the OS does not map this region at all. A new callback in platform_override is introduced and allows to fixup the device-tree. It is used here to override this new default behaviour on SiFive Fu540 platforms that has an erratum that prevents S-mode software to access a PMP protected region using 1GB page table mapping. If PMP is present, telling the OS not to map the reserved regions does not add much protection since it only avoids access to regions that are already protected by PMP. But by not allowing the OS to map those regions, it creates holes in the OS system memory map and prevents the use of hugepages which would generate, among other benefits, less TLB miss. Signed-off-by: Alexandre Ghiti <alex@ghiti.fr> Reviewed-by: Atish Patra <atish.patra@wdc.com> Reviewed-by: Anup Patel <anup.patel@wdc.com>
2020-05-01platform: Add generic FDT based platform supportAnup Patel1-0/+26
We add generic FDT based platform support which provides platform specific functionality based on the FDT passed by previous booting stage. By default, the generic FDT platform makes following assumptions: 1. platform FW_TEXT_START is 0x80000000 2. platform features are default 3. platform stack size is default 4. platform has no quirks or work-arounds The above assumptions (except 1) can be overridden by adding special platform callbacks which will be called based on the FDT root node compatible string. By default, we compile OpenSBI generic platform as follows: $ make PLATFORM=generic For a non-standard FW_TEXT_START, we can compile OpenSBI generic platform as follows: $ make PLATFORM=generic FW_TEXT_START=<non_standard_text_start> Signed-off-by: Anup Patel <anup.patel@wdc.com> Reviewed-by: Atish Patra <atish.patra@wdc.com>