- Jun 13, 2022
-
-
Samuel Holland authored
These functions save/restore the state of the PLIC associated with the current hart. The context save/restore functions only manipulate a single context, since most likely the M-mode context is unused and does not need to be saved. Signed-off-by:
Samuel Holland <samuel@sholland.org> Reviewed-by:
Anup Patel <anup@brainfault.org>
-
Samuel Holland authored
These can be used by platform code to save the PLIC priority state, if it would otherwise be lost during non-retentive suspend. The platform is responsible for allocating all necessary storage. As a space optimization, store the saved priority values as 8-bit integers, since that is large enough to hold any priority value on the relevant platforms. Reviewed-by:
Anup Patel <anup@brainfault.org> Signed-off-by:
Samuel Holland <samuel@sholland.org>
-
Samuel Holland authored
These can be used by platform code to save the PLIC context state, if it would otherwise be lost during non-retentive suspend. The platform is responsible for allocating all necessary storage. Reviewed-by:
Anup Patel <anup@brainfault.org> Signed-off-by:
Samuel Holland <samuel@sholland.org>
-
Samuel Holland authored
This simplifies both the callers and the callees by removing duplicated code and consolidating the error handling. It also fixes two bugs in the process: 1) ie_words was one too large when plic->num_src was a multiple of 32. 2) plic_set_ie takes a 32-bit mask, not a Boolean value, so the FPGA platforms previously only enabled one out of every 32 interrupts. Reviewed-by:Anup Patel <anup@brainfault.org> Signed-off-by:
Samuel Holland <samuel@sholland.org>
-
Samuel Holland authored
None of the functions modify the passed-in plic_data, so mark it const. Reviewed-by:
Anup Patel <anup@brainfault.org> Signed-off-by:
Samuel Holland <samuel@sholland.org>
-
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>
-