lib: utils: reset: thead: add back "plic-delegate" handling

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.
This commit is contained in:
Jisheng Zhang
2023-08-27 19:00:47 +08:00
committed by Han Gao
parent 58bc661d74
commit d16b0e0a00

View File

@@ -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);