lib: utils: fdt_fixup: Allow preserving PMU properties
authorYu Chien Peter Lin <peterlin@andestech.com>
Thu, 30 Nov 2023 12:42:08 +0000 (20:42 +0800)
committerAnup Patel <anup@brainfault.org>
Wed, 6 Dec 2023 12:29:44 +0000 (17:59 +0530)
Add a Kconfig option to control PMU fixup, so the next
stage software can dump the PMU node including event
mapping information for debugging purposes.

Signed-off-by: Yu Chien Peter Lin <peterlin@andestech.com>
Reviewed-by: Atish Patra <atishp@rivosinc.com>
Reviewed-by: Anup Patel <anup@brainfault.org>
lib/utils/fdt/Kconfig
lib/utils/fdt/fdt_fixup.c

index 23b003bfb46dc4e6d405d060991ff4d8029fa4d1..9a42d158ff2e4608978e60f0cbc51a86ee1f216a 100644 (file)
@@ -15,4 +15,11 @@ config FDT_PMU
        bool "FDT performance monitoring unit (PMU) support"
        default n
 
+config FDT_FIXUPS_PRESERVE_PMU_NODE
+       bool "Preserve PMU node in device-tree"
+       depends on FDT_PMU
+       default n
+       help
+         Preserve PMU node properties for debugging purposes.
+
 endif
index e213dedba613f797f77fb748c3a89065c7778d2c..5fc76738077ec124b382529d7c43272e26f819a9 100644 (file)
@@ -394,5 +394,8 @@ void fdt_fixups(void *fdt)
        fdt_plic_fixup(fdt);
 
        fdt_reserved_memory_fixup(fdt);
+
+#ifndef CONFIG_FDT_FIXUPS_PRESERVE_PMU_NODE
        fdt_pmu_fixup(fdt);
+#endif
 }