aboutsummaryrefslogtreecommitdiff
path: root/drivers/clk/microchip/mpfs_clk.h
diff options
context:
space:
mode:
authorConor Dooley2022-10-25 08:58:45 +0100
committerLeo Yu-Chi Liang2022-11-15 15:37:17 +0800
commitfb103971feb637809a96fe739d81fe2f887cf3ac (patch)
tree7e74590d70d9d998ee97db5e958e0e32324917c1 /drivers/clk/microchip/mpfs_clk.h
parent540d02217f8f997c55818ecd16d8624c520ca750 (diff)
clk: microchip: mpfs: convert parent rate acquistion to get_get_rate()
Currently the clock driver for PolarFire SoC takes a very naive approach to the relationship between clocks. It reads the dt to get an input clock, assumes that that is fixed frequency, reads the "clock-frequency" property & uses that to set up both the "cfg" and "periph" clocks. Simplifying for the sake of incremental fixes, the "correct" parentage for the clocks currently supported in U-Boot is that the "cfg" clocks should be children of the fixed frequency clock in the dt. The AHB clock is one of these "cfg" clocks and is the parent of the "periph" clocks. Instead of passing the clock rate of the fixed-frequency clock to the "cfg" and "periph" registration functions and the name of the parents, pass their actual parents & use clk_get_rate() to determine their parents rates. The "periph" clocks are purely gate clocks and should not be reading the AHB clocks registers to determine their rates, as they can simply report the output of clk_get_rate() on their parent. Signed-off-by: Conor Dooley <conor.dooley@microchip.com> Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com> Reviewed-by: Padmarao Begari <padmarao.begari@microchip.com>
Diffstat (limited to 'drivers/clk/microchip/mpfs_clk.h')
-rw-r--r--drivers/clk/microchip/mpfs_clk.h12
1 files changed, 4 insertions, 8 deletions
diff --git a/drivers/clk/microchip/mpfs_clk.h b/drivers/clk/microchip/mpfs_clk.h
index 442562a5e7b..35cfeac92e8 100644
--- a/drivers/clk/microchip/mpfs_clk.h
+++ b/drivers/clk/microchip/mpfs_clk.h
@@ -11,22 +11,18 @@
* mpfs_clk_register_cfgs() - register configuration clocks
*
* @base: base address of the mpfs system register.
- * @clk_rate: the mpfs pll clock rate.
- * @parent_name: a pointer to parent clock name.
+ * @parent: a pointer to parent clock.
* Return: zero on success, or a negative error code.
*/
-int mpfs_clk_register_cfgs(void __iomem *base, u32 clk_rate,
- const char *parent_name);
+int mpfs_clk_register_cfgs(void __iomem *base, struct clk *parent);
/**
* mpfs_clk_register_periphs() - register peripheral clocks
*
* @base: base address of the mpfs system register.
- * @clk_rate: the mpfs pll clock rate.
- * @parent_name: a pointer to parent clock name.
+ * @parent: a pointer to parent clock.
* Return: zero on success, or a negative error code.
*/
-int mpfs_clk_register_periphs(void __iomem *base, u32 clk_rate,
- const char *parent_name);
+int mpfs_clk_register_periphs(void __iomem *base, struct clk *parent);
/**
* divider_get_val() - get the clock divider value
*