Skip to content

Commit

Permalink
lib: utils: reset: thead: add back "plic-delegate" handling
Browse files Browse the repository at this point in the history
When backporting commit 78c2b19218bd ("lib: utils/irqchip:
Automatically delegate T-HEAD PLIC access"), we removed the delegate
property handling as upstream does, but it will break sdk linux
kernel which still relies on "plic-delegate" property, add back
it.
  • Loading branch information
xhackerustc authored and RevySR committed Sep 26, 2023
1 parent 58bc661 commit d16b0e0
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lib/utils/reset/fdt_reset_thead.c
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,13 @@ static int thead_reset_init(void *fdt, int nodeoff,
clone_csrs(cnt);
}

/* Delegate plic enable regs for S-mode */
val = fdt_getprop(fdt, nodeoff, "plic-delegate", &len);
if (len > 0 && val) {
p = (void *)(ulong)fdt64_to_cpu(*val);
writel(BIT(0), p);
}

/* Old reset method for secondary harts */
if (fdt_getprop(fdt, nodeoff, "using-csr-reset", &len)) {
csr_write(0x7c7, (ulong)&__thead_pre_start_warm);
Expand Down

0 comments on commit d16b0e0

Please sign in to comment.