From: Hoegeun Kwon Date: Mon, 20 Nov 2023 04:39:44 +0000 (+0900) Subject: generic/starfive: Add syscrg reg base compatible string X-Git-Tag: accepted/tizen/unified/riscv/20231123.095152^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0393f8e32faabd5f86b1ff3434d66c027b22347a;p=platform%2Fkernel%2Fopensbi.git 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 --- 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)