diff --git a/platform/generic/Kconfig b/platform/generic/Kconfig index 3be75cf3..f9e7ed2a 100644 --- a/platform/generic/Kconfig +++ b/platform/generic/Kconfig @@ -56,6 +56,7 @@ config PLATFORM_STARFIVE_JH7110 config PLATFORM_THEAD bool "THEAD C9xx support" select THEAD_C9XX_ERRATA + select THEAD_C9XX_PMU default n source "$(OPENSBI_SRC_DIR)/platform/generic/andes/Kconfig" diff --git a/platform/generic/thead/thead-generic.c b/platform/generic/thead/thead-generic.c index c77140c3..72f4aaac 100644 --- a/platform/generic/thead/thead-generic.c +++ b/platform/generic/thead/thead-generic.c @@ -8,6 +8,7 @@ #include #include +#include #include #include #include @@ -29,6 +30,13 @@ static int thead_generic_early_init(bool cold_boot, return 0; } +static int thead_generic_extensions_init(const struct fdt_match *match, + struct sbi_hart_features *hfeatures) +{ + thead_c9xx_register_pmu_device(); + return 0; +} + static struct thead_generic_quirks thead_th1520_quirks = { .errata = THEAD_QUIRK_ERRATA_TLB_FLUSH, }; @@ -39,6 +47,7 @@ static const struct fdt_match thead_generic_match[] = { }; const struct platform_override thead_generic = { - .match_table = thead_generic_match, - .early_init = thead_generic_early_init, + .match_table = thead_generic_match, + .early_init = thead_generic_early_init, + .extensions_init = thead_generic_extensions_init, };