clk: socfpga: agilex5: add clock driver for Agilex5
Subsystems (2)
A message that is not in the archive (sent off-list or not yet received): [email protected]
PATCH v3 1/1 clk: socfpga: agilex5: add clock driver for Agilex5
Add the new Clock manager driver to support new Agilex5 platform. The new driver got rid of the clk_parent_data structures as there are no 'clock-names' property in the DT bindings and use parent_names internally. This is based on the previous feedback from the maintainer.
---
Changes in v3:
- Fix warning of commit message line more than 75 characters
- Align the code to match bracket.
Changes in v2:
- Add clk-agilex5 to Makefile
- Add Kconfig to include Agilex5 clock manager
- us of.h instead of of_device and of_address
- use devm_platform_ioremap_resource to simplify the get resource
- Fix bound-checking coverage struct clock_data
- Clean up harmless TODO comment
--- drivers/clk/socfpga/Kconfig | 2 +- drivers/clk/socfpga/Makefile | 2 +- drivers/clk/socfpga/clk-agilex5.c | 561 +++++++++++++++++++++++++++ drivers/clk/socfpga/clk-gate-s10.c | 53 +++ drivers/clk/socfpga/clk-periph-s10.c | 41 ++ drivers/clk/socfpga/clk-pll-s10.c | 36 ++ drivers/clk/socfpga/stratix10-clk.h | 43 ++ 7 files changed, 736 insertions(+), 2 deletions(-) create mode 100644 drivers/clk/socfpga/clk-agilex5.c
drivers/clk/socfpga/Kconfig +1 -1
@@ -13,7 +13,7 @@ config CLK_INTEL_SOCFPGA32 default ARM && ARCH_INTEL_SOCFPGA config CLK_INTEL_SOCFPGA64 - bool "Intel Stratix / Agilex / N5X clock controller support" if COMPILE_TEST && (!ARM64 || !ARCH_INTEL_SOCFPGA) + bool "Intel Stratix / Agilex / N5X / Agilex5 clock controller support" if COMPILE_TEST && (!ARM64 || !ARCH_INTEL_SOCFPGA) default ARM64 && ARCH_INTEL_SOCFPGA endif # CLK_INTEL_SOCFPGA
drivers/clk/socfpga/Makefile +1 -1
@@ -3,4 +3,4 @@ obj-$(CONFIG_CLK_INTEL_SOCFPGA32) += clk.o clk-gate.o clk-pll.o clk-periph.o \ clk-pll-a10.o clk-periph-a10.o clk-gate-a10.o obj-$(CONFIG_CLK_INTEL_SOCFPGA64) += clk-s10.o \ clk-pll-s10.o clk-periph-s10.o clk-gate-s10.o \ - clk-agilex.o + clk-agilex.o clk-agilex5.o
drivers/clk/socfpga/clk-agilex5.c new file +561 -0
561 lines not on this page · raw message
drivers/clk/socfpga/clk-gate-s10.c +53 -0
56 lines not on this page · raw message
drivers/clk/socfpga/clk-periph-s10.c +41 -0
44 lines not on this page · raw message
drivers/clk/socfpga/clk-pll-s10.c +36 -0
@@ -304,3 +304,39 @@ struct clk_hw *n5x_register_pll(const struct stratix10_pll_clock *clks, }return hw_clk; } + +struct clk_hw *agilex5_register_pll (const struct agilex5_pll_clock *clks, +void __iomem *reg) +{ +struct clk_hw *hw_clk; +struct socfpga_pll *pll_clk; +struct clk_init_data init; +const char *name = clks->name; +int ret; + + pll_clk =kzalloc (sizeof (*pll_clk),GFP_KERNEL ); +if (WARN_ON (!pll_clk)) +return NULL ; + + pll_clk->hw.reg = reg + clks->offset; + +if (streq (name,SOCFPGA_BOOT_CLK )) + init.ops = &clk_boot_ops; +else + init.ops = &agilex_clk_pll_ops; + + init.name = name; + init.flags = clks->flags; + init.num_parents = clks->num_parents; + init.parent_names = clks->parent_names; + pll_clk->hw.hw.init = &init; + pll_clk->hw.bit_idx =SOCFPGA_PLL_POWER ; + hw_clk = &pll_clk->hw.hw; + + ret =clk_hw_register (NULL , hw_clk); +if (ret) { +kfree (pll_clk); +return ERR_PTR (ret); + } +return hw_clk; +}
drivers/clk/socfpga/stratix10-clk.h +43 -0
55 lines not on this page · raw message
Signature · 1 line
2.35.3