- Jun 13, 2024
-
-
Yu Chien Peter Lin authored
Save/restore sbi_trap_context during domain context switching to ensure proper trap handling and isolation. This maintains correct domain-specific state, avoiding context corruption. Fixes: abea9497 ("lib: sbi: Introduce trap context") Signed-off-by:
Yu Chien Peter Lin <peterlin@andestech.com> Reviewed-by:
Alvin Chang <alvinga@andestech.com> Tested-by:
Alvin Chang <alvinga@andestech.com> Reviewed-by:
Yong Li <yong.li@intel.com> Tested-by:
Yong Li <yong.li@intel.com>
-
Xiang W authored
If there are multiple dt nodes, the previous code only tries to match the first one, which may lose initialization. Signed-off-by:
Xiang W <wxjstz@126.com> Reviewed-by:
Anup Patel <anup@brainfault.org>
-
Xiang W authored
When the dt node has a status property and the value is not ok or okay, skip initializing reset. Signed-off-by:
Xiang W <wxjstz@126.com> Reviewed-by:
Anup Patel <anup@brainfault.org>
-
Xiang W authored
If there are multiple dt nodes, the previous code only tries to match the first one, which may lose initialization. Signed-off-by:
Xiang W <wxjstz@126.com> Reviewed-by:
Anup Patel <anup@brainfault.org>
-
Xiang W authored
When the dt node has a status property and the value is not ok or okay, skip initializing serial. Signed-off-by:
Xiang W <wxjstz@126.com> Reviewed-by:
Anup Patel <anup@brainfault.org>
-
Xiang W authored
When the dt node has a status property and the value is not ok or okay, skip initializing irqchip. Signed-off-by:
Xiang W <wxjstz@126.com> Reviewed-by:
Anup Patel <anup@brainfault.org>
-
Xiang W authored
When the dt node has a status property and the value is not ok or okay, skip initializing timer. Signed-off-by:
Xiang W <wxjstz@126.com> Reviewed-by:
Anup Patel <anup@brainfault.org>
-
Xiang W authored
When the dt node has a status property and the value is not ok or okay, skip initializing ipi. Signed-off-by:
Xiang W <wxjstz@126.com> Reviewed-by:
Anup Patel <anup@brainfault.org>
-
- Jun 05, 2024
-
-
Anup Patel authored
During Linux AIA driver review, the APLIC DT property for interrupt delegation was renamed to "riscv,delegation" so let's use the new DT property name and fallback to old DT property name if the new DT property name is not available. Fixes: 34612193 ("lib: utils/irqchip: Add FDT based driver for APLIC") Signed-off-by:
Anup Patel <apatel@ventanamicro.com>
-
- May 23, 2024
-
-
Inochi Amaoto authored
"gpio-poweroff" and "gpio-restart" always set gpio to high to active the function, but some chips need a low signal to active. Fortunately, it can be achieved by setting GPIO_FLAG_ACTIVE_LOW for the gpio. Implement this flag support for the gpio library so the gpio reset can function well. Signed-off-by:
Inochi Amaoto <inochiama@outlook.com> Reviewed-by:
Anup Patel <anup@brainfault.org>
-
Clément Léger authored
The spec states that a6, a7, flags and sepc are writable but the implementation was not allowing that. Add support for these 4 writable attributes. Signed-off-by:
Clément Léger <cleger@rivosinc.com> Reviewed-by:
Samuel Holland <samuel.holland@sifive.com> Reviewed-by:
Anup Patel <anup@brainfault.org>
-
Cyan Yang authored
Add extra sanity checks to prevent the caller getting the invalid result from imsic_get_data() or imsic_get_target_file() when imsic is not initialized correctly. Signed-off-by:
Cyan Yang <cyan.yang@sifive.com> Reviewed-by:
Anup Patel <anup@brainfault.org>
-
Anup Patel authored
Bring back FW_TEXT_START as an optional parameter to allow users explicitly specify compile time address for loading debug symbols. When not specified, the FW_TEXT_START is assumed to be 0. Fixes: d4d2582e ("firmware: remove FW_TEXT_START") Signed-off-by:
Anup Patel <apatel@ventanamicro.com> Tested-by:
Clément Léger <cleger@rivosinc.com>
-
- May 16, 2024
-
-
Cheng Yang authored
The current mlevel imsic check is only for the platform, which may cause hart without imsic in the platform to trigger an illegal instruction exception when initializing imsic. For example, the platform contains a management hart that only supports wired interrupts. This patch will check if each hart supports Smaia extension before doing imsic initialization to avoid triggering illegal instruction exceptions. Signed-off-by:
Cheng Yang <yangcheng.work@foxmail.com> Reviewed-by:
Anup Patel <anup@brainfault.org>
-
Inochi Amaoto authored
The Sophgo CV18XX/SG200X series SoCs have a standard C906 core. Add support for it. Signed-off-by:
Inochi Amaoto <inochiama@outlook.com> Reviewed-by:
Anup Patel <anup@brainfault.org>
-
- May 15, 2024
-
-
Anup Patel authored
Currently, the sbi_sse_exit() gets event in a loop but does not put it back after use. This results in global events remaining locked causing hangs on sub-sequent calls to sse_event_get() for global events. Fixes: c8cdf01d ("lib: sbi: Add support for Supervisor Software Events extension") Signed-off-by:
Anup Patel <apatel@ventanamicro.com> Reviewed-by:
Himanshu Chauhan <hchauhan@ventanamicro.com>
-
Inochi Amaoto authored
SG2042 uses an onboard MCU to provide reset function. Add reset driver to support this onboard MCU. Signed-off-by:
Inochi Amaoto <inochiama@outlook.com> Reviewed-by:
Anup Patel <anup@brainfault.org>
-
- May 13, 2024
-
-
Xiang W authored
The inline function can simplify the code by setting some call restrictions. This ensures logical smoothness Signed-off-by:
Xiang W <wxjstz@126.com> Reviewed-by:
Anup Patel <anup@brainfault.org>
-
Xiang W authored
Modify the return value of the sbi_dbtr_shmem_disabled function to bool to make the semantics clearer. Signed-off-by:
Xiang W <wxjstz@126.com> Reviewed-by:
Anup Patel <anup@brainfault.org>
-
Xiang W authored
The previous code detected shmem_phys_hi and shmem_phys_lo as two addresses. fix this bug Signed-off-by:
Xiang W <wxjstz@126.com> Reviewed-by:
Himanshu Chauhan <hchauhan@ventanamicro.com>
-
Xiang W authored
Obtaining a 64-bit address under rv64 does not require combining 32-bit registers Signed-off-by:
Xiang W <wxjstz@126.com> Reviewed-by:
Himanshu Chauhan <hchauhan@ventanamicro.com>
-
Xiang W authored
After getting hart_shmem_base, dbtr_thishart_state_ptr cannot be empty. So remove check code. Signed-off-by:
Xiang W <wxjstz@126.com> Reviewed-by:
Himanshu Chauhan <hchauhan@ventanamicro.com>
-
Xiang W authored
When only phys_hi is equal to SBI_DBTR_SHMEM_INVALID_ADDR, it may be a legal address. The old code would modify the legal address. Signed-off-by:
Xiang W <wxjstz@126.com> Reviewed-by:
Himanshu Chauhan <hchauhan@ventanamicro.com>
-
- May 09, 2024
-
-
Yangyu Chen authored
Canaan Kendryte K230 SoC has T-Head C908 cores inside. The dt-binding has been merged into the linux kernel [1]. However, it has early version of C908 core which does not have Sscofpmf and need to use T-Head PMU extension. Thus, we add a K230 compatible string to thead_generic_match and set quirk for T-Head PMU. [1] https://lore.kernel.org/linux-riscv/tencent_4D85743622F39109466913393EE2F6C5980A@qq.com/ Signed-off-by:
Yangyu Chen <cyy@cyyself.name> Reviewed-by:
Inochi Amaoto <inochiama@outlook.com> Reviewed-by:
Anup Patel <anup@brainfault.org>
-
Yangyu Chen authored
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/Zh9sUUUT09LZb0MO@gmail.com/ Signed-off-by:
Yangyu Chen <cyy@cyyself.name> Reviewed-by:
Inochi Amaoto <inochiama@outlook.com> Reviewed-by:
Anup Patel <anup@brainfault.org>
-
Ben Zong-You Xie authored
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 <ben717@andestech.com> Reviewed-by:
Anup Patel <anup@brainfault.org>
-
Ben Zong-You Xie authored
Rename files with the prefix andes45 to andes. Signed-off-by:
Ben Zong-You Xie <ben717@andestech.com> Reviewed-by:
Anup Patel <anup@brainfault.org>
-
- May 07, 2024
-
-
Alvin Chang authored
Add spinlock protection to avoid race condition on assigned_harts during domain context switching. Also, rename/add variables for accessing the corresponding domain of target/current context. Signed-off-by:
Alvin Chang <alvinga@andestech.com> Reviewed-by:
Yu Chien Peter Lin <peterlin@andestech.com> Reviewed-by:
Anup Patel <anup@brainfault.org>
-
Pope B.Lei authored
Although Mstatus.MPV is set, before executing mret, access to VS mode registers should use the actual register addresses, not the pseudonyms of S registers. Signed-off-by:
Pope B.Lei <popeblei@gmail.com> Reviewed-by:
Anup Patel <anup@brainfault.org>
-
Clément Léger authored
When registering an SSE event, check for the handler_entry_pc to belong to supervisor mode domain using sbi_domain_check_addr_range(). Signed-off-by:
Clément Léger <cleger@rivosinc.com> Reported-by:
Samuel Holland <samuel.holland@sifive.com> Reviewed-by:
Anup Patel <anup@brainfault.org>
-
Clément Léger authored
Rather then passing 1 to sbi_domain_check_addr_range() for supervisor mode, use PRV_S. Signed-off-by:
Clément Léger <cleger@rivosinc.com> Reviewed-by:
Anup Patel <anup@brainfault.org>
-
Clément Léger authored
Move the enable callback call before sending the IPI. Even though the event is locked and no race condition can happen, this is more logical. Signed-off-by:
Clément Léger <cleger@rivosinc.com> Reported-by:
Samuel Holland <samuel.holland@sifive.com> Reviewed-by:
Anup Patel <anup@brainfault.org>
-
Clément Léger authored
The list loop below that check is actually not looping if the list is empty so there was no need for this check. Signed-off-by:
Clément Léger <cleger@rivosinc.com> Reported-by:
Samuel Holland <samuel.holland@sifive.com> Reviewed-by:
Anup Patel <anup@brainfault.org>
-
Clément Léger authored
Rather than checking 32bits overflow with some absolute value, check the value to be different from the cast itself. Signed-off-by:
Clément Léger <cleger@rivosinc.com> Reported-by:
Samuel Holland <samuel.holland@sifive.com> Reviewed-by:
Anup Patel <anup@brainfault.org>
-
Clément Léger authored
There was a naming incoherency between enabled events list lock/unlock. Rename sse_hart_unlock() to sse_enabled_event_unlock() to be coherent and reword comments above lock()/unlock() functions. Signed-off-by:
Clément Léger <cleger@rivosinc.com> Reviewed-by:
Anup Patel <anup@brainfault.org>
-
Clément Léger authored
Fix some errors spotted by Samuel while reviewing the SSE implementation. Signed-off-by:
Clément Léger <cleger@rivosinc.com> Reported-by:
Samuel Holland <samuel.holland@sifive.com> Reviewed-by:
Anup Patel <anup@brainfault.org>
-
Ivan Orlov authored
Implement the test which covers some of the functions from the `riscv_locks.h` file. This test consists of 3 test cases: 1) For lock/unlock functions 2) Unsuccessful trylock (the lock was previously taken) 3) Successful trylock (the lock is free and can be taken) Signed-off-by:
Ivan Orlov <ivan.orlov0322@gmail.com> Reviewed-by:
Anup Patel <anup@brainfault.org>
-
Ivan Orlov authored
Implement the test which covers some of the functions from the `riscv_atomic.h` header file. The test contains 9 test cases: 1) atomic read/write test 2) add/return test 3) sub/return test 4) cmpxchg test 5) atomic_xchg test 6) atomic_raw_set_bit test 7) atomic_raw_clear_bit test 8) atomic_set_bit test 9) atomic_clear_bit test Some of the test cases operate on the `test_atomic` variable. It gets initialized in the suite init function. Signed-off-by:
Ivan Orlov <ivan.orlov0322@gmail.com> Reviewed-by:
Anup Patel <anup@brainfault.org>
-
Ivan Orlov authored
Allow to define an init function for the test suite. It could help us to initialize global variable once, and use them in multiple test cases after the initialization. For instance, if multiple test cases use the same atomic_t var, it could be helpful to call ATOMIC_INIT once during the suite initialization. Signed-off-by:
Ivan Orlov <ivan.orlov0322@gmail.com> Reviewed-by:
Anup Patel <anup@brainfault.org>
-
- Apr 10, 2024
-
-
Xiang W authored
Now opensbi can run at any address via dynamic relocation. We can remove FW_TEXT_START. Signed-off-by:
Xiang W <wxjstz@126.com> Reviewed-by:
Anup Patel <anup@brainfault.org> Tested-by:
Anup Patel <anup@brainfault.org>
-