From 6af55769eb8cd5b9c7fdcd959586e0bc0fce3994 Mon Sep 17 00:00:00 2001 From: Bin Meng Date: Tue, 17 Mar 2020 07:59:42 -0700 Subject: lib: utils: Move PLIC DT fix up codes to fdt_helper.c Now that we have a dedicated fdt_helper.c file for DT releated helper routines, move plic_fdt_fixup() codes from plic.c to fdt_helper.c and rename it to fdt_plic_fixup() at the same time, to keep name consistency in the same file. Signed-off-by: Bin Meng Reviewed-by: Atish Patra --- include/sbi_utils/fdt/fdt_helper.h | 13 +++++++++++++ include/sbi_utils/irqchip/plic.h | 2 -- 2 files changed, 13 insertions(+), 2 deletions(-) (limited to 'include/sbi_utils') diff --git a/include/sbi_utils/fdt/fdt_helper.h b/include/sbi_utils/fdt/fdt_helper.h index a6c30735..67251f8f 100644 --- a/include/sbi_utils/fdt/fdt_helper.h +++ b/include/sbi_utils/fdt/fdt_helper.h @@ -9,6 +9,19 @@ #ifndef __FDT_HELPER_H__ #define __FDT_HELPER_H__ +/** + * Fix up the PLIC node in the device tree + * + * This routine updates the "interrupt-extended" property of the PLIC node in + * the device tree to hide the M-mode external interrupt from CPUs. + * + * It is recommended that platform codes call this helper in their final_init() + * + * @param fdt: device tree blob + * @param compat: PLIC node compatible string + */ +void fdt_plic_fixup(void *fdt, const char *compat); + /** * Fix up the reserved memory node in the device tree * diff --git a/include/sbi_utils/irqchip/plic.h b/include/sbi_utils/irqchip/plic.h index 8d6cefad..8e190ce4 100644 --- a/include/sbi_utils/irqchip/plic.h +++ b/include/sbi_utils/irqchip/plic.h @@ -12,8 +12,6 @@ #include -void plic_fdt_fixup(void *fdt, const char *compat); - int plic_warm_irqchip_init(u32 target_hart, int m_cntx_id, int s_cntx_id); int plic_cold_irqchip_init(unsigned long base, u32 num_sources, u32 hart_count); -- cgit v1.3.1