- Jul 11, 2021
-
-
Atish Patra authored
RISC-V SBI specfication 0.3 defines a PMU extension that allows supervisor mode to start/stop/configure pmu related events. This patch implements all of the functionality defined in the specification. Reviewed-by:
Anup Patel <anup.patel@wdc.com> Signed-off-by:
Atish Patra <atish.patra@wdc.com>
-
Atish Patra authored
The PMU DT node bindings are defined in docs/pmu_support.md Add few fdt helper functions to parse the DT node and update the event-counter mapping tables. Reviewed-by:
Anup Patel <anup.patel@wdc.com> Signed-off-by:
Atish Patra <atish.patra@wdc.com>
-
Atish Patra authored
RISC-V SBI v0.3 specification defined a PMU extension to configure/start/stop the hardware/firmware pmu events. Implement PMU support in OpenSBI library. The implementation is agnostic of event to counter mapping & mhpmevent value configuration. That means, it expects platform hooks will be used to set up the mapping and provide the mhpmevent value at runtime. Reviewed-by:
Anup Patel <anup.patel@wdc.com> Signed-off-by:
Atish Patra <atish.patra@wdc.com>
-
Atish Patra authored
A platform hook to initialize PMU allows platform vendors to provide their own mechanism to define pmu event-counter mappings in addition to the DT based approach. Another platform hook that allows platform vendors customize the final mhpmevent value configuration. Reviewed-by:
Anup Patel <anup.patel@wdc.com> Signed-off-by:
Atish Patra <atish.patra@wdc.com>
-
Atish Patra authored
Currently, csr_read/write_num functions are used to read/write PMP related CSRs where CSR value is decided at runtime. Expand this function to include PMU related CSRs as well. Reviewed-by:
Anup Patel <anup.patel@wdc.com> Reviewed-by:
Xiang W <wxjstz@126.com> Signed-off-by:
Atish Patra <atish.patra@wdc.com>
-
Atish Patra authored
This patch removes redundant print from sbi_boot_print_hart(). Reviewed-by:
Anup Patel <anup.patel@wdc.com> Signed-off-by:
Atish Patra <atish.patra@wdc.com>
-
Atish Patra authored
Implement a list helper function that checks for empty lists. Reviewed-by:
Anup Patel <anup.patel@wdc.com> Reviewed-by:
Xiang W <wxjstz@126.com> Signed-off-by:
Atish Patra <atish.patra@wdc.com>
-
Atish Patra authored
Currently, all bits in mcountern are enabled unconditionally at boot time. With SBI PMU extension, all the programmable counters should enabled only during performance monitoring for a particular event. However, this is done only if mcountinhibit is implemented because the supervisor mode can not start/stop any event without mcountinhibit. Similarly, supervisor should take care enabling scounteren which allows U-mode to access programmable pmu counters. All the non-programmable ones (CY, TM, IR) should be enabled in M-mode because some userspace may rely on builtins such as __builtin_readcyclecounter. Supervisor OS can still disable them during initial configuration. Reviewed-by:
Anup Patel <anup.patel@wdc.com> Signed-off-by:
Atish Patra <atish.patra@wdc.com>
-
Atish Patra authored
RISC-V privilege specification allows the implementation to have less than 64 bits. Add a function to detect the number of implemented bits in mhpmcounter dynamically at runtime. Reviewed-by:
Xiang W <wxjstz@126.com> Reviewed-by:
Anup Patel <anup.patel@wdc.com> Signed-off-by:
Atish Patra <atish.patra@wdc.com>
-
Atish Patra authored
Reviewed-by:
Xiang W <wxjstz@126.com> Reviewed-by:
Anup Patel <anup.patel@wdc.com> Signed-off-by:
Atish Patra <atish.patra@wdc.com>
-
Atish Patra authored
RISC-V ISA specification v1.11 defined mcountinhibit CSR that allows software to stop any counter from incrementing. The SBI PMU extension depends on this CSR support in hardware. Define mcountinhibit as a hart specific feature and detect it at runtime. Reviewed-by:
Anup Patel <anup.patel@wdc.com> Signed-off-by:
Atish Patra <atish.patra@wdc.com>
-
Atish Patra authored
SBI PMU extension requires a firmware to be aware of the event to counter/mhpmevent mappings supported by the hardware. One approach is to encode that information in the device tree. Define a device tree binding that allows a hardware to describe all the PMU mappings required in concise format. Reviewed-by:
Anup Patel <anup.patel@wdc.com> Signed-off-by:
Atish Patra <atish.patra@wdc.com>
-
- Jul 06, 2021
-
-
Bin Meng authored
fw_platform_init() fills platform.name without considering the ending null character. Fix it. Signed-off-by:
Bin Meng <bmeng.cn@gmail.com> Reviewed-by:
Anup Patel <anup.patel@wdc.com>
-
Bin Meng authored
FW_PIC is on by default. Hence no need to explicitly require it. Signed-off-by:
Bin Meng <bmeng.cn@gmail.com> Reviewed-by:
Anup Patel <anup.patel@wdc.com>
-
Green Wan authored
Unify all the file and function names of 'sifive_test' device, to use the same prefix. This is also a preparatory patch for upcoming sifive reset device. Signed-off-by:
Green Wan <green.wan@sifive.com> Reviewed-by:
Bin Meng <bmeng.cn@gmail.com> Reviewed-by:
Anup Patel <anup.patel@wdc.com>
-
- Jun 24, 2021
-
-
Anup Patel authored
The ACLINT devices are backward compatible with SiFive CLINT so we replace all CLINT library usage in various platforms with ACLINT library. As a result of this replacement, the CLINT library is not used by any part of OpenSBI hence we remove it. Signed-off-by:
Anup Patel <anup.patel@wdc.com> Reviewed-by:
Bin Meng <bmeng.cn@gmail.com> Reviewed-by:
Xiang W <wxjstz@126.com>
-
Anup Patel authored
We add a new FDT based ACLINT MTIMER driver which works for both CLINT device and standalone ACLINT MTIMER device. Signed-off-by:
Anup Patel <anup.patel@wdc.com> Reviewed-by:
Bin Meng <bmeng.cn@gmail.com> Reviewed-by:
Xiang W <wxjstz@126.com>
-
Anup Patel authored
We add a new FDT based ACLINT MSWI IPI driver which works for both CLINT device and standalone ACLINT MSWI device. Signed-off-by:
Anup Patel <anup.patel@wdc.com> Reviewed-by:
Bin Meng <bmeng.cn@gmail.com> Reviewed-by:
Xiang W <wxjstz@126.com>
-
Anup Patel authored
We add fdt_parse_aclint_node() which can parse both ACLINT and CLINT DT nodes. This means fdt_parse_clint_node() is not required anymore so we remove it as well. Signed-off-by:
Anup Patel <anup.patel@wdc.com> Reviewed-by:
Bin Meng <bmeng.cn@gmail.com> Reviewed-by:
Xiang W <wxjstz@126.com>
-
Anup Patel authored
We add common ACLINT MSWI library similar to the CLINT library so that OpenSBI platforms can use it. Signed-off-by:
Anup Patel <anup.patel@wdc.com> Reviewed-by:
Bin Meng <bmeng.cn@gmail.com> Reviewed-by:
Xiang W <wxjstz@126.com>
-
Anup Patel authored
We add common ACLINT MTIMER library similar to the CLINT library so that OpenSBI platforms can use it. Signed-off-by:
Anup Patel <anup.patel@wdc.com> Reviewed-by:
Bin Meng <bmeng.cn@gmail.com> Reviewed-by:
Xiang W <wxjstz@126.com>
-
- Jun 22, 2021
-
-
Heinrich Schuchardt authored
Don't assign an unused value to variable index. Use operator '-=' where applicable. Signed-off-by:
Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by:
Atish Patra <atish.patra@wdc.com> Reviewed-by:
Xiang W <wxjstz@126.com>
-
Heinrich Schuchardt authored
Compiling wake_coldboot_harts() with GCC 11 and -Wextra yields: lib/sbi/sbi_init.c:208:27: error: comparison of integer expressions of different signedness: ‘int’ and ‘u32’ {aka ‘unsigned int’} [-Werror=sign-compare] 208 | for (int i = 0; i <= sbi_scratch_last_hartid(); i++) { | ^~ Signed-off-by:Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by:
Atish Patra <atish.patra@wdc.com> Reviewed-by:
Xiang W <wxjstz@126.com>
-
Heinrich Schuchardt authored
Compiling sbi_tlb_entry_process() with GCC 11 and -Wextra yields: lib/sbi/sbi_tlb.c: In function ‘sbi_tlb_process_count’: lib/sbi/sbi_tlb.c:206:31: error: comparison of integer expressions of different signedness: ‘u32’ {aka ‘unsigned int’} and ‘int’ [-Werror=sign-compare] 206 | if (deq_count > count) Signed-off-by:Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by:
Atish Patra <atish.patra@wdc.com> Reviewed-by:
Xiang W <wxjstz@126.com>
-
Bin Meng authored
Sync with libfdt v1.6.1 release source codes. Signed-off-by:
Bin Meng <bmeng.cn@gmail.com> Reviewed-by:
Anup Patel <anup.patel@wdc.com>
-
- Jun 12, 2021
-
-
Charles Papon authored
Current, GET_F64_REG() macro does not generate correct inline assembly for the RV32 systems. This patch provides separate definitions of GET_F64_REG() macro for RV32 and RV64 systems. Signed-off-by:
Charles Papon <charles.papon.90@gmail.com> Signed-off-by:
Anup Patel <anup.patel@wdc.com>
-
- Jun 11, 2021
-
-
Heinrich Schuchardt authored
If property csr-copy does not exist, fdt_getprop() will return NULL and cnt will have a random value from the stack. Call clone_csrs() only if cnt is initialized to a non-zero value. Fixes: 49e422c5 ("lib: utils: reset: Add T-HEAD sample platform reset driver") Signed-off-by:
Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by:
Anup Patel <anup.patel@wdc.com>
-
Heinrich Schuchardt authored
In sbi_scratch_init() we determine the last hart. The index of the last hart cannot exceed SBI_HARTMASK_MAX_BITS - 1. We should not initialize last_hartid_having_scratch to a higher number to avoid buffer overflows when using this value before calling sbi_scratch_init(). When allocating scratch memory in sbi_scratch_alloc_offset() we zero out the allocated memory for all harts except for the last one. We should not skip the last hart. Signed-off-by:
Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by:
Anup Patel <anup.patel@wdc.com>
-
Bin Meng authored
plicsw_ipi_sync() is a forward declaration but without the actual implementation. Drop it. Signed-off-by:
Bin Meng <bmeng.cn@gmail.com> Reviewed-by:
Anup Patel <anup.patel@wdc.com>
-
Bin Meng authored
This is not used anywhere. Drop it. Signed-off-by:
Bin Meng <bmeng.cn@gmail.com> Reviewed-by:
Anup Patel <anup.patel@wdc.com>
-
Bin Meng authored
Fix several places in the docmentation that are missing spaces. Signed-off-by:
Bin Meng <bmeng.cn@gmail.com> Reviewed-by:
Anup Patel <anup.patel@wdc.com>
-
Bin Meng authored
- %s/CLINT/PLICSW - replace '.' with a space - add a space around * in plicsw_cold_ipi_init() Signed-off-by:
Bin Meng <bmeng.cn@gmail.com> Reviewed-by:
Anup Patel <anup.patel@wdc.com>
-
- Jun 02, 2021
-
-
Heinrich Schuchardt authored
The parameter owner of function sbi_scratch_alloc_offset() is never used. The scratch memory is small. We should not use it for debug information in future. Hence eliminate the parameter. Signed-off-by:
Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by:
Xiang W <wxjstz@126.com> Reviewed-by:
Anup Patel <anup.patel@wdc.com>
-
Heinrich Schuchardt authored
The value of the /chosen/stdout-path devicetree property is used to determine the UART used by openSBI. According to the devicetree specification the value may contain a hyphen, e.g. chosen { stdout-path = "/serial@f00:115200"; }; If the character ':' is present, it terminates the path of the device. Signed-off-by:Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by:
Atish Patra <atish.patra@wdc.com>
-
Heinrich Schuchardt authored
Describe how to debug OpenSBI on QEMU with GDB. Signed-off-by:
Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by:
Atish Patra <atish.patra@wdc.com>
-
- May 24, 2021
-
-
Anup Patel authored
We should try other FDT drivers when we see SBI_ENODEV returned by cold_init() of FDT driver. Signed-off-by:
Anup Patel <anup.patel@wdc.com> Reviewed-by:
Atish Patra <atish.patra@wdc.com> Reviewed-by:
Xiang W <wxjstz@126.com>
-
Anup Patel authored
We can merge region B onto region A only if base of region A is aligned to region A order + 1. Signed-off-by:
Anup Patel <anup.patel@wdc.com> Reviewed-by:
Atish Patra <atish.patra@wdc.com> Reviewed-by:
Xiang W <wxjstz@126.com>
-
- May 19, 2021
-
-
Daniel Schaefer authored
Use strncmp() instead of strcmp() in __fixup_find_domain_offset() so that it compiles fine when linking with external firmware (such as EDK2). Signed-off-by:
Daniel Schaefer <daniel.schaefer@hpe.com> Reviewed-by:
Xiang W <wxjstz@126.com> Reviewed-by:
Abner Chang <abner.chang@hpe.com> Reviewed-by:
Anup Patel <anup.patel@wdc.com>
-
Daniel Schaefer authored
When SBI is built by external firmware, we need to use their functions, defined in libfdt_env.h. Just like 2cfd2fc9 Signed-off-by:
Daniel Schaefer <daniel.schaefer@hpe.com> Reviewed-by:
Abner Chang <abner.chang@hpe.com> Reviewed-by:
Xiang W <wxjstz@126.com> Reviewed-by:
Anup Patel <anup.patel@wdc.com>
-
Daniel Schaefer authored
we want to use sbi_strncpy as strncpy in the OpenSBI implementation for libfdt. Just like 2845d2d2 Signed-off-by:
Daniel Schaefer <daniel.schaefer@hpe.com> Reviewed-by:
Abner Chang <abner.chang@hpe.com> Reviewed-by:
Xiang W <wxjstz@126.com> Reviewed-by:
Anup Patel <anup.patel@wdc.com>
-