clksource:starfive-timer: Modify the default clock frequency
authorsamin <samin.guo@starfivetech.com>
Sun, 15 May 2022 10:44:28 +0000 (18:44 +0800)
committersamin <samin.guo@starfivetech.com>
Sun, 15 May 2022 10:57:05 +0000 (18:57 +0800)
timer on soc is 24M.

Signed-off-by: samin <samin.guo@starfivetech.com>
arch/riscv/boot/dts/starfive/jh7110-evb.dts
arch/riscv/boot/dts/starfive/jh7110.dtsi
drivers/watchdog/starfive-wdt.c

index bce5855..4155a95 100755 (executable)
@@ -11,7 +11,3 @@
        model = "StarFive JH7110 EVB";
        compatible = "starfive,jh7110-evb", "starfive,jh7110";
 };
-
-&timer {
-       clock-frequency = <24000000>;
-};
\ No newline at end of file
index f189189..9c3fc15 100644 (file)
                                 <&clkgen JH7110_TIMER_CLK_APB>;
                        clock-names = "timer0", "timer1",
                                      "timer2", "timer3", "apb_clk";
-                       clock-frequency = <2000000>;
+                       clock-frequency = <24000000>;
                        status = "okay";
                };
 
                        reg = <0x0 0x13070000 0x0 0x10000>;
                        interrupts = <68>;
                        interrupt-names = "wdog";
-                       clock-frequency = <2000000>;
                        clocks = <&clkgen JH7110_DSKIT_WDT_CLK_WDT>,
                                 <&clkgen JH7110_DSKIT_WDT_CLK_APB>;
                        clock-names = "core_clk", "apb_clk";
index a6d38d2..f572936 100755 (executable)
@@ -205,7 +205,6 @@ MODULE_DEVICE_TABLE(platform, si5wdt_ids);
 
 static int si5wdt_get_clock_rate(struct stf_si5_wdt *wdt)
 {
-#ifdef HWBOARD_FPGA
        int ret;
        u32 freq;
 
@@ -215,14 +214,13 @@ static int si5wdt_get_clock_rate(struct stf_si5_wdt *wdt)
                wdt->freq = (u64)freq;
                return 0;
        }
-       dev_err(wdt->dev, "get rate failed, need clock-frequency define in dts.\n");
-#else
+       dev_dbg(wdt->dev, "get rate failed, need clock-frequency define in dts.\n");
+
        if (!IS_ERR(wdt->core_clk)) {
                wdt->freq = clk_get_rate(wdt->core_clk);
                return 0;
        }
-#endif
-
+       dev_err(wdt->dev, "get clock-frequency failed\n");
        return -ENOENT;
 }