first pass converting omap4 clock data to DT
Subsystems (6)
cover first pass converting omap4 clock data to DT
This is a very incomplete conversion of a handful of OMAP4 PRCM clocks from the statically defined clock data in arch/arm/mach-omap2/cclock44xx_data.c to a new dts file in arch/arm/boot/dts/omap4-clocks.dtsi.
I am not a DT expert so many of the choices here may be quite disgusting to look at, or may be on the right path. In particular I simply include the new omap4-clocks.dtsi from omap4.dtsi, which feels a bit kludgey. Also this series depends on the basic clock bindings RFC I posted earlier today[1].
I actually have an omap4-clock.dtsi file with many more clocks converted to the mux-clock, divider-clock, fixed-clock, fixed-factor and (unpublished) gate-clock bindings in my local repo, but it is not currently booting. I wanted to get this early preview out regardless.
[1] http://article.gmane.org/gmane.linux.kernel/1501216
Mike Turquette (3):
clk: omap: introduce clock driver
ARM: dts: omap4 clock data
ARM: omap4: register DT clocks & remove old data
arch/arm/boot/dts/omap4-clocks.dtsi | 128 ++++++++++++++++++++++++++++++++++ arch/arm/boot/dts/omap4.dtsi | 2 + arch/arm/mach-omap2/cclock44xx_data.c | 54 ++------------ drivers/clk/Makefile | 1 + drivers/clk/omap/Makefile | 1 + drivers/clk/omap/clk.c | 55 +++++++++++++++ include/linux/clk/omap.h | 24 +++++++ 7 files changed, 217 insertions(+), 48 deletions(-) create mode 100644 arch/arm/boot/dts/omap4-clocks.dtsi create mode 100644 drivers/clk/omap/Makefile create mode 100644 drivers/clk/omap/clk.c create mode 100644 include/linux/clk/omap.h
Signature · 1 line
1.8.1.2
RFC PATCH 1/3 clk: omap: introduce clock driver
Parses OMAP clock data from DT and registers those clocks with the clock framework. dt_omap_clk_init must be called early during boot for timer initialization so it is exported and called from the existing clock code instead of probing like a real driver.
---
This driver simply matches the basic bindings (so far). Eventually it would match omap-specific bindings for DPLLs, CLKOUTX2 and strange leaf clocks as well. This doesn't scale well since non-OMAP related clock data (e.g. a pmic or discrete audio codec) will get grouped into this driver if it matches on a basic clock type. Suggestions?
drivers/clk/Makefile | 1 + drivers/clk/omap/Makefile | 1 + drivers/clk/omap/clk.c | 55 +++++++++++++++++++++++++++++++++++++++++++++++ include/linux/clk/omap.h | 24 +++++++++++++++++++++ 4 files changed, 81 insertions(+) create mode 100644 drivers/clk/omap/Makefile create mode 100644 drivers/clk/omap/clk.c create mode 100644 include/linux/clk/omap.h
drivers/clk/Makefile +1 -0
@@ -31,6 +31,7 @@ obj-$(CONFIG_ARCH_VT8500) += clk-vt8500.o obj-$(CONFIG_ARCH_ZYNQ) += clk-zynq.o obj-$(CONFIG_ARCH_TEGRA) += tegra/ obj-$(CONFIG_PLAT_SAMSUNG) += samsung/ +obj-$(CONFIG_ARCH_OMAP) += omap/ obj-$(CONFIG_X86) += x86/
drivers/clk/omap/Makefile new file +1 -0
@@ -0,0 +1 @@ +obj-y += clk.o
drivers/clk/omap/clk.c new file +55 -0
55 lines not on this page · raw message
include/linux/clk/omap.h new file +24 -0
@@ -0,0 +1,24 @@ +/* +* Copyright (C) 2010 Broadcom +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 2 of the License, or +* (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software +* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#ifndef __LINUX_CLK_OMAP_H_ +#define __LINUX_CLK_OMAP_H_ + +int __init dt_omap_clk_init (void ); + +#endif
Signature · 1 line
1.8.1.2
Tony Lindgren
maintainerRFC PATCH 1/3 clk: omap: introduce clock driver
Quoted 4 lines · Mike Turquette
Parses OMAP clock data from DT and registers those clocks with the clock framework.
dt_omap_clk_initmust be called early during boot for timer initialization so it is exported and called from the existing clock code instead of probing like a real driver.
Thanks for doing this, makes sense to me. I have queued up patches to make omap4 DT only, so this is the way to go.
Quoted 17 lines
include/linux/clk/omap.h new file +14
-0@@ -0,0 +1,24 @@ +/* +* Copyright (C) 2010 Broadcom +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 2 of the License, or +* (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License
include/linux/clk/omap.h line 24
Quoted 10 lines
include/linux/clk/omap.h new file +10
-0+* along with this program; if not, write to the Free Software +* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#ifndef __LINUX_CLK_OMAP_H_ +#define __LINUX_CLK_OMAP_H_ + +int __init dt_omap_clk_init (void ); + +#endif
Maybe leave out the Broadcom copyright from this header? :)
Regards,
Tony
RFC PATCH 1/3 clk: omap: introduce clock driver
In reply to Mike TurquetteQuoted 5 lines · Mike Turquette
Parses OMAP clock data from DT and registers those clocks with the clock framework.
dt_omap_clk_initmust be called early during boot for timer initialization so it is exported and called from the existing clock code instead of probing like a real driver.
Quoted 7 lines
Cc Benoit Cousson <[email protected]>Cc Rajendra Nayak <[email protected]>Cc Joel A Fernandes <[email protected]>Cc Nishanth Menon <[email protected]>Cc Paul Walmsley <[email protected]>Cc Tony Lindgren <[email protected]>Signed-off-by Mike Turquette <[email protected]>
Hi Mike,
Comments below...
Quoted 6 lines
---
This driver simply matches the basic bindings (so far). Eventually it would match omap-specific bindings for DPLLs, CLKOUTX2 and strange leaf clocks as well. This doesn't scale well since non-OMAP related clock data (e.g. a pmic or discrete audio codec) will get grouped into this driver if it matches on a basic clock type. Suggestions?
Take a look at the definition of irqchip_init(). It would be possible to do the same think for clk chips so that merely configuring in the driver would add the support to a global list of clk chip initializers.
drivers/irqchip/irqchip.c
Quoted 76 lines
drivers/clk/Makefile | 1 + drivers/clk/omap/Makefile | 1 + drivers/clk/omap/clk.c | 55 +++++++++++++++++++++++++++++++++++++++++++++++ include/linux/clk/omap.h | 24 +++++++++++++++++++++ 4 files changed, 81 insertions(+) create mode 100644 drivers/clk/omap/Makefile create mode 100644 drivers/clk/omap/clk.c create mode 100644 include/linux/clk/omap.hdrivers/clk/Makefile +1
-0@@ -31,6 +31,7 @@ obj-$(CONFIG_ARCH_VT8500) += clk-vt8500.o obj-$(CONFIG_ARCH_ZYNQ) += clk-zynq.o obj-$(CONFIG_ARCH_TEGRA) += tegra/ obj-$(CONFIG_PLAT_SAMSUNG) += samsung/ +obj-$(CONFIG_ARCH_OMAP) += omap/ obj-$(CONFIG_X86) += x86/drivers/clk/omap/Makefile new file +1
-0@@ -0,0 +1 @@ +obj-y += clk.odrivers/clk/omap/clk.c new file +41
-0@@ -0,0 +1,55 @@ +/* +* OMAP PRCM clock driver +* +* Copyright (C) 2013 Linaro.org - http://www.linaro.org +* Mike Turquette <[email protected]> +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License version 2 as +* published by the Free Software Foundation. +* +* This program is distributed "as is" WITHOUT ANY WARRANTY of any +* kind, whether express or implied; without even the implied warranty +* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +*/ + +#include <linux/clk-provider.h> +#include <linux/clk/omap.h> +#include <linux/kernel.h> +#include <linux/module.h> +#include <linux/of_device.h> +#include <linux/platform_device.h> + +/* FIXME - should the OMAP PRCM clock driver match generic types? */ +static const struct of_device_id clk_match[] = { + {.compatible ="fixed-clock" , .data = of_fixed_clk_setup, }, + {.compatible ="mux-clock" , .data = of_mux_clk_setup, }, + {.compatible ="fixed-factor-clock" , + .data = of_fixed_factor_clk_setup, }, + {}, +}; + +static int omap_clk_probe (struct platform_device *pdev) +{ +of_clk_init (clk_match); +return 0 ; +} + +static struct platform_driver omap_clk_driver = { + .probe = omap_clk_probe, + .driver = {
drivers/clk/omap/clk.c line 51
Quoted 10 lines
drivers/clk/omap/clk.c new file +10
-0+ .name = "omap_clk", + .of_match_table = of_match_ptr(clk_match), + }, +}; + +/* FIXME - need to initialize early; skip real driver registration & probe */ +int __init dt_omap_clk_init (void ) +{ +return omap_clk_probe (NULL ); +}
Since this isn't remotely a platform_driver, I would drop the pretense and cut out all the platform_drivers references. omap_clk_driver isn't even referenced anywhere!
Quoted 22 lines
drivers/clk/omap/clk.c new file +4
-0+ +MODULE_DESCRIPTION ("OMAP Clock driver" ); +MODULE_AUTHOR ("Texas Instruments Inc." ); +MODULE_LICENSE ("GPL v2" );include/linux/clk/omap.h new file +12
-0@@ -0,0 +1,24 @@ +/* +* Copyright (C) 2010 Broadcom +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 2 of the License, or +* (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details.
include/linux/clk/omap.h line 22
Quoted 10 lines
include/linux/clk/omap.h new file +10
-0+* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software +* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#ifndef __LINUX_CLK_OMAP_H_ +#define __LINUX_CLK_OMAP_H_ + +int __init dt_omap_clk_init (void );
__init annotations don't generally go in the header files.
g.
RFC PATCH 2/3 ARM: dts: omap4 clock data
In reply to Mike TurquetteThis is a first pass at creating a unique node for each clock in the OMAP4 power, reset and & clock manager (PRCM). So far I have only converted mux clocks & fixed-rate clocks, which coexist with the current clock data in the kernel. The rest needs to be done but better to publish early and often to see what others think of this approach.
--- arch/arm/boot/dts/omap4-clocks.dtsi | 128 ++++++++++++++++++++++++++++++++++++ arch/arm/boot/dts/omap4.dtsi | 2 + 2 files changed, 130 insertions(+) create mode 100644 arch/arm/boot/dts/omap4-clocks.dtsi
arch/arm/boot/dts/omap4-clocks.dtsi new file +128 -0
@@ -0,0 +1,128 @@ +/* + * Copyright (C) 2013 Linaro Incorporated - http://www.linaro.org/ + * + * Mike Turquette <[email protected]> + * + * Data is automatically generated from the OMAP hardware databases. If + * changes need to be made, do not edit this file directly. Instead contact + * the following developers who will update the code generator: + * + * Benoit Cousson <[email protected]> + * Rajendra Nayak <[email protected]> + * Mike Turquette <[email protected]> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + */ + +/* FIXME need to print the address directly */ +/* +#include "../../mach-omap2/prm44xx.h" +#include "../../mach-omap2/cm2_44xx.h" +#include "../../mach-omap2/cm1_44xx.h" +*/ + + +/* Root clocks */ + +extalt_clkin_ck: extalt_clkin_ck { + #clock-cells = <0>; + compatible = "fixed-clock"; + clock-frequency = <59000000>; +}; + +pad_slimbus_core_clks_ck: pad_slimbus_core_clks_ck { + #clock-cells = <0>; + compatible = "fixed-clock"; + clock-frequency = <12000000>; +}; + +secure_32k_clk_src_ck: secure_32k_clk_src_ck { + #clock-cells = <0>; + compatible = "fixed-clock"; + clock-frequency = <32768>; +}; + +virt_12000000_ck: virt_12000000_ck { + #clock-cells = <0>; + compatible = "fixed-clock"; + clock-frequency = <12000000>; +}; + +virt_13000000_ck: virt_13000000_ck { + #clock-cells = <0>; + compatible = "fixed-clock"; + clock-frequency = <13000000>; +}; + +virt_16800000_ck: virt_16800000_ck { + #clock-cells = <0>; + compatible = "fixed-clock"; + clock-frequency = <16800000>; +}; + +virt_19200000_ck: virt_19200000_ck { + #clock-cells = <0>; + compatible = "fixed-clock"; + clock-frequency = <19200000>; +}; + +virt_26000000_ck: virt_26000000_ck { + #clock-cells = <0>; + compatible = "fixed-clock"; + clock-frequency = <26000000>; +}; + +virt_27000000_ck: virt_27000000_ck { + #clock-cells = <0>; + compatible = "fixed-clock"; + clock-frequency = <27000000>; +}; + +virt_38400000_ck: virt_38400000_ck { + #clock-cells = <0>; + compatible = "fixed-clock"; + clock-frequency = <38400000>; +}; + +sys_clkin_dt: sys_clkin_dt at 4a306110 { + #clock-cells = <0>; + compatible = "mux-clock"; + clocks = <&virt_12000000_ck>, <&virt_13000000_ck>, <&virt_16800000_ck>, <&virt_19200000_ck>, <&virt_26000000_ck>, <&virt_27000000_ck>, <&virt_38400000_ck>; + reg = <0x4a306110 0x4>; + mask = <0x7>; + shift = <0>; + index_one; +}; + +tie_low_clock_ck: tie_low_clock_ck { + #clock-cells = <0>; + compatible = "fixed-clock"; + clock-frequency = <0>; +}; + +utmi_phy_clkout_ck: utmi_phy_clkout_ck { + #clock-cells = <0>; + compatible = "fixed-clock"; + clock-frequency = <60000000>; +}; + +xclk60mhsp1_ck: xclk60mhsp1_ck { + #clock-cells = <0>; + compatible = "fixed-clock"; + clock-frequency = <60000000>; +}; + +xclk60mhsp2_ck: xclk60mhsp2_ck { + #clock-cells = <0>; + compatible = "fixed-clock"; + clock-frequency = <60000000>; +}; + +xclk60motg_ck: xclk60motg_ck { + #clock-cells = <0>; + compatible = "fixed-clock"; + clock-frequency = <60000000>; +}; +
arch/arm/boot/dts/omap4.dtsi +2 -0
@@ -106,6 +106,8 @@ ti,hwmods = "counter_32k"; }; + /include/ "omap4-clocks.dtsi" + omap4_pmx_core: pinmux at 4a100040 { compatible = "ti,omap4-padconf", "pinctrl-single"; reg = <0x4a100040 0x0196>;
Signature · 1 line
1.8.1.2
Tony Lindgren
maintainerRFC PATCH 2/3 ARM: dts: omap4 clock data
arch/arm/boot/dts/omap4-clocks.dtsi line 24
Quoted 12 lines · Mike Turquette
This is a first pass at creating a unique node for each clock in the OMAP4 power, reset and & clock manager (PRCM). So far I have only converted mux clocks & fixed-rate clocks, which coexist with the current clock data in the kernel. The rest needs to be done but better to publish early and often to see what others think of this approach.
arch/arm/boot/dts/omap4-clocks.dtsi new file +6
-0+/* FIXME need to print the address directly */ +/* +#include "../../mach-omap2/prm44xx.h" +#include "../../mach-omap2/cm2_44xx.h" +#include "../../mach-omap2/cm1_44xx.h" +*/
I don't think you're using the above includes any longer in this file?
Regards,
Tony
RFC PATCH 2/3 ARM: dts: omap4 clock data
Quoting Tony Lindgren (2013-06-04 07:55:43)
Quoted 7 lines · Mike Turquette
Quoted 5 lines
This is a first pass at creating a unique node for each clock in the OMAP4 power, reset and & clock manager (PRCM). So far I have only converted mux clocks & fixed-rate clocks, which coexist with the current clock data in the kernel. The rest needs to be done but better to publish early and often to see what others think of this approach.
Quoted 10 lines
arch/arm/boot/dts/omap4-clocks.dtsi line 24
Quoted 6 lines
arch/arm/boot/dts/omap4-clocks.dtsi new file +6
-0+/* FIXME need to print the address directly */ +/* +#include "../../mach-omap2/prm44xx.h" +#include "../../mach-omap2/cm2_44xx.h" +#include "../../mach-omap2/cm1_44xx.h" +*/I don't think you're using the above includes any longer in this file?
Correct. I actually spotted this before emailing the patches out at midnight, but by then I didn't care to fix it. The benefits of marking a patch as "RFC" ;-)
I had a mind to use the new preprocessor capabilities of dtc for the PRCM bit masks and shift values, but instead I ended up using the raw hex values. I've actually come to prefer using the raw hex values for DT, which I think makes more sense for a description of the hardware which is not tied to any Linux implementation.
Regards,
Mike
Quoted 3 lines
Regards,
Tony
Tony Lindgren
maintainerRFC PATCH 2/3 ARM: dts: omap4 clock data
Quoted 19 lines · Mike Turquette
Quoting Tony Lindgren (2013-06-04 07:55:43)
Quoted 7 lines · Mike Turquette
Quoted 5 lines
This is a first pass at creating a unique node for each clock in the OMAP4 power, reset and & clock manager (PRCM). So far I have only converted mux clocks & fixed-rate clocks, which coexist with the current clock data in the kernel. The rest needs to be done but better to publish early and often to see what others think of this approach.
Quoted 10 lines
arch/arm/boot/dts/omap4-clocks.dtsi line 24
Quoted 6 lines
arch/arm/boot/dts/omap4-clocks.dtsi new file +6
-0+/* FIXME need to print the address directly */ +/* +#include "../../mach-omap2/prm44xx.h" +#include "../../mach-omap2/cm2_44xx.h" +#include "../../mach-omap2/cm1_44xx.h" +*/I don't think you're using the above includes any longer in this file?
Quoted 3 lines
Correct. I actually spotted this before emailing the patches out at midnight, but by then I didn't care to fix it. The benefits of marking a patch as "RFC" ;-)
:)
Quoted 5 lines
I had a mind to use the new preprocessor capabilities of dtc for the PRCM bit masks and shift values, but instead I ended up using the raw hex values. I've actually come to prefer using the raw hex values for DT, which I think makes more sense for a description of the hardware which is not tied to any Linux implementation.
Agreed, especially if the value is only used once.
Regards,
Tony
RFC PATCH 3/3 ARM: omap4: register DT clocks & remove old data
In reply to Mike TurquetteNow that some of the OMAP4 PRCM clock data has been converted to a DeviceTree representation it is no longer needed as static clock data. Register the DT clocks first, followed by the remaining static clocks.
--- arch/arm/mach-omap2/cclock44xx_data.c | 54 ++++------------------------------- 1 file changed, 6 insertions(+), 48 deletions(-)
arch/arm/mach-omap2/cclock44xx_data.c +6 -48
@@ -27,6 +27,7 @@#include <linux/clk-private.h> #include <linux/clkdev.h> #include <linux/io.h> +#include <linux/clk/omap.h> #include "soc.h" #include "iomap.h"
@@ -61,18 +62,12 @@/* Root clocks */ -DEFINE_CLK_FIXED_RATE (extalt_clkin_ck,CLK_IS_ROOT ,59000000 ,0x0 ); -DEFINE_CLK_FIXED_RATE (pad_clks_src_ck,CLK_IS_ROOT ,12000000 ,0x0 );DEFINE_CLK_GATE (pad_clks_ck,"pad_clks_src_ck" , &pad_clks_src_ck,0x0 ,OMAP4430_CM_CLKSEL_ABE ,OMAP4430_PAD_CLKS_GATE_SHIFT ,0x0 ,NULL ); -DEFINE_CLK_FIXED_RATE (pad_slimbus_core_clks_ck,CLK_IS_ROOT ,12000000 ,0x0 ); - -DEFINE_CLK_FIXED_RATE (secure_32k_clk_src_ck,CLK_IS_ROOT ,32768 ,0x0 ); -DEFINE_CLK_FIXED_RATE (slimbus_src_clk,CLK_IS_ROOT ,12000000 ,0x0 ); DEFINE_CLK_GATE(slimbus_clk, "slimbus_src_clk", &slimbus_src_clk, 0x0,
@@ -81,20 +76,6 @@ DEFINE_CLK_GATE(slimbus_clk, "slimbus_src_clk", &slimbus_src_clk, 0x0,DEFINE_CLK_FIXED_RATE (sys_32k_ck,CLK_IS_ROOT ,32768 ,0x0 ); -DEFINE_CLK_FIXED_RATE (virt_12000000_ck,CLK_IS_ROOT ,12000000 ,0x0 ); - -DEFINE_CLK_FIXED_RATE (virt_13000000_ck,CLK_IS_ROOT ,13000000 ,0x0 ); - -DEFINE_CLK_FIXED_RATE (virt_16800000_ck,CLK_IS_ROOT ,16800000 ,0x0 ); - -DEFINE_CLK_FIXED_RATE (virt_19200000_ck,CLK_IS_ROOT ,19200000 ,0x0 ); - -DEFINE_CLK_FIXED_RATE (virt_26000000_ck,CLK_IS_ROOT ,26000000 ,0x0 ); - -DEFINE_CLK_FIXED_RATE (virt_27000000_ck,CLK_IS_ROOT ,27000000 ,0x0 ); - -DEFINE_CLK_FIXED_RATE (virt_38400000_ck,CLK_IS_ROOT ,38400000 ,0x0 ); -static const char *sys_clkin_ck_parents[] = {"virt_12000000_ck" ,"virt_13000000_ck" ,"virt_16800000_ck" ,"virt_19200000_ck" ,"virt_26000000_ck" ,"virt_27000000_ck" ,
@@ -105,16 +86,6 @@ DEFINE_CLK_MUX(sys_clkin_ck, sys_clkin_ck_parents, NULL, 0x0,OMAP4430_CM_SYS_CLKSEL ,OMAP4430_SYS_CLKSEL_SHIFT , OMAP4430_SYS_CLKSEL_WIDTH, CLK_MUX_INDEX_ONE, NULL); -DEFINE_CLK_FIXED_RATE (tie_low_clock_ck,CLK_IS_ROOT ,0 ,0x0 ); - -DEFINE_CLK_FIXED_RATE (utmi_phy_clkout_ck,CLK_IS_ROOT ,60000000 ,0x0 ); - -DEFINE_CLK_FIXED_RATE (xclk60mhsp1_ck,CLK_IS_ROOT ,60000000 ,0x0 ); - -DEFINE_CLK_FIXED_RATE (xclk60mhsp2_ck,CLK_IS_ROOT ,60000000 ,0x0 ); - -DEFINE_CLK_FIXED_RATE (xclk60motg_ck,CLK_IS_ROOT ,60000000 ,0x0 ); -/* Module clocks and DPLL outputs */ static const char *abe_dpll_bypass_clk_mux_ck_parents[] = {
@@ -826,7 +797,7 @@ DEFINE_CLK_GATE(dss_sys_clk, "syc_clk_div_ck", &syc_clk_div_ck, 0x0,OMAP4430_CM_DSS_DSS_CLKCTRL , OMAP4430_OPTFCLKEN_SYS_CLK_SHIFT, 0x0, NULL); -DEFINE_CLK_GATE (dss_tv_clk,"extalt_clkin_ck" , &extalt_clkin_ck,0x0 , +DEFINE_CLK_GATE (dss_tv_clk,"extalt_clkin_ck" ,NULL ,0x0 ,OMAP4430_CM_DSS_DSS_CLKCTRL ,OMAP4430_OPTFCLKEN_TV_CLK_SHIFT ,0x0 ,NULL );
@@ -1051,7 +1022,7 @@ DEFINE_CLK_GATE(slimbus2_fclk_0, "func_24mc_fclk", &func_24mc_fclk, 0x0, OMAP4430_OPTFCLKEN_PER24MC_GFCLK_SHIFT, 0x0, NULL);DEFINE_CLK_GATE (slimbus2_slimbus_clk,"pad_slimbus_core_clks_ck" , - &pad_slimbus_core_clks_ck,0x0 , +NULL ,0x0 ,OMAP4430_CM_L4PER_SLIMBUS2_CLKCTRL ,OMAP4430_OPTFCLKEN_SLIMBUS_CLK_SHIFT ,0x0 ,NULL );
@@ -1442,27 +1413,11 @@ static struct omap_clk omap443x_clks[] = {* clocks common to omap44xx */ static struct omap_clk omap44xx_clks[] = { -CLK (NULL ,"extalt_clkin_ck" , &extalt_clkin_ck),CLK (NULL ,"pad_clks_src_ck" , &pad_clks_src_ck),CLK (NULL ,"pad_clks_ck" , &pad_clks_ck), -CLK (NULL ,"pad_slimbus_core_clks_ck" , &pad_slimbus_core_clks_ck), -CLK (NULL ,"secure_32k_clk_src_ck" , &secure_32k_clk_src_ck),CLK (NULL ,"slimbus_src_clk" , &slimbus_src_clk),CLK (NULL ,"slimbus_clk" , &slimbus_clk),CLK (NULL ,"sys_32k_ck" , &sys_32k_ck), -CLK (NULL ,"virt_12000000_ck" , &virt_12000000_ck), -CLK (NULL ,"virt_13000000_ck" , &virt_13000000_ck), -CLK (NULL ,"virt_16800000_ck" , &virt_16800000_ck), -CLK (NULL ,"virt_19200000_ck" , &virt_19200000_ck), -CLK (NULL ,"virt_26000000_ck" , &virt_26000000_ck), -CLK (NULL ,"virt_27000000_ck" , &virt_27000000_ck), -CLK (NULL ,"virt_38400000_ck" , &virt_38400000_ck), -CLK (NULL ,"sys_clkin_ck" , &sys_clkin_ck), -CLK (NULL ,"tie_low_clock_ck" , &tie_low_clock_ck), -CLK (NULL ,"utmi_phy_clkout_ck" , &utmi_phy_clkout_ck), -CLK (NULL ,"xclk60mhsp1_ck" , &xclk60mhsp1_ck), -CLK (NULL ,"xclk60mhsp2_ck" , &xclk60mhsp2_ck), -CLK (NULL ,"xclk60motg_ck" , &xclk60motg_ck),CLK (NULL ,"abe_dpll_bypass_clk_mux_ck" , &abe_dpll_bypass_clk_mux_ck),CLK (NULL ,"abe_dpll_refclk_mux_ck" , &abe_dpll_refclk_mux_ck),CLK (NULL ,"dpll_abe_ck" , &dpll_abe_ck),
@@ -1690,6 +1645,9 @@ int __init omap4xxx_clk_init(void) {int rc; +/* FIXME register clocks from DT first */ +dt_omap_clk_init (); +if (cpu_is_omap443x ()) { cpu_mask =RATE_IN_4430 ;omap_clocks_register (omap443x_clks,ARRAY_SIZE (omap443x_clks));
Signature · 1 line
1.8.1.2
cover first pass converting omap4 clock data to DT
In reply to Mike TurquetteHi Mike,
Quoted 4 lines · Mike Turquette
This is a very incomplete conversion of a handful of OMAP4 PRCM clocks from the statically defined clock data in
arch/arm/mach-omap2/cclock44xx_data.cto a new dts file inarch/arm/boot/dts/omap4-clocks.dtsi.
I gave a quick try for this set and it seems to be working nicely, so for at least me this approach is fine. Feel free to add tested-by me if you like (for the basic clock bindings also.) Can't comment much on the DT stuff though as my experience is rather limited on it.
Quoted 10 lines
I am not a DT expert so many of the choices here may be quite disgusting to look at, or may be on the right path. In particular I simply include the new
omap4-clocks.dtsifromomap4.dtsi, which feels a bit kludgey. Also this series depends on the basic clock bindings RFC I posted earlier today[1].I actually have an
omap4-clock.dtsifile with many more clocks converted to the mux-clock, divider-clock, fixed-clock, fixed-factor and (unpublished) gate-clock bindings in my local repo, but it is not currently booting. I wanted to get this early preview out regardless.
Any way I can get access to your local tree? Can you push a branch somewhere? I could provide you debugging support on this at least, as I spent quite a bit of time earlier moving the clock data under drivers/clk... I guess you are probably seeing similar issues I faced.
-Tero
Quoted 21 lines
[1] http://article.gmane.org/gmane.linux.kernel/1501216
Mike Turquette (3):
clk: omap: introduce clock driver
ARM: dts: omap4 clock data
ARM: omap4: register DT clocks & remove old dataarch/arm/boot/dts/omap4-clocks.dtsi | 128 ++++++++++++++++++++++++++++++++++ arch/arm/boot/dts/omap4.dtsi | 2 + arch/arm/mach-omap2/cclock44xx_data.c | 54 ++------------ drivers/clk/Makefile | 1 + drivers/clk/omap/Makefile | 1 + drivers/clk/omap/clk.c | 55 +++++++++++++++ include/linux/clk/omap.h | 24 +++++++ 7 files changed, 217 insertions(+), 48 deletions(-) create mode 100644 arch/arm/boot/dts/omap4-clocks.dtsi create mode 100644 drivers/clk/omap/Makefile create mode 100644 drivers/clk/omap/clk.c create mode 100644 include/linux/clk/omap.h
cover first pass converting omap4 clock data to DT
Quoting Tero Kristo (2013-06-04 06:28:54)
Quoted 24 lines
Hi Mike,
Quoted 4 lines · Mike Turquette
This is a very incomplete conversion of a handful of OMAP4 PRCM clocks from the statically defined clock data in
arch/arm/mach-omap2/cclock44xx_data.cto a new dts file inarch/arm/boot/dts/omap4-clocks.dtsi.I gave a quick try for this set and it seems to be working nicely, so for at least me this approach is fine. Feel free to add tested-by me if you like (for the basic clock bindings also.) Can't comment much on the DT stuff though as my experience is rather limited on it.
Quoted 10 lines
I am not a DT expert so many of the choices here may be quite disgusting to look at, or may be on the right path. In particular I simply include the new
omap4-clocks.dtsifromomap4.dtsi, which feels a bit kludgey. Also this series depends on the basic clock bindings RFC I posted earlier today[1].I actually have an
omap4-clock.dtsifile with many more clocks converted to the mux-clock, divider-clock, fixed-clock, fixed-factor and (unpublished) gate-clock bindings in my local repo, but it is not currently booting. I wanted to get this early preview out regardless.
Quoted 5 lines
Any way I can get access to your local tree? Can you push a branch somewhere? I could provide you debugging support on this at least, as I spent quite a bit of time earlier moving the clock data under
drivers/clk... I guess you are probably seeing similar issues I faced.
I'll be pushing changes to my github tree:git://github.com/mturquette/linux.git clk-next-omap-dt
https://github.com/mturquette/linux/tree/clk-next-omap-dt
For now it is just this series based on the prerequisites, based on clk-next, based on -rc3.
Regards,
Mike
Quoted 23 lines
-Tero
Quoted 21 lines
[1] http://article.gmane.org/gmane.linux.kernel/1501216
Mike Turquette (3):
clk: omap: introduce clock driver
ARM: dts: omap4 clock data
ARM: omap4: register DT clocks & remove old dataarch/arm/boot/dts/omap4-clocks.dtsi | 128 ++++++++++++++++++++++++++++++++++ arch/arm/boot/dts/omap4.dtsi | 2 + arch/arm/mach-omap2/cclock44xx_data.c | 54 ++------------ drivers/clk/Makefile | 1 + drivers/clk/omap/Makefile | 1 + drivers/clk/omap/clk.c | 55 +++++++++++++++ include/linux/clk/omap.h | 24 +++++++ 7 files changed, 217 insertions(+), 48 deletions(-) create mode 100644 arch/arm/boot/dts/omap4-clocks.dtsi create mode 100644 drivers/clk/omap/Makefile create mode 100644 drivers/clk/omap/clk.c create mode 100644 include/linux/clk/omap.h