From 0393f8e32faabd5f86b1ff3434d66c027b22347a Mon Sep 17 00:00:00 2001 From: Hoegeun Kwon Date: Mon, 20 Nov 2023 13:39:44 +0900 Subject: [PATCH] generic/starfive: Add syscrg reg base compatible string Add "starfive,jh7110-syscrg" used for setting clk_reg_base. clkgen uses syscrg reg base. If clkgen does not find a compatible string, it searches for the syscrg compatible string and get the syscrg reg base. Change-Id: I9eadbf349eab0c14c27b9db97981820e4a940b70 Signed-off-by: Hoegeun Kwon --- platform/generic/starfive/jh7110.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/platform/generic/starfive/jh7110.c b/platform/generic/starfive/jh7110.c index 6f87303..5eee472 100644 --- a/platform/generic/starfive/jh7110.c +++ b/platform/generic/starfive/jh7110.c @@ -255,6 +255,13 @@ static int starfive_jh7110_inst_init(void *fdt) } noff = fdt_node_offset_by_compatible(fdt, -1, "starfive,jh7110-clkgen"); + /* + * clkgen uses syscrg reg base with index 0. + * If clkgen does not find a compatible string, it searches for + * the syscrg compatible string and get the syscrg reg base. + */ + if (noff == -FDT_ERR_NOTFOUND) + noff = fdt_node_offset_by_compatible(fdt, -1, "starfive,jh7110-syscrg"); if (-1 < noff) { rc = fdt_get_node_addr_size(fdt, noff, 0, &addr, NULL); if (rc) -- 2.34.1