@@ -26,6 +26,7 @@ config PLATFORM_GENERIC_MINOR_VER
config PLATFORM_ALLWINNER_D1
bool "Allwinner D1 support"
depends on FDT_IRQCHIP_PLIC
+ select THEAD_C9XX_CSR
select THEAD_C9XX_PMU
default n
@@ -53,6 +54,7 @@ config PLATFORM_SIFIVE_FU740
config PLATFORM_SOPHGO_SG2042
bool "Sophgo sg2042 support"
+ select THEAD_C9XX_CSR
select THEAD_C9XX_ERRATA
select THEAD_C9XX_PMU
default n
@@ -63,6 +65,7 @@ config PLATFORM_STARFIVE_JH7110
config PLATFORM_THEAD
bool "THEAD C9xx support"
+ select THEAD_C9XX_CSR
select THEAD_C9XX_ERRATA
select THEAD_C9XX_PMU
default n
@@ -5,6 +5,7 @@
*/
#include <platform_override.h>
+#include <thead/c9xx_csr.h>
#include <thead/c9xx_encoding.h>
#include <thead/c9xx_pmu.h>
#include <sbi/riscv_asm.h>
@@ -238,4 +239,5 @@ const struct platform_override sun20i_d1 = {
.final_init = sun20i_d1_final_init,
.fdt_fixup = sun20i_d1_fdt_fixup,
.extensions_init = sun20i_d1_extensions_init,
+ .read_csr = thead_c9xx_read_csr,
};
@@ -7,6 +7,7 @@
*/
#include <platform_override.h>
+#include <thead/c9xx_csr.h>
#include <thead/c9xx_errata.h>
#include <thead/c9xx_pmu.h>
#include <sbi/sbi_const.h>
@@ -60,4 +61,5 @@ const struct platform_override sophgo_sg2042 = {
.match_table = sophgo_sg2042_match,
.early_init = sophgo_sg2042_early_init,
.extensions_init = sophgo_sg2042_extensions_init,
+ .read_csr = thead_c9xx_read_csr,
};
@@ -7,6 +7,7 @@
*/
#include <platform_override.h>
+#include <thead/c9xx_csr.h>
#include <thead/c9xx_errata.h>
#include <thead/c9xx_pmu.h>
#include <sbi/sbi_const.h>
@@ -50,4 +51,5 @@ const struct platform_override thead_generic = {
.match_table = thead_generic_match,
.early_init = thead_generic_early_init,
.extensions_init = thead_generic_extensions_init,
+ .read_csr = thead_c9xx_read_csr,
};
Let's enable the T-Head CSR read handler for all platform-overrides that include a T-Head hart. Signed-off-by: Christoph Müllner <christoph.muellner@vrull.eu> --- platform/generic/Kconfig | 3 +++ platform/generic/allwinner/sun20i-d1.c | 2 ++ platform/generic/sophgo/sg2042.c | 2 ++ platform/generic/thead/thead-generic.c | 2 ++ 4 files changed, 9 insertions(+)