mirror of
https://github.com/torvalds/linux.git
synced 2026-05-29 17:43:52 +02:00
irqchip/aslint-sswi: Resolve hart index
Resolve hart index according to assignment in the "riscv,hart-indexes" property as defined in the specification [1] Signed-off-by: Vladimir Kondratiev <vladimir.kondratiev@mobileye.com> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Link: https://lore.kernel.org/all/20250612143911.3224046-6-vladimir.kondratiev@mobileye.com Link: https://github.com/riscvarchive/riscv-aclint [1]
This commit is contained in:
parent
c8c8443a64
commit
128ab2cfd0
|
|
@ -71,6 +71,7 @@ static int __init aclint_sswi_parse_irq(struct fwnode_handle *fwnode, void __iom
|
|||
for (u32 i = 0; i < contexts; i++) {
|
||||
struct of_phandle_args parent;
|
||||
unsigned long hartid;
|
||||
u32 hart_index;
|
||||
int rc, cpu;
|
||||
|
||||
rc = of_irq_parse_one(to_of_node(fwnode), i, &parent);
|
||||
|
|
@ -86,6 +87,11 @@ static int __init aclint_sswi_parse_irq(struct fwnode_handle *fwnode, void __iom
|
|||
|
||||
cpu = riscv_hartid_to_cpuid(hartid);
|
||||
|
||||
rc = riscv_get_hart_index(fwnode, i, &hart_index);
|
||||
if (rc) {
|
||||
pr_warn("%pfwP: hart index [%d] not found\n", fwnode, i);
|
||||
return -EINVAL;
|
||||
}
|
||||
per_cpu(sswi_cpu_regs, cpu) = reg + hart_index * 4;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user