summaryrefslogtreecommitdiff
path: root/platform/generic/include
AgeCommit message (Collapse)Author
2025-12-21platform: generic: eswin: Add shutdown/reboot support for Hifive Premier P550Bo Gan
Hifive Premier P550[1] is a Mini-DTX form factor board with EIC7700X. It has a STM32F407VET6 onboard MCU acting as the BMC, controlling ATX power on/off while providing remote management features. The EIC7700X SoC/SoM communicates with the BMC via UART2, using ESWIN's protocol. The messages transmitted are fixed sizes (267 bytes), and depending on the type, can be directional or bi-directional. The shutdown and cold reboot requests are directional messages from SoC to BMC (NOTIFY type) with CMD_POWER_OFF or CMD_RESTART. The payload of shutdown/cold reboot requests should be empty and are ignored by the BMC at the moment. A HFP (Hifive Premier) specific reset device is registered in addition to the SoC reset device. For shutdown and cold reboot, the board-level reset takes precedence. The definitions of the SoC <-> BMC message protocol is taken from ESWIN's repo [2]. The only file used from that repo is `hf_common.h` It's disjunctively dual licensed as (GPL-2.0-only OR BSD-2-Clause), hence, compatible with the license of OpenSBI. It's heavily modified and renamed as platform/generic/include/eswin/hfp.h. The author and copyright in the original file are retained. Validated shutdown/cold reboot working on Hifive Premier P550. [1] https://www.sifive.com/boards/hifive-premier-p550#documentation [2] https://github.com/eswincomputing/hifive-premier-p550-mcu-patches.git Signed-off-by: Bo Gan <[email protected]> Reviewed-by: Anup Patel <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Anup Patel <[email protected]>
2025-12-21platform: generic: eswin: add EIC7700Bo Gan
Initial platform support for ESWIN Computing EIC7700 based on public SoC datasheet[1] and tested on HiFive Premier P550. Vendor U-boot/Linux boots fine, and I've tested Geekbench 6.5.0 Preview and got scores on par with the vendor OpenSBI. System shutdown/reboot for HiFive Premier P550 and other boards will be implemented in subsequent commits. At this point, only SoC-level warm reset is implemented. The files and functions are intentionally named as eic770x in many places for future enhancements to support the 2 die version of the same SoC, namely EIC7702, seen on DC-ROMA AI PC FML13V03 [2]. This patch set only deals with the single die version, and the assumption is we can be either die with id=0 or id=1, but there's only a single die in the system, or we are only using a single die out of 2. However, the way the SoC handles 2- die greatly affects how we configure it in a 1-die setup. EIC770X address map has die 0/1 memory regions interleaved (see comments in eic770x.c). If only 1 die is connected or active, it creates holes in the address map for those regions corresponding to the remote die. When speculative- execution or HW prefetcher touches data-cacheable regions that happen to fall into those holes, it can trigger bus error. Specifically: - Remote (non-existent) die L3 zero device - Remote (non-existent) die cached memory region - Other holes in Memory Port To make matters worse, EIC770X doesn't have cache coherent DMA, and due to the fact that the P550 core lacks Svpbmt, the SoC maps main memory twice as different regions, so it can bypass cache and fetch the data directly from memory. In address space, we have two memory regions, one as cached, the other as uncached. Thus, we also need an extra PMP entry to protect OpenSBI blob from the uncached window. To do this, platform code requires single_fw_region, otherwise, we'll run out of PMP entries. EIC770X also have several feature disable/enable CSRs accessible in M mode. By default many core features such as speculation and HW prefetch are disabled, and M mode software is responsible of enabling. Hence, introduce 4 new build time tunable parameters to Kconfig, which reflects the values get updated to those CSRs: - ESWIN_EIC770X_FEAT0_CFG - ESWIN_EIC770X_FEAT1_CFG - ESWIN_EIC770X_L1_HWPF_CFG - ESWIN_EIC770X_L2_HWPF_CFG The default values are somewhat optimal for generic workloads. They are dumped when running SiFive's vendor OpenSBI, and in addition, with my own tuning to address the perf regression reported by drmpeg [3] To build the firmware+u-boot blob, Use the following, and docs [4] for testing it with UART boot without flashing: make FW_TEXT_START=0x80000000 \ FW_PAYLOAD_OFFSET=0x200000 \ FW_PAYLOAD_PATH=u-boot-nodtb.bin \ FW_PAYLOAD_FDT_ADDR=0xf8000000 \ FW_FDT_PATH=u-boot.dtb [1] https://github.com/eswincomputing/EIC7700X-SoC-Technical-Reference-Manual [2] https://github.com/geerlingguy/sbc-reviews/issues/82 [3] https://forums.sifive.com/t/low-1-core-stream-bandwidth/7274/15 [4] https://github.com/ganboing/EIC770x-Docs/blob/main/p550/bootchain/UART-Boot.md Signed-off-by: Bo Gan <[email protected]> Reviewed-by: Anup Patel <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Anup Patel <[email protected]>
2025-10-20platform: generic: spacemit: add K1Xianbin Zhu
Add initial platform support for the SpacemiT K1 SoC, including early/final init hooks, cold boot handling, and CCI-550 snoop/DVM enablement. Co-authored-by: Troy Mitchell <[email protected]> Signed-off-by: Troy Mitchell <[email protected]> Signed-off-by: Xianbin Zhu <[email protected]> Reviewed-by: Anup Patel <[email protected]> Link: https://lore.kernel.org/all/[email protected]/ [1] Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Anup Patel <[email protected]>
2025-09-30platform: generic: Add Andes QiLai SoC supportBen Zong-You Xie
Extend generic platform to support Andes QiLai SoC. Signed-off-by: Ben Zong-You Xie <[email protected]> Reviewed-by: Anup Patel <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Anup Patel <[email protected]>
2025-08-28Fix license to compatible BSD-2-ClauseXiang W
OpenSBI is a BSD project. We need to modify some codes to compatible with BSD-2-Clause license. Signed-off-by: Xiang W <[email protected]> Reviewed-by: Ben Zong-You Xie <[email protected]> Reviewed-by: Anup Patel <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Anup Patel <[email protected]>
2025-06-14platform: generic: mips: add P8700Chao-ying Fu
Extend generic platform to support MIPS P8700. Signed-off-by: Chao-ying Fu <[email protected]> Reviewed-by: Anup Patel <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Anup Patel <[email protected]>
2025-04-23platform: generic: Remove platform override hooksSamuel Holland
Now that all of the overrides are modifying generic_platform_ops directly, remove the unused hooks and forwarding functions. The remaining members of struct platform_override match struct fdt_driver, so use that type instead. This allows a future commit to reuse the fdt_driver-based init function. Signed-off-by: Samuel Holland <[email protected]> Reviewed-by: Anup Patel <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Anup Patel <[email protected]>
2025-04-23platform: generic: Modify platform ops instead of using hooksSamuel Holland
Switch all existing platform overrides to use the helper pattern instead of the platform hooks. After this commit, only the .match_table and .init members of struct platform_override are used. There are two minor behavioral differences: - For Allwinner D1, fdt_add_cpu_idle_states() is now called before the body of generic_final_init(). This should have no functional impact. - For StarFive JH7110, if the /chosen/starfive,boot-hart-id property is missing, the code now falls back to using generic_coldboot_harts, instead of accepting any hart. Signed-off-by: Samuel Holland <[email protected]> Reviewed-by: Anup Patel <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Anup Patel <[email protected]>
2025-04-23platform: generic: Allow replacing platform operationsSamuel Holland
Currently the generic platform follows the middleware pattern: it implements the sbi_platform hooks, while providing its own set of hooks for further customization. This has a few disadvantages: each location where customization is needed requires a separate platform_override hook, including places where the generic function does nothing except forward to a platform_override hook, and the extra layer of function pointers adds runtime overhead. Let's restructure the generic platform to follow the helper pattern. Allow platform overrides to treat the generic platform as a template, adding or replacing the sbi_platform_operations as needed. Export the generic implementations, so they can be called as helpers from inside the override functions. With this pattern, the platform_override function pointers are replaced by direct calls, and the forwarding functions can be removed. The forwarding functions are not exported, since there is no reason for an override to call them. generic_vendor_ext_check() must be rewritten, since now there is a new way to override vendor_ext_provider. Signed-off-by: Samuel Holland <[email protected]> Reviewed-by: Anup Patel <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Anup Patel <[email protected]>
2025-04-23platform: generic: Add an init hook matching fdt_driverSamuel Holland
In preparation for reusing the fdt_driver code to match platform overrides, add a new .init hook matching the type signature from fdt_driver. This hook replaces the existing .fw_init hook, since it is called at roughly the same place in the init process. Signed-off-by: Samuel Holland <[email protected]> Reviewed-by: Anup Patel <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Anup Patel <[email protected]>
2025-04-23platform: generic: andes: Remove inline definitionsSamuel Holland
The addresses of these functions are used to set function pointers in struct platform_override, so it is not valid for them to be inline. Signed-off-by: Samuel Holland <[email protected]> Reviewed-by: Anup Patel <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Anup Patel <[email protected]>
2025-01-30lib: sbi: pmu: fix usage of sbi_pmu_irq_bit()Clément Léger
While sbi_pmu_irq_bit() was used to delegate irq to S-mode, LCOFIP usage was still hardcoded in various places. This led to change the returned value of sbi_pmu_irq_bit() to be a bit number rather than a bit mask since it returns an 'int' and we need to obtain the bit number itself to handle it in the IRQs handlers. Add a similar function to return the irq mask which can also be used where the mask is required rather than the bit itself. Signed-off-by: Clément Léger <[email protected]> Reviewed-by: Samuel Holland <[email protected]> Reviewed-by: Atish Patra <[email protected]>
2024-08-24platform: generic: Pass FDT to early/final_init overridesSamuel Holland
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 <[email protected]> Reviewed-by: Andrew Jones <[email protected]> Reviewed-by: Anup Patel <[email protected]>
2024-08-24platform: generic: Constify FDT pointers in fw_platform_init()Samuel Holland
Indicate that none of these functions modify the devicetree by constifying the parameter type. Signed-off-by: Samuel Holland <[email protected]> Reviewed-by: Andrew Jones <[email protected]> Reviewed-by: Anup Patel <[email protected]>
2024-08-23platform: generic: andes: add a new Andes SBI call to free a PMA entryBen Zong-You Xie
Add a new Andes SBI call to free a PMA entry, and reset the memory attributes for the corresponding NAPOT region. Signed-off-by: Ben Zong-You Xie <[email protected]> Reviewed-by: Anup Patel <[email protected]>
2024-08-23platform: generic: andes: add a new Andes SBI call to set up a PMA entryBen Zong-You Xie
Implement a new Andes SBI call, which is to set up a NAPOT region with given memory attributes. Signed-off-by: Ben Zong-You Xie <[email protected]> Reviewed-by: Anup Patel <[email protected]>
2024-08-23platform: generic: andes: add Andes SBI call to probe Andes PMA featureBen Zong-You Xie
Add a new Andes SBI call to check whether PPMA is supported by hardware or not. Signed-off-by: Ben Zong-You Xie <[email protected]> Reviewed-by: Anup Patel <[email protected]>
2024-06-18platform: generic: andes: Refine Andes PMA related codeBen Zong-You Xie
This patch refines the Andes PMA related code. The main change is refactor andes_pma_[read|write]_cfg() and andes_pma_[read|write]_addr() into new functions andes_pma_[read|write]_num(). Also, fix some coding style problems. Signed-off-by: Ben Zong-You Xie <[email protected]> Reviewed-by: Anup Patel <[email protected]>
2024-05-09platform: generic: thead: separate T-Head PMU ErrataYangyu Chen
As Guo Ren said from the kernel mailing list [1], future T-Head CPUs, including the newer versions of T-Head C908, will feature standard Sscofpmf extension. For these CPUs, T-Head's implementation of PMU Overflow Interrupts may not needed anymore. In this case, we shouldn't apply T-Head PMU for all T-Head CPUs. Thus, this patch separated T-Head PMU errata. [1] https://lore.kernel.org/linux-riscv/[email protected]/ Signed-off-by: Yangyu Chen <[email protected]> Reviewed-by: Inochi Amaoto <[email protected]> Reviewed-by: Anup Patel <[email protected]>
2024-05-09platform: andes: Change all occurrences of andes45 to andesBen Zong-You Xie
To make the framework suit all Andes CPUs, change all occurrences of andes45 to andes. In addition, we fix some coding style problems and remove an unused macro in andes.h. Signed-off-by: Ben Zong-You Xie <[email protected]> Reviewed-by: Anup Patel <[email protected]>
2024-05-09platform: andes: Rename files with the prefix andes45Ben Zong-You Xie
Rename files with the prefix andes45 to andes. Signed-off-by: Ben Zong-You Xie <[email protected]> Reviewed-by: Anup Patel <[email protected]>
2024-03-04platform: andes: Drop andes_pmu_setup()Yu Chien Peter Lin
andes_pmu_setup() [1] was intended to populate event mapping from hardcoded arrays, however, this increases firmware size and we should just use PMU DT node [2] instead. Link: https://lists.infradead.org/pipermail/opensbi/2023-November/006032.html [1] Link: https://github.com/riscv-software-src/opensbi/blob/v1.4/docs/pmu_support.md#example-3 [2] Signed-off-by: Yu Chien Peter Lin <[email protected]> Reviewed-by: Anup Patel <[email protected]>
2023-12-19lib: sbi: Allow ecall handlers to directly update register stateAnup Patel
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 <[email protected]>
2023-12-06platform: andes: Factor out is_andes() helperYu Chien Peter Lin
We will need is_andes(45) in the following patch, so factor out the code that parses marchid to make it reusable for checking any Andes CPU variants. Also improves the comment in ae350_hart_start(). Signed-off-by: Yu Chien Peter Lin <[email protected]> Reviewed-by: Anup Patel <[email protected]>
2023-12-06platform: andes: Add Andes custom PMU supportYu Chien Peter Lin
Before the ratification of Sscofpmf, the Andes PMU extension was designed to support the sampling and filtering with hardware performance counters (zihpm), it works with the current SBI PMU extension and Linux SBI PMU driver. We implement 1) the PMU device callbacks that update the corresponding bits on custom CSRs, 2) extentions_init() to detect the hardware support of Andes PMU and initialize the per-hart PMU related CSR, and 3) pmu_init() to register PMU device and populate event mappings. Also define a andes_pmu_setup() function which is in preparation for adding default PMU mappings in andes_hpm.h Signed-off-by: Yu Chien Peter Lin <[email protected]> Reviewed-by: Leo Yu-Chi Liang <[email protected]> Reviewed-by: Anup Patel <[email protected]>
2023-12-06platform: generic: Introduce pmu_init() platform overrideYu Chien Peter Lin
Add pmu_init() platform override, which will be used to register PMU device and populate event mappings. Signed-off-by: Yu Chien Peter Lin <[email protected]> Reviewed-by: Atish Patra <[email protected]> Reviewed-by: Lad Prabhakar <[email protected]> Reviewed-by: Anup Patel <[email protected]>
2023-12-06platform: include: andes45: Add PMU related CSR definesYu Chien Peter Lin
Add CSR definitions for Andes PMU extension. Signed-off-by: Yu Chien Peter Lin <[email protected]> Reviewed-by: Leo Yu-Chi Liang <[email protected]> Reviewed-by: Anup Patel <[email protected]> Reviewed-by: Atish Patra <[email protected]> Reviewed-by: Lad Prabhakar <[email protected]> Tested-by: Lad Prabhakar <[email protected]>
2023-11-14platform: generic: thead: separate implement of T-HEAD c9xx errataInochi Amaoto
Separate the implement of T-HEAD c9xx errata to allow any platform with bug related to c9xx cores can use it. Signed-off-by: Inochi Amaoto <[email protected]> Reviewed-by: Anup Patel <[email protected]>
2023-11-14platform: generic: thead: separate implement of T-HEAD c9xx pmuInochi Amaoto
Separate the implement of T-HEAD c9xx pmu to allow any platform with c9xx cores can use it. Signed-off-by: Inochi Amaoto <[email protected]> Reviewed-by: Anup Patel <[email protected]>
2023-11-14platform: generic: thead: move to thead c9xx header to vendor specific postionInochi Amaoto
The CSR encoding for t-head c9xx cores is shared across all the platforms with these cores. So move header thead_c9xx.h to the thead subdir. Signed-off-by: Inochi Amaoto <[email protected]> Acked-by: Guo Ren <[email protected]> Reviewed-by: Anup Patel <[email protected]>
2023-09-10platform: Allow platforms to specify the size of tlb fifoXiang W
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 <[email protected]> Signed-off-by: Xing Xiaoguang <[email protected]> Reviewed-by: Anup Patel <[email protected]>
2023-04-14platform: generic: andes/renesas: Add SBI EXT to check for enabling IOCP errataLad Prabhakar
I/O Coherence Port (IOCP) provides an AXI interface for connecting external non-caching masters, such as DMA controllers. The accesses from IOCP are coherent with D-Caches and L2 Cache. IOCP is a specification option and is disabled on the Renesas RZ/Five SoC (which is based on Andes AX45MP core) due to this reason IP blocks using DMA will fail. As a workaround for SoCs with IOCP disabled CMO needs to be handled by software. Firstly OpenSBI configures the memory region as "Memory, Non-cacheable, Bufferable" and passes this region as a global shared dma pool as a DT node. With DMA_GLOBAL_POOL enabled all DMA allocations happen from this region and synchronization callbacks are implemented to synchronize when doing DMA transactions. SBI_EXT_ANDES_IOCP_SW_WORKAROUND checks if the IOCP errata should be applied to handle cache management. Signed-off-by: Lad Prabhakar <[email protected]> Reviewed-by: Anup Patel <[email protected]> Reviewed-by: Conor Dooley <[email protected]> Reviewed-by: Yu Chien Peter Lin <[email protected]>
2023-02-27platform: generic: renesas: rzfive: Add support to configure the PMALad Prabhakar
I/O Coherence Port (IOCP) provides an AXI interface for connecting external non-caching masters, such as DMA controllers. The accesses from IOCP are coherent with D-Caches and L2 Cache. IOCP is a specification option and is disabled on the Renesas RZ/Five SoC due to this reason IP blocks using DMA will fail. The Andes AX45MP core has a Programmable Physical Memory Attributes (PMA) block that allows dynamic adjustment of memory attributes in the runtime. It contains a configurable amount of PMA entries implemented as CSR registers to control the attributes of memory locations in interest. Below are the memory attributes supported: * Device, Non-bufferable * Device, bufferable * Memory, Non-cacheable, Non-bufferable * Memory, Non-cacheable, Bufferable * Memory, Write-back, No-allocate * Memory, Write-back, Read-allocate * Memory, Write-back, Write-allocate * Memory, Write-back, Read and Write-allocate More info about PMA (section 10.3): Link: http://www.andestech.com/wp-content/uploads/AX45MP-1C-Rev.-5.0.0-Datasheet.pdf As a workaround for SoCs with IOCP disabled CMO needs to be handled by software. Firstly OpenSBI configures the memory region as "Memory, Non-cacheable, Bufferable" and passes this region as a global shared dma pool as a DT node. With DMA_GLOBAL_POOL enabled all DMA allocations happen from this region and synchronization callbacks are implemented to synchronize when doing DMA transactions. Example PMA region passed as a DT node from OpenSBI: reserved-memory { #address-cells = <2>; #size-cells = <2>; ranges; pma_resv0@58000000 { compatible = "shared-dma-pool"; reg = <0x0 0x58000000 0x0 0x08000000>; no-map; linux,dma-default; }; }; Signed-off-by: Lad Prabhakar <[email protected]> Reviewed-by: Yu Chien Peter Lin <[email protected]> Reviewed-by: Anup Patel <[email protected]>
2023-02-27include: sbi: Remove extid parameter from vendor_ext_provider() callbackAnup Patel
The extid parameter of vendor_ext_provider() is redundant so let us remove it. Signed-off-by: Anup Patel <[email protected]>
2023-02-27lib: sbi: Align SBI vendor extension id with mvendorid CSRAnup Patel
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 <[email protected]>
2023-01-22platform: andes/ae350: Implement hart hotplug using HSM extensionYu Chien Peter Lin
Add hart_start() and hart_stop() callbacks for the multi-core ae350 platform, it utilizes the ATCSMU to put the harts into power-gated deep sleep mode. The programming sequence is stated as below: 1. Set the wakeup events to PCSm_WE 2. Set the sleep command to PCSm_CTL 3. Set the reset vector to HARTm_RESET_VECTOR_{LO|HI} 4. Write back and invalidate D-cache by executing the CCTL command L1D_WBINVAL_ALL 5. Disable I/D-cache by clearing mcache_ctl.{I|D}C_EN 6. Disable D-cache coherency by clearing mcache_ctl_.DC_COHEN 7. Wait for mcache_ctl.DC_COHSTA to be cleared to ensure the previous step is completed 8. Execute WFI Signed-off-by: Yu Chien Peter Lin <[email protected]> Reviewed-by: Anup Patel <[email protected]>
2023-01-07platform: generic: Allow platform_override to perform firmware initWei Liang Lim
We add a generic platform override callback to allow platform specific firmware init. Signed-off-by: Wei Liang Lim <[email protected]> Reviewed-by: Chee Hong Ang <[email protected]> Reviewed-by: Jun Liang Tan <[email protected]> Reviewed-by: Anup Patel <[email protected]>
2023-01-07platform: generic: Allow platform_override to select cold boot HARTAnup Patel
We add a generic platform override callback to allow platform specific selection of cold boot HART. Signed-off-by: Anup Patel <[email protected]>
2022-10-13platform: generic: allwinner: add support for c9xx pmuHeiko Stuebner
With the T-HEAD C9XX cores being designed before or during ratification of the SSCOFPMF extension, they implement a PMU extension that behaves very similar but not equal to it by providing overflow interrupts though in a slightly different registers format. The sun20i-d1 is using this core. So implement the necessary overrides to allow its pmu to be used via the standard sbi-pmu extension. For now it's also the only soc using this core, so keep the additional code in the d1-space for now. Reviewed-by: Andrew Jones <[email protected]> Reviewed-by: Guo Ren <[email protected]> Reviewed-by: Anup Patel <[email protected]> Signed-off-by: Heiko Stuebner <[email protected]>
2022-10-13platform: generic: add extensions_init handler and platform-overrideHeiko Stuebner
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 <[email protected]> Reviewed-by: Guo Ren <[email protected]> Reviewed-by: Anup Patel <[email protected]> Signed-off-by: Heiko Stuebner <[email protected]>
2022-06-13platform: generic: add overrides for vendor extensionsMayuresh Chitale
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 <[email protected]> Reviewed-by: Anup Patel <[email protected]>
2021-04-28lib: sbi: Simplify system reset platform operationsAnup Patel
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 <[email protected]> Reviewed-by: Alistair Francis <[email protected]>
2020-12-01lib: sbi: Improve system reset platform operationsAnup Patel
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 <[email protected]> Reviewed-by: Atish Patra <[email protected]>
2020-06-15platform/lib: Allow the OS to map the regions that are protected by PMPAlexandre Ghiti
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 <[email protected]> Reviewed-by: Atish Patra <[email protected]> Reviewed-by: Anup Patel <[email protected]>
2020-05-01platform: Add generic FDT based platform supportAnup Patel
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 <[email protected]> Reviewed-by: Atish Patra <[email protected]>