- Jun 13, 2022
-
-
Samuel Holland authored
The suspend code needs to know the resume address for two reasons: 1) Programming some hardware register or management firmware. Here we assume the hardware/firmware maintains its state between suspends, so it only needs to be programmed once at startup. 2) When a non-retentive suspend request ends up being retentive, due to lack of hardware support, pending interrupt, or for some other reason. However, the behavior here is not platform-dependent, and this can be handled in the generic hart suspend function. Since neither situation requires the platform-level suspend function to know the resume address, stop passing it to that function. Instead, handle the non-retentive to retentive situation generically. Reviewed-by:Anup Patel <anup@brainfault.org> Signed-off-by:
Samuel Holland <samuel@sholland.org>
-
Samuel Holland authored
Non-retentive suspend states may require platform-specific actions during resume. For example, firmware may need to save and restore the values of custom CSRs. Add a hook to support this. Reviewed-by:
Anup Patel <anup@brainfault.org> Signed-off-by:
Samuel Holland <samuel@sholland.org>
-
Mayuresh Chitale authored
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>
-
dramforever authored
HS-mode software can choose what exceptions to delegate to VS-mode using the hedeleg CSR. Synthetic VS/VU-mode exceptions should also honor hedeleg. They should be redirected to VS-mode if and only if delegated by HS-mode. Signed-off-by:
dramforever <dramforever@live.com> Reviewed-by:
Xiang W <wxjstz@126.com> Reviewed-by:
Anup Patel <anup@brainfault.org>
-
- Jun 01, 2022
-
-
Samuel Holland authored
While OpenC906 appears to properly decode `fence.tso` as a fence instruction[1], the version of the C906 taped out in the Allwinner D1 does not, and raises illegal instruction. Handle this errata by emulating `fence.tso` as `fence rw, rw`. [1]: https://github.com/T-head-Semi/openc906/blob/30827e7f/C906_RTL_FACTORY/gen_rtl/idu/rtl/aq_idu_id_decd.v#L2097 Signed-off-by:
Samuel Holland <samuel@sholland.org> Reviewed-by:
Anup Patel <anup@brainfault.org>
-
- May 30, 2022
-
-
Samuel Holland authored
This table does not need to be modified at runtime. Signed-off-by:
Samuel Holland <samuel@sholland.org> Reviewed-by:
Anup Patel <anup@brainfault.org>
-
Samuel Holland authored
The device's timer_value callback is already the right prototype to use for the get_time_val function pointer. Signed-off-by:
Samuel Holland <samuel@sholland.org> Reviewed-by:
Anup Patel <anup@brainfault.org>
-
Samuel Holland authored
Match data stores hardware attributes which do not change at runtime, so it does not need to be mutable. Make it const. Reviewed-by:
Guo Ren <guoren@kernel.org> Reviewed-by:
Xiang W <wxjstz@126.com> Reviewed-by:
Anup Patel <anup@brainfault.org> Signed-off-by:
Samuel Holland <samuel@sholland.org>
-
Xiang W authored
If the csr's operation comes from M mode, it should not be forwarded to low-privilege processing, this patch fixes this problem. Signed-off-by:
Xiang W <wxjstz@126.com> Reviewed-by:
Anup Patel <anup@brainfault.org>
-
- May 14, 2022
-
-
Jan Remes authored
The function returns the highest hart-id of the harts actually used in the system (enabled). Change the name to reflect this fact. Signed-off-by:
Jan Remes <jan.remes@codasip.com> Reviewed-by:
Anup Patel <anup@brainfault.org>
-
Jan Remes authored
Ignore CPU nodes in FDT which are not enabled. Signed-off-by:
Jan Remes <jan.remes@codasip.com> Reviewed-by:
Xiang W <wxjstz@126.com> Reviewed-by:
Anup Patel <anup@brainfault.org>
-
Jan Remes authored
Ignore CPU nodes in FDT that are not enabled. Signed-off-by:
Jan Remes <jan.remes@codasip.com> Reviewed-by:
Anup Patel <anup@brainfault.org>
-
Jan Remes authored
If an FDT node contains a "status" property and this property is not "ok" or "okay", this node should be ignored. Introduce a function that checks this. Signed-off-by:
Jan Remes <jan.remes@codasip.com> Reviewed-by:
Xiang W <wxjstz@126.com> Reviewed-by:
Anup Patel <anup@brainfault.org>
-
- May 13, 2022
-
-
Jan Remes authored
Fix typo in irqchip_imsic_update_hartid_table() when checking for CPU node. Signed-off-by:
Jan Remes <jan.remes@codasip.com> Reviewed-by:
Anup Patel <anup@brainfault.org> Reviewed-by:
Bin Meng <bmeng.cn@gmail.com>
-
Anup Patel authored
Let us move SiFive platform overrides for FU540 and FU740 into a separate directory so better maintainability. Other SoC vendors can also create their own directory under platform/generic. Signed-off-by:
Anup Patel <apatel@ventanamicro.com> Reviewed-by:
Atish Patra <atishp@rivosinc.com>
-
Anup Patel authored
Instead of having platform override module list hard-coded in the C source, we generate it using carray.sh at compile-time. Signed-off-by:
Anup Patel <apatel@ventanamicro.com> Reviewed-by:
Atish Patra <atishp@rivosinc.com>
-
Anup Patel authored
Instead of having FDT gpio driver list hard-coded in the C source, we generate it using carray.sh at compile-time. Signed-off-by:
Anup Patel <apatel@ventanamicro.com> Reviewed-by:
Atish Patra <atishp@rivosinc.com>
-
Anup Patel authored
Instead of having FDT i2c adapter driver list hard-coded in the C source, we generate it using carray.sh at compile-time. Signed-off-by:
Anup Patel <apatel@ventanamicro.com> Reviewed-by:
Atish Patra <atishp@rivosinc.com>
-
Anup Patel authored
Instead of having FDT ipi driver list hard-coded in the C source, we generate it using carray.sh at compile-time. Signed-off-by:
Anup Patel <apatel@ventanamicro.com> Reviewed-by:
Atish Patra <atishp@rivosinc.com>
-
Anup Patel authored
Instead of having FDT irqchip driver list hard-coded in the C source, we generate it using carray.sh at compile-time. Signed-off-by:
Anup Patel <apatel@ventanamicro.com> Reviewed-by:
Atish Patra <atishp@rivosinc.com>
-
Anup Patel authored
Instead of having FDT timer driver list hard-coded in the C source, we generate it using carray.sh at compile-time. Signed-off-by:
Anup Patel <apatel@ventanamicro.com> Reviewed-by:
Atish Patra <atishp@rivosinc.com>
-
Anup Patel authored
Instead of having FDT serial driver list hard-coded in the C source, we generate it using carray.sh at compile-time. Signed-off-by:
Anup Patel <apatel@ventanamicro.com> Reviewed-by:
Atish Patra <atishp@rivosinc.com>
-
Anup Patel authored
Instead of having FDT reset driver list hard-coded in the C source, we generate it using carray.sh at compile-time. Signed-off-by:
Anup Patel <apatel@ventanamicro.com> Reviewed-by:
Atish Patra <atishp@rivosinc.com>
-
Anup Patel authored
Generating C array at compile time based on details provided by objects.mk is a very useful feature which will help us compile only a subset of drivers or modules. We add a bash script (carray.sh) which takes array details and object/variable list from command-line to generate a C source containing array of object/variable pointers. We also extend top-level makefile to use carray.sh whenever specified through objects.mk. Signed-off-by:
Anup Patel <apatel@ventanamicro.com> Reviewed-by:
Atish Patra <atishp@rivosinc.com>
-
Anup Patel authored
The generated C source could be anywhere within build directory so let us update the make rule to comple generated C source accordingly. Signed-off-by:
Anup Patel <apatel@ventanamicro.com> Reviewed-by:
Atish Patra <atishp@rivosinc.com>
-
- May 07, 2022
-
-
Anup Patel authored
We add platform specific extensions_init() callback which allows platforms to populate HART extensions for each HART. For example, the generic platform can populate HART extensions from HART ISA string described in DeviceTree. Signed-off-by:
Anup Patel <apatel@ventanamicro.com> Reviewed-by:
Atish Patra <atishp@rivosinc.com>
-
Anup Patel authored
We add sbi_hart_update_extension() function which allow platforms to enable/disable hart extensions. Signed-off-by:
Anup Patel <anup@brainfault.org> Reviewed-by:
Atish Patra <atishp@rivosinc.com>
-
Anup Patel authored
Currently, the hart_detect_features() is called everytime a hart is stopped and started again which is unnecessary work. We update hart_detect_features() to detect hart features only once for each hart. Signed-off-by:
Anup Patel <apatel@ventanamicro.com> Reviewed-by:
Atish Patra <atishp@rivosinc.com>
-
Anup Patel authored
Since past few years, we have been using "hart features" in OpenSBI to represent all optionalities and multi-letter extensions defined by the RISC-V specifications. The RISC-V profiles specification has taken a different approach and started assigning extension names for all optionalities which did not have any extension name previously. (Refer, https://github.com/riscv/riscv-profiles/blob/main/profiles.adoc ) Inspired from the RISC-V profiles specification, we convert OpenSBI hart features into hart extensions. Going forward, we align the extension naming with RISC-V profiles specification. Currently, only "time CSR" and "AIA CSR" have not been assigned extension name but for everything else we have a name. Signed-off-by:
Anup Patel <apatel@ventanamicro.com> Reviewed-by:
Atish Patra <atishp@rivosinc.com>
-
Anup Patel authored
The AIA feature detection uses unnecessary goto which is not need and AIA case in sbi_hart_feature_id2string() does not break. This patch fixes both issues in AIA feature detection. Signed-off-by:
Anup Patel <apatel@ventanamicro.com> Reviewed-by:
Atish Patra <atishp@rivosinc.com>
-
Anup Patel authored
If a hart implements privileged spec v1.12 (or higher) then we can safely assume that menvcfg CSR is present and we don't need MENVCFG as a hart feature. Signed-off-by:
Anup Patel <apatel@ventanamicro.com> Reviewed-by:
Atish Patra <atishp@rivosinc.com>
-
Anup Patel authored
If a hart implements privileged spec v1.11 (or higher) then we can safely assume that mcountinhibit CSR is present and we don't need MCOUNTINHIBT as a hart feature. Signed-off-by:
Anup Patel <apatel@ventanamicro.com> Reviewed-by:
Atish Patra <atishp@rivosinc.com>
-
Anup Patel authored
If a hart implements privileged spec v1.10 (or higher) then we can safely assume that [m|s]counteren CSR are present and we don't need MCOUNTEREN and SCOUNTEREN as hart features. Signed-off-by:
Anup Patel <apatel@ventanamicro.com> Reviewed-by:
Atish Patra <atishp@rivosinc.com>
-
Anup Patel authored
The ISA string printed at boot time is not the complete ISA string representing all single letter and multi-letter extensions rather it is base ISA string derived from misa CSR so let us update the boot print accordingly. Signed-off-by:
Anup Patel <apatel@ventanamicro.com> Reviewed-by:
Atish Patra <atishp@rivosinc.com>
-
Anup Patel authored
Both 's' and 'u' are not treated as ISA extensions since these are privilege modes so let's remove it from misa_string() output. Signed-off-by:
Anup Patel <apatel@ventanamicro.com> Reviewed-by:
Atish Patra <atishp@rivosinc.com>
-
Anup Patel authored
It is possible to guess privileged spec versions based on the CSRs that where introduced in different privileged spec versions. In future, if we are not able guess privileged spec version then we can have platform provide it. We add privileged spec version as per-hart feature and try to guess it based on presence of mcounteren, mcountinhibit, and menvcfg CSRs. Signed-off-by:
Anup Patel <apatel@ventanamicro.com> Reviewed-by:
Atish Patra <atishp@rivosinc.com>
-
Atish Patra authored
MHPMEVENT3H-31H are defined in sscofpmf extension. Thus, they should be accessed only if sscofpmf is present. Signed-off-by:
Atish Patra <atishp@rivosinc.com> Reviewed-by:
Anup Patel <anup@brainfault.org>
-
Jun Liang Tan authored
Increase maximum number of PMU hardware events that can be mapped by OpenSBI to 256 Signed-off-by:
Jun Liang Tan <junliang.tan@linux.starfivetech.com> Signed-off-by:
Wei Liang Lim <weiliang.lim@linux.starfivetech.com> Reviewed-by:
Anup Patel <anup@brainfault.org>
-
- Apr 28, 2022
-
-
Anup Patel authored
The mhpmevent3h to mhpmevent31h CSRs are available on RV32 only when Sscofpmf extension is available so mstatus_init() should set this CSRs only when Sscofpmf extension is available. Signed-off-by:
Anup Patel <apatel@ventanamicro.com> Reviewed-by:
Atish Patra <atishp@rivosinc.com>
-
Atish Patra authored
Recently, Sstc extension was ratified. It defines stimecmp which allows the supervisor mode to directly update the timecmp value without the need of the SBI call. The hardware also can inject the S-mode timer interrupt direclty to the supervisor without going through the M-mode. To maintain backward compatibility with the older software, SBI call now uses stimecmp directly if the hardware supports. Implement the Sstc extension. Signed-off-by:
Atish Patra <atishp@rivosinc.com> Reviewed-by:
Anup Patel <anup@brainfault.org>
-