realtek: clock: only allow CPU reclocking
authorSander Vanheule <sander@svanheule.net>
Wed, 9 Nov 2022 21:37:19 +0000 (22:37 +0100)
committerSander Vanheule <sander@svanheule.net>
Mon, 26 Dec 2022 19:29:36 +0000 (20:29 +0100)
Since memory reclocking support is incomplete, and LXB reclocking would cause
issues with UART and timer rates, disable changing the rates of these clocks.

target/linux/realtek/files-5.10/drivers/clk/realtek/clk-rtl83xx.c

index eb95dae2dd5e7e515269e5ad5f055f31d58146aa..50756ff1b4c58ad9377c03189d666fee7bcc9bde 100644 (file)
@@ -373,7 +373,7 @@ static int rtcl_set_rate(struct clk_hw *hw, unsigned long rate, unsigned long pa
        const struct rtcl_rtab_set *rtab = &rtcl_rtab_set[rtcl_ccu->soc][clk->idx];
        const struct rtcl_round_set *round = &rtcl_round_set[rtcl_ccu->soc][clk->idx];
 
-       if ((parent_rate != RTCL_XTAL_RATE) || (!rtcl_ccu->sram.vbase))
+       if ((clk->idx != CLK_CPU) || (!rtcl_ccu->sram.vbase))
                return -EINVAL;
 /*
  * Currently we do not know if SRAM is stable on these devices. Maybe someone