- Jul 11, 2021
-
-
Bin Meng authored
Avoid using a magic number, instead use a macro for the version of struct fw_dynamic_info. Signed-off-by:
Bin Meng <bmeng.cn@gmail.com> Reviewed-by:
Xiang W <wxjstz@126.com> Reviewed-by:
Anup Patel <anup.patel@wdc.com>
-
Bin Meng authored
The sanity checks on the magic and version was already done in fw_boot_hart(), which happens before fw_save_info() is called. Signed-off-by:
Bin Meng <bmeng.cn@gmail.com> Reviewed-by:
Xiang W <wxjstz@126.com> Reviewed-by:
Anup Patel <anup.patel@wdc.com>
-
Bin Meng authored
At present in the rendered platform guide, all instances of <xyz> are missing. Use < and > to replace <> to make them visible. Signed-off-by:
Bin Meng <bmeng.cn@gmail.com> Reviewed-by:
Xiang W <wxjstz@126.com> Reviewed-by:
Anup Patel <anup.patel@wdc.com>
-
Bin Meng authored
It's riscv-pk, not riskv-pk. Signed-off-by:
Bin Meng <bmeng.cn@gmail.com> Reviewed-by:
Xiang W <wxjstz@126.com> Reviewed-by:
Anup Patel <anup.patel@wdc.com>
-
Bin Meng authored
Before entering _scratch_init(), register t3 already holds a copy of the firmware end address, hence there is no need to calculate it again. This reduces 3 instructions in each _scratch_init() loop. Signed-off-by:
Bin Meng <bmeng.cn@gmail.com> Reviewed-by:
Xiang W <wxjstz@126.com> Reviewed-by:
Atish Patra <atish.patra@wdc.com>
-
Atish Patra authored
Add PMU support for generic platform. Generic platform solely relies on the device tree to parse all pmu related information. If any event is not described in device tree, generic platform will not support it. Reviewed-by:
Anup Patel <anup.patel@wdc.com> Signed-off-by:
Atish Patra <atish.patra@wdc.com>
-
Atish Patra authored
Follow the standard conventon for static function names: All global functions should be start with sbi_<module name>_ All static functions should be start with <module name>_ 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 defines a set of firmware events that can provide additional information about the current firmware context. All of the firmware event monitoring are enabled now. The firmware events must be defined as raw perf event with MSB set as specified in the specification. Reviewed-by:
Anup Patel <anup.patel@wdc.com> Signed-off-by:
Atish Patra <atish.patra@wdc.com>
-
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>
-