
On Tue, 2 Apr 2019 16:58:33 +0530 Jagan Teki jagan@amarulasolutions.com wrote:
This is revised version of previous i.MX6 clock management [1].
The main difference between previous version is
- Group the i.MX6 ccm clocks into gates and tree instead of handling
the clocks in simple way using case statement.
- use gate clocks for enable/disable management.
- use tree clocks for get/set rate or parent traverse management.
- parent clock handling via clock type.
- traverse the parent clock using recursive functionlaity.
The main motive behind this tree framework is to make the clock tree management simple and useful for U-Boot requirements instead of garbing Linux clock management code.
We are trying to manage the Allwinner clocks with similar kind, so having this would really help i.MX6 as well.
Added simple names for clock macros, but will update it in future version.
I have skipped ENET clocks from previous series, will add it in future patches.
Changes for v2:
- changed framework patches.
- add support for imx6qdl and imx6ul boards
- add clock gates, tree.
[1] https://patchwork.ozlabs.org/cover/950964/
Any inputs?
Hmm.... It looks like we are doing some development in parallel.
Please look into following commit [1]: https://patchwork.ozlabs.org/patch/1034051/
It ports from Linux 5.0 the CCF framework for iMX6Q, which IMHO in the long term is a better approach. The code is kept simple and resembles the code from Barebox.
Please correct me if I'm wrong, but the code from your work is not modeling muxes, gates and other components from Linux CCF.
Unfortunately for [1] - I did not have time recently to finish it ... (address Simon's comments about uclass).
Jagan.
Jagan Teki (10): clk: imx: Kconfig: Make CONFIG_CLK available for selection clk: imx: Add i.MX6Q clock driver clk: imx: Add i.MX6UL clock driver clk: Add clk_div_mask helper clk: imx: Add imx6q clock tree support clk: imx6: Add imx6ul clock tree support ARM: dts: i.MX6QDL: Add u-boot,dm-spl for clks ARM: dts: i.MX6UL: Add u-boot,dm-spl for clks configs: icore_mipi: Enable CLK ARM: imx6: Enable CLK for Engicam i.MX6UL boards
arch/arm/dts/imx6qdl-u-boot.dtsi | 4 + arch/arm/dts/imx6ul-u-boot.dtsi | 4 + arch/arm/include/asm/arch-mx6/clock.h | 109 ++++++++++++++++ arch/arm/mach-imx/mx6/Kconfig | 2 + configs/imx6qdl_icore_mipi_defconfig | 2 + configs/imx8qxp_mek_defconfig | 2 +- drivers/clk/imx/Kconfig | 29 ++++- drivers/clk/imx/Makefile | 6 + drivers/clk/imx/clk-imx6-common.c | 172 ++++++++++++++++++++++++++ drivers/clk/imx/clk-imx6q.c | 109 ++++++++++++++++ drivers/clk/imx/clk-imx6ul.c | 85 +++++++++++++ include/clk-uclass.h | 2 + 12 files changed, 523 insertions(+), 3 deletions(-) create mode 100644 drivers/clk/imx/clk-imx6-common.c create mode 100644 drivers/clk/imx/clk-imx6q.c create mode 100644 drivers/clk/imx/clk-imx6ul.c
Best regards,
Lukasz Majewski
--
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email: lukma@denx.de