* [PATCH RFC 0/3] first pass converting omap4 clock data to DT @ 2013-06-04 6:39 Mike Turquette 2013-06-04 6:39 ` [PATCH RFC 1/3] clk: omap: introduce clock driver Mike Turquette ` (3 more replies) 0 siblings, 4 replies; 11+ messages in thread From: Mike Turquette @ 2013-06-04 6:39 UTC (permalink / raw) To: linux-arm-kernel Cc: linux-omap, devicetree-discuss, Tero Kristo, Rajendra, Nishanth Menon, Benoit Cousson, 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.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 -- 1.8.1.2 ^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH RFC 1/3] clk: omap: introduce clock driver 2013-06-04 6:39 [PATCH RFC 0/3] first pass converting omap4 clock data to DT Mike Turquette @ 2013-06-04 6:39 ` Mike Turquette 2013-06-04 14:52 ` Tony Lindgren 2013-06-14 22:12 ` Grant Likely 2013-06-04 6:39 ` [PATCH RFC 2/3] ARM: dts: omap4 clock data Mike Turquette ` (2 subsequent siblings) 3 siblings, 2 replies; 11+ messages in thread From: Mike Turquette @ 2013-06-04 6:39 UTC (permalink / raw) To: linux-arm-kernel Cc: linux-omap, devicetree-discuss, Tero Kristo, Rajendra, Nishanth Menon, Benoit Cousson, Mike Turquette, Joel A Fernandes, Paul Walmsley, Tony Lindgren 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. Cc: Benoit Cousson <b-cousson@ti.com> Cc: Rajendra Nayak <rnayak@ti.com> Cc: Joel A Fernandes <joelagnel@ti.com> Cc: Nishanth Menon <nm@ti.com> Cc: Paul Walmsley <paul@pwsan.com> Cc: Tony Lindgren <tony@atomide.com> Signed-off-by: Mike Turquette <mturquette@linaro.org> --- 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 diff --git a/drivers/clk/Makefile b/drivers/clk/Makefile index f51b52b..efd4f2a 100644 --- a/drivers/clk/Makefile +++ b/drivers/clk/Makefile @@ -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/ diff --git a/drivers/clk/omap/Makefile b/drivers/clk/omap/Makefile new file mode 100644 index 0000000..8195931 --- /dev/null +++ b/drivers/clk/omap/Makefile @@ -0,0 +1 @@ +obj-y += clk.o diff --git a/drivers/clk/omap/clk.c b/drivers/clk/omap/clk.c new file mode 100644 index 0000000..e9e5c95 --- /dev/null +++ b/drivers/clk/omap/clk.c @@ -0,0 +1,55 @@ +/* + * OMAP PRCM clock driver + * + * Copyright (C) 2013 Linaro.org - http://www.linaro.org + * Mike Turquette <mturquette@linaro.org> + * + * 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 = { + .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); +} + +MODULE_DESCRIPTION("OMAP Clock driver"); +MODULE_AUTHOR("Texas Instruments Inc."); +MODULE_LICENSE("GPL v2"); diff --git a/include/linux/clk/omap.h b/include/linux/clk/omap.h new file mode 100644 index 0000000..504e838 --- /dev/null +++ b/include/linux/clk/omap.h @@ -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 -- 1.8.1.2 ^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: [PATCH RFC 1/3] clk: omap: introduce clock driver 2013-06-04 6:39 ` [PATCH RFC 1/3] clk: omap: introduce clock driver Mike Turquette @ 2013-06-04 14:52 ` Tony Lindgren 2013-06-14 22:12 ` Grant Likely 1 sibling, 0 replies; 11+ messages in thread From: Tony Lindgren @ 2013-06-04 14:52 UTC (permalink / raw) To: Mike Turquette Cc: linux-arm-kernel, linux-omap, devicetree-discuss, Tero Kristo, Rajendra, Nishanth Menon, Benoit Cousson, Joel A Fernandes, Paul Walmsley * Mike Turquette <mturquette@linaro.org> [130603 23:45]: > 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. 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. > --- /dev/null > +++ b/include/linux/clk/omap.h > @@ -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 Maybe leave out the Broadcom copyright from this header? :) Regards, Tony ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH RFC 1/3] clk: omap: introduce clock driver 2013-06-04 6:39 ` [PATCH RFC 1/3] clk: omap: introduce clock driver Mike Turquette 2013-06-04 14:52 ` Tony Lindgren @ 2013-06-14 22:12 ` Grant Likely 1 sibling, 0 replies; 11+ messages in thread From: Grant Likely @ 2013-06-14 22:12 UTC (permalink / raw) To: linux-arm-kernel Cc: Nishanth Menon, Joel A Fernandes, Mike Turquette, devicetree-discuss, Tero Kristo, linux-omap On Mon, 3 Jun 2013 23:39:16 -0700, Mike Turquette <mturquette@linaro.org> wrote: > 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. > > Cc: Benoit Cousson <b-cousson@ti.com> > Cc: Rajendra Nayak <rnayak@ti.com> > Cc: Joel A Fernandes <joelagnel@ti.com> > Cc: Nishanth Menon <nm@ti.com> > Cc: Paul Walmsley <paul@pwsan.com> > Cc: Tony Lindgren <tony@atomide.com> > Signed-off-by: Mike Turquette <mturquette@linaro.org> Hi Mike, Comments below... > --- > 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 > > 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 > > diff --git a/drivers/clk/Makefile b/drivers/clk/Makefile > index f51b52b..efd4f2a 100644 > --- a/drivers/clk/Makefile > +++ b/drivers/clk/Makefile > @@ -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/ > > diff --git a/drivers/clk/omap/Makefile b/drivers/clk/omap/Makefile > new file mode 100644 > index 0000000..8195931 > --- /dev/null > +++ b/drivers/clk/omap/Makefile > @@ -0,0 +1 @@ > +obj-y += clk.o > diff --git a/drivers/clk/omap/clk.c b/drivers/clk/omap/clk.c > new file mode 100644 > index 0000000..e9e5c95 > --- /dev/null > +++ b/drivers/clk/omap/clk.c > @@ -0,0 +1,55 @@ > +/* > + * OMAP PRCM clock driver > + * > + * Copyright (C) 2013 Linaro.org - http://www.linaro.org > + * Mike Turquette <mturquette@linaro.org> > + * > + * 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 = { > + .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! > + > +MODULE_DESCRIPTION("OMAP Clock driver"); > +MODULE_AUTHOR("Texas Instruments Inc."); > +MODULE_LICENSE("GPL v2"); > diff --git a/include/linux/clk/omap.h b/include/linux/clk/omap.h > new file mode 100644 > index 0000000..504e838 > --- /dev/null > +++ b/include/linux/clk/omap.h > @@ -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); __init annotations don't generally go in the header files. g. ^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH RFC 2/3] ARM: dts: omap4 clock data 2013-06-04 6:39 [PATCH RFC 0/3] first pass converting omap4 clock data to DT Mike Turquette 2013-06-04 6:39 ` [PATCH RFC 1/3] clk: omap: introduce clock driver Mike Turquette @ 2013-06-04 6:39 ` Mike Turquette 2013-06-04 14:55 ` Tony Lindgren 2013-06-04 6:39 ` [PATCH RFC 3/3] ARM: omap4: register DT clocks & remove old data Mike Turquette 2013-06-04 13:28 ` [PATCH RFC 0/3] first pass converting omap4 clock data to DT Tero Kristo 3 siblings, 1 reply; 11+ messages in thread From: Mike Turquette @ 2013-06-04 6:39 UTC (permalink / raw) To: linux-arm-kernel Cc: linux-omap, devicetree-discuss, Tero Kristo, Rajendra, Nishanth Menon, Benoit Cousson, Mike Turquette, Joel A Fernandes, Paul Walmsley, Tony Lindgren 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. Cc: Benoit Cousson <b-cousson@ti.com> Cc: Rajendra Nayak <rnayak@ti.com> Cc: Joel A Fernandes <joelagnel@ti.com> Cc: Nishanth Menon <nm@ti.com> Cc: Paul Walmsley <paul@pwsan.com> Cc: Tony Lindgren <tony@atomide.com> Signed-off-by: Mike Turquette <mturquette@linaro.org> --- 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 diff --git a/arch/arm/boot/dts/omap4-clocks.dtsi b/arch/arm/boot/dts/omap4-clocks.dtsi new file mode 100644 index 0000000..664e100 --- /dev/null +++ b/arch/arm/boot/dts/omap4-clocks.dtsi @@ -0,0 +1,128 @@ +/* + * Copyright (C) 2013 Linaro Incorporated - http://www.linaro.org/ + * + * Mike Turquette <mturquette@linaro.org> + * + * 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 <benoit.cousson@linaro.org> + * Rajendra Nayak <rnayak@ti.com> + * Mike Turquette <mturquette@linaro.org> + * + * 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@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>; +}; + diff --git a/arch/arm/boot/dts/omap4.dtsi b/arch/arm/boot/dts/omap4.dtsi index 2a56428..70608db 100644 --- a/arch/arm/boot/dts/omap4.dtsi +++ b/arch/arm/boot/dts/omap4.dtsi @@ -106,6 +106,8 @@ ti,hwmods = "counter_32k"; }; + /include/ "omap4-clocks.dtsi" + omap4_pmx_core: pinmux@4a100040 { compatible = "ti,omap4-padconf", "pinctrl-single"; reg = <0x4a100040 0x0196>; -- 1.8.1.2 ^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: [PATCH RFC 2/3] ARM: dts: omap4 clock data 2013-06-04 6:39 ` [PATCH RFC 2/3] ARM: dts: omap4 clock data Mike Turquette @ 2013-06-04 14:55 ` Tony Lindgren [not found] ` <20130604145543.GK3331-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org> 0 siblings, 1 reply; 11+ messages in thread From: Tony Lindgren @ 2013-06-04 14:55 UTC (permalink / raw) To: Mike Turquette Cc: linux-arm-kernel, linux-omap, devicetree-discuss, Tero Kristo, Rajendra, Nishanth Menon, Benoit Cousson, Joel A Fernandes, Paul Walmsley * Mike Turquette <mturquette@linaro.org> [130603 23:45]: > 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. > +/* 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 ^ permalink raw reply [flat|nested] 11+ messages in thread
[parent not found: <20130604145543.GK3331-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org>]
* Re: [PATCH RFC 2/3] ARM: dts: omap4 clock data [not found] ` <20130604145543.GK3331-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org> @ 2013-06-04 18:34 ` Mike Turquette 2013-06-04 19:37 ` Tony Lindgren 0 siblings, 1 reply; 11+ messages in thread From: Mike Turquette @ 2013-06-04 18:34 UTC (permalink / raw) To: Tony Lindgren Cc: Nishanth Menon, Joel A Fernandes, devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ, Tero Kristo, linux-omap-u79uwXL29TY76Z2rM5mHXA, linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r Quoting Tony Lindgren (2013-06-04 07:55:43) > * Mike Turquette <mturquette-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org> [130603 23:45]: > > 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. > > > +/* 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 > Regards, > > Tony ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH RFC 2/3] ARM: dts: omap4 clock data 2013-06-04 18:34 ` Mike Turquette @ 2013-06-04 19:37 ` Tony Lindgren 0 siblings, 0 replies; 11+ messages in thread From: Tony Lindgren @ 2013-06-04 19:37 UTC (permalink / raw) To: Mike Turquette Cc: linux-arm-kernel, linux-omap, devicetree-discuss, Tero Kristo, Rajendra, Nishanth Menon, Benoit Cousson, Joel A Fernandes, Paul Walmsley * Mike Turquette <mturquette@linaro.org> [130604 11:40]: > Quoting Tony Lindgren (2013-06-04 07:55:43) > > * Mike Turquette <mturquette@linaro.org> [130603 23:45]: > > > 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. > > > > > +/* 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. Agreed, especially if the value is only used once. Regards, Tony ^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH RFC 3/3] ARM: omap4: register DT clocks & remove old data 2013-06-04 6:39 [PATCH RFC 0/3] first pass converting omap4 clock data to DT Mike Turquette 2013-06-04 6:39 ` [PATCH RFC 1/3] clk: omap: introduce clock driver Mike Turquette 2013-06-04 6:39 ` [PATCH RFC 2/3] ARM: dts: omap4 clock data Mike Turquette @ 2013-06-04 6:39 ` Mike Turquette 2013-06-04 13:28 ` [PATCH RFC 0/3] first pass converting omap4 clock data to DT Tero Kristo 3 siblings, 0 replies; 11+ messages in thread From: Mike Turquette @ 2013-06-04 6:39 UTC (permalink / raw) To: linux-arm-kernel Cc: linux-omap, devicetree-discuss, Tero Kristo, Rajendra, Nishanth Menon, Benoit Cousson, Mike Turquette, Joel A Fernandes, Paul Walmsley, Tony Lindgren Now 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. Cc: Benoit Cousson <b-cousson@ti.com> Cc: Rajendra Nayak <rnayak@ti.com> Cc: Joel A Fernandes <joelagnel@ti.com> Cc: Nishanth Menon <nm@ti.com> Cc: Paul Walmsley <paul@pwsan.com> Cc: Tony Lindgren <tony@atomide.com> Signed-off-by: Mike Turquette <mturquette@linaro.org> --- arch/arm/mach-omap2/cclock44xx_data.c | 54 ++++------------------------------- 1 file changed, 6 insertions(+), 48 deletions(-) diff --git a/arch/arm/mach-omap2/cclock44xx_data.c b/arch/arm/mach-omap2/cclock44xx_data.c index 88e37a4..97fd65c 100644 --- a/arch/arm/mach-omap2/cclock44xx_data.c +++ b/arch/arm/mach-omap2/cclock44xx_data.c @@ -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)); -- 1.8.1.2 ^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: [PATCH RFC 0/3] first pass converting omap4 clock data to DT 2013-06-04 6:39 [PATCH RFC 0/3] first pass converting omap4 clock data to DT Mike Turquette ` (2 preceding siblings ...) 2013-06-04 6:39 ` [PATCH RFC 3/3] ARM: omap4: register DT clocks & remove old data Mike Turquette @ 2013-06-04 13:28 ` Tero Kristo 2013-06-05 6:45 ` Mike Turquette 3 siblings, 1 reply; 11+ messages in thread From: Tero Kristo @ 2013-06-04 13:28 UTC (permalink / raw) To: Mike Turquette Cc: linux-arm-kernel, linux-omap, devicetree-discuss, Rajendra, Nishanth Menon, Benoit Cousson Hi Mike, On Mon, 2013-06-03 at 23:39 -0700, Mike Turquette wrote: > 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 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. > 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. 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 > > [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 > ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH RFC 0/3] first pass converting omap4 clock data to DT 2013-06-04 13:28 ` [PATCH RFC 0/3] first pass converting omap4 clock data to DT Tero Kristo @ 2013-06-05 6:45 ` Mike Turquette 0 siblings, 0 replies; 11+ messages in thread From: Mike Turquette @ 2013-06-05 6:45 UTC (permalink / raw) To: t-kristo-l0cyMroinI0 Cc: Nishanth Menon, devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ, linux-omap-u79uwXL29TY76Z2rM5mHXA, linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r Quoting Tero Kristo (2013-06-04 06:28:54) > Hi Mike, > > On Mon, 2013-06-03 at 23:39 -0700, Mike Turquette wrote: > > 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 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. > > > 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. > > 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 > -Tero > > > > > [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 > > ^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2013-06-14 22:12 UTC | newest] Thread overview: 11+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2013-06-04 6:39 [PATCH RFC 0/3] first pass converting omap4 clock data to DT Mike Turquette 2013-06-04 6:39 ` [PATCH RFC 1/3] clk: omap: introduce clock driver Mike Turquette 2013-06-04 14:52 ` Tony Lindgren 2013-06-14 22:12 ` Grant Likely 2013-06-04 6:39 ` [PATCH RFC 2/3] ARM: dts: omap4 clock data Mike Turquette 2013-06-04 14:55 ` Tony Lindgren [not found] ` <20130604145543.GK3331-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org> 2013-06-04 18:34 ` Mike Turquette 2013-06-04 19:37 ` Tony Lindgren 2013-06-04 6:39 ` [PATCH RFC 3/3] ARM: omap4: register DT clocks & remove old data Mike Turquette 2013-06-04 13:28 ` [PATCH RFC 0/3] first pass converting omap4 clock data to DT Tero Kristo 2013-06-05 6:45 ` Mike Turquette
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).