Skip to contentSkip to conversation

lib: utils/fdt: Fix DT property for APLIC delegation

PATCH New Anup Patel 2 participants 2 messages Jun 5, 2024 – Jun 13, 2024

lore
Share & tools
lore

Anup Patel

author
#0 lore raw

PATCH 1/1 lib: utils/fdt: Fix DT property for APLIC delegation

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 34612193af92 ("lib: utils/irqchip: Add FDT based driver for APLIC")
---
 lib/utils/fdt/fdt_helper.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
lib/utils/fdt/fdt_helper.c +3 -1
index a0e93b9..9a945af 100644
@@ -720,7 +720,9 @@ aplic_msi_parent_done:
 		deleg->child_index = 0;
 	}
 
-	del = fdt_getprop(fdt, nodeoff, "riscv,delegate", &len);
+	del = fdt_getprop(fdt, nodeoff, "riscv,delegation", &len);
+	if (!del)
+		del = fdt_getprop(fdt, nodeoff, "riscv,delegate", &len);
 	if (!del || len < (3 * sizeof(fdt32_t)))
 		goto skip_delegate_parse;
 	d = 0;
Signature · 1 line
2.34.1
Applied
#1 lore raw

PATCH 1/1 lib: utils/fdt: Fix DT property for APLIC delegation

Quoted 8 lines · On Wed, Jun 5, 2024 at 12:00?PM Anup Patel <[email protected]> wrote:

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 34612193af92 ("lib: utils/irqchip: Add FDT based driver for APLIC")

Applied this patch to the riscv/opensbi repo.

Thanks,
Anup

Quoted 22 lines
---
 lib/utils/fdt/fdt_helper.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
lib/utils/fdt/fdt_helper.c +3 -2
index a0e93b9..9a945af 100644
@@ -720,7 +720,9 @@ aplic_msi_parent_done:
                deleg->child_index = 0;
        }
 
-       del = fdt_getprop(fdt, nodeoff, "riscv,delegate", &len);
+       del = fdt_getprop(fdt, nodeoff, "riscv,delegation", &len);
+       if (!del)
+               del = fdt_getprop(fdt, nodeoff, "riscv,delegate", &len);
        if (!del || len < (3 * sizeof(fdt32_t)))
                goto skip_delegate_parse;
        d = 0;
--

2.34.1