[PATCH v4 10/15] lib: utils: fdt_fixup: Allow preserving PMU properties

Atish Patra atishp at atishpatra.org
Mon Dec 4 01:05:35 PST 2023


On Thu, Nov 30, 2023 at 4:43 AM Yu Chien Peter Lin
<peterlin at andestech.com> wrote:
>
> 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 at andestech.com>
> ---
> Changes v1 -> v2:
>   - New patch
> Changes v2 -> v3:
>   - Rename to SBI_SCRATCH_PRESERVE_PMU_NODE (suggested by Anup)
>   - Include Anup's RB tag
> Changes v3 -> v4:
>   - Use Kconfig instead (suggested by Anup)
> ---
>  lib/utils/fdt/Kconfig     | 7 +++++++
>  lib/utils/fdt/fdt_fixup.c | 3 +++
>  2 files changed, 10 insertions(+)
>
> diff --git a/lib/utils/fdt/Kconfig b/lib/utils/fdt/Kconfig
> index 23b003b..9a42d15 100644
> --- a/lib/utils/fdt/Kconfig
> +++ b/lib/utils/fdt/Kconfig
> @@ -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
> diff --git a/lib/utils/fdt/fdt_fixup.c b/lib/utils/fdt/fdt_fixup.c
> index e213ded..5fc7673 100644
> --- a/lib/utils/fdt/fdt_fixup.c
> +++ b/lib/utils/fdt/fdt_fixup.c
> @@ -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
>  }
> --
> 2.34.1
>


Reviewed-by: Atish Patra <atishp at rivosinc.com>
-- 
Regards,
Atish



More information about the opensbi mailing list