summaryrefslogtreecommitdiff
path: root/platform/generic/include
AgeCommit message (Collapse)Author
2026-06-28platform: generic: spacemit: k1: fix wrong address definitionsJunhui Liu
PMU_AP_CORE2_IDLE_CFG and PMU_AP_CORE3_IDLE_CFG are not continuous with PMU_AP_CORE0_IDLE_CFG and PMU_AP_CORE1_IDLE_CFG. They are at PMU AP base + 0x160 and + 0x164, matching the vendor OpenSBI definitions. After fixing these addresses, the intermediate cluster offset macros are redundant now, so define the wakeup and idle registers directly as PMU_AP_BASE offsets. This makes the actual register addresses easier to inspect and compare against the vendor code. C1_RVBADDR_HI_ADDR is also corrected according to the vendor OpenSBI definition. This was tested by writing an invalid value to the corrected address, which prevents cluster1 CPUs from coming online, while doing the same with the old address does not affect SMP boot. Fixes: 1f84ec2a ("platform: generic: spacemit: add K1") Signed-off-by: Junhui Liu <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Anup Patel <[email protected]>
2026-06-15platform: generic: eswin: Add eic770x_hsm and fix warm reset issuesBo Gan
During warm reset, my EIC770X/Hifive Premier P550 can sometimes encounter memory corruption issue crashing Linux boot. Currently the issue is mitigated by having a sbi_printf before writing to the reset register. I analyzed the issue further since then. From the SoC datasheet[1], it's recommended to implement power-down flow as: a. Designate a primary core, and let it broadcast requests to other cores to execute a CEASE insn. Primary core also notifies an "Externel Agent" to start monitoring. b. Primary core waits for other cores to CEASE before it CEASEs. c. "External Agent" waits for primary core to CEASE before resets the Core Complex. It's possible that EIC770X can trigger undefined behavior if the core complex is reset while the harts are actively running. The sbi_printf in the reset handler effectively hides the problem by delaying the reset -- by the time sbi_printf finishes, all other harts will have already landed in the loop in sbi_hsm_hart_wait(), which parks the hart. Without the sbi_printf, I confirmed that other harts haven't reached sbi_hsm_hart_wait yet before current hart resets the SoC. (by debugging) To safely reset, and inspired by the datasheet, the warm reset logic in eic770x.c now use the current hart as both primary core and the "External Agent", and other harts as secondary cores. It leverages the HSM framework and a new eic770x_hsm device to CEASE other harts, and wait for them to CEASE before resets the SoC. with the sbi_printf before reset removed, and this logic in place, stress test shows that the memory corruption issue no longer occurs. The new eic770x_hsm device is only used for the reset-CEASE logic at the moment, and may be extended to a fully functional HSM device in the future. [1] https://github.com/eswincomputing/EIC7700X-SoC-Technical-Reference-Manual Fixes: e5797e0688c1 ("platform: generic: eswin: add EIC7700") 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]>
2026-06-12platform: generic: Optimize extensions_init() to parse ISA extensions onceAnup Patel
Instead of parsing ISA extensions separately for each hart in the generic_extensions_init() function, it is better to parse ISA extensions for all available harts in the cold boot path. Also, this allows us to remove fdt_isa_bitmap from scratch space and directly initialize "extensions" in struct sbi_hart_features for each hart. Signed-off-by: Anup Patel <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Anup Patel <[email protected]>
2026-05-09platform: generic: Tenstorrent Atlantis supportNicholas Piggin
Add the Tenstorrent Atlantis as a generic-platform. This initial support enables the single_fw_region option, and verifies and prints HART PMA CSR configuration. Signed-off-by: Nicholas Piggin <[email protected]> Reviewed-by: Anup Patel <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Anup Patel <[email protected]>
2026-02-25platform: generic: p8700: fix MIPS specific CSRsVladimir Kondratiev
P8700 has MIPS specific CSRs. Fix the list, adding few missing ones and remove few non-existing Signed-off-by: Vladimir Kondratiev <[email protected]> Reviewed-by: Anup Patel <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Anup Patel <[email protected]>
2026-02-25platform: generic: mips p8700: dump MMIO regionsVladimir Kondratiev
Debug print MMIO regions Signed-off-by: Vladimir Kondratiev <[email protected]> Reviewed-by: Anup Patel <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Anup Patel <[email protected]>
2026-02-25platform: generic: mips eyeq7h: fix NCORE registers access from clusters 1..2Vladimir Kondratiev
CPU clusters 1 and 2 cannot access NCORE registers through AUX ports. AUX ports of clusters 1 and 2 are connected to NCORE through east port. East port has no access to NCORE registers address space. Re-route NCORE registers range to MEM port by re-configuring MMIO regions in the GCR. REsulting map is as below. Mind a gap between regions [1] and [2]; this gap covering NCORE registers now routed to the default MEM port Cluster 0: 4 MMIO regions [0] : 0x0000000000000000-0x000000001fff0000 AUX0 UC|UCA [1] : 0x0000000020000000-0x00000000677f0000 AUX0 ANY [2] : 0x0000000080000000-0x0000001fffff0000 AUX0 UC|UCA [3] : --disabled-- Cluster 1: 4 MMIO regions [0] : 0x0000000000000000-0x000000001fff0000 AUX0 UC|UCA [1] : 0x0000000020000000-0x00000000677f0000 AUX0 ANY [2] : 0x0000000080000000-0x0000001fffff0000 AUX0 UC|UCA [3] : --disabled-- Cluster 2: 4 MMIO regions [0] : 0x0000000000000000-0x000000001fff0000 AUX0 UC|UCA [1] : 0x0000000020000000-0x00000000677f0000 AUX0 ANY [2] : 0x0000000080000000-0x0000001fffff0000 AUX0 UC|UCA [3] : --disabled-- Signed-off-by: Vladimir Kondratiev <[email protected]> Reviewed-by: Anup Patel <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Anup Patel <[email protected]>
2026-02-25platform: generic: mips eyeq7h: synchronize timers across clustersVladimir Kondratiev
Use eyeq7 specific method to synchronously restart architectural mtimer and eyeq7h specific high-resolution timer with common hardware trigger. This ensures all timers are precisely in sync Signed-off-by: Vladimir Kondratiev <[email protected]> Reviewed-by: Anup Patel <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Anup Patel <[email protected]>
2026-02-25platform: generic: mips p8700: synchronize hi-res timersVladimir Kondratiev
There's high-resolution (1GHz) timer found in the p8700 cluster. This timer used for precise time measurement by platform specific software. Synchronize this proprietary timers to reference in cluster 0. Procedure borrowed from the aclint mtimer. Signed-off-by: Vladimir Kondratiev <[email protected]> Reviewed-by: Anup Patel <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Anup Patel <[email protected]>
2026-02-25platform: generic: mips p8700: use SBI bitfield manipulator macrosVladimir Kondratiev
Switch to GENMASK, EXTRACT_BITFIELD, INSERT_BITFIELD Signed-off-by: Vladimir Kondratiev <[email protected]> Reviewed-by: Anup Patel <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Anup Patel <[email protected]>
2026-02-25platform: generic: mips p8700: CPU clusters memrangesVladimir Kondratiev
Reserve memory regions for CPU clusters according to P8700 cluster memory layout. There's a set of components in the CPU cluster according to [1] [1] https://mips.com/wp-content/uploads/2025/11/P8700-F_Programmers_Reference_Manual-TM.pdf Signed-off-by: Vladimir Kondratiev <[email protected]> Reviewed-by: Anup Patel <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Anup Patel <[email protected]>
2026-02-25platform: generic: mips p8700: cache geometry detectionVladimir Kondratiev
P8700 has a read-only cache configuration registers. Provide a CPU specific function to extract cache information. Use this information in the eyeq7h board for informational message Signed-off-by: Vladimir Kondratiev <[email protected]> Reviewed-by: Anup Patel <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Anup Patel <[email protected]>
2026-02-25platform: generic: mips: add P8700 based "eyeq7h" and "boston"Vladimir Kondratiev
Refactor MIPS P8700 support, convert P8700 into a "CPU" and add 2 platforms using this CPU: - "boston" - FPGA platform developed by MIPS - "eyeq7h" - automotive platform by Mobileye Signed-off-by: Vladimir Kondratiev <[email protected]> Reviewed-by: Anup Patel <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Anup Patel <[email protected]>
2026-02-25platform: generic: mips p8700: access CM registers via match dataVladimir Kondratiev
Modify the coherence manager register accessors to use the global variable p8700_cm_info instead of the statically declared GLOBAL_CM_BASE array. Also use p8700_cm_info to get the number of coherence managers and their base addresses in mips_p8700_early_init() and mips_p8700_nascent_init(). Clean up the hard-coded values in mips/board.h, access to the coherence manager is now fully based on information provided by platform compatible from the device tree. Signed-off-by: Benoît Monin <[email protected]> Signed-off-by: Vladimir Kondratiev <[email protected]> Reviewed-by: Anup Patel <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Anup Patel <[email protected]>
2026-02-25platform: generic: mips p8700: Add match data for CM infoBenoît Monin
Introduce a structure p8700_cm_info holding the number of coherence managers and their base addresses found in a particular SoC. Declare a global pointer to the structure that is set in mips_p8700_platform_init(), based on the match data of the platform compatible. For the match data of the MIPS P8700, a single coherence manager with a base address of 0x16100000 is declared, identical to what is found in mips/board.h. For now, access to the coherence manager register is still based on the hard-coded values defined in mips/board.h. Signed-off-by: Benoît Monin <[email protected]> Signed-off-by: Vladimir Kondratiev <[email protected]> Reviewed-by: Anup Patel <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Anup Patel <[email protected]>
2026-02-25platform: generic: mips p8700: use global CM addressesVladimir Kondratiev
In the multi-cluster system each cluster has its own CM (Coherency Manager). Every CM has its "global" memory address where it is accessible from any bus master. Initially, all CMs accessible from the local cluster using same "local" address. Transactions by local address are not routed through system bus and thus are faster. Remap CM in every cluster to the local address matching its global address. Then, every CM is always accessed using same address, but when transaction initiated from the local cluster it is routed internally. This removes need for 2 PMP regions covering local address access. CM accessor functions simplified because there's no need to detect whether transaction is local or global Access timer always in cluster 0 Signed-off-by: Vladimir Kondratiev <[email protected]> Reviewed-by: Anup Patel <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Anup Patel <[email protected]>
2026-02-25platform: generic: mips p8700: improve CM access tracingVladimir Kondratiev
use function call like format; debug print returning value of the "read" accessor Signed-off-by: Vladimir Kondratiev <[email protected]> Reviewed-by: Anup Patel <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Anup Patel <[email protected]>
2026-02-11platform: generic/andes: add CSR save and restore functions for AE350 platformBen Zong-You Xie
Implement a save and restore mechanism for Andes-specific CSRs to support hardware power-saving modes, such as CPU hotplug or suspend to RAM. Signed-off-by: Ben Zong-You Xie <[email protected]> Signed-off-by: Leo Yu-Chi Liang <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Anup Patel <[email protected]>
2026-02-11lib: utils/hsm: factor out ATCSMU code into an HSM driverBen Zong-You Xie
Refactor ATCSMU (System Management Unit) support by moving it from a system utility into a dedicated FDT-based HSM driver. Key changes include: - Moving the functions in lib/utils/sys/atcsmu.c into the new HSM driver - Moving hart start and stop operations on AE350 platform into the new HSM driver - Converting the assembly-based functions in sleep.S to C code for the readability - Updating the ATCWDT200 driver Signed-off-by: Ben Zong-You Xie <[email protected]> Signed-off-by: Leo Yu-Chi Liang <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Anup Patel <[email protected]>
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]>