* [PATCH 0/8] Marvell Berlin full clock support @ 2014-05-11 20:24 Sebastian Hesselbarth [not found] ` <1399839881-29895-1-git-send-email-sebastian.hesselbarth-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> ` (4 more replies) 0 siblings, 5 replies; 24+ messages in thread From: Sebastian Hesselbarth @ 2014-05-11 20:24 UTC (permalink / raw) To: Sebastian Hesselbarth Cc: Mike Turquette, Rob Herring, Pawel Moll, Mark Rutland, Ian Campbell, Kumar Gala, Russell King, Alexandre Belloni, Antoine Tenart, devicetree, linux-arm-kernel, linux-kernel This is a patch set combining initial effort from Alexandre Belloni [1][2] and a bad one from me [3] to bring proper DT based clocks to Marvell Berlin SoCs. As I was unsure, how Alexandre's initial patch sets fit in the whole picture, I had to look at it myself. It took me a while to sort out the messy clk related registers of Berlin, but finally IMHO I found a good compromise between DT and driver registered clocks. As I don't have any access to BG2Q code/documentation, it needs some additional patches from Alexandre. This is basically berlin2q.dtsi changes and a core clock driver for BG2Q. Anyway, this is nothing that should stall a proper driver-/DT-related review. Apoloigies for the noise the three approaches may have caused, but anybody who takes a closer look at either this patches or the corresponding GPL'd Chromecast SDK [4][5] will quickly see that Marvell HW engineers really hate those who have to write the drivers for their register sets. It is full of "similar" registers for the same IP that received some TLC, like one register is shifted by 4 bits with respect to the other registers dealing with the same functionalities. *sigh* The patches are based on v3.15-rc1 and I have compared the resulting clock frequencies with u-boot's reported frequencies where possible on Chromecast (BG2CD) and NSZ-GS7 (BG2). I'd love to see them in for v3.16 as it will allow us to proceed with working on drivers that actually need those clocks. Current support for Marvell Berlin SoCs is almost limited to serial console, so there is absolutely nothing to break. To make sure it will not break others, I prepared a topic branch and added it to berlin's linux-next branch. The topic branch can be found at https://github.com/shesselba/linux-berlin.git topic/clk Patch 1 first adds a helper function to derive a unique clock name out of the DT nodes name and either the reg property or a magic number. This is taken from DT's platform code, that derives similar unique names for proper platform devices. Patch 2 adds the whole binding documentation for all clock related IP. Patches 3, 4, and 5 then add clock drivers for the Audio/Video PLL, simple PLLs, and complex clock divider cells found on Berlin SoCs. Where required, currently known differences between BG2/BG2CD and BG2Q are taken care of. Patch 6 adds a clock driver for the remaining core clocks of BG2/BG2CD. The register set dealing with it, is shared among input and bypass muxes, clock dividers and clock gates. Patches 7 and 8 finally convert the DT SoC include for BG2 and BG2CD to make use of the new clock related DT nodes. [1] https://lkml.org/lkml/2014/4/23/831 [2] https://lkml.org/lkml/2014/4/24/624 [3] https://lkml.org/lkml/2014/5/8/592 [4] https://code.google.com/p/chromecast-mirrored-source/source/browse/bootloader/berlin_tools/bootloader/clock/galois_speed.c?repo=sdk [5] https://code.google.com/p/chromecast-mirrored-source/source/browse/bootloader/berlin_tools/bootloader/include/Firmware_Berlin_BG2CD_A0/global.h?repo=sdk Alexandre Belloni (2): clk: berlin: add driver for BG2x simple PLLs clk: berlin: add driver for BG2x complex divider cells Sebastian Hesselbarth (6): clk: add helper for unique DT clock names clk: berlin: add clock binding docs for Marvell Berlin2 SoCs clk: berlin: add driver for BG2x audio/video PLL clk: berlin: add core clock driver for BG2/BG2CD ARM: dts: berlin: convert BG2CD to DT clock nodes ARM: dts: berlin: convert BG2 to DT clock nodes .../devicetree/bindings/clock/berlin2-clock.txt | 169 +++++++ arch/arm/boot/dts/berlin2.dtsi | 200 ++++++-- arch/arm/boot/dts/berlin2cd.dtsi | 198 ++++++-- drivers/clk/Makefile | 1 + drivers/clk/berlin/Makefile | 3 + drivers/clk/berlin/berlin2-avpll.c | 373 +++++++++++++++ drivers/clk/berlin/berlin2-div.c | 326 +++++++++++++ drivers/clk/berlin/berlin2-div.h | 80 ++++ drivers/clk/berlin/berlin2-pll.c | 171 +++++++ drivers/clk/berlin/bg2.c | 509 +++++++++++++++++++++ drivers/clk/clk.c | 29 ++ include/dt-bindings/clock/berlin2.h | 35 ++ include/linux/clk-provider.h | 5 + 13 files changed, 2042 insertions(+), 57 deletions(-) create mode 100644 Documentation/devicetree/bindings/clock/berlin2-clock.txt create mode 100644 drivers/clk/berlin/Makefile create mode 100644 drivers/clk/berlin/berlin2-avpll.c create mode 100644 drivers/clk/berlin/berlin2-div.c create mode 100644 drivers/clk/berlin/berlin2-div.h create mode 100644 drivers/clk/berlin/berlin2-pll.c create mode 100644 drivers/clk/berlin/bg2.c create mode 100644 include/dt-bindings/clock/berlin2.h --- Cc: Mike Turquette <mturquette@linaro.org> Cc: Rob Herring <robh+dt@kernel.org> Cc: Pawel Moll <pawel.moll@arm.com> Cc: Mark Rutland <mark.rutland@arm.com> Cc: Ian Campbell <ijc+devicetree@hellion.org.uk> Cc: Kumar Gala <galak@codeaurora.org> Cc: Russell King <linux@arm.linux.org.uk> Cc: Alexandre Belloni <alexandre.belloni@free-electrons.com> Cc: Antoine Tenart <antoine.tenart@free-electrons.com> Cc: devicetree@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org -- 1.9.1 ^ permalink raw reply [flat|nested] 24+ messages in thread
[parent not found: <1399839881-29895-1-git-send-email-sebastian.hesselbarth-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>]
* [PATCH 1/8] clk: add helper for unique DT clock names [not found] ` <1399839881-29895-1-git-send-email-sebastian.hesselbarth-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> @ 2014-05-11 20:24 ` Sebastian Hesselbarth 2014-05-13 19:49 ` Mike Turquette 0 siblings, 1 reply; 24+ messages in thread From: Sebastian Hesselbarth @ 2014-05-11 20:24 UTC (permalink / raw) To: Sebastian Hesselbarth Cc: Mike Turquette, Grant Likely, Rob Herring, Alexandre Belloni, Antoine Tenart, devicetree-u79uwXL29TY76Z2rM5mHXA, linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r, linux-kernel-u79uwXL29TY76Z2rM5mHXA Currently, most DT clock drivers pick a unique node name to allow unique clock names. As ePAPR recommends node names to be generic, we therefore provide a helper to generate a unique clock name from the DT node name plus reg property or a magic number instead. This is basically the same we already do for proper devices and may vanish as soon as there is some (early) device support for clocks available. Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> --- Cc: Mike Turquette <mturquette-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org> Cc: Grant Likely <grant.likely-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org> Cc: Rob Herring <robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org> Cc: Alexandre Belloni <alexandre.belloni-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org> Cc: Antoine Tenart <antoine.tenart-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org> Cc: devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org Cc: linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org Cc: linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org --- drivers/clk/clk.c | 29 +++++++++++++++++++++++++++++ include/linux/clk-provider.h | 5 +++++ 2 files changed, 34 insertions(+) diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c index dff0373f53c1..b449a635dbfa 100644 --- a/drivers/clk/clk.c +++ b/drivers/clk/clk.c @@ -17,6 +17,7 @@ #include <linux/list.h> #include <linux/slab.h> #include <linux/of.h> +#include <linux/of_address.h> #include <linux/device.h> #include <linux/init.h> #include <linux/sched.h> @@ -2543,6 +2544,34 @@ const char *of_clk_get_parent_name(struct device_node *np, int index) } EXPORT_SYMBOL_GPL(of_clk_get_parent_name); +/** + * of_clk_create_name() - Allocate and create a unique clock name + * @np: Device node pointer of the clock node + * + * This will allocate and create a unique clock name based on the + * reg property value. As a last resort, it will use the node name + * followed by a unique number. The caller has to deallocate the + * buffer. + */ +char *of_clk_create_name(struct device_node *np) +{ + static atomic_t clk_no_reg_magic; + const __be32 *reg; + u64 addr; + int magic; + + reg = of_get_property(np, "reg", NULL); + if (reg) { + addr = of_translate_address(np, reg); + return kasprintf(GFP_KERNEL, "%llx.%s", + (unsigned long long)addr, np->name); + } + + magic = atomic_add_return(1, &clk_no_reg_magic); + return kasprintf(GFP_KERNEL, "%s.%d", np->name, magic); +} +EXPORT_SYMBOL_GPL(of_clk_create_name); + struct clock_provider { of_clk_init_cb_t clk_init_cb; struct device_node *np; diff --git a/include/linux/clk-provider.h b/include/linux/clk-provider.h index 511917416fb0..c6f3ca1cd81c 100644 --- a/include/linux/clk-provider.h +++ b/include/linux/clk-provider.h @@ -514,6 +514,7 @@ struct clk *of_clk_src_simple_get(struct of_phandle_args *clkspec, struct clk *of_clk_src_onecell_get(struct of_phandle_args *clkspec, void *data); int of_clk_get_parent_count(struct device_node *np); const char *of_clk_get_parent_name(struct device_node *np, int index); +char *of_clk_create_name(struct device_node *np); void of_clk_init(const struct of_device_id *matches); @@ -543,6 +544,10 @@ static inline const char *of_clk_get_parent_name(struct device_node *np, { return NULL; } +static inline char *of_clk_create_name(struct device_node *np) +{ + return NULL; +} #define of_clk_init(matches) \ { while (0); } #endif /* CONFIG_OF */ -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply related [flat|nested] 24+ messages in thread
* Re: [PATCH 1/8] clk: add helper for unique DT clock names 2014-05-11 20:24 ` [PATCH 1/8] clk: add helper for unique DT clock names Sebastian Hesselbarth @ 2014-05-13 19:49 ` Mike Turquette 2014-05-13 20:19 ` Sebastian Hesselbarth 0 siblings, 1 reply; 24+ messages in thread From: Mike Turquette @ 2014-05-13 19:49 UTC (permalink / raw) To: Sebastian Hesselbarth Cc: Grant Likely, Rob Herring, Alexandre Belloni, Antoine Tenart, devicetree, linux-arm-kernel, linux-kernel Quoting Sebastian Hesselbarth (2014-05-11 13:24:34) > Currently, most DT clock drivers pick a unique node name to allow unique > clock names. As ePAPR recommends node names to be generic, we therefore > provide a helper to generate a unique clock name from the DT node name > plus reg property or a magic number instead. This is basically the same > we already do for proper devices and may vanish as soon as there is some > (early) device support for clocks available. > > Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com> > --- > Cc: Mike Turquette <mturquette@linaro.org> > Cc: Grant Likely <grant.likely@linaro.org> > Cc: Rob Herring <robh+dt@kernel.org> > Cc: Alexandre Belloni <alexandre.belloni@free-electrons.com> > Cc: Antoine Tenart <antoine.tenart@free-electrons.com> > Cc: devicetree@vger.kernel.org > Cc: linux-arm-kernel@lists.infradead.org > Cc: linux-kernel@vger.kernel.org > --- > drivers/clk/clk.c | 29 +++++++++++++++++++++++++++++ > include/linux/clk-provider.h | 5 +++++ > 2 files changed, 34 insertions(+) > > diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c > index dff0373f53c1..b449a635dbfa 100644 > --- a/drivers/clk/clk.c > +++ b/drivers/clk/clk.c > @@ -17,6 +17,7 @@ > #include <linux/list.h> > #include <linux/slab.h> > #include <linux/of.h> > +#include <linux/of_address.h> > #include <linux/device.h> > #include <linux/init.h> > #include <linux/sched.h> > @@ -2543,6 +2544,34 @@ const char *of_clk_get_parent_name(struct device_node *np, int index) > } > EXPORT_SYMBOL_GPL(of_clk_get_parent_name); > > +/** > + * of_clk_create_name() - Allocate and create a unique clock name > + * @np: Device node pointer of the clock node > + * > + * This will allocate and create a unique clock name based on the > + * reg property value. As a last resort, it will use the node name > + * followed by a unique number. The caller has to deallocate the > + * buffer. > + */ > +char *of_clk_create_name(struct device_node *np) > +{ > + static atomic_t clk_no_reg_magic; > + const __be32 *reg; > + u64 addr; > + int magic; > + > + reg = of_get_property(np, "reg", NULL); > + if (reg) { > + addr = of_translate_address(np, reg); > + return kasprintf(GFP_KERNEL, "%llx.%s", > + (unsigned long long)addr, np->name); > + } > + > + magic = atomic_add_return(1, &clk_no_reg_magic); > + return kasprintf(GFP_KERNEL, "%s.%d", np->name, magic); For the case where we the reg property is present we use reg.name, but for the case were the reg property is missing we use name.magic. Is it intentional to switch the string and integer pairs? Doing so avoids the case where magic might collide with a simple bus clock (e.g. 'clk@1'), but I wanted to double check that it was intentional. Regards, Mike > +} > +EXPORT_SYMBOL_GPL(of_clk_create_name); > + > struct clock_provider { > of_clk_init_cb_t clk_init_cb; > struct device_node *np; > diff --git a/include/linux/clk-provider.h b/include/linux/clk-provider.h > index 511917416fb0..c6f3ca1cd81c 100644 > --- a/include/linux/clk-provider.h > +++ b/include/linux/clk-provider.h > @@ -514,6 +514,7 @@ struct clk *of_clk_src_simple_get(struct of_phandle_args *clkspec, > struct clk *of_clk_src_onecell_get(struct of_phandle_args *clkspec, void *data); > int of_clk_get_parent_count(struct device_node *np); > const char *of_clk_get_parent_name(struct device_node *np, int index); > +char *of_clk_create_name(struct device_node *np); > > void of_clk_init(const struct of_device_id *matches); > > @@ -543,6 +544,10 @@ static inline const char *of_clk_get_parent_name(struct device_node *np, > { > return NULL; > } > +static inline char *of_clk_create_name(struct device_node *np) > +{ > + return NULL; > +} > #define of_clk_init(matches) \ > { while (0); } > #endif /* CONFIG_OF */ > -- > 1.9.1 > ^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH 1/8] clk: add helper for unique DT clock names 2014-05-13 19:49 ` Mike Turquette @ 2014-05-13 20:19 ` Sebastian Hesselbarth 2014-05-13 20:51 ` Mike Turquette 0 siblings, 1 reply; 24+ messages in thread From: Sebastian Hesselbarth @ 2014-05-13 20:19 UTC (permalink / raw) To: Mike Turquette Cc: Grant Likely, Rob Herring, Alexandre Belloni, Antoine Tenart, devicetree-u79uwXL29TY76Z2rM5mHXA, linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r, linux-kernel-u79uwXL29TY76Z2rM5mHXA On 05/13/2014 09:49 PM, Mike Turquette wrote: > Quoting Sebastian Hesselbarth (2014-05-11 13:24:34) >> Currently, most DT clock drivers pick a unique node name to allow unique >> clock names. As ePAPR recommends node names to be generic, we therefore >> provide a helper to generate a unique clock name from the DT node name >> plus reg property or a magic number instead. This is basically the same >> we already do for proper devices and may vanish as soon as there is some >> (early) device support for clocks available. >> >> Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> [...] >> diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c >> index dff0373f53c1..b449a635dbfa 100644 >> --- a/drivers/clk/clk.c >> +++ b/drivers/clk/clk.c >> @@ -17,6 +17,7 @@ >> #include <linux/list.h> >> #include <linux/slab.h> >> #include <linux/of.h> >> +#include <linux/of_address.h> >> #include <linux/device.h> >> #include <linux/init.h> >> #include <linux/sched.h> >> @@ -2543,6 +2544,34 @@ const char *of_clk_get_parent_name(struct device_node *np, int index) >> } >> EXPORT_SYMBOL_GPL(of_clk_get_parent_name); >> >> +/** >> + * of_clk_create_name() - Allocate and create a unique clock name >> + * @np: Device node pointer of the clock node >> + * >> + * This will allocate and create a unique clock name based on the >> + * reg property value. As a last resort, it will use the node name >> + * followed by a unique number. The caller has to deallocate the >> + * buffer. >> + */ >> +char *of_clk_create_name(struct device_node *np) >> +{ >> + static atomic_t clk_no_reg_magic; >> + const __be32 *reg; >> + u64 addr; >> + int magic; >> + >> + reg = of_get_property(np, "reg", NULL); >> + if (reg) { >> + addr = of_translate_address(np, reg); >> + return kasprintf(GFP_KERNEL, "%llx.%s", >> + (unsigned long long)addr, np->name); >> + } >> + >> + magic = atomic_add_return(1, &clk_no_reg_magic); >> + return kasprintf(GFP_KERNEL, "%s.%d", np->name, magic); > > For the case where we the reg property is present we use reg.name, but > for the case were the reg property is missing we use name.magic. Is it > intentional to switch the string and integer pairs? > > Doing so avoids the case where magic might collide with a simple bus > clock (e.g. 'clk@1'), but I wanted to double check that it was > intentional. Mike, yes it is intentional and copies what is done for platform_device names. Unfortunately, as much as I prefer this patch someday, it doesn't work with the rest of the helpers as expected. While this can generate unique and generic clock names, especially of_clk_get_parent_name() picks either an clock-output-names named clock _or_ the node name ignoring the above auto-generated name of course. If you agree with the general approach here, we should still postpone this for the next cycle when I have more time to look at the details. I prefer to rename the nodes and use clock-output-names where required for the Berlin clock nodes now. Sebastian >> +} >> +EXPORT_SYMBOL_GPL(of_clk_create_name); >> + >> struct clock_provider { >> of_clk_init_cb_t clk_init_cb; >> struct device_node *np; >> diff --git a/include/linux/clk-provider.h b/include/linux/clk-provider.h >> index 511917416fb0..c6f3ca1cd81c 100644 >> --- a/include/linux/clk-provider.h >> +++ b/include/linux/clk-provider.h >> @@ -514,6 +514,7 @@ struct clk *of_clk_src_simple_get(struct of_phandle_args *clkspec, >> struct clk *of_clk_src_onecell_get(struct of_phandle_args *clkspec, void *data); >> int of_clk_get_parent_count(struct device_node *np); >> const char *of_clk_get_parent_name(struct device_node *np, int index); >> +char *of_clk_create_name(struct device_node *np); >> >> void of_clk_init(const struct of_device_id *matches); >> >> @@ -543,6 +544,10 @@ static inline const char *of_clk_get_parent_name(struct device_node *np, >> { >> return NULL; >> } >> +static inline char *of_clk_create_name(struct device_node *np) >> +{ >> + return NULL; >> +} >> #define of_clk_init(matches) \ >> { while (0); } >> #endif /* CONFIG_OF */ >> -- >> 1.9.1 >> -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH 1/8] clk: add helper for unique DT clock names 2014-05-13 20:19 ` Sebastian Hesselbarth @ 2014-05-13 20:51 ` Mike Turquette 2014-05-13 21:25 ` Sebastian Hesselbarth 0 siblings, 1 reply; 24+ messages in thread From: Mike Turquette @ 2014-05-13 20:51 UTC (permalink / raw) To: Sebastian Hesselbarth Cc: devicetree, Antoine Tenart, linux-kernel, Rob Herring, Alexandre Belloni, Grant Likely, linux-arm-kernel Quoting Sebastian Hesselbarth (2014-05-13 13:19:58) > On 05/13/2014 09:49 PM, Mike Turquette wrote: > > Quoting Sebastian Hesselbarth (2014-05-11 13:24:34) > >> Currently, most DT clock drivers pick a unique node name to allow unique > >> clock names. As ePAPR recommends node names to be generic, we therefore > >> provide a helper to generate a unique clock name from the DT node name > >> plus reg property or a magic number instead. This is basically the same > >> we already do for proper devices and may vanish as soon as there is some > >> (early) device support for clocks available. > >> > >> Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com> > [...] > >> diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c > >> index dff0373f53c1..b449a635dbfa 100644 > >> --- a/drivers/clk/clk.c > >> +++ b/drivers/clk/clk.c > >> @@ -17,6 +17,7 @@ > >> #include <linux/list.h> > >> #include <linux/slab.h> > >> #include <linux/of.h> > >> +#include <linux/of_address.h> > >> #include <linux/device.h> > >> #include <linux/init.h> > >> #include <linux/sched.h> > >> @@ -2543,6 +2544,34 @@ const char *of_clk_get_parent_name(struct device_node *np, int index) > >> } > >> EXPORT_SYMBOL_GPL(of_clk_get_parent_name); > >> > >> +/** > >> + * of_clk_create_name() - Allocate and create a unique clock name > >> + * @np: Device node pointer of the clock node > >> + * > >> + * This will allocate and create a unique clock name based on the > >> + * reg property value. As a last resort, it will use the node name > >> + * followed by a unique number. The caller has to deallocate the > >> + * buffer. > >> + */ > >> +char *of_clk_create_name(struct device_node *np) > >> +{ > >> + static atomic_t clk_no_reg_magic; > >> + const __be32 *reg; > >> + u64 addr; > >> + int magic; > >> + > >> + reg = of_get_property(np, "reg", NULL); > >> + if (reg) { > >> + addr = of_translate_address(np, reg); > >> + return kasprintf(GFP_KERNEL, "%llx.%s", > >> + (unsigned long long)addr, np->name); > >> + } > >> + > >> + magic = atomic_add_return(1, &clk_no_reg_magic); > >> + return kasprintf(GFP_KERNEL, "%s.%d", np->name, magic); > > > > For the case where we the reg property is present we use reg.name, but > > for the case were the reg property is missing we use name.magic. Is it > > intentional to switch the string and integer pairs? > > > > Doing so avoids the case where magic might collide with a simple bus > > clock (e.g. 'clk@1'), but I wanted to double check that it was > > intentional. > > Mike, > > yes it is intentional and copies what is done for platform_device names. > > Unfortunately, as much as I prefer this patch someday, it doesn't work > with the rest of the helpers as expected. While this can generate unique > and generic clock names, especially of_clk_get_parent_name() picks > either an clock-output-names named clock _or_ the node name ignoring the > above auto-generated name of course. > > If you agree with the general approach here, we should still postpone > this for the next cycle when I have more time to look at the details. > I prefer to rename the nodes and use clock-output-names where required > for the Berlin clock nodes now. Yes, that sounds fine. I'd also like the DT maintainers to take a look at this and weigh in. Thanks, Mike > > Sebastian > > >> +} > >> +EXPORT_SYMBOL_GPL(of_clk_create_name); > >> + > >> struct clock_provider { > >> of_clk_init_cb_t clk_init_cb; > >> struct device_node *np; > >> diff --git a/include/linux/clk-provider.h b/include/linux/clk-provider.h > >> index 511917416fb0..c6f3ca1cd81c 100644 > >> --- a/include/linux/clk-provider.h > >> +++ b/include/linux/clk-provider.h > >> @@ -514,6 +514,7 @@ struct clk *of_clk_src_simple_get(struct of_phandle_args *clkspec, > >> struct clk *of_clk_src_onecell_get(struct of_phandle_args *clkspec, void *data); > >> int of_clk_get_parent_count(struct device_node *np); > >> const char *of_clk_get_parent_name(struct device_node *np, int index); > >> +char *of_clk_create_name(struct device_node *np); > >> > >> void of_clk_init(const struct of_device_id *matches); > >> > >> @@ -543,6 +544,10 @@ static inline const char *of_clk_get_parent_name(struct device_node *np, > >> { > >> return NULL; > >> } > >> +static inline char *of_clk_create_name(struct device_node *np) > >> +{ > >> + return NULL; > >> +} > >> #define of_clk_init(matches) \ > >> { while (0); } > >> #endif /* CONFIG_OF */ > >> -- > >> 1.9.1 > >> > ^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH 1/8] clk: add helper for unique DT clock names 2014-05-13 20:51 ` Mike Turquette @ 2014-05-13 21:25 ` Sebastian Hesselbarth 0 siblings, 0 replies; 24+ messages in thread From: Sebastian Hesselbarth @ 2014-05-13 21:25 UTC (permalink / raw) To: Mike Turquette Cc: Grant Likely, Rob Herring, Alexandre Belloni, Antoine Tenart, devicetree-u79uwXL29TY76Z2rM5mHXA, linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r, linux-kernel-u79uwXL29TY76Z2rM5mHXA On 05/13/2014 10:51 PM, Mike Turquette wrote: > Quoting Sebastian Hesselbarth (2014-05-13 13:19:58) >> On 05/13/2014 09:49 PM, Mike Turquette wrote: >>> Quoting Sebastian Hesselbarth (2014-05-11 13:24:34) >>>> Currently, most DT clock drivers pick a unique node name to allow unique >>>> clock names. As ePAPR recommends node names to be generic, we therefore >>>> provide a helper to generate a unique clock name from the DT node name >>>> plus reg property or a magic number instead. This is basically the same >>>> we already do for proper devices and may vanish as soon as there is some >>>> (early) device support for clocks available. >>>> >>>> Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> >> [...] >>>> diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c >>>> index dff0373f53c1..b449a635dbfa 100644 >>>> --- a/drivers/clk/clk.c >>>> +++ b/drivers/clk/clk.c >>>> @@ -17,6 +17,7 @@ >>>> #include <linux/list.h> >>>> #include <linux/slab.h> >>>> #include <linux/of.h> >>>> +#include <linux/of_address.h> >>>> #include <linux/device.h> >>>> #include <linux/init.h> >>>> #include <linux/sched.h> >>>> @@ -2543,6 +2544,34 @@ const char *of_clk_get_parent_name(struct device_node *np, int index) >>>> } >>>> EXPORT_SYMBOL_GPL(of_clk_get_parent_name); >>>> >>>> +/** >>>> + * of_clk_create_name() - Allocate and create a unique clock name >>>> + * @np: Device node pointer of the clock node >>>> + * >>>> + * This will allocate and create a unique clock name based on the >>>> + * reg property value. As a last resort, it will use the node name >>>> + * followed by a unique number. The caller has to deallocate the >>>> + * buffer. >>>> + */ >>>> +char *of_clk_create_name(struct device_node *np) >>>> +{ >>>> + static atomic_t clk_no_reg_magic; >>>> + const __be32 *reg; >>>> + u64 addr; >>>> + int magic; >>>> + >>>> + reg = of_get_property(np, "reg", NULL); >>>> + if (reg) { >>>> + addr = of_translate_address(np, reg); >>>> + return kasprintf(GFP_KERNEL, "%llx.%s", >>>> + (unsigned long long)addr, np->name); >>>> + } >>>> + >>>> + magic = atomic_add_return(1, &clk_no_reg_magic); >>>> + return kasprintf(GFP_KERNEL, "%s.%d", np->name, magic); >>> >>> For the case where we the reg property is present we use reg.name, but >>> for the case were the reg property is missing we use name.magic. Is it >>> intentional to switch the string and integer pairs? >>> >>> Doing so avoids the case where magic might collide with a simple bus >>> clock (e.g. 'clk@1'), but I wanted to double check that it was >>> intentional. >> >> Mike, >> >> yes it is intentional and copies what is done for platform_device names. >> >> Unfortunately, as much as I prefer this patch someday, it doesn't work >> with the rest of the helpers as expected. While this can generate unique >> and generic clock names, especially of_clk_get_parent_name() picks >> either an clock-output-names named clock _or_ the node name ignoring the >> above auto-generated name of course. >> >> If you agree with the general approach here, we should still postpone >> this for the next cycle when I have more time to look at the details. >> I prefer to rename the nodes and use clock-output-names where required >> for the Berlin clock nodes now. > > Yes, that sounds fine. I'd also like the DT maintainers to take a look > at this and weigh in. Ok, great! So, I drop the of_clk_create_name() for the Berlin clock drivers now and send a v2 with some bugs fixed. I also received the requested BG2Q dtsi changes and tests from Alexandre. Will pick up the DT clock naming issues next cycle then. Would be good to get some remarks from the DT maintainers in the meantime. Sebastian >>>> +} >>>> +EXPORT_SYMBOL_GPL(of_clk_create_name); >>>> + >>>> struct clock_provider { >>>> of_clk_init_cb_t clk_init_cb; >>>> struct device_node *np; >>>> diff --git a/include/linux/clk-provider.h b/include/linux/clk-provider.h >>>> index 511917416fb0..c6f3ca1cd81c 100644 >>>> --- a/include/linux/clk-provider.h >>>> +++ b/include/linux/clk-provider.h >>>> @@ -514,6 +514,7 @@ struct clk *of_clk_src_simple_get(struct of_phandle_args *clkspec, >>>> struct clk *of_clk_src_onecell_get(struct of_phandle_args *clkspec, void *data); >>>> int of_clk_get_parent_count(struct device_node *np); >>>> const char *of_clk_get_parent_name(struct device_node *np, int index); >>>> +char *of_clk_create_name(struct device_node *np); >>>> >>>> void of_clk_init(const struct of_device_id *matches); >>>> >>>> @@ -543,6 +544,10 @@ static inline const char *of_clk_get_parent_name(struct device_node *np, >>>> { >>>> return NULL; >>>> } >>>> +static inline char *of_clk_create_name(struct device_node *np) >>>> +{ >>>> + return NULL; >>>> +} >>>> #define of_clk_init(matches) \ >>>> { while (0); } >>>> #endif /* CONFIG_OF */ >>>> -- >>>> 1.9.1 >>>> >> -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply [flat|nested] 24+ messages in thread
* [PATCH 2/8] clk: berlin: add clock binding docs for Marvell Berlin2 SoCs 2014-05-11 20:24 [PATCH 0/8] Marvell Berlin full clock support Sebastian Hesselbarth [not found] ` <1399839881-29895-1-git-send-email-sebastian.hesselbarth-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> @ 2014-05-11 20:24 ` Sebastian Hesselbarth 2014-05-13 8:38 ` Sebastian Hesselbarth ` (2 more replies) 2014-05-11 20:24 ` [PATCH 7/8] ARM: dts: berlin: convert BG2CD to DT clock nodes Sebastian Hesselbarth ` (2 subsequent siblings) 4 siblings, 3 replies; 24+ messages in thread From: Sebastian Hesselbarth @ 2014-05-11 20:24 UTC (permalink / raw) To: Sebastian Hesselbarth Cc: Mike Turquette, Rob Herring, Pawel Moll, Mark Rutland, Ian Campbell, Kumar Gala, Randy Dunlap, Alexandre Belloni, Antoine Tenart, devicetree, linux-doc, linux-arm-kernel, linux-kernel This adds mandatory device tree binding documentation for the clock related IP found on Marvell Berlin2 (BG2, BG2CD, and BG2Q) SoCs. Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com> --- Cc: Mike Turquette <mturquette@linaro.org> Cc: Rob Herring <robh+dt@kernel.org> Cc: Pawel Moll <pawel.moll@arm.com> Cc: Mark Rutland <mark.rutland@arm.com> Cc: Ian Campbell <ijc+devicetree@hellion.org.uk> Cc: Kumar Gala <galak@codeaurora.org> Cc: Randy Dunlap <rdunlap@infradead.org> Cc: Alexandre Belloni <alexandre.belloni@free-electrons.com> Cc: Antoine Tenart <antoine.tenart@free-electrons.com> Cc: devicetree@vger.kernel.org Cc: linux-doc@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org --- .../devicetree/bindings/clock/berlin2-clock.txt | 169 +++++++++++++++++++++ 1 file changed, 169 insertions(+) create mode 100644 Documentation/devicetree/bindings/clock/berlin2-clock.txt diff --git a/Documentation/devicetree/bindings/clock/berlin2-clock.txt b/Documentation/devicetree/bindings/clock/berlin2-clock.txt new file mode 100644 index 000000000000..3da87a488402 --- /dev/null +++ b/Documentation/devicetree/bindings/clock/berlin2-clock.txt @@ -0,0 +1,169 @@ +* Marvell Berlin2 clock bindings + +Marvell Berlin2 (BG2, BG2CD, BG2Q) share the same IP for PLLs and clocks, +with some minor differences in features and register layout. The below +describes the individual clock related IP: + +* Audio/Video PLL + +The Audio/Video PLL (AVPLL) is a dual-VCO PLL with 8 channels each. Each +of the VCOs can sythesize a single VCO frequency based on a single input +reference clock. Each of the 8 channels then, can derive an output clock +from that VCO frequency by various dividers/multipliers. + +Required properties: +- compatible: shall be "marvell,berlin2-avpll" +- reg: address and length of the corresponding AVPLL registers +- #clock-cells: shall be set to 2 +- clocks: single clock specifier referencing the AVPLL input clock + +To ease match-up with the desired AVPLL output clock, clock specifiers +referencing AVPLL clocks shall contain two cells. The first refers to +the VCO (0=AVPLL_A, 1=AVPLL_B) while the second refers to the corresponding +channel starting with 1. For example, to reference AVPLL_B3 the clock +specifier shall be: <&avpll 1 3>. + +Example: + +avpll: pll@ea0040 { + compatible = "marvell,berlin2-avpll"; + #clock-cells = <2>; + reg = <0xea0050 0x100>; + clocks = <&refclk>; +}; + +* Simple PLLs + +Simple PLLs are memory mapped PLLs that can sythesize a single output clock +based on a single input reference clock. + +Required properties: +- compatible: shall be one of the following: + "marvell,berlin2-pll" for Berlin BG2/BG2CD PLLs + "marvell,berlin2q-pll" for Berlin BG2Q PLLs +- reg: address and length of the corresponding PLL registers +- #clock-cells: shall be set to 0 +- clocks: single clock specifier referencing the PLL input clock + +Example: + +cpupll: pll@ea003c { + compatible = "marvell,berlin2-pll"; + #clock-cells = <0>; + reg = <0xea003c 0x14>; + clocks = <&refclk>; +}; + +* Single-register clock dividers + +Single-register clock dividers are complex divider cells, allowing +to divide a reference clock with a set of fixed dividers. Also they +comprise and input clock mux with bypass and an ouput clock gate. + +Required properties: +- compatible: shall be "marvell,berlin2-clk-div" +- reg: address and length of the corresponding DIV registers +- #clock-cells: shall be set to 0 +- clocks: clock specifiers referencing the DIV input clocks +- clock-names: array of strings describing the clock specifiers above. + Allowed clock-names are "mux_bypass" for the clock mux bypass selection + and "muxN" (N=0..7) for each of the 8 possible clock mux inputs. + +Example: + +gfx3dcore_clk: clock@ea022c { + compatible = "marvell,berlin2-clk-div"; + #clock-cells = <0>; + reg = <0xea0022c 0x4>; + clocks = <&syspll>, + <&avpll AVPLL_B 4>, <&avpll AVPLL_B 5>, + <&avpll AVPLL_B 6>, <&avpll AVPLL_B 7>; + clock-names = "mux_bypass", + "mux0", "mux1", "mux2", "mux3"; +}; + +* SoC-specific core clocks + +In addition to the above, there is a register set dealing with SoC +specific clock dividers, muxes, and gates. There is also the complex +divider cell used above, but instead of independent registers, they +share a common set of registers. The core clocks are represented by +a single DT node providing access to the remaining clocks. + +Required properties: +- compatible: shall be one of + "marvell,berlin2-core-clocks" for BG2/BG2CD SoCs + "marvell,berlin2q-core-clocks" for BG2Q SoCs +- reg: address and length of the corresponding clock registers +- #clock-cells: shall be set to 1 +- clocks: clock specifiers referencing the core clock input clocks +- clock-names: array of strings describing the clock specifiers above. + Allowed clock-names for the reference clocks are + "refclk", "syspll", "mempll", "cpupll" + also Audio/Video PLL clocks shall be named with + "avpll_VN" (V=0...1 for AVPLL_A and AVPLL_B, N=1..8 for the + corresponding reference input from AVPLL). + +Optional properties for BG2/BG2CD SoCs: +- clocks/clock-names: in addition to the allowed clock names above, + there is an external video clock input that shall be named "video_ext0". + +Clocks provided by core clocks shall be referenced by a clock specifier +indexing one of the provided clocks. A SoC-specific list of available clocks +is below the example. + +Example: +coreclk: clock@ea0150 { + compatible = "marvell,berlin2-core-clocks"; + #clock-cells = <1>; + reg = <0xea0150 0x1c>; + clocks = <&refclk>, <&syspll>, <&mempll>, <&cpupll>, + <&avpll 0 1>, <&avpll 0 2>, + <&avpll 0 3>, <&avpll 0 4>, + <&avpll 0 5>, <&avpll 0 6>, + <&avpll 0 7>, <&avpll 0 8>, + <&avpll 1 1>, <&avpll 1 2>, + <&avpll 1 3>, <&avpll 1 4>, + <&avpll 1 5>, <&avpll 1 6>, + <&avpll 1 7>, <&avpll 1 8>, + <&externalvideoclk>; + clock-names = "refclk", "syspll", "mempll", "cpupll", + "avpll_a1", "avpll_a2", "avpll_a3", "avpll_a4", + "avpll_a5", "avpll_a6", "avpll_a7", "avpll_a8", + "avpll_b1", "avpll_b2", "avpll_b3", "avpll_b4", + "avpll_b5", "avpll_b6", "avpll_b7", "avpll_b8", + "video_ext0"; +}; + +* BG2/BG2CD core clock indicies: +0 - SYS +1 - CPU +2 - DRMFIGO +3 - CFG +4 - GFX +5 - ZSP +6 - PERIF +7 - PCUBE +8 - VSCOPE +9 - NFC_ECC +10 - VPP +11 - APP +12 - AUDIO0 +23 - AUDIO2 +14 - AUDIO3 +15 - AUDIO1 +16 - GETH0 +17 - GETH1 +18 - SATA +19 - AHBAPB +20 - USB0 +21 - USB1 +22 - PBRIDGE +23 - SDIO0 +24 - SDIO1 +25 - NFC +26 - SMEMC +27 - AUDIOHD +28 - VIDEO0 +29 - VIDEO1 +30 - VIDEO2 -- 1.9.1 ^ permalink raw reply related [flat|nested] 24+ messages in thread
* Re: [PATCH 2/8] clk: berlin: add clock binding docs for Marvell Berlin2 SoCs 2014-05-11 20:24 ` [PATCH 2/8] clk: berlin: add clock binding docs for Marvell Berlin2 SoCs Sebastian Hesselbarth @ 2014-05-13 8:38 ` Sebastian Hesselbarth 2014-05-13 14:47 ` Alexandre Belloni 2014-05-14 22:32 ` Mike Turquette 2 siblings, 0 replies; 24+ messages in thread From: Sebastian Hesselbarth @ 2014-05-13 8:38 UTC (permalink / raw) Cc: Mike Turquette, Rob Herring, Pawel Moll, Mark Rutland, Ian Campbell, Kumar Gala, Randy Dunlap, Alexandre Belloni, Antoine Tenart, devicetree, linux-doc, linux-arm-kernel, linux-kernel On 05/11/2014 10:24 PM, Sebastian Hesselbarth wrote: > This adds mandatory device tree binding documentation for the clock related > IP found on Marvell Berlin2 (BG2, BG2CD, and BG2Q) SoCs. > > Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com> > --- > Cc: Mike Turquette <mturquette@linaro.org> > Cc: Rob Herring <robh+dt@kernel.org> > Cc: Pawel Moll <pawel.moll@arm.com> > Cc: Mark Rutland <mark.rutland@arm.com> > Cc: Ian Campbell <ijc+devicetree@hellion.org.uk> > Cc: Kumar Gala <galak@codeaurora.org> > Cc: Randy Dunlap <rdunlap@infradead.org> > Cc: Alexandre Belloni <alexandre.belloni@free-electrons.com> > Cc: Antoine Tenart <antoine.tenart@free-electrons.com> > Cc: devicetree@vger.kernel.org > Cc: linux-doc@vger.kernel.org > Cc: linux-arm-kernel@lists.infradead.org > Cc: linux-kernel@vger.kernel.org > --- > .../devicetree/bindings/clock/berlin2-clock.txt | 169 +++++++++++++++++++++ > 1 file changed, 169 insertions(+) > create mode 100644 Documentation/devicetree/bindings/clock/berlin2-clock.txt > > diff --git a/Documentation/devicetree/bindings/clock/berlin2-clock.txt b/Documentation/devicetree/bindings/clock/berlin2-clock.txt > new file mode 100644 > index 000000000000..3da87a488402 > --- /dev/null > +++ b/Documentation/devicetree/bindings/clock/berlin2-clock.txt > @@ -0,0 +1,169 @@ > +* Marvell Berlin2 clock bindings > + > +Marvell Berlin2 (BG2, BG2CD, BG2Q) share the same IP for PLLs and clocks, > +with some minor differences in features and register layout. The below > +describes the individual clock related IP: > + > +* Audio/Video PLL > + > +The Audio/Video PLL (AVPLL) is a dual-VCO PLL with 8 channels each. Each > +of the VCOs can sythesize a single VCO frequency based on a single input > +reference clock. Each of the 8 channels then, can derive an output clock > +from that VCO frequency by various dividers/multipliers. > + > +Required properties: > +- compatible: shall be "marvell,berlin2-avpll" > +- reg: address and length of the corresponding AVPLL registers > +- #clock-cells: shall be set to 2 > +- clocks: single clock specifier referencing the AVPLL input clock > + > +To ease match-up with the desired AVPLL output clock, clock specifiers > +referencing AVPLL clocks shall contain two cells. The first refers to > +the VCO (0=AVPLL_A, 1=AVPLL_B) while the second refers to the corresponding > +channel starting with 1. For example, to reference AVPLL_B3 the clock > +specifier shall be: <&avpll 1 3>. > + > +Example: > + > +avpll: pll@ea0040 { > + compatible = "marvell,berlin2-avpll"; > + #clock-cells = <2>; > + reg = <0xea0050 0x100>; > + clocks = <&refclk>; > +}; > + > +* Simple PLLs > + > +Simple PLLs are memory mapped PLLs that can sythesize a single output clock > +based on a single input reference clock. > + > +Required properties: > +- compatible: shall be one of the following: > + "marvell,berlin2-pll" for Berlin BG2/BG2CD PLLs > + "marvell,berlin2q-pll" for Berlin BG2Q PLLs > +- reg: address and length of the corresponding PLL registers > +- #clock-cells: shall be set to 0 > +- clocks: single clock specifier referencing the PLL input clock > + > +Example: > + > +cpupll: pll@ea003c { > + compatible = "marvell,berlin2-pll"; > + #clock-cells = <0>; > + reg = <0xea003c 0x14>; > + clocks = <&refclk>; > +}; > + > +* Single-register clock dividers > + > +Single-register clock dividers are complex divider cells, allowing > +to divide a reference clock with a set of fixed dividers. Also they > +comprise and input clock mux with bypass and an ouput clock gate. > + > +Required properties: > +- compatible: shall be "marvell,berlin2-clk-div" > +- reg: address and length of the corresponding DIV registers > +- #clock-cells: shall be set to 0 > +- clocks: clock specifiers referencing the DIV input clocks > +- clock-names: array of strings describing the clock specifiers above. > + Allowed clock-names are "mux_bypass" for the clock mux bypass selection > + and "muxN" (N=0..7) for each of the 8 possible clock mux inputs. > + > +Example: > + > +gfx3dcore_clk: clock@ea022c { > + compatible = "marvell,berlin2-clk-div"; Actually using the clock driver for SDHCI IP revealed some issues already. Above compatible should have been "marvell,berlin2-div". I'll fix it up for v2. Also, the commit msg should start with 'dt-binding: clk:' I guess. Sebastian > + #clock-cells = <0>; > + reg = <0xea0022c 0x4>; > + clocks = <&syspll>, > + <&avpll AVPLL_B 4>, <&avpll AVPLL_B 5>, > + <&avpll AVPLL_B 6>, <&avpll AVPLL_B 7>; > + clock-names = "mux_bypass", > + "mux0", "mux1", "mux2", "mux3"; > +}; > + > +* SoC-specific core clocks > + > +In addition to the above, there is a register set dealing with SoC > +specific clock dividers, muxes, and gates. There is also the complex > +divider cell used above, but instead of independent registers, they > +share a common set of registers. The core clocks are represented by > +a single DT node providing access to the remaining clocks. > + > +Required properties: > +- compatible: shall be one of > + "marvell,berlin2-core-clocks" for BG2/BG2CD SoCs > + "marvell,berlin2q-core-clocks" for BG2Q SoCs > +- reg: address and length of the corresponding clock registers > +- #clock-cells: shall be set to 1 > +- clocks: clock specifiers referencing the core clock input clocks > +- clock-names: array of strings describing the clock specifiers above. > + Allowed clock-names for the reference clocks are > + "refclk", "syspll", "mempll", "cpupll" > + also Audio/Video PLL clocks shall be named with > + "avpll_VN" (V=0...1 for AVPLL_A and AVPLL_B, N=1..8 for the > + corresponding reference input from AVPLL). > + > +Optional properties for BG2/BG2CD SoCs: > +- clocks/clock-names: in addition to the allowed clock names above, > + there is an external video clock input that shall be named "video_ext0". > + > +Clocks provided by core clocks shall be referenced by a clock specifier > +indexing one of the provided clocks. A SoC-specific list of available clocks > +is below the example. > + > +Example: > +coreclk: clock@ea0150 { > + compatible = "marvell,berlin2-core-clocks"; > + #clock-cells = <1>; > + reg = <0xea0150 0x1c>; > + clocks = <&refclk>, <&syspll>, <&mempll>, <&cpupll>, > + <&avpll 0 1>, <&avpll 0 2>, > + <&avpll 0 3>, <&avpll 0 4>, > + <&avpll 0 5>, <&avpll 0 6>, > + <&avpll 0 7>, <&avpll 0 8>, > + <&avpll 1 1>, <&avpll 1 2>, > + <&avpll 1 3>, <&avpll 1 4>, > + <&avpll 1 5>, <&avpll 1 6>, > + <&avpll 1 7>, <&avpll 1 8>, > + <&externalvideoclk>; > + clock-names = "refclk", "syspll", "mempll", "cpupll", > + "avpll_a1", "avpll_a2", "avpll_a3", "avpll_a4", > + "avpll_a5", "avpll_a6", "avpll_a7", "avpll_a8", > + "avpll_b1", "avpll_b2", "avpll_b3", "avpll_b4", > + "avpll_b5", "avpll_b6", "avpll_b7", "avpll_b8", > + "video_ext0"; > +}; > + > +* BG2/BG2CD core clock indicies: > +0 - SYS > +1 - CPU > +2 - DRMFIGO > +3 - CFG > +4 - GFX > +5 - ZSP > +6 - PERIF > +7 - PCUBE > +8 - VSCOPE > +9 - NFC_ECC > +10 - VPP > +11 - APP > +12 - AUDIO0 > +23 - AUDIO2 > +14 - AUDIO3 > +15 - AUDIO1 > +16 - GETH0 > +17 - GETH1 > +18 - SATA > +19 - AHBAPB > +20 - USB0 > +21 - USB1 > +22 - PBRIDGE > +23 - SDIO0 > +24 - SDIO1 > +25 - NFC > +26 - SMEMC > +27 - AUDIOHD > +28 - VIDEO0 > +29 - VIDEO1 > +30 - VIDEO2 > ^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH 2/8] clk: berlin: add clock binding docs for Marvell Berlin2 SoCs 2014-05-11 20:24 ` [PATCH 2/8] clk: berlin: add clock binding docs for Marvell Berlin2 SoCs Sebastian Hesselbarth 2014-05-13 8:38 ` Sebastian Hesselbarth @ 2014-05-13 14:47 ` Alexandre Belloni 2014-05-14 22:32 ` Mike Turquette 2 siblings, 0 replies; 24+ messages in thread From: Alexandre Belloni @ 2014-05-13 14:47 UTC (permalink / raw) To: Sebastian Hesselbarth Cc: Mike Turquette, Rob Herring, Pawel Moll, Mark Rutland, Ian Campbell, Kumar Gala, Randy Dunlap, Antoine Tenart, devicetree, linux-doc, linux-arm-kernel, linux-kernel Hi, Not much to say, On 11/05/2014 at 22:24:35 +0200, Sebastian Hesselbarth wrote : > +* Single-register clock dividers > + > +Single-register clock dividers are complex divider cells, allowing > +to divide a reference clock with a set of fixed dividers. Also they > +comprise and input clock mux with bypass and an ouput clock gate. typo here-----^ > + > +Required properties: > +- compatible: shall be "marvell,berlin2-clk-div" > +- reg: address and length of the corresponding DIV registers > +- #clock-cells: shall be set to 0 > +- clocks: clock specifiers referencing the DIV input clocks > +- clock-names: array of strings describing the clock specifiers above. > + Allowed clock-names are "mux_bypass" for the clock mux bypass selection > + and "muxN" (N=0..7) for each of the 8 possible clock mux inputs. > + -- Alexandre Belloni, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com ^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH 2/8] clk: berlin: add clock binding docs for Marvell Berlin2 SoCs 2014-05-11 20:24 ` [PATCH 2/8] clk: berlin: add clock binding docs for Marvell Berlin2 SoCs Sebastian Hesselbarth 2014-05-13 8:38 ` Sebastian Hesselbarth 2014-05-13 14:47 ` Alexandre Belloni @ 2014-05-14 22:32 ` Mike Turquette 2014-05-14 23:17 ` Sebastian Hesselbarth 2 siblings, 1 reply; 24+ messages in thread From: Mike Turquette @ 2014-05-14 22:32 UTC (permalink / raw) To: Sebastian Hesselbarth Cc: Rob Herring, Pawel Moll, Mark Rutland, Ian Campbell, Kumar Gala, Randy Dunlap, Alexandre Belloni, Antoine Tenart, devicetree, linux-doc, linux-arm-kernel, linux-kernel Quoting Sebastian Hesselbarth (2014-05-11 13:24:35) > This adds mandatory device tree binding documentation for the clock related > IP found on Marvell Berlin2 (BG2, BG2CD, and BG2Q) SoCs. > > Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com> > --- > Cc: Mike Turquette <mturquette@linaro.org> > Cc: Rob Herring <robh+dt@kernel.org> > Cc: Pawel Moll <pawel.moll@arm.com> > Cc: Mark Rutland <mark.rutland@arm.com> > Cc: Ian Campbell <ijc+devicetree@hellion.org.uk> > Cc: Kumar Gala <galak@codeaurora.org> > Cc: Randy Dunlap <rdunlap@infradead.org> > Cc: Alexandre Belloni <alexandre.belloni@free-electrons.com> > Cc: Antoine Tenart <antoine.tenart@free-electrons.com> > Cc: devicetree@vger.kernel.org > Cc: linux-doc@vger.kernel.org > Cc: linux-arm-kernel@lists.infradead.org > Cc: linux-kernel@vger.kernel.org > --- > .../devicetree/bindings/clock/berlin2-clock.txt | 169 +++++++++++++++++++++ > 1 file changed, 169 insertions(+) > create mode 100644 Documentation/devicetree/bindings/clock/berlin2-clock.txt > > diff --git a/Documentation/devicetree/bindings/clock/berlin2-clock.txt b/Documentation/devicetree/bindings/clock/berlin2-clock.txt > new file mode 100644 > index 000000000000..3da87a488402 > --- /dev/null > +++ b/Documentation/devicetree/bindings/clock/berlin2-clock.txt > @@ -0,0 +1,169 @@ > +* Marvell Berlin2 clock bindings > + > +Marvell Berlin2 (BG2, BG2CD, BG2Q) share the same IP for PLLs and clocks, > +with some minor differences in features and register layout. The below > +describes the individual clock related IP: > + > +* Audio/Video PLL > + > +The Audio/Video PLL (AVPLL) is a dual-VCO PLL with 8 channels each. Each > +of the VCOs can sythesize a single VCO frequency based on a single input > +reference clock. Each of the 8 channels then, can derive an output clock > +from that VCO frequency by various dividers/multipliers. > + > +Required properties: > +- compatible: shall be "marvell,berlin2-avpll" > +- reg: address and length of the corresponding AVPLL registers > +- #clock-cells: shall be set to 2 > +- clocks: single clock specifier referencing the AVPLL input clock > + > +To ease match-up with the desired AVPLL output clock, clock specifiers > +referencing AVPLL clocks shall contain two cells. The first refers to > +the VCO (0=AVPLL_A, 1=AVPLL_B) while the second refers to the corresponding > +channel starting with 1. For example, to reference AVPLL_B3 the clock > +specifier shall be: <&avpll 1 3>. > + > +Example: > + > +avpll: pll@ea0040 { > + compatible = "marvell,berlin2-avpll"; > + #clock-cells = <2>; > + reg = <0xea0050 0x100>; > + clocks = <&refclk>; > +}; Hi Sebastian, Thanks for submitting the series. It looks good. I do have some comments about the DT bindings though. I'm encouraging new bindings (and especially new platforms or existing platforms that are only now converting over to CCF) to not put their per-clock data into DTS. This has scalability problems, is unpopular with the DT crowd and sometimes makes it hard to do things like set CLK_SET_RATE_PARENT flags for individual clocks. The following is a copy/paste from an email I sent earlier today[1]. Of course per-clock data makes great sense if you have an off-SoC clock such as a fixed-rate oscillator (e.g. the fixed-clock binding). Let me know what you think: I assume the rest of your clocks are part of a clock generator IP block inside of your chip. Have you looked at the QCOM binding? It is my favorite binding these days. Here are some highlights: See Documentation/devicetree/bindings/clock/qcom,gcc.txt. >From arch/arm/boot/dts/qcom-msm8974.dtsi: gcc: clock-controller@fc400000 { compatible = "qcom,gcc-msm8974"; #clock-cells = <1>; #reset-cells = <1>; reg = <0xfc400000 0x4000>; }; ... serial@f991e000 { compatible = "qcom,msm-uartdm-v1.4", "qcom,msm-uartdm"; reg = <0xf991e000 0x1000>; interrupts = <0 108 0x0>; clocks = <&gcc GCC_BLSP1_UART2_APPS_CLK>, <&gcc GCC_BLSP1_AHB_CLK>; clock-names = "core", "iface"; }; >From drivers/clk/qcom/gcc-msm8974.c: static struct clk_branch gcc_blsp1_uart2_apps_clk = { .halt_reg = 0x0704, .clkr = { .enable_reg = 0x0704, .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_blsp1_uart2_apps_clk", .parent_names = (const char *[]){ "blsp1_uart2_apps_clk_src", }, .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, }, }, }; Using this type of binding you only need to declare your clock generator IP node in dts, and then define a mapping in the DT include chroot. Then you can define your per-clock data inside of your clock driver instead of putting all of the details inside of DT. If you have a strong reason to do it the way that you originally posted then let me know. Regards, Mike [1] https://lkml.org/lkml/2014/5/14/598 ^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH 2/8] clk: berlin: add clock binding docs for Marvell Berlin2 SoCs 2014-05-14 22:32 ` Mike Turquette @ 2014-05-14 23:17 ` Sebastian Hesselbarth 2014-05-15 4:41 ` Mike Turquette 0 siblings, 1 reply; 24+ messages in thread From: Sebastian Hesselbarth @ 2014-05-14 23:17 UTC (permalink / raw) To: Mike Turquette Cc: Rob Herring, Pawel Moll, Mark Rutland, Ian Campbell, Kumar Gala, Randy Dunlap, Alexandre Belloni, Antoine Tenart, devicetree-u79uwXL29TY76Z2rM5mHXA, linux-doc-u79uwXL29TY76Z2rM5mHXA, linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r, linux-kernel-u79uwXL29TY76Z2rM5mHXA On 05/15/2014 12:32 AM, Mike Turquette wrote: > Quoting Sebastian Hesselbarth (2014-05-11 13:24:35) >> This adds mandatory device tree binding documentation for the clock related >> IP found on Marvell Berlin2 (BG2, BG2CD, and BG2Q) SoCs. >> >> Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> >> --- >> Cc: Mike Turquette <mturquette-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org> >> Cc: Rob Herring <robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org> >> Cc: Pawel Moll <pawel.moll-5wv7dgnIgG8@public.gmane.org> >> Cc: Mark Rutland <mark.rutland-5wv7dgnIgG8@public.gmane.org> >> Cc: Ian Campbell <ijc+devicetree-KcIKpvwj1kUDXYZnReoRVg@public.gmane.org> >> Cc: Kumar Gala <galak-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org> >> Cc: Randy Dunlap <rdunlap-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org> >> Cc: Alexandre Belloni <alexandre.belloni-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org> >> Cc: Antoine Tenart <antoine.tenart-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org> >> Cc: devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org >> Cc: linux-doc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org >> Cc: linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org >> Cc: linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org >> --- >> .../devicetree/bindings/clock/berlin2-clock.txt | 169 +++++++++++++++++++++ >> 1 file changed, 169 insertions(+) >> create mode 100644 Documentation/devicetree/bindings/clock/berlin2-clock.txt >> >> diff --git a/Documentation/devicetree/bindings/clock/berlin2-clock.txt b/Documentation/devicetree/bindings/clock/berlin2-clock.txt >> new file mode 100644 >> index 000000000000..3da87a488402 >> --- /dev/null >> +++ b/Documentation/devicetree/bindings/clock/berlin2-clock.txt >> @@ -0,0 +1,169 @@ >> +* Marvell Berlin2 clock bindings >> + >> +Marvell Berlin2 (BG2, BG2CD, BG2Q) share the same IP for PLLs and clocks, >> +with some minor differences in features and register layout. The below >> +describes the individual clock related IP: >> + >> +* Audio/Video PLL >> + >> +The Audio/Video PLL (AVPLL) is a dual-VCO PLL with 8 channels each. Each >> +of the VCOs can sythesize a single VCO frequency based on a single input >> +reference clock. Each of the 8 channels then, can derive an output clock >> +from that VCO frequency by various dividers/multipliers. >> + >> +Required properties: >> +- compatible: shall be "marvell,berlin2-avpll" >> +- reg: address and length of the corresponding AVPLL registers >> +- #clock-cells: shall be set to 2 >> +- clocks: single clock specifier referencing the AVPLL input clock >> + >> +To ease match-up with the desired AVPLL output clock, clock specifiers >> +referencing AVPLL clocks shall contain two cells. The first refers to >> +the VCO (0=AVPLL_A, 1=AVPLL_B) while the second refers to the corresponding >> +channel starting with 1. For example, to reference AVPLL_B3 the clock >> +specifier shall be: <&avpll 1 3>. >> + >> +Example: >> + >> +avpll: pll@ea0040 { >> + compatible = "marvell,berlin2-avpll"; >> + #clock-cells = <2>; >> + reg = <0xea0050 0x100>; >> + clocks = <&refclk>; >> +}; > > Thanks for submitting the series. It looks good. I do have some comments > about the DT bindings though. I'm encouraging new bindings (and > especially new platforms or existing platforms that are only now > converting over to CCF) to not put their per-clock data into DTS. This > has scalability problems, is unpopular with the DT crowd and sometimes > makes it hard to do things like set CLK_SET_RATE_PARENT flags for > individual clocks. Ok, so you are proposing the have a single node for all the SoCs internal plls and clocks. The individual SoCs will have to deal with the differences in a single driver, right? > The following is a copy/paste from an email I sent earlier today[1]. Of > course per-clock data makes great sense if you have an off-SoC clock > such as a fixed-rate oscillator (e.g. the fixed-clock binding). Let me > know what you think: [...] > Using this type of binding you only need to declare your clock generator > IP node in dts, and then define a mapping in the DT include chroot. Then > you can define your per-clock data inside of your clock driver instead > of putting all of the details inside of DT. > > If you have a strong reason to do it the way that you originally posted > then let me know. Actually, the intermediate patch set sent before this one had a single DT clock node. The most important draw-back of a single clock node is that Berlin's global registers are more like a register dumpster. Vital other registers, e.g. reset, are intermixed with clock registers. Given the lack of public datasheets (I look everything up in some auto-generated BSP includes), I like the current approach because it helps to get in at least some structure to the register mess ;) Considering the postponed of_clk_create_name() helper, that would allow us to remove at least the names from DT again. Another option would be a syscon node for the registers, that clk, reset, pinctrl drivers can access. But IIRC early syscon support isn't settled, yet? So, my current idea is: - take this as is, stabilize berlin branches for v3.16 - review of_clk_create_name() and of_clk_get_parent_name() to allow to remove clock-output-names properties from Berlin (and other) dtsis - maybe switch to early syscon if it is available in v3.16 I know this would likely break DT ABI policy, but hey who else boots mainline Linux on his Chromecast currently except me :P Is that okay with you (and DT folks)? Sebastian -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH 2/8] clk: berlin: add clock binding docs for Marvell Berlin2 SoCs 2014-05-14 23:17 ` Sebastian Hesselbarth @ 2014-05-15 4:41 ` Mike Turquette 2014-05-15 6:53 ` Sebastian Hesselbarth 2014-05-15 8:34 ` Alexandre Belloni 0 siblings, 2 replies; 24+ messages in thread From: Mike Turquette @ 2014-05-15 4:41 UTC (permalink / raw) To: Sebastian Hesselbarth Cc: Mark Rutland, devicetree, Pawel Moll, Ian Campbell, Antoine Tenart, Randy Dunlap, linux-doc, linux-kernel, Rob Herring, Alexandre Belloni, Kumar Gala, linux-arm-kernel Quoting Sebastian Hesselbarth (2014-05-14 16:17:52) > On 05/15/2014 12:32 AM, Mike Turquette wrote: > > Quoting Sebastian Hesselbarth (2014-05-11 13:24:35) > >> +avpll: pll@ea0040 { > >> + compatible = "marvell,berlin2-avpll"; > >> + #clock-cells = <2>; > >> + reg = <0xea0050 0x100>; > >> + clocks = <&refclk>; > >> +}; > > > > Thanks for submitting the series. It looks good. I do have some comments > > about the DT bindings though. I'm encouraging new bindings (and > > especially new platforms or existing platforms that are only now > > converting over to CCF) to not put their per-clock data into DTS. This > > has scalability problems, is unpopular with the DT crowd and sometimes > > makes it hard to do things like set CLK_SET_RATE_PARENT flags for > > individual clocks. > > Ok, so you are proposing the have a single node for all the SoCs > internal plls and clocks. The individual SoCs will have to deal > with the differences in a single driver, right? To be precise, I'm talking about modeling an IP block as a single node. So if you have one clock generator IP block then you have one node. If you have more than one clock generator block then you have more than one node. Re-using the qcom example there are compatible strings for two different clock generator blocks named gcc and mmcc, respectively. So two DT nodes in the case for msm platforms that have one gcc instance and one rcg instance. Additionally other IP blocks may have internal clocks that can be modeled as part of that node. OMAP's Display SubSystem (DSS) and Image Signal Processor (ISP) blocks all have internal clocks that are modeled through the clock framework. (There are no DT bindings for that stuff, but the concept still applies) > > > The following is a copy/paste from an email I sent earlier today[1]. Of > > course per-clock data makes great sense if you have an off-SoC clock > > such as a fixed-rate oscillator (e.g. the fixed-clock binding). Let me > > know what you think: > [...] > > Using this type of binding you only need to declare your clock generator > > IP node in dts, and then define a mapping in the DT include chroot. Then > > you can define your per-clock data inside of your clock driver instead > > of putting all of the details inside of DT. > > > > If you have a strong reason to do it the way that you originally posted > > then let me know. > > Actually, the intermediate patch set sent before this one had a single > DT clock node. The most important draw-back of a single clock node > is that Berlin's global registers are more like a register dumpster. > Vital other registers, e.g. reset, are intermixed with clock registers. Yeah, this is pretty common. The compatible string should reflect the IP block as a whole, not just the clocks part of it. Lots of vendors have PRCMs or PRCMUs or CARs or whatever. Check out the recent series to have the reset bits and regulator support added to the qcom binding[1]. (I'm using qcom quite a bit in my examples but they are not the first to add reset control to their clock driver. I think Tegra did it first...) > > Given the lack of public datasheets (I look everything up in some > auto-generated BSP includes), I like the current approach because it > helps to get in at least some structure to the register mess ;) > > Considering the postponed of_clk_create_name() helper, that would allow > us to remove at least the names from DT again. Another option would be > a syscon node for the registers, that clk, reset, pinctrl drivers can > access. But IIRC early syscon support isn't settled, yet? Yeah, I'm not sure of the state of syscon. And modeling this stuff in the clock driver isn't the end of the world. There might be better places than drivers/clk/* for sure... I sometimes joke that the name of the IP block determines where the code lands. If it is Power, Reset & Clock Manager (several platforms use this acronym) then it can end up in drivers/clk or drivers/reset really easily. Same for Clock and Reset IP blocks (Tegra). > > So, my current idea is: > - take this as is, stabilize berlin branches for v3.16 > - review of_clk_create_name() and of_clk_get_parent_name() to allow > to remove clock-output-names properties from Berlin (and other) dtsis > - maybe switch to early syscon if it is available in v3.16 > > I know this would likely break DT ABI policy, but hey who else boots > mainline Linux on his Chromecast currently except me :P I'm not a big fan of DT stable ABI, but if you plan on changing it for 3.17 why not just do it the right way the first time? And switching to syscon is not a hard requirement. I'm OK with you putting the reset and regulator stuff in the clock driver if that makes the most sense for your platform (especially if registers are shared and the same locks need to be used, etc). What do you think? Regards, Mike [1] https://lkml.org/lkml/2014/4/4/568 > > Is that okay with you (and DT folks)? > > Sebastian ^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH 2/8] clk: berlin: add clock binding docs for Marvell Berlin2 SoCs 2014-05-15 4:41 ` Mike Turquette @ 2014-05-15 6:53 ` Sebastian Hesselbarth 2014-05-15 8:34 ` Alexandre Belloni 1 sibling, 0 replies; 24+ messages in thread From: Sebastian Hesselbarth @ 2014-05-15 6:53 UTC (permalink / raw) To: Mike Turquette Cc: Rob Herring, Pawel Moll, Mark Rutland, Ian Campbell, Kumar Gala, Randy Dunlap, Alexandre Belloni, Antoine Tenart, devicetree, linux-doc, linux-arm-kernel, linux-kernel On 05/15/2014 06:41 AM, Mike Turquette wrote: > Quoting Sebastian Hesselbarth (2014-05-14 16:17:52) >> On 05/15/2014 12:32 AM, Mike Turquette wrote: >>> Quoting Sebastian Hesselbarth (2014-05-11 13:24:35) >>>> +avpll: pll@ea0040 { >>>> + compatible = "marvell,berlin2-avpll"; >>>> + #clock-cells = <2>; >>>> + reg = <0xea0050 0x100>; >>>> + clocks = <&refclk>; >>>> +}; >>> >>> Thanks for submitting the series. It looks good. I do have some comments >>> about the DT bindings though. I'm encouraging new bindings (and >>> especially new platforms or existing platforms that are only now >>> converting over to CCF) to not put their per-clock data into DTS. This >>> has scalability problems, is unpopular with the DT crowd and sometimes >>> makes it hard to do things like set CLK_SET_RATE_PARENT flags for >>> individual clocks. >> >> Ok, so you are proposing the have a single node for all the SoCs >> internal plls and clocks. The individual SoCs will have to deal >> with the differences in a single driver, right? > > To be precise, I'm talking about modeling an IP block as a single node. > So if you have one clock generator IP block then you have one node. If > you have more than one clock generator block then you have more than one > node. Re-using the qcom example there are compatible strings for two > different clock generator blocks named gcc and mmcc, respectively. So > two DT nodes in the case for msm platforms that have one gcc instance > and one rcg instance. Hmm, I'd argue that you'd identify an IP block by the price tag is carries. You can buy a single PLL but given the vast amount of different register sets for PLLs, it is hard to identify what still count for the same IP. > Additionally other IP blocks may have internal clocks that can be > modeled as part of that node. OMAP's Display SubSystem (DSS) and Image > Signal Processor (ISP) blocks all have internal clocks that are modeled > through the clock framework. (There are no DT bindings for that stuff, > but the concept still applies) Agreed. If we hit any clock mux/divider/gate in any other register set, I wouldn't think of putting it into the core clock driver but the IP driver instead. >>> If you have a strong reason to do it the way that you originally posted >>> then let me know. >> >> Actually, the intermediate patch set sent before this one had a single >> DT clock node. The most important draw-back of a single clock node >> is that Berlin's global registers are more like a register dumpster. >> Vital other registers, e.g. reset, are intermixed with clock registers. > > Yeah, this is pretty common. The compatible string should reflect the IP > block as a whole, not just the clocks part of it. Lots of vendors have > PRCMs or PRCMUs or CARs or whatever. > > Check out the recent series to have the reset bits and regulator support > added to the qcom binding[1]. (I'm using qcom quite a bit in my examples > but they are not the first to add reset control to their clock driver. I > think Tegra did it first...) Yeah, I have to think about it a while. The register block we are talking about contains - from what I remember from the ~20k lines include - pinctrl, padctrl, reset, clocks, secondary cpu boot related registers. Maybe it is time to admit that these registers will never be split into separate blocks but should be dealt with a single node. >> Given the lack of public datasheets (I look everything up in some >> auto-generated BSP includes), I like the current approach because it >> helps to get in at least some structure to the register mess ;) >> >> Considering the postponed of_clk_create_name() helper, that would allow >> us to remove at least the names from DT again. Another option would be >> a syscon node for the registers, that clk, reset, pinctrl drivers can >> access. But IIRC early syscon support isn't settled, yet? > > Yeah, I'm not sure of the state of syscon. And modeling this stuff in > the clock driver isn't the end of the world. There might be better > places than drivers/clk/* for sure... I sometimes joke that the name of > the IP block determines where the code lands. If it is Power, Reset & > Clock Manager (several platforms use this acronym) then it can end up in > drivers/clk or drivers/reset really easily. Same for Clock and Reset IP > blocks (Tegra). > >> >> So, my current idea is: >> - take this as is, stabilize berlin branches for v3.16 >> - review of_clk_create_name() and of_clk_get_parent_name() to allow >> to remove clock-output-names properties from Berlin (and other) dtsis >> - maybe switch to early syscon if it is available in v3.16 >> >> I know this would likely break DT ABI policy, but hey who else boots >> mainline Linux on his Chromecast currently except me :P > > I'm not a big fan of DT stable ABI, but if you plan on changing it for > 3.17 why not just do it the right way the first time? And switching to > syscon is not a hard requirement. I'm OK with you putting the reset and > regulator stuff in the clock driver if that makes the most sense for > your platform (especially if registers are shared and the same locks > need to be used, etc). > > What do you think? Currently, I think that a single node for the global registers with reg property and different nodes for clock/reset and pinctrl would be best. I think I can workaround missing early syscon with atomic_io for now and have a syscon provided regmap later: global: registers@ea0000 { compatible = "marvell,berlin2-global-registers"; reg = <0xea0000 0x400>; }; pinctrl: pin-controller { compatible = "marvell,berlin2-pinctrl"; ... }; clocks: clocks { compatible = "marvell,berlin2-clocks"; #clock-cells = <1>; /* or clocks and reset FWIW */ }; or on a sub-node basis: global: registers@ea0000 { compatible = "marvell,berlin2-global-registers"; reg = <0xea0000 0x400>; #clock-cells = <1>; #reset-cells = <1>; pinctrl: pin-controller { compatible = "marvell,berlin2-pinctrl"; ... }; }; But I haven't made up my mind, yet. Sebastian ^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH 2/8] clk: berlin: add clock binding docs for Marvell Berlin2 SoCs 2014-05-15 4:41 ` Mike Turquette 2014-05-15 6:53 ` Sebastian Hesselbarth @ 2014-05-15 8:34 ` Alexandre Belloni 1 sibling, 0 replies; 24+ messages in thread From: Alexandre Belloni @ 2014-05-15 8:34 UTC (permalink / raw) To: Mike Turquette Cc: Sebastian Hesselbarth, Rob Herring, Pawel Moll, Mark Rutland, Ian Campbell, Kumar Gala, Randy Dunlap, Antoine Tenart, devicetree, linux-doc, linux-arm-kernel, linux-kernel On 14/05/2014 at 21:41:06 -0700, Mike Turquette wrote : > > > The following is a copy/paste from an email I sent earlier today[1]. Of > > > course per-clock data makes great sense if you have an off-SoC clock > > > such as a fixed-rate oscillator (e.g. the fixed-clock binding). Let me > > > know what you think: > > [...] > > > Using this type of binding you only need to declare your clock generator > > > IP node in dts, and then define a mapping in the DT include chroot. Then > > > you can define your per-clock data inside of your clock driver instead > > > of putting all of the details inside of DT. > > > > > > If you have a strong reason to do it the way that you originally posted > > > then let me know. > > > > Actually, the intermediate patch set sent before this one had a single > > DT clock node. The most important draw-back of a single clock node > > is that Berlin's global registers are more like a register dumpster. > > Vital other registers, e.g. reset, are intermixed with clock registers. > > Yeah, this is pretty common. The compatible string should reflect the IP > block as a whole, not just the clocks part of it. Lots of vendors have > PRCMs or PRCMUs or CARs or whatever. > > Check out the recent series to have the reset bits and regulator support > added to the qcom binding[1]. (I'm using qcom quite a bit in my examples > but they are not the first to add reset control to their clock driver. I > think Tegra did it first...) > > > > > Given the lack of public datasheets (I look everything up in some > > auto-generated BSP includes), I like the current approach because it > > helps to get in at least some structure to the register mess ;) > > > > Considering the postponed of_clk_create_name() helper, that would allow > > us to remove at least the names from DT again. Another option would be > > a syscon node for the registers, that clk, reset, pinctrl drivers can > > access. But IIRC early syscon support isn't settled, yet? > > Yeah, I'm not sure of the state of syscon. And modeling this stuff in > the clock driver isn't the end of the world. There might be better > places than drivers/clk/* for sure... I sometimes joke that the name of > the IP block determines where the code lands. If it is Power, Reset & > Clock Manager (several platforms use this acronym) then it can end up in > drivers/clk or drivers/reset really easily. Same for Clock and Reset IP > blocks (Tegra). > So, this is called "global". On BG2/BG2CD, you have pinmuxing, a register enabling nand power and switching the pll bypasses, all the pll configuration, complex clocks, reset, product ID, nand write protect, simple clocks, more resets, more clocks for which we don't have a driver yet and finally pad control. Now, on BG2Q, it is almost the same but between the cpupll registers and the global registers, there is the whole APB bus, so timers, gpio controllers, ... I would believe that is the strong reason you are asking for. It would also break the DT ABI (not that I care) almost each time we add a new clock that we didn't know about. Let me suggest something completely wild (to rephrase Thomas Petazzoni and Kevin Hilman at ELC): How about we have only a "marvell,berlin2", "marvell,berlin2cd" or "marvell,berlin2q" compatible string and handle that in either arch/arm/mach-berlin or driver/soc/mach-berlin and then use a bunch of structures to add all the peripherals like clocks, reset, timer, gpio controllers, pinmux, padconf... Maybe we could call those structures "platform_data" :) > > > > So, my current idea is: > > - take this as is, stabilize berlin branches for v3.16 > > - review of_clk_create_name() and of_clk_get_parent_name() to allow > > to remove clock-output-names properties from Berlin (and other) dtsis > > - maybe switch to early syscon if it is available in v3.16 > > > > I know this would likely break DT ABI policy, but hey who else boots > > mainline Linux on his Chromecast currently except me :P > > I'm not a big fan of DT stable ABI, but if you plan on changing it for > 3.17 why not just do it the right way the first time? And switching to > syscon is not a hard requirement. I'm OK with you putting the reset and > regulator stuff in the clock driver if that makes the most sense for > your platform (especially if registers are shared and the same locks > need to be used, etc). > -- Alexandre Belloni, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com ^ permalink raw reply [flat|nested] 24+ messages in thread
* [PATCH 7/8] ARM: dts: berlin: convert BG2CD to DT clock nodes 2014-05-11 20:24 [PATCH 0/8] Marvell Berlin full clock support Sebastian Hesselbarth [not found] ` <1399839881-29895-1-git-send-email-sebastian.hesselbarth-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> 2014-05-11 20:24 ` [PATCH 2/8] clk: berlin: add clock binding docs for Marvell Berlin2 SoCs Sebastian Hesselbarth @ 2014-05-11 20:24 ` Sebastian Hesselbarth [not found] ` <1399839881-29895-8-git-send-email-sebastian.hesselbarth-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> 2014-05-11 20:24 ` [PATCH 8/8] ARM: dts: berlin: convert BG2 " Sebastian Hesselbarth 2014-05-14 20:15 ` [PATCH v2 00/10] Marvell Berlin full clock support Sebastian Hesselbarth 4 siblings, 1 reply; 24+ messages in thread From: Sebastian Hesselbarth @ 2014-05-11 20:24 UTC (permalink / raw) To: Sebastian Hesselbarth Cc: Mike Turquette, Rob Herring, Pawel Moll, Mark Rutland, Ian Campbell, Kumar Gala, Russell King, Alexandre Belloni, Antoine Tenart, devicetree, linux-arm-kernel, linux-kernel This converts Berlin BG2CD SoC dtsi to make use of the new DT clock nodes for Berlin SoCs. Also add a binding include to ease core clock references. Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com> --- Cc: Mike Turquette <mturquette@linaro.org> Cc: Rob Herring <robh+dt@kernel.org> Cc: Pawel Moll <pawel.moll@arm.com> Cc: Mark Rutland <mark.rutland@arm.com> Cc: Ian Campbell <ijc+devicetree@hellion.org.uk> Cc: Kumar Gala <galak@codeaurora.org> Cc: Russell King <linux@arm.linux.org.uk> Cc: Alexandre Belloni <alexandre.belloni@free-electrons.com> Cc: Antoine Tenart <antoine.tenart@free-electrons.com> Cc: devicetree@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org --- arch/arm/boot/dts/berlin2cd.dtsi | 198 +++++++++++++++++++++++++++++++----- drivers/clk/berlin/Makefile | 2 + include/dt-bindings/clock/berlin2.h | 35 +++++++ 3 files changed, 207 insertions(+), 28 deletions(-) create mode 100644 include/dt-bindings/clock/berlin2.h diff --git a/arch/arm/boot/dts/berlin2cd.dtsi b/arch/arm/boot/dts/berlin2cd.dtsi index 094968c27533..c1b8dc8264d3 100644 --- a/arch/arm/boot/dts/berlin2cd.dtsi +++ b/arch/arm/boot/dts/berlin2cd.dtsi @@ -12,6 +12,7 @@ */ #include "skeleton.dtsi" +#include <dt-bindings/clock/berlin2.h> #include <dt-bindings/interrupt-controller/arm-gic.h> / { @@ -30,24 +31,18 @@ }; }; - clocks { - smclk: sysmgr-clock { - compatible = "fixed-clock"; - #clock-cells = <0>; - clock-frequency = <25000000>; - }; - - cfgclk: cfg-clock { - compatible = "fixed-clock"; - #clock-cells = <0>; - clock-frequency = <75000000>; - }; + refclk: oscillator { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = <25000000>; + }; - sysclk: system-clock { - compatible = "fixed-clock"; - #clock-cells = <0>; - clock-frequency = <300000000>; - }; + twdclk: twdclk { + compatible = "fixed-factor-clock"; + #clock-cells = <0>; + clocks = <&coreclk CLKID_CPU>; + clock-mult = <1>; + clock-div = <3>; }; soc { @@ -76,7 +71,7 @@ compatible = "arm,cortex-a9-twd-timer"; reg = <0xad0600 0x20>; interrupts = <GIC_PPI 13 IRQ_TYPE_LEVEL_HIGH>; - clocks = <&sysclk>; + clocks = <&twdclk>; }; apb@e80000 { @@ -91,7 +86,7 @@ compatible = "snps,dw-apb-timer"; reg = <0x2c00 0x14>; interrupts = <8>; - clocks = <&cfgclk>; + clocks = <&coreclk CLKID_CFG>; clock-names = "timer"; status = "okay"; }; @@ -100,7 +95,7 @@ compatible = "snps,dw-apb-timer"; reg = <0x2c14 0x14>; interrupts = <9>; - clocks = <&cfgclk>; + clocks = <&coreclk CLKID_CFG>; clock-names = "timer"; status = "okay"; }; @@ -109,7 +104,7 @@ compatible = "snps,dw-apb-timer"; reg = <0x2c28 0x14>; interrupts = <10>; - clocks = <&cfgclk>; + clocks = <&coreclk CLKID_CFG>; clock-names = "timer"; status = "disabled"; }; @@ -118,7 +113,7 @@ compatible = "snps,dw-apb-timer"; reg = <0x2c3c 0x14>; interrupts = <11>; - clocks = <&cfgclk>; + clocks = <&coreclk CLKID_CFG>; clock-names = "timer"; status = "disabled"; }; @@ -127,7 +122,7 @@ compatible = "snps,dw-apb-timer"; reg = <0x2c50 0x14>; interrupts = <12>; - clocks = <&cfgclk>; + clocks = <&coreclk CLKID_CFG>; clock-names = "timer"; status = "disabled"; }; @@ -136,7 +131,7 @@ compatible = "snps,dw-apb-timer"; reg = <0x2c64 0x14>; interrupts = <13>; - clocks = <&cfgclk>; + clocks = <&coreclk CLKID_CFG>; clock-names = "timer"; status = "disabled"; }; @@ -145,7 +140,7 @@ compatible = "snps,dw-apb-timer"; reg = <0x2c78 0x14>; interrupts = <14>; - clocks = <&cfgclk>; + clocks = <&coreclk CLKID_CFG>; clock-names = "timer"; status = "disabled"; }; @@ -154,7 +149,7 @@ compatible = "snps,dw-apb-timer"; reg = <0x2c8c 0x14>; interrupts = <15>; - clocks = <&cfgclk>; + clocks = <&coreclk CLKID_CFG>; clock-names = "timer"; status = "disabled"; }; @@ -169,6 +164,153 @@ }; }; + syspll: pll@ea0014 { + compatible = "marvell,berlin2-pll"; + #clock-cells = <0>; + reg = <0xea0014 0x14>; + clocks = <&refclk>; + }; + + mempll: pll@ea0028 { + compatible = "marvell,berlin2-pll"; + #clock-cells = <0>; + reg = <0xea0028 0x14>; + clocks = <&refclk>; + }; + + cpupll: pll@ea003c { + compatible = "marvell,berlin2-pll"; + #clock-cells = <0>; + reg = <0xea003c 0x14>; + clocks = <&refclk>; + }; + + avpll: pll@ea0040 { + compatible = "marvell,berlin2-avpll"; + #clock-cells = <2>; + reg = <0xea0050 0x100>; + clocks = <&refclk>; + }; + + coreclk: clock@ea0150 { + compatible = "marvell,berlin2-core-clocks"; + #clock-cells = <1>; + reg = <0xea0150 0x1c>; + clocks = <&refclk>, <&syspll>, <&mempll>, <&cpupll>, + <&avpll 0 1>, <&avpll 0 2>, + <&avpll 0 3>, <&avpll 0 4>, + <&avpll 0 5>, <&avpll 0 6>, + <&avpll 0 7>, <&avpll 0 8>, + <&avpll 1 1>, <&avpll 1 2>, + <&avpll 1 3>, <&avpll 1 4>, + <&avpll 1 5>, <&avpll 1 6>, + <&avpll 1 7>, <&avpll 1 8>; + clock-names = "refclk", "syspll", "mempll", "cpupll", + "avpll_a1", "avpll_a2", "avpll_a3", "avpll_a4", + "avpll_a5", "avpll_a6", "avpll_a7", "avpll_a8", + "avpll_b1", "avpll_b2", "avpll_b3", "avpll_b4", + "avpll_b5", "avpll_b6", "avpll_b7", "avpll_b8"; + }; + + gfx3dcore_clk: clock@ea022c { + compatible = "marvell,berlin2-clk-div"; + #clock-cells = <0>; + reg = <0xea0022c 0x4>; + clocks = <&syspll>, + <&avpll 1 4>, <&avpll 1 5>, + <&avpll 1 6>, <&avpll 1 7>; + clock-names = "mux_bypass", + "mux0", "mux1", "mux2", "mux3"; + }; + + gfx3dsys_clk: clock@ea0230 { + compatible = "marvell,berlin2-clk-div"; + #clock-cells = <0>; + reg = <0xea00230 0x4>; + clocks = <&syspll>, + <&avpll 1 4>, <&avpll 1 5>, + <&avpll 1 6>, <&avpll 1 7>; + clock-names = "mux_bypass", + "mux0", "mux1", "mux2", "mux3"; + }; + + arc_clk: clock@ea0234 { + compatible = "marvell,berlin2-clk-div"; + #clock-cells = <0>; + reg = <0xea00234 0x4>; + clocks = <&syspll>, + <&avpll 1 4>, <&avpll 1 5>, + <&avpll 1 6>, <&avpll 1 7>; + clock-names = "mux_bypass", + "mux0", "mux1", "mux2", "mux3"; + }; + + vip_clk: clock@ea0238 { + compatible = "marvell,berlin2-clk-div"; + #clock-cells = <0>; + reg = <0xea00238 0x4>; + clocks = <&syspll>, + <&avpll 1 4>, <&avpll 1 5>, + <&avpll 1 6>, <&avpll 1 7>; + clock-names = "mux_bypass", + "mux0", "mux1", "mux2", "mux3"; + }; + + sdio0xin_clk: clock@ea023c { + compatible = "marvell,berlin2-clk-div"; + #clock-cells = <0>; + reg = <0xea0023c 0x4>; + clocks = <&syspll>, + <&avpll 1 4>, <&avpll 1 5>, + <&avpll 1 6>, <&avpll 1 7>; + clock-names = "mux_bypass", + "mux0", "mux1", "mux2", "mux3"; + }; + + sdio1xin_clk: clock@ea0240 { + compatible = "marvell,berlin2-clk-div"; + #clock-cells = <0>; + reg = <0xea00240 0x4>; + clocks = <&syspll>, + <&avpll 1 4>, <&avpll 1 5>, + <&avpll 1 6>, <&avpll 1 7>; + clock-names = "mux_bypass", + "mux0", "mux1", "mux2", "mux3"; + }; + + gfx3dextra_clk: clock@ea0244 { + compatible = "marvell,berlin2-clk-div"; + #clock-cells = <0>; + reg = <0xea00244 0x4>; + clocks = <&syspll>, + <&avpll 1 4>, <&avpll 1 5>, + <&avpll 1 6>, <&avpll 1 7>; + clock-names = "mux_bypass", + "mux0", "mux1", "mux2", "mux3"; + }; + + gc360_clk: clock@ea024c { + compatible = "marvell,berlin2-clk-div"; + #clock-cells = <0>; + reg = <0xea0024c 0x4>; + clocks = <&syspll>, + <&avpll 1 4>, <&avpll 1 5>, + <&avpll 1 6>, <&avpll 1 7>; + clock-names = "mux_bypass", + "mux0", "mux1", "mux2", "mux3"; + }; + + sdio_dllmst_clk: clock@ea0250 { + compatible = "marvell,berlin2-clk-div"; + #clock-cells = <0>; + reg = <0xea00250 0x4>; + clocks = <&syspll>, + <&avpll 1 4>, <&avpll 1 5>, + <&avpll 1 6>, <&avpll 1 7>; + clock-names = "mux_bypass", + "mux0", "mux1", "mux2", "mux3"; + }; + apb@fc0000 { compatible = "simple-bus"; #address-cells = <1>; @@ -183,7 +325,7 @@ reg-shift = <2>; reg-io-width = <1>; interrupts = <8>; - clocks = <&smclk>; + clocks = <&refclk>; status = "disabled"; }; @@ -193,7 +335,7 @@ reg-shift = <2>; reg-io-width = <1>; interrupts = <9>; - clocks = <&smclk>; + clocks = <&refclk>; status = "disabled"; }; diff --git a/drivers/clk/berlin/Makefile b/drivers/clk/berlin/Makefile index f0a7dc8b5e30..2b33e1e74503 100644 --- a/drivers/clk/berlin/Makefile +++ b/drivers/clk/berlin/Makefile @@ -1 +1,3 @@ obj-y += berlin2-avpll.o berlin2-pll.o berlin2-div.o +obj-$(CONFIG_MACH_BERLIN_BG2) += bg2.o +obj-$(CONFIG_MACH_BERLIN_BG2CD) += bg2.o diff --git a/include/dt-bindings/clock/berlin2.h b/include/dt-bindings/clock/berlin2.h new file mode 100644 index 000000000000..dacf7edec4d3 --- /dev/null +++ b/include/dt-bindings/clock/berlin2.h @@ -0,0 +1,35 @@ +/* + * Berlin2 BG2/BG2CD clock tree IDs + */ + +#define CLKID_SYS 0 +#define CLKID_CPU 1 +#define CLKID_DRMFIGO 2 +#define CLKID_CFG 3 +#define CLKID_GFX 4 +#define CLKID_ZSP 5 +#define CLKID_PERIF 6 +#define CLKID_PCUBE 7 +#define CLKID_VSCOPE 8 +#define CLKID_NFC_ECC 9 +#define CLKID_VPP 10 +#define CLKID_APP 11 +#define CLKID_AUDIO0 12 +#define CLKID_AUDIO2 23 +#define CLKID_AUDIO3 14 +#define CLKID_AUDIO1 15 +#define CLKID_GETH0 16 +#define CLKID_GETH1 17 +#define CLKID_SATA 18 +#define CLKID_AHBAPB 19 +#define CLKID_USB0 20 +#define CLKID_USB1 21 +#define CLKID_PBRIDGE 22 +#define CLKID_SDIO0 23 +#define CLKID_SDIO1 24 +#define CLKID_NFC 25 +#define CLKID_SMEMC 26 +#define CLKID_AUDIOHD 27 +#define CLKID_VIDEO0 28 +#define CLKID_VIDEO1 29 +#define CLKID_VIDEO2 30 -- 1.9.1 ^ permalink raw reply related [flat|nested] 24+ messages in thread
[parent not found: <1399839881-29895-8-git-send-email-sebastian.hesselbarth-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>]
* Re: [PATCH 7/8] ARM: dts: berlin: convert BG2CD to DT clock nodes [not found] ` <1399839881-29895-8-git-send-email-sebastian.hesselbarth-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> @ 2014-05-12 19:55 ` Sebastian Hesselbarth 2014-05-13 8:42 ` Sebastian Hesselbarth 1 sibling, 0 replies; 24+ messages in thread From: Sebastian Hesselbarth @ 2014-05-12 19:55 UTC (permalink / raw) Cc: Mike Turquette, Rob Herring, Pawel Moll, Mark Rutland, Ian Campbell, Kumar Gala, Russell King, Alexandre Belloni, Antoine Tenart, devicetree-u79uwXL29TY76Z2rM5mHXA, linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r, linux-kernel-u79uwXL29TY76Z2rM5mHXA On 05/11/2014 10:24 PM, Sebastian Hesselbarth wrote: > This converts Berlin BG2CD SoC dtsi to make use of the new DT clock > nodes for Berlin SoCs. Also add a binding include to ease core clock > references. > > Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > --- > Cc: Mike Turquette <mturquette-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org> > Cc: Rob Herring <robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org> > Cc: Pawel Moll <pawel.moll-5wv7dgnIgG8@public.gmane.org> > Cc: Mark Rutland <mark.rutland-5wv7dgnIgG8@public.gmane.org> > Cc: Ian Campbell <ijc+devicetree-KcIKpvwj1kUDXYZnReoRVg@public.gmane.org> > Cc: Kumar Gala <galak-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org> > Cc: Russell King <linux-lFZ/pmaqli7XmaaqVzeoHQ@public.gmane.org> > Cc: Alexandre Belloni <alexandre.belloni-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org> > Cc: Antoine Tenart <antoine.tenart-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org> > Cc: devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org > Cc: linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org > Cc: linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org > --- > arch/arm/boot/dts/berlin2cd.dtsi | 198 +++++++++++++++++++++++++++++++----- > drivers/clk/berlin/Makefile | 2 + This above shouldn't be part of this patch of course, I'll fix it up. Sebastian > include/dt-bindings/clock/berlin2.h | 35 +++++++ > 3 files changed, 207 insertions(+), 28 deletions(-) > create mode 100644 include/dt-bindings/clock/berlin2.h > > diff --git a/arch/arm/boot/dts/berlin2cd.dtsi b/arch/arm/boot/dts/berlin2cd.dtsi > index 094968c27533..c1b8dc8264d3 100644 > --- a/arch/arm/boot/dts/berlin2cd.dtsi > +++ b/arch/arm/boot/dts/berlin2cd.dtsi > @@ -12,6 +12,7 @@ > */ > > #include "skeleton.dtsi" > +#include <dt-bindings/clock/berlin2.h> > #include <dt-bindings/interrupt-controller/arm-gic.h> > > / { > @@ -30,24 +31,18 @@ > }; > }; > > - clocks { > - smclk: sysmgr-clock { > - compatible = "fixed-clock"; > - #clock-cells = <0>; > - clock-frequency = <25000000>; > - }; > - > - cfgclk: cfg-clock { > - compatible = "fixed-clock"; > - #clock-cells = <0>; > - clock-frequency = <75000000>; > - }; > + refclk: oscillator { > + compatible = "fixed-clock"; > + #clock-cells = <0>; > + clock-frequency = <25000000>; > + }; > > - sysclk: system-clock { > - compatible = "fixed-clock"; > - #clock-cells = <0>; > - clock-frequency = <300000000>; > - }; > + twdclk: twdclk { > + compatible = "fixed-factor-clock"; > + #clock-cells = <0>; > + clocks = <&coreclk CLKID_CPU>; > + clock-mult = <1>; > + clock-div = <3>; > }; > > soc { > @@ -76,7 +71,7 @@ > compatible = "arm,cortex-a9-twd-timer"; > reg = <0xad0600 0x20>; > interrupts = <GIC_PPI 13 IRQ_TYPE_LEVEL_HIGH>; > - clocks = <&sysclk>; > + clocks = <&twdclk>; > }; > > apb@e80000 { > @@ -91,7 +86,7 @@ > compatible = "snps,dw-apb-timer"; > reg = <0x2c00 0x14>; > interrupts = <8>; > - clocks = <&cfgclk>; > + clocks = <&coreclk CLKID_CFG>; > clock-names = "timer"; > status = "okay"; > }; > @@ -100,7 +95,7 @@ > compatible = "snps,dw-apb-timer"; > reg = <0x2c14 0x14>; > interrupts = <9>; > - clocks = <&cfgclk>; > + clocks = <&coreclk CLKID_CFG>; > clock-names = "timer"; > status = "okay"; > }; > @@ -109,7 +104,7 @@ > compatible = "snps,dw-apb-timer"; > reg = <0x2c28 0x14>; > interrupts = <10>; > - clocks = <&cfgclk>; > + clocks = <&coreclk CLKID_CFG>; > clock-names = "timer"; > status = "disabled"; > }; > @@ -118,7 +113,7 @@ > compatible = "snps,dw-apb-timer"; > reg = <0x2c3c 0x14>; > interrupts = <11>; > - clocks = <&cfgclk>; > + clocks = <&coreclk CLKID_CFG>; > clock-names = "timer"; > status = "disabled"; > }; > @@ -127,7 +122,7 @@ > compatible = "snps,dw-apb-timer"; > reg = <0x2c50 0x14>; > interrupts = <12>; > - clocks = <&cfgclk>; > + clocks = <&coreclk CLKID_CFG>; > clock-names = "timer"; > status = "disabled"; > }; > @@ -136,7 +131,7 @@ > compatible = "snps,dw-apb-timer"; > reg = <0x2c64 0x14>; > interrupts = <13>; > - clocks = <&cfgclk>; > + clocks = <&coreclk CLKID_CFG>; > clock-names = "timer"; > status = "disabled"; > }; > @@ -145,7 +140,7 @@ > compatible = "snps,dw-apb-timer"; > reg = <0x2c78 0x14>; > interrupts = <14>; > - clocks = <&cfgclk>; > + clocks = <&coreclk CLKID_CFG>; > clock-names = "timer"; > status = "disabled"; > }; > @@ -154,7 +149,7 @@ > compatible = "snps,dw-apb-timer"; > reg = <0x2c8c 0x14>; > interrupts = <15>; > - clocks = <&cfgclk>; > + clocks = <&coreclk CLKID_CFG>; > clock-names = "timer"; > status = "disabled"; > }; > @@ -169,6 +164,153 @@ > }; > }; > > + syspll: pll@ea0014 { > + compatible = "marvell,berlin2-pll"; > + #clock-cells = <0>; > + reg = <0xea0014 0x14>; > + clocks = <&refclk>; > + }; > + > + mempll: pll@ea0028 { > + compatible = "marvell,berlin2-pll"; > + #clock-cells = <0>; > + reg = <0xea0028 0x14>; > + clocks = <&refclk>; > + }; > + > + cpupll: pll@ea003c { > + compatible = "marvell,berlin2-pll"; > + #clock-cells = <0>; > + reg = <0xea003c 0x14>; > + clocks = <&refclk>; > + }; > + > + avpll: pll@ea0040 { > + compatible = "marvell,berlin2-avpll"; > + #clock-cells = <2>; > + reg = <0xea0050 0x100>; > + clocks = <&refclk>; > + }; > + > + coreclk: clock@ea0150 { > + compatible = "marvell,berlin2-core-clocks"; > + #clock-cells = <1>; > + reg = <0xea0150 0x1c>; > + clocks = <&refclk>, <&syspll>, <&mempll>, <&cpupll>, > + <&avpll 0 1>, <&avpll 0 2>, > + <&avpll 0 3>, <&avpll 0 4>, > + <&avpll 0 5>, <&avpll 0 6>, > + <&avpll 0 7>, <&avpll 0 8>, > + <&avpll 1 1>, <&avpll 1 2>, > + <&avpll 1 3>, <&avpll 1 4>, > + <&avpll 1 5>, <&avpll 1 6>, > + <&avpll 1 7>, <&avpll 1 8>; > + clock-names = "refclk", "syspll", "mempll", "cpupll", > + "avpll_a1", "avpll_a2", "avpll_a3", "avpll_a4", > + "avpll_a5", "avpll_a6", "avpll_a7", "avpll_a8", > + "avpll_b1", "avpll_b2", "avpll_b3", "avpll_b4", > + "avpll_b5", "avpll_b6", "avpll_b7", "avpll_b8"; > + }; > + > + gfx3dcore_clk: clock@ea022c { > + compatible = "marvell,berlin2-clk-div"; > + #clock-cells = <0>; > + reg = <0xea0022c 0x4>; > + clocks = <&syspll>, > + <&avpll 1 4>, <&avpll 1 5>, > + <&avpll 1 6>, <&avpll 1 7>; > + clock-names = "mux_bypass", > + "mux0", "mux1", "mux2", "mux3"; > + }; > + > + gfx3dsys_clk: clock@ea0230 { > + compatible = "marvell,berlin2-clk-div"; > + #clock-cells = <0>; > + reg = <0xea00230 0x4>; > + clocks = <&syspll>, > + <&avpll 1 4>, <&avpll 1 5>, > + <&avpll 1 6>, <&avpll 1 7>; > + clock-names = "mux_bypass", > + "mux0", "mux1", "mux2", "mux3"; > + }; > + > + arc_clk: clock@ea0234 { > + compatible = "marvell,berlin2-clk-div"; > + #clock-cells = <0>; > + reg = <0xea00234 0x4>; > + clocks = <&syspll>, > + <&avpll 1 4>, <&avpll 1 5>, > + <&avpll 1 6>, <&avpll 1 7>; > + clock-names = "mux_bypass", > + "mux0", "mux1", "mux2", "mux3"; > + }; > + > + vip_clk: clock@ea0238 { > + compatible = "marvell,berlin2-clk-div"; > + #clock-cells = <0>; > + reg = <0xea00238 0x4>; > + clocks = <&syspll>, > + <&avpll 1 4>, <&avpll 1 5>, > + <&avpll 1 6>, <&avpll 1 7>; > + clock-names = "mux_bypass", > + "mux0", "mux1", "mux2", "mux3"; > + }; > + > + sdio0xin_clk: clock@ea023c { > + compatible = "marvell,berlin2-clk-div"; > + #clock-cells = <0>; > + reg = <0xea0023c 0x4>; > + clocks = <&syspll>, > + <&avpll 1 4>, <&avpll 1 5>, > + <&avpll 1 6>, <&avpll 1 7>; > + clock-names = "mux_bypass", > + "mux0", "mux1", "mux2", "mux3"; > + }; > + > + sdio1xin_clk: clock@ea0240 { > + compatible = "marvell,berlin2-clk-div"; > + #clock-cells = <0>; > + reg = <0xea00240 0x4>; > + clocks = <&syspll>, > + <&avpll 1 4>, <&avpll 1 5>, > + <&avpll 1 6>, <&avpll 1 7>; > + clock-names = "mux_bypass", > + "mux0", "mux1", "mux2", "mux3"; > + }; > + > + gfx3dextra_clk: clock@ea0244 { > + compatible = "marvell,berlin2-clk-div"; > + #clock-cells = <0>; > + reg = <0xea00244 0x4>; > + clocks = <&syspll>, > + <&avpll 1 4>, <&avpll 1 5>, > + <&avpll 1 6>, <&avpll 1 7>; > + clock-names = "mux_bypass", > + "mux0", "mux1", "mux2", "mux3"; > + }; > + > + gc360_clk: clock@ea024c { > + compatible = "marvell,berlin2-clk-div"; > + #clock-cells = <0>; > + reg = <0xea0024c 0x4>; > + clocks = <&syspll>, > + <&avpll 1 4>, <&avpll 1 5>, > + <&avpll 1 6>, <&avpll 1 7>; > + clock-names = "mux_bypass", > + "mux0", "mux1", "mux2", "mux3"; > + }; > + > + sdio_dllmst_clk: clock@ea0250 { > + compatible = "marvell,berlin2-clk-div"; > + #clock-cells = <0>; > + reg = <0xea00250 0x4>; > + clocks = <&syspll>, > + <&avpll 1 4>, <&avpll 1 5>, > + <&avpll 1 6>, <&avpll 1 7>; > + clock-names = "mux_bypass", > + "mux0", "mux1", "mux2", "mux3"; > + }; > + > apb@fc0000 { > compatible = "simple-bus"; > #address-cells = <1>; > @@ -183,7 +325,7 @@ > reg-shift = <2>; > reg-io-width = <1>; > interrupts = <8>; > - clocks = <&smclk>; > + clocks = <&refclk>; > status = "disabled"; > }; > > @@ -193,7 +335,7 @@ > reg-shift = <2>; > reg-io-width = <1>; > interrupts = <9>; > - clocks = <&smclk>; > + clocks = <&refclk>; > status = "disabled"; > }; > > diff --git a/drivers/clk/berlin/Makefile b/drivers/clk/berlin/Makefile > index f0a7dc8b5e30..2b33e1e74503 100644 > --- a/drivers/clk/berlin/Makefile > +++ b/drivers/clk/berlin/Makefile > @@ -1 +1,3 @@ > obj-y += berlin2-avpll.o berlin2-pll.o berlin2-div.o > +obj-$(CONFIG_MACH_BERLIN_BG2) += bg2.o > +obj-$(CONFIG_MACH_BERLIN_BG2CD) += bg2.o > diff --git a/include/dt-bindings/clock/berlin2.h b/include/dt-bindings/clock/berlin2.h > new file mode 100644 > index 000000000000..dacf7edec4d3 > --- /dev/null > +++ b/include/dt-bindings/clock/berlin2.h > @@ -0,0 +1,35 @@ > +/* > + * Berlin2 BG2/BG2CD clock tree IDs > + */ > + > +#define CLKID_SYS 0 > +#define CLKID_CPU 1 > +#define CLKID_DRMFIGO 2 > +#define CLKID_CFG 3 > +#define CLKID_GFX 4 > +#define CLKID_ZSP 5 > +#define CLKID_PERIF 6 > +#define CLKID_PCUBE 7 > +#define CLKID_VSCOPE 8 > +#define CLKID_NFC_ECC 9 > +#define CLKID_VPP 10 > +#define CLKID_APP 11 > +#define CLKID_AUDIO0 12 > +#define CLKID_AUDIO2 23 > +#define CLKID_AUDIO3 14 > +#define CLKID_AUDIO1 15 > +#define CLKID_GETH0 16 > +#define CLKID_GETH1 17 > +#define CLKID_SATA 18 > +#define CLKID_AHBAPB 19 > +#define CLKID_USB0 20 > +#define CLKID_USB1 21 > +#define CLKID_PBRIDGE 22 > +#define CLKID_SDIO0 23 > +#define CLKID_SDIO1 24 > +#define CLKID_NFC 25 > +#define CLKID_SMEMC 26 > +#define CLKID_AUDIOHD 27 > +#define CLKID_VIDEO0 28 > +#define CLKID_VIDEO1 29 > +#define CLKID_VIDEO2 30 > -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH 7/8] ARM: dts: berlin: convert BG2CD to DT clock nodes [not found] ` <1399839881-29895-8-git-send-email-sebastian.hesselbarth-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> 2014-05-12 19:55 ` Sebastian Hesselbarth @ 2014-05-13 8:42 ` Sebastian Hesselbarth 1 sibling, 0 replies; 24+ messages in thread From: Sebastian Hesselbarth @ 2014-05-13 8:42 UTC (permalink / raw) Cc: Mike Turquette, Rob Herring, Pawel Moll, Mark Rutland, Ian Campbell, Kumar Gala, Russell King, Alexandre Belloni, Antoine Tenart, devicetree-u79uwXL29TY76Z2rM5mHXA, linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r, linux-kernel-u79uwXL29TY76Z2rM5mHXA On 05/11/2014 10:24 PM, Sebastian Hesselbarth wrote: > This converts Berlin BG2CD SoC dtsi to make use of the new DT clock > nodes for Berlin SoCs. Also add a binding include to ease core clock > references. > > Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > --- [...] > diff --git a/arch/arm/boot/dts/berlin2cd.dtsi b/arch/arm/boot/dts/berlin2cd.dtsi > index 094968c27533..c1b8dc8264d3 100644 > --- a/arch/arm/boot/dts/berlin2cd.dtsi > +++ b/arch/arm/boot/dts/berlin2cd.dtsi [...] > @@ -169,6 +164,153 @@ > }; > }; > > + syspll: pll@ea0014 { > + compatible = "marvell,berlin2-pll"; > + #clock-cells = <0>; > + reg = <0xea0014 0x14>; > + clocks = <&refclk>; > + }; > + > + mempll: pll@ea0028 { > + compatible = "marvell,berlin2-pll"; > + #clock-cells = <0>; > + reg = <0xea0028 0x14>; > + clocks = <&refclk>; > + }; > + > + cpupll: pll@ea003c { > + compatible = "marvell,berlin2-pll"; > + #clock-cells = <0>; > + reg = <0xea003c 0x14>; > + clocks = <&refclk>; > + }; > + > + avpll: pll@ea0040 { > + compatible = "marvell,berlin2-avpll"; > + #clock-cells = <2>; > + reg = <0xea0050 0x100>; > + clocks = <&refclk>; > + }; > + > + coreclk: clock@ea0150 { > + compatible = "marvell,berlin2-core-clocks"; > + #clock-cells = <1>; > + reg = <0xea0150 0x1c>; > + clocks = <&refclk>, <&syspll>, <&mempll>, <&cpupll>, > + <&avpll 0 1>, <&avpll 0 2>, > + <&avpll 0 3>, <&avpll 0 4>, > + <&avpll 0 5>, <&avpll 0 6>, > + <&avpll 0 7>, <&avpll 0 8>, > + <&avpll 1 1>, <&avpll 1 2>, > + <&avpll 1 3>, <&avpll 1 4>, > + <&avpll 1 5>, <&avpll 1 6>, > + <&avpll 1 7>, <&avpll 1 8>; > + clock-names = "refclk", "syspll", "mempll", "cpupll", > + "avpll_a1", "avpll_a2", "avpll_a3", "avpll_a4", > + "avpll_a5", "avpll_a6", "avpll_a7", "avpll_a8", > + "avpll_b1", "avpll_b2", "avpll_b3", "avpll_b4", > + "avpll_b5", "avpll_b6", "avpll_b7", "avpll_b8"; > + }; > + > + gfx3dcore_clk: clock@ea022c { > + compatible = "marvell,berlin2-clk-div"; correct compatible should be "marvell,berlin2-div"... > + #clock-cells = <0>; > + reg = <0xea0022c 0x4>; ... and reg is off by an extra '0'. I'll fix it up for v2. Sebastian > + clocks = <&syspll>, > + <&avpll 1 4>, <&avpll 1 5>, > + <&avpll 1 6>, <&avpll 1 7>; > + clock-names = "mux_bypass", > + "mux0", "mux1", "mux2", "mux3"; > + }; > + > + gfx3dsys_clk: clock@ea0230 { > + compatible = "marvell,berlin2-clk-div"; > + #clock-cells = <0>; > + reg = <0xea00230 0x4>; > + clocks = <&syspll>, > + <&avpll 1 4>, <&avpll 1 5>, > + <&avpll 1 6>, <&avpll 1 7>; > + clock-names = "mux_bypass", > + "mux0", "mux1", "mux2", "mux3"; > + }; > + > + arc_clk: clock@ea0234 { > + compatible = "marvell,berlin2-clk-div"; > + #clock-cells = <0>; > + reg = <0xea00234 0x4>; > + clocks = <&syspll>, > + <&avpll 1 4>, <&avpll 1 5>, > + <&avpll 1 6>, <&avpll 1 7>; > + clock-names = "mux_bypass", > + "mux0", "mux1", "mux2", "mux3"; > + }; > + > + vip_clk: clock@ea0238 { > + compatible = "marvell,berlin2-clk-div"; > + #clock-cells = <0>; > + reg = <0xea00238 0x4>; > + clocks = <&syspll>, > + <&avpll 1 4>, <&avpll 1 5>, > + <&avpll 1 6>, <&avpll 1 7>; > + clock-names = "mux_bypass", > + "mux0", "mux1", "mux2", "mux3"; > + }; > + > + sdio0xin_clk: clock@ea023c { > + compatible = "marvell,berlin2-clk-div"; > + #clock-cells = <0>; > + reg = <0xea0023c 0x4>; > + clocks = <&syspll>, > + <&avpll 1 4>, <&avpll 1 5>, > + <&avpll 1 6>, <&avpll 1 7>; > + clock-names = "mux_bypass", > + "mux0", "mux1", "mux2", "mux3"; > + }; > + > + sdio1xin_clk: clock@ea0240 { > + compatible = "marvell,berlin2-clk-div"; > + #clock-cells = <0>; > + reg = <0xea00240 0x4>; > + clocks = <&syspll>, > + <&avpll 1 4>, <&avpll 1 5>, > + <&avpll 1 6>, <&avpll 1 7>; > + clock-names = "mux_bypass", > + "mux0", "mux1", "mux2", "mux3"; > + }; > + > + gfx3dextra_clk: clock@ea0244 { > + compatible = "marvell,berlin2-clk-div"; > + #clock-cells = <0>; > + reg = <0xea00244 0x4>; > + clocks = <&syspll>, > + <&avpll 1 4>, <&avpll 1 5>, > + <&avpll 1 6>, <&avpll 1 7>; > + clock-names = "mux_bypass", > + "mux0", "mux1", "mux2", "mux3"; > + }; > + > + gc360_clk: clock@ea024c { > + compatible = "marvell,berlin2-clk-div"; > + #clock-cells = <0>; > + reg = <0xea0024c 0x4>; > + clocks = <&syspll>, > + <&avpll 1 4>, <&avpll 1 5>, > + <&avpll 1 6>, <&avpll 1 7>; > + clock-names = "mux_bypass", > + "mux0", "mux1", "mux2", "mux3"; > + }; > + > + sdio_dllmst_clk: clock@ea0250 { > + compatible = "marvell,berlin2-clk-div"; > + #clock-cells = <0>; > + reg = <0xea00250 0x4>; > + clocks = <&syspll>, > + <&avpll 1 4>, <&avpll 1 5>, > + <&avpll 1 6>, <&avpll 1 7>; > + clock-names = "mux_bypass", > + "mux0", "mux1", "mux2", "mux3"; > + }; > + > apb@fc0000 { > compatible = "simple-bus"; > #address-cells = <1>; > @@ -183,7 +325,7 @@ > reg-shift = <2>; > reg-io-width = <1>; > interrupts = <8>; > - clocks = <&smclk>; > + clocks = <&refclk>; > status = "disabled"; > }; > > @@ -193,7 +335,7 @@ > reg-shift = <2>; > reg-io-width = <1>; > interrupts = <9>; > - clocks = <&smclk>; > + clocks = <&refclk>; > status = "disabled"; > }; > > diff --git a/drivers/clk/berlin/Makefile b/drivers/clk/berlin/Makefile > index f0a7dc8b5e30..2b33e1e74503 100644 > --- a/drivers/clk/berlin/Makefile > +++ b/drivers/clk/berlin/Makefile > @@ -1 +1,3 @@ > obj-y += berlin2-avpll.o berlin2-pll.o berlin2-div.o > +obj-$(CONFIG_MACH_BERLIN_BG2) += bg2.o > +obj-$(CONFIG_MACH_BERLIN_BG2CD) += bg2.o > diff --git a/include/dt-bindings/clock/berlin2.h b/include/dt-bindings/clock/berlin2.h > new file mode 100644 > index 000000000000..dacf7edec4d3 > --- /dev/null > +++ b/include/dt-bindings/clock/berlin2.h > @@ -0,0 +1,35 @@ > +/* > + * Berlin2 BG2/BG2CD clock tree IDs > + */ > + > +#define CLKID_SYS 0 > +#define CLKID_CPU 1 > +#define CLKID_DRMFIGO 2 > +#define CLKID_CFG 3 > +#define CLKID_GFX 4 > +#define CLKID_ZSP 5 > +#define CLKID_PERIF 6 > +#define CLKID_PCUBE 7 > +#define CLKID_VSCOPE 8 > +#define CLKID_NFC_ECC 9 > +#define CLKID_VPP 10 > +#define CLKID_APP 11 > +#define CLKID_AUDIO0 12 > +#define CLKID_AUDIO2 23 > +#define CLKID_AUDIO3 14 > +#define CLKID_AUDIO1 15 > +#define CLKID_GETH0 16 > +#define CLKID_GETH1 17 > +#define CLKID_SATA 18 > +#define CLKID_AHBAPB 19 > +#define CLKID_USB0 20 > +#define CLKID_USB1 21 > +#define CLKID_PBRIDGE 22 > +#define CLKID_SDIO0 23 > +#define CLKID_SDIO1 24 > +#define CLKID_NFC 25 > +#define CLKID_SMEMC 26 > +#define CLKID_AUDIOHD 27 > +#define CLKID_VIDEO0 28 > +#define CLKID_VIDEO1 29 > +#define CLKID_VIDEO2 30 > -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply [flat|nested] 24+ messages in thread
* [PATCH 8/8] ARM: dts: berlin: convert BG2 to DT clock nodes 2014-05-11 20:24 [PATCH 0/8] Marvell Berlin full clock support Sebastian Hesselbarth ` (2 preceding siblings ...) 2014-05-11 20:24 ` [PATCH 7/8] ARM: dts: berlin: convert BG2CD to DT clock nodes Sebastian Hesselbarth @ 2014-05-11 20:24 ` Sebastian Hesselbarth 2014-05-14 20:15 ` [PATCH v2 00/10] Marvell Berlin full clock support Sebastian Hesselbarth 4 siblings, 0 replies; 24+ messages in thread From: Sebastian Hesselbarth @ 2014-05-11 20:24 UTC (permalink / raw) To: Sebastian Hesselbarth Cc: Mike Turquette, Rob Herring, Pawel Moll, Mark Rutland, Ian Campbell, Kumar Gala, Russell King, Alexandre Belloni, Antoine Tenart, devicetree, linux-arm-kernel, linux-kernel This converts Berlin BG2 SoC dtsi to make use of the new DT clock nodes for Berlin SoCs. While at it, also fix up twdclk which is running at cpuclk/3 instead of sysclk. Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com> --- Cc: Mike Turquette <mturquette@linaro.org> Cc: Rob Herring <robh+dt@kernel.org> Cc: Pawel Moll <pawel.moll@arm.com> Cc: Mark Rutland <mark.rutland@arm.com> Cc: Ian Campbell <ijc+devicetree@hellion.org.uk> Cc: Kumar Gala <galak@codeaurora.org> Cc: Russell King <linux@arm.linux.org.uk> Cc: Alexandre Belloni <alexandre.belloni@free-electrons.com> Cc: Antoine Tenart <antoine.tenart@free-electrons.com> Cc: devicetree@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org --- arch/arm/boot/dts/berlin2.dtsi | 200 +++++++++++++++++++++++++++++++++++------ 1 file changed, 171 insertions(+), 29 deletions(-) diff --git a/arch/arm/boot/dts/berlin2.dtsi b/arch/arm/boot/dts/berlin2.dtsi index 56a1af2f1052..5d84171a1e4b 100644 --- a/arch/arm/boot/dts/berlin2.dtsi +++ b/arch/arm/boot/dts/berlin2.dtsi @@ -12,6 +12,7 @@ */ #include "skeleton.dtsi" +#include <dt-bindings/clock/berlin2.h> #include <dt-bindings/interrupt-controller/arm-gic.h> / { @@ -37,24 +38,18 @@ }; }; - clocks { - smclk: sysmgr-clock { - compatible = "fixed-clock"; - #clock-cells = <0>; - clock-frequency = <25000000>; - }; - - cfgclk: cfg-clock { - compatible = "fixed-clock"; - #clock-cells = <0>; - clock-frequency = <100000000>; - }; + refclk: oscillator { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = <25000000>; + }; - sysclk: system-clock { - compatible = "fixed-clock"; - #clock-cells = <0>; - clock-frequency = <400000000>; - }; + twdclk: twdclk { + compatible = "fixed-factor-clock"; + #clock-cells = <0>; + clocks = <&coreclk CLKID_CPU>; + clock-mult = <1>; + clock-div = <3>; }; soc { @@ -83,7 +78,7 @@ compatible = "arm,cortex-a9-twd-timer"; reg = <0xad0600 0x20>; interrupts = <GIC_PPI 13 IRQ_TYPE_LEVEL_HIGH>; - clocks = <&sysclk>; + clocks = <&twdclk>; }; apb@e80000 { @@ -98,7 +93,7 @@ compatible = "snps,dw-apb-timer"; reg = <0x2c00 0x14>; interrupts = <8>; - clocks = <&cfgclk>; + clocks = <&coreclk CLKID_CFG>; clock-names = "timer"; status = "okay"; }; @@ -107,7 +102,7 @@ compatible = "snps,dw-apb-timer"; reg = <0x2c14 0x14>; interrupts = <9>; - clocks = <&cfgclk>; + clocks = <&coreclk CLKID_CFG>; clock-names = "timer"; status = "okay"; }; @@ -116,7 +111,7 @@ compatible = "snps,dw-apb-timer"; reg = <0x2c28 0x14>; interrupts = <10>; - clocks = <&cfgclk>; + clocks = <&coreclk CLKID_CFG>; clock-names = "timer"; status = "disabled"; }; @@ -125,7 +120,7 @@ compatible = "snps,dw-apb-timer"; reg = <0x2c3c 0x14>; interrupts = <11>; - clocks = <&cfgclk>; + clocks = <&coreclk CLKID_CFG>; clock-names = "timer"; status = "disabled"; }; @@ -134,7 +129,7 @@ compatible = "snps,dw-apb-timer"; reg = <0x2c50 0x14>; interrupts = <12>; - clocks = <&cfgclk>; + clocks = <&coreclk CLKID_CFG>; clock-names = "timer"; status = "disabled"; }; @@ -143,7 +138,7 @@ compatible = "snps,dw-apb-timer"; reg = <0x2c64 0x14>; interrupts = <13>; - clocks = <&cfgclk>; + clocks = <&coreclk CLKID_CFG>; clock-names = "timer"; status = "disabled"; }; @@ -152,7 +147,7 @@ compatible = "snps,dw-apb-timer"; reg = <0x2c78 0x14>; interrupts = <14>; - clocks = <&cfgclk>; + clocks = <&coreclk CLKID_CFG>; clock-names = "timer"; status = "disabled"; }; @@ -161,7 +156,7 @@ compatible = "snps,dw-apb-timer"; reg = <0x2c8c 0x14>; interrupts = <15>; - clocks = <&cfgclk>; + clocks = <&coreclk CLKID_CFG>; clock-names = "timer"; status = "disabled"; }; @@ -176,6 +171,153 @@ }; }; + syspll: pll@ea0014 { + compatible = "marvell,berlin2-pll"; + #clock-cells = <0>; + reg = <0xea0014 0x14>; + clocks = <&refclk>; + }; + + mempll: pll@ea0028 { + compatible = "marvell,berlin2-pll"; + #clock-cells = <0>; + reg = <0xea0028 0x14>; + clocks = <&refclk>; + }; + + cpupll: pll@ea003c { + compatible = "marvell,berlin2-pll"; + #clock-cells = <0>; + reg = <0xea003c 0x14>; + clocks = <&refclk>; + }; + + avpll: pll@ea0040 { + compatible = "marvell,berlin2-avpll"; + #clock-cells = <2>; + reg = <0xea0050 0x100>; + clocks = <&refclk>; + }; + + coreclk: clock@ea0150 { + compatible = "marvell,berlin2-core-clocks"; + #clock-cells = <1>; + reg = <0xea0150 0x1c>; + clocks = <&refclk>, <&syspll>, <&mempll>, <&cpupll>, + <&avpll 0 1>, <&avpll 0 2>, + <&avpll 0 3>, <&avpll 0 4>, + <&avpll 0 5>, <&avpll 0 6>, + <&avpll 0 7>, <&avpll 0 8>, + <&avpll 1 1>, <&avpll 1 2>, + <&avpll 1 3>, <&avpll 1 4>, + <&avpll 1 5>, <&avpll 1 6>, + <&avpll 1 7>, <&avpll 1 8>; + clock-names = "refclk", "syspll", "mempll", "cpupll", + "avpll_a1", "avpll_a2", "avpll_a3", "avpll_a4", + "avpll_a5", "avpll_a6", "avpll_a7", "avpll_a8", + "avpll_b1", "avpll_b2", "avpll_b3", "avpll_b4", + "avpll_b5", "avpll_b6", "avpll_b7", "avpll_b8"; + }; + + gfx3dcore_clk: clock@ea022c { + compatible = "marvell,berlin2-clk-div"; + #clock-cells = <0>; + reg = <0xea0022c 0x4>; + clocks = <&syspll>, + <&avpll 1 4>, <&avpll 1 5>, + <&avpll 1 6>, <&avpll 1 7>; + clock-names = "mux_bypass", + "mux0", "mux1", "mux2", "mux3"; + }; + + gfx3dsys_clk: clock@ea0230 { + compatible = "marvell,berlin2-clk-div"; + #clock-cells = <0>; + reg = <0xea00230 0x4>; + clocks = <&syspll>, + <&avpll 1 4>, <&avpll 1 5>, + <&avpll 1 6>, <&avpll 1 7>; + clock-names = "mux_bypass", + "mux0", "mux1", "mux2", "mux3"; + }; + + arc_clk: clock@ea0234 { + compatible = "marvell,berlin2-clk-div"; + #clock-cells = <0>; + reg = <0xea00234 0x4>; + clocks = <&syspll>, + <&avpll 1 4>, <&avpll 1 5>, + <&avpll 1 6>, <&avpll 1 7>; + clock-names = "mux_bypass", + "mux0", "mux1", "mux2", "mux3"; + }; + + vip_clk: clock@ea0238 { + compatible = "marvell,berlin2-clk-div"; + #clock-cells = <0>; + reg = <0xea00238 0x4>; + clocks = <&syspll>, + <&avpll 1 4>, <&avpll 1 5>, + <&avpll 1 6>, <&avpll 1 7>; + clock-names = "mux_bypass", + "mux0", "mux1", "mux2", "mux3"; + }; + + sdio0xin_clk: clock@ea023c { + compatible = "marvell,berlin2-clk-div"; + #clock-cells = <0>; + reg = <0xea0023c 0x4>; + clocks = <&syspll>, + <&avpll 1 4>, <&avpll 1 5>, + <&avpll 1 6>, <&avpll 1 7>; + clock-names = "mux_bypass", + "mux0", "mux1", "mux2", "mux3"; + }; + + sdio1xin_clk: clock@ea0240 { + compatible = "marvell,berlin2-clk-div"; + #clock-cells = <0>; + reg = <0xea00240 0x4>; + clocks = <&syspll>, + <&avpll 1 4>, <&avpll 1 5>, + <&avpll 1 6>, <&avpll 1 7>; + clock-names = "mux_bypass", + "mux0", "mux1", "mux2", "mux3"; + }; + + gfx3dextra_clk: clock@ea0244 { + compatible = "marvell,berlin2-clk-div"; + #clock-cells = <0>; + reg = <0xea00244 0x4>; + clocks = <&syspll>, + <&avpll 1 4>, <&avpll 1 5>, + <&avpll 1 6>, <&avpll 1 7>; + clock-names = "mux_bypass", + "mux0", "mux1", "mux2", "mux3"; + }; + + gc360_clk: clock@ea024c { + compatible = "marvell,berlin2-clk-div"; + #clock-cells = <0>; + reg = <0xea0024c 0x4>; + clocks = <&syspll>, + <&avpll 1 4>, <&avpll 1 5>, + <&avpll 1 6>, <&avpll 1 7>; + clock-names = "mux_bypass", + "mux0", "mux1", "mux2", "mux3"; + }; + + sdio_dllmst_clk: clock@ea0250 { + compatible = "marvell,berlin2-clk-div"; + #clock-cells = <0>; + reg = <0xea00250 0x4>; + clocks = <&syspll>, + <&avpll 1 4>, <&avpll 1 5>, + <&avpll 1 6>, <&avpll 1 7>; + clock-names = "mux_bypass", + "mux0", "mux1", "mux2", "mux3"; + }; + apb@fc0000 { compatible = "simple-bus"; #address-cells = <1>; @@ -190,7 +332,7 @@ reg-shift = <2>; reg-io-width = <1>; interrupts = <8>; - clocks = <&smclk>; + clocks = <&refclk>; status = "disabled"; }; @@ -200,7 +342,7 @@ reg-shift = <2>; reg-io-width = <1>; interrupts = <9>; - clocks = <&smclk>; + clocks = <&refclk>; status = "disabled"; }; @@ -210,7 +352,7 @@ reg-shift = <2>; reg-io-width = <1>; interrupts = <10>; - clocks = <&smclk>; + clocks = <&refclk>; status = "disabled"; }; -- 1.9.1 ^ permalink raw reply related [flat|nested] 24+ messages in thread
* [PATCH v2 00/10] Marvell Berlin full clock support 2014-05-11 20:24 [PATCH 0/8] Marvell Berlin full clock support Sebastian Hesselbarth ` (3 preceding siblings ...) 2014-05-11 20:24 ` [PATCH 8/8] ARM: dts: berlin: convert BG2 " Sebastian Hesselbarth @ 2014-05-14 20:15 ` Sebastian Hesselbarth 2014-05-14 20:15 ` [PATCH v2 01/10] dt-binding: clk: add clock binding docs for Marvell Berlin2 SoCs Sebastian Hesselbarth ` (4 more replies) 4 siblings, 5 replies; 24+ messages in thread From: Sebastian Hesselbarth @ 2014-05-14 20:15 UTC (permalink / raw) To: Sebastian Hesselbarth Cc: Rob Herring, Pawel Moll, Mark Rutland, Ian Campbell, Kumar Gala, Randy Dunlap, Mike Turquette, Alexandre Belloni, Jisheng Zhang, devicetree, linux-doc, linux-arm-kernel, linux-kernel This is version 2 of a patch set to bring proper DT based clocks to Marvell Berlin SoCs. The overall changes are: * Dropped of_clk_create_name() helper Booting into an initramfs rootfs revealed that the unique clock names created with that helper clash with the way of_clk_get_parent_name() resolves the clock specifier to get the correct clock name. Anyway, I still consider the helper a good idea and postpone it to the next cycle when I have more time to look at the details. * Added BG2Q core clock driver and dtsi changes Alexandre just provided them, so I added them to this patch set. The single patch overview now is: Patch 1 adds the whole binding documentation for all clock related IP found on BG2, BG2CD, and BG2Q. Patch 2 adds corresponding dt-binding includes for the core clock indices to be used in both DT and the driver. Patches 3, 4, and 5 add clock drivers for the Audio/Video PLL, simple PLLs, and complex clock divider cells found on Berlin SoCs. Where required, currently known differences between BG2/BG2CD and BG2Q are taken care of. Patches 6 and 7 add core clock drivers for the remaining clocks of BG2/BG2CD and BG2Q. The register set dealing with it, is shared among input and bypass muxes, clock dividers and clock gates. Patches 8, 9, and 10 finally convert the DT SoC includes for BG2, BG2CD, and BG2Q to make use of the new clock related DT nodes. Alexandre Belloni (4): clk: berlin: add driver for BG2x simple PLLs clk: berlin: add driver for BG2x complex divider cells clk: berlin: add core clock driver for BG2Q ARM: dts: berlin: convert BG2Q to DT clock nodes Sebastian Hesselbarth (6): dt-binding: clk: add clock binding docs for Marvell Berlin2 SoCs clk: berlin: add binding include for BG2/BG2CD clock ids clk: berlin: add driver for BG2x audio/video PLL clk: berlin: add core clock driver for BG2/BG2CD ARM: dts: berlin: convert BG2CD to DT clock nodes ARM: dts: berlin: convert BG2 to DT clock nodes .../devicetree/bindings/clock/berlin2-clock.txt | 195 ++++++++ arch/arm/boot/dts/berlin2.dtsi | 207 +++++++-- arch/arm/boot/dts/berlin2cd.dtsi | 205 +++++++-- arch/arm/boot/dts/berlin2q.dtsi | 80 +++- drivers/clk/Makefile | 1 + drivers/clk/berlin/Makefile | 4 + drivers/clk/berlin/berlin2-avpll.c | 368 +++++++++++++++ drivers/clk/berlin/berlin2-div.c | 324 +++++++++++++ drivers/clk/berlin/berlin2-div.h | 80 ++++ drivers/clk/berlin/berlin2-pll.c | 168 +++++++ drivers/clk/berlin/bg2.c | 502 +++++++++++++++++++++ drivers/clk/berlin/bg2q.c | 269 +++++++++++ include/dt-bindings/clock/berlin2.h | 35 ++ include/dt-bindings/clock/berlin2q.h | 28 ++ 14 files changed, 2385 insertions(+), 81 deletions(-) create mode 100644 Documentation/devicetree/bindings/clock/berlin2-clock.txt create mode 100644 drivers/clk/berlin/Makefile create mode 100644 drivers/clk/berlin/berlin2-avpll.c create mode 100644 drivers/clk/berlin/berlin2-div.c create mode 100644 drivers/clk/berlin/berlin2-div.h create mode 100644 drivers/clk/berlin/berlin2-pll.c create mode 100644 drivers/clk/berlin/bg2.c create mode 100644 drivers/clk/berlin/bg2q.c create mode 100644 include/dt-bindings/clock/berlin2.h create mode 100644 include/dt-bindings/clock/berlin2q.h --- Cc: Rob Herring <robh+dt@kernel.org> Cc: Pawel Moll <pawel.moll@arm.com> Cc: Mark Rutland <mark.rutland@arm.com> Cc: Ian Campbell <ijc+devicetree@hellion.org.uk> Cc: Kumar Gala <galak@codeaurora.org> Cc: Randy Dunlap <rdunlap@infradead.org> Cc: Mike Turquette <mturquette@linaro.org> Cc: Alexandre Belloni <alexandre.belloni@free-electrons.com> Cc: Jisheng Zhang <jszhang@marvell.com> Cc: devicetree@vger.kernel.org Cc: linux-doc@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org -- 1.9.1 ^ permalink raw reply [flat|nested] 24+ messages in thread
* [PATCH v2 01/10] dt-binding: clk: add clock binding docs for Marvell Berlin2 SoCs 2014-05-14 20:15 ` [PATCH v2 00/10] Marvell Berlin full clock support Sebastian Hesselbarth @ 2014-05-14 20:15 ` Sebastian Hesselbarth 2014-05-14 20:15 ` [PATCH v2 02/10] clk: berlin: add binding include for BG2/BG2CD clock ids Sebastian Hesselbarth ` (3 subsequent siblings) 4 siblings, 0 replies; 24+ messages in thread From: Sebastian Hesselbarth @ 2014-05-14 20:15 UTC (permalink / raw) To: Sebastian Hesselbarth Cc: Mark Rutland, Jisheng Zhang, Mike Turquette, Pawel Moll, Ian Campbell, Randy Dunlap, linux-doc, linux-kernel, devicetree, Rob Herring, Alexandre Belloni, Kumar Gala, linux-arm-kernel This adds mandatory device tree binding documentation for the clock related IP found on Marvell Berlin2 (BG2, BG2CD, and BG2Q) SoCs. Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com> --- Changelog: v1->v2: - typo fixed (Reported by Alexandre Belloni) - added BG2Q core clock indices Cc: Rob Herring <robh+dt@kernel.org> Cc: Pawel Moll <pawel.moll@arm.com> Cc: Mark Rutland <mark.rutland@arm.com> Cc: Ian Campbell <ijc+devicetree@hellion.org.uk> Cc: Kumar Gala <galak@codeaurora.org> Cc: Randy Dunlap <rdunlap@infradead.org> Cc: Mike Turquette <mturquette@linaro.org> Cc: Alexandre Belloni <alexandre.belloni@free-electrons.com> Cc: Jisheng Zhang <jszhang@marvell.com> Cc: devicetree@vger.kernel.org Cc: linux-doc@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org --- .../devicetree/bindings/clock/berlin2-clock.txt | 195 +++++++++++++++++++++ 1 file changed, 195 insertions(+) create mode 100644 Documentation/devicetree/bindings/clock/berlin2-clock.txt diff --git a/Documentation/devicetree/bindings/clock/berlin2-clock.txt b/Documentation/devicetree/bindings/clock/berlin2-clock.txt new file mode 100644 index 000000000000..6ca380cf6e4f --- /dev/null +++ b/Documentation/devicetree/bindings/clock/berlin2-clock.txt @@ -0,0 +1,195 @@ +* Marvell Berlin2 clock bindings + +Marvell Berlin2 (BG2, BG2CD, BG2Q) share the same IP for PLLs and clocks, +with some minor differences in features and register layout. The below +describes the individual clock related IP: + +* Audio/Video PLL + +The Audio/Video PLL (AVPLL) is a dual-VCO PLL with 8 channels each. Each +of the VCOs can sythesize a single VCO frequency based on a single input +reference clock. Each of the 8 channels then, can derive an output clock +from that VCO frequency by various dividers/multipliers. + +Required properties: +- compatible: shall be "marvell,berlin2-avpll" +- reg: address and length of the corresponding AVPLL registers +- #clock-cells: shall be set to 2 +- clocks: single clock specifier referencing the AVPLL input clock + +To ease match-up with the desired AVPLL output clock, clock specifiers +referencing AVPLL clocks shall contain two cells. The first refers to +the VCO (0=AVPLL_A, 1=AVPLL_B) while the second refers to the corresponding +channel starting with 1. For example, to reference AVPLL_B3 the clock +specifier shall be: <&avpll 1 3>. + +Example: + +avpll: pll@ea0040 { + compatible = "marvell,berlin2-avpll"; + #clock-cells = <2>; + reg = <0xea0050 0x100>; + clocks = <&refclk>; +}; + +* Simple PLLs + +Simple PLLs are memory mapped PLLs that can sythesize a single output clock +based on a single input reference clock. + +Required properties: +- compatible: shall be one of the following: + "marvell,berlin2-pll" for Berlin BG2/BG2CD PLLs + "marvell,berlin2q-pll" for Berlin BG2Q PLLs +- reg: address and length of the corresponding PLL registers +- #clock-cells: shall be set to 0 +- clocks: single clock specifier referencing the PLL input clock + +Example: + +cpupll: pll@ea003c { + compatible = "marvell,berlin2-pll"; + #clock-cells = <0>; + reg = <0xea003c 0x14>; + clocks = <&refclk>; +}; + +* Single-register clock dividers + +Single-register clock dividers are complex divider cells, allowing +to divide a reference clock with a set of fixed dividers. Also they +comprise an input clock mux with bypass and an ouput clock gate. + +Required properties: +- compatible: shall be "marvell,berlin2-clk-div" +- reg: address and length of the corresponding DIV registers +- #clock-cells: shall be set to 0 +- clocks: clock specifiers referencing the DIV input clocks +- clock-names: array of strings describing the clock specifiers above. + Allowed clock-names are "mux_bypass" for the clock mux bypass selection + and "muxN" (N=0..7) for each of the 8 possible clock mux inputs. + +Example: + +gfx3dcore_clk: clock@ea022c { + compatible = "marvell,berlin2-clk-div"; + #clock-cells = <0>; + reg = <0xea0022c 0x4>; + clocks = <&syspll>, + <&avpll AVPLL_B 4>, <&avpll AVPLL_B 5>, + <&avpll AVPLL_B 6>, <&avpll AVPLL_B 7>; + clock-names = "mux_bypass", + "mux0", "mux1", "mux2", "mux3"; +}; + +* SoC-specific core clocks + +In addition to the above, there is a register set dealing with SoC +specific clock dividers, muxes, and gates. There is also the complex +divider cell used above, but instead of independent registers, they +share a common set of registers. The core clocks are represented by +a single DT node providing access to the remaining clocks. + +Required properties: +- compatible: shall be one of + "marvell,berlin2-core-clocks" for BG2/BG2CD SoCs + "marvell,berlin2q-core-clocks" for BG2Q SoCs +- reg: address and length of the corresponding clock registers +- #clock-cells: shall be set to 1 +- clocks: clock specifiers referencing the core clock input clocks +- clock-names: array of strings describing the clock specifiers above. + Allowed clock-names for the reference clocks are + "refclk", "syspll", "mempll", "cpupll" + also Audio/Video PLL clocks shall be named with + "avpll_VN" (V=0...1 for AVPLL_A and AVPLL_B, N=1..8 for the + corresponding reference input from AVPLL). + +Optional properties for BG2/BG2CD SoCs: +- clocks/clock-names: in addition to the allowed clock names above, + there is an external video clock input that shall be named "video_ext0". + +Clocks provided by core clocks shall be referenced by a clock specifier +indexing one of the provided clocks. A SoC-specific list of available clocks +is below the example. + +Example: +coreclk: clock@ea0150 { + compatible = "marvell,berlin2-core-clocks"; + #clock-cells = <1>; + reg = <0xea0150 0x1c>; + clocks = <&refclk>, <&syspll>, <&mempll>, <&cpupll>, + <&avpll 0 1>, <&avpll 0 2>, + <&avpll 0 3>, <&avpll 0 4>, + <&avpll 0 5>, <&avpll 0 6>, + <&avpll 0 7>, <&avpll 0 8>, + <&avpll 1 1>, <&avpll 1 2>, + <&avpll 1 3>, <&avpll 1 4>, + <&avpll 1 5>, <&avpll 1 6>, + <&avpll 1 7>, <&avpll 1 8>, + <&externalvideoclk>; + clock-names = "refclk", "syspll", "mempll", "cpupll", + "avpll_a1", "avpll_a2", "avpll_a3", "avpll_a4", + "avpll_a5", "avpll_a6", "avpll_a7", "avpll_a8", + "avpll_b1", "avpll_b2", "avpll_b3", "avpll_b4", + "avpll_b5", "avpll_b6", "avpll_b7", "avpll_b8", + "video_ext0"; +}; + +* BG2/BG2CD core clock indicies: +0 - SYS +1 - CPU +2 - DRMFIGO +3 - CFG +4 - GFX +5 - ZSP +6 - PERIF +7 - PCUBE +8 - VSCOPE +9 - NFC_ECC +10 - VPP +11 - APP +12 - AUDIO0 +23 - AUDIO2 +14 - AUDIO3 +15 - AUDIO1 +16 - GETH0 +17 - GETH1 +18 - SATA +19 - AHBAPB +20 - USB0 +21 - USB1 +22 - PBRIDGE +23 - SDIO0 +24 - SDIO1 +25 - NFC +26 - SMEMC +27 - AUDIOHD +28 - VIDEO0 +29 - VIDEO1 +30 - VIDEO2 + +* BG2Q core clock indicies: +0 - SYS +1 - DRMFIGO +2 - CFG +3 - GFX2D +4 - ZSP +5 - PERIF +6 - PCUBE +7 - VSCOPE +8 - NFC_ECC +9 - VPP +10 - APP +11 - GFX2DAXI +12 - GETH0 +13 - SATA +14 - AHBAPB +15 - USB0 +16 - USB1 +17 - USB2 +18 - USB3 +19 - PBRIDGE +20 - SDIO +21 - NFC +22 - SMEMC +23 - PCIE -- 1.9.1 ^ permalink raw reply related [flat|nested] 24+ messages in thread
* [PATCH v2 02/10] clk: berlin: add binding include for BG2/BG2CD clock ids 2014-05-14 20:15 ` [PATCH v2 00/10] Marvell Berlin full clock support Sebastian Hesselbarth 2014-05-14 20:15 ` [PATCH v2 01/10] dt-binding: clk: add clock binding docs for Marvell Berlin2 SoCs Sebastian Hesselbarth @ 2014-05-14 20:15 ` Sebastian Hesselbarth 2014-05-14 20:15 ` [PATCH v2 08/10] ARM: dts: berlin: convert BG2CD to DT clock nodes Sebastian Hesselbarth ` (2 subsequent siblings) 4 siblings, 0 replies; 24+ messages in thread From: Sebastian Hesselbarth @ 2014-05-14 20:15 UTC (permalink / raw) To: Sebastian Hesselbarth Cc: Mark Rutland, Jisheng Zhang, Mike Turquette, Pawel Moll, Ian Campbell, linux-kernel, devicetree, Rob Herring, Alexandre Belloni, Kumar Gala, linux-arm-kernel This adds a dt-binding include for Marvell Berlin BG2/BG2CD and BG2Q core clock IDs. Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com> --- Changelog: v1->v2: - separate patch to make it usable in the driver (Suggested by Alexandre Belloni) Cc: Rob Herring <robh+dt@kernel.org> Cc: Pawel Moll <pawel.moll@arm.com> Cc: Mark Rutland <mark.rutland@arm.com> Cc: Ian Campbell <ijc+devicetree@hellion.org.uk> Cc: Kumar Gala <galak@codeaurora.org> Cc: Mike Turquette <mturquette@linaro.org> Cc: Alexandre Belloni <alexandre.belloni@free-electrons.com> Cc: Jisheng Zhang <jszhang@marvell.com> Cc: devicetree@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org --- include/dt-bindings/clock/berlin2.h | 35 +++++++++++++++++++++++++++++++++++ include/dt-bindings/clock/berlin2q.h | 28 ++++++++++++++++++++++++++++ 2 files changed, 63 insertions(+) create mode 100644 include/dt-bindings/clock/berlin2.h create mode 100644 include/dt-bindings/clock/berlin2q.h diff --git a/include/dt-bindings/clock/berlin2.h b/include/dt-bindings/clock/berlin2.h new file mode 100644 index 000000000000..dacf7edec4d3 --- /dev/null +++ b/include/dt-bindings/clock/berlin2.h @@ -0,0 +1,35 @@ +/* + * Berlin2 BG2/BG2CD clock tree IDs + */ + +#define CLKID_SYS 0 +#define CLKID_CPU 1 +#define CLKID_DRMFIGO 2 +#define CLKID_CFG 3 +#define CLKID_GFX 4 +#define CLKID_ZSP 5 +#define CLKID_PERIF 6 +#define CLKID_PCUBE 7 +#define CLKID_VSCOPE 8 +#define CLKID_NFC_ECC 9 +#define CLKID_VPP 10 +#define CLKID_APP 11 +#define CLKID_AUDIO0 12 +#define CLKID_AUDIO2 23 +#define CLKID_AUDIO3 14 +#define CLKID_AUDIO1 15 +#define CLKID_GETH0 16 +#define CLKID_GETH1 17 +#define CLKID_SATA 18 +#define CLKID_AHBAPB 19 +#define CLKID_USB0 20 +#define CLKID_USB1 21 +#define CLKID_PBRIDGE 22 +#define CLKID_SDIO0 23 +#define CLKID_SDIO1 24 +#define CLKID_NFC 25 +#define CLKID_SMEMC 26 +#define CLKID_AUDIOHD 27 +#define CLKID_VIDEO0 28 +#define CLKID_VIDEO1 29 +#define CLKID_VIDEO2 30 diff --git a/include/dt-bindings/clock/berlin2q.h b/include/dt-bindings/clock/berlin2q.h new file mode 100644 index 000000000000..069d6516ea9c --- /dev/null +++ b/include/dt-bindings/clock/berlin2q.h @@ -0,0 +1,28 @@ +/* + * Berlin2 BG2Q clock tree IDs + */ + +#define CLKID_SYS 0 +#define CLKID_DRMFIGO 1 +#define CLKID_CFG 2 +#define CLKID_GFX2D 3 +#define CLKID_ZSP 4 +#define CLKID_PERIF 5 +#define CLKID_PCUBE 6 +#define CLKID_VSCOPE 7 +#define CLKID_NFC_ECC 8 +#define CLKID_VPP 9 +#define CLKID_APP 10 +#define CLKID_GFX2DAXI 11 +#define CLKID_GETH0 12 +#define CLKID_SATA 13 +#define CLKID_AHBAPB 14 +#define CLKID_USB0 15 +#define CLKID_USB1 16 +#define CLKID_USB2 17 +#define CLKID_USB3 18 +#define CLKID_PBRIDGE 19 +#define CLKID_SDIO 20 +#define CLKID_NFC 21 +#define CLKID_SMEMC 22 +#define CLKID_PCIE 23 -- 1.9.1 ^ permalink raw reply related [flat|nested] 24+ messages in thread
* [PATCH v2 08/10] ARM: dts: berlin: convert BG2CD to DT clock nodes 2014-05-14 20:15 ` [PATCH v2 00/10] Marvell Berlin full clock support Sebastian Hesselbarth 2014-05-14 20:15 ` [PATCH v2 01/10] dt-binding: clk: add clock binding docs for Marvell Berlin2 SoCs Sebastian Hesselbarth 2014-05-14 20:15 ` [PATCH v2 02/10] clk: berlin: add binding include for BG2/BG2CD clock ids Sebastian Hesselbarth @ 2014-05-14 20:15 ` Sebastian Hesselbarth 2014-05-14 20:15 ` [PATCH v2 09/10] ARM: dts: berlin: convert BG2 " Sebastian Hesselbarth 2014-05-14 20:15 ` [PATCH v2 10/10] ARM: dts: berlin: convert BG2Q " Sebastian Hesselbarth 4 siblings, 0 replies; 24+ messages in thread From: Sebastian Hesselbarth @ 2014-05-14 20:15 UTC (permalink / raw) To: Sebastian Hesselbarth Cc: Rob Herring, Pawel Moll, Mark Rutland, Ian Campbell, Kumar Gala, Mike Turquette, Alexandre Belloni, Jisheng Zhang, devicetree, linux-arm-kernel, linux-kernel This converts Berlin BG2CD SoC dtsi to make use of the new DT clock nodes for Berlin SoCs. Also add a binding include to ease core clock references. Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com> --- Changelog: v1->v2: - dropped of_clk_create_name() usage required unique node names for clocks and plls - added clock-output-names to allow fixed-factor-clock to find its parent name Cc: Rob Herring <robh+dt@kernel.org> Cc: Pawel Moll <pawel.moll@arm.com> Cc: Mark Rutland <mark.rutland@arm.com> Cc: Ian Campbell <ijc+devicetree@hellion.org.uk> Cc: Kumar Gala <galak@codeaurora.org> Cc: Mike Turquette <mturquette@linaro.org> Cc: Alexandre Belloni <alexandre.belloni@free-electrons.com> Cc: Jisheng Zhang <jszhang@marvell.com> Cc: devicetree@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org --- arch/arm/boot/dts/berlin2cd.dtsi | 205 +++++++++++++++++++++++++++++++++------ 1 file changed, 177 insertions(+), 28 deletions(-) diff --git a/arch/arm/boot/dts/berlin2cd.dtsi b/arch/arm/boot/dts/berlin2cd.dtsi index 6eb1bdae23ac..818c7557bad5 100644 --- a/arch/arm/boot/dts/berlin2cd.dtsi +++ b/arch/arm/boot/dts/berlin2cd.dtsi @@ -12,6 +12,7 @@ */ #include "skeleton.dtsi" +#include <dt-bindings/clock/berlin2.h> #include <dt-bindings/interrupt-controller/arm-gic.h> / { @@ -30,24 +31,18 @@ }; }; - clocks { - smclk: sysmgr-clock { - compatible = "fixed-clock"; - #clock-cells = <0>; - clock-frequency = <25000000>; - }; - - cfgclk: cfg-clock { - compatible = "fixed-clock"; - #clock-cells = <0>; - clock-frequency = <75000000>; - }; + refclk: oscillator { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = <25000000>; + }; - sysclk: system-clock { - compatible = "fixed-clock"; - #clock-cells = <0>; - clock-frequency = <300000000>; - }; + twdclk: twdclk { + compatible = "fixed-factor-clock"; + #clock-cells = <0>; + clocks = <&coreclk CLKID_CPU>; + clock-mult = <1>; + clock-div = <3>; }; soc { @@ -76,7 +71,7 @@ compatible = "arm,cortex-a9-twd-timer"; reg = <0xad0600 0x20>; interrupts = <GIC_PPI 13 IRQ_TYPE_LEVEL_HIGH>; - clocks = <&sysclk>; + clocks = <&twdclk>; }; apb@e80000 { @@ -163,7 +158,7 @@ compatible = "snps,dw-apb-timer"; reg = <0x2c00 0x14>; interrupts = <8>; - clocks = <&cfgclk>; + clocks = <&coreclk CLKID_CFG>; clock-names = "timer"; status = "okay"; }; @@ -172,7 +167,7 @@ compatible = "snps,dw-apb-timer"; reg = <0x2c14 0x14>; interrupts = <9>; - clocks = <&cfgclk>; + clocks = <&coreclk CLKID_CFG>; clock-names = "timer"; status = "okay"; }; @@ -181,7 +176,7 @@ compatible = "snps,dw-apb-timer"; reg = <0x2c28 0x14>; interrupts = <10>; - clocks = <&cfgclk>; + clocks = <&coreclk CLKID_CFG>; clock-names = "timer"; status = "disabled"; }; @@ -190,7 +185,7 @@ compatible = "snps,dw-apb-timer"; reg = <0x2c3c 0x14>; interrupts = <11>; - clocks = <&cfgclk>; + clocks = <&coreclk CLKID_CFG>; clock-names = "timer"; status = "disabled"; }; @@ -199,7 +194,7 @@ compatible = "snps,dw-apb-timer"; reg = <0x2c50 0x14>; interrupts = <12>; - clocks = <&cfgclk>; + clocks = <&coreclk CLKID_CFG>; clock-names = "timer"; status = "disabled"; }; @@ -208,7 +203,7 @@ compatible = "snps,dw-apb-timer"; reg = <0x2c64 0x14>; interrupts = <13>; - clocks = <&cfgclk>; + clocks = <&coreclk CLKID_CFG>; clock-names = "timer"; status = "disabled"; }; @@ -217,7 +212,7 @@ compatible = "snps,dw-apb-timer"; reg = <0x2c78 0x14>; interrupts = <14>; - clocks = <&cfgclk>; + clocks = <&coreclk CLKID_CFG>; clock-names = "timer"; status = "disabled"; }; @@ -226,7 +221,7 @@ compatible = "snps,dw-apb-timer"; reg = <0x2c8c 0x14>; interrupts = <15>; - clocks = <&cfgclk>; + clocks = <&coreclk CLKID_CFG>; clock-names = "timer"; status = "disabled"; }; @@ -241,6 +236,160 @@ }; }; + syspll: syspll@ea0014 { + compatible = "marvell,berlin2-pll"; + #clock-cells = <0>; + reg = <0xea0014 0x14>; + clocks = <&refclk>; + }; + + mempll: mempll@ea0028 { + compatible = "marvell,berlin2-pll"; + #clock-cells = <0>; + reg = <0xea0028 0x14>; + clocks = <&refclk>; + }; + + cpupll: cpupll@ea003c { + compatible = "marvell,berlin2-pll"; + #clock-cells = <0>; + reg = <0xea003c 0x14>; + clocks = <&refclk>; + }; + + avpll: avpll@ea0040 { + compatible = "marvell,berlin2-avpll"; + #clock-cells = <2>; + reg = <0xea0050 0x100>; + clocks = <&refclk>; + }; + + coreclk: core-clock@ea0150 { + compatible = "marvell,berlin2-core-clocks"; + #clock-cells = <1>; + reg = <0xea0150 0x1c>; + clocks = <&refclk>, <&syspll>, <&mempll>, <&cpupll>, + <&avpll 0 1>, <&avpll 0 2>, + <&avpll 0 3>, <&avpll 0 4>, + <&avpll 0 5>, <&avpll 0 6>, + <&avpll 0 7>, <&avpll 0 8>, + <&avpll 1 1>, <&avpll 1 2>, + <&avpll 1 3>, <&avpll 1 4>, + <&avpll 1 5>, <&avpll 1 6>, + <&avpll 1 7>, <&avpll 1 8>; + clock-names = "refclk", "syspll", "mempll", "cpupll", + "avpll_a1", "avpll_a2", "avpll_a3", "avpll_a4", + "avpll_a5", "avpll_a6", "avpll_a7", "avpll_a8", + "avpll_b1", "avpll_b2", "avpll_b3", "avpll_b4", + "avpll_b5", "avpll_b6", "avpll_b7", "avpll_b8"; + clock-output-names = "sys", "cpu", "drmfigo", "cfg", + "gfx", "zsp", "perif", "pcube", "vscope", + "nfc_ecc", "vpp", "app", "audio0", "audio2", + "audio3", "audio1", "geth0", "geth1", "sata", + "ahbapb", "usb0", "usb1", "pbridge", "sdio0", + "sdio1", "nfc", "smemc", "audiohd", "video0", + "video1", "video2"; + }; + + gfx3dcore_clk: gfx3dcore@ea022c { + compatible = "marvell,berlin2-clk-div"; + #clock-cells = <0>; + reg = <0xea022c 0x4>; + clocks = <&syspll>, + <&avpll 1 4>, <&avpll 1 5>, + <&avpll 1 6>, <&avpll 1 7>; + clock-names = "mux_bypass", + "mux0", "mux1", "mux2", "mux3"; + }; + + gfx3dsys_clk: gfx3dsys@ea0230 { + compatible = "marvell,berlin2-clk-div"; + #clock-cells = <0>; + reg = <0xea0230 0x4>; + clocks = <&syspll>, + <&avpll 1 4>, <&avpll 1 5>, + <&avpll 1 6>, <&avpll 1 7>; + clock-names = "mux_bypass", + "mux0", "mux1", "mux2", "mux3"; + }; + + arc_clk: arc@ea0234 { + compatible = "marvell,berlin2-clk-div"; + #clock-cells = <0>; + reg = <0xea0234 0x4>; + clocks = <&syspll>, + <&avpll 1 4>, <&avpll 1 5>, + <&avpll 1 6>, <&avpll 1 7>; + clock-names = "mux_bypass", + "mux0", "mux1", "mux2", "mux3"; + }; + + vip_clk: vip@ea0238 { + compatible = "marvell,berlin2-clk-div"; + #clock-cells = <0>; + reg = <0xea0238 0x4>; + clocks = <&syspll>, + <&avpll 1 4>, <&avpll 1 5>, + <&avpll 1 6>, <&avpll 1 7>; + clock-names = "mux_bypass", + "mux0", "mux1", "mux2", "mux3"; + }; + + sdio0xin_clk: sdio0xin@ea023c { + compatible = "marvell,berlin2-clk-div"; + #clock-cells = <0>; + reg = <0xea023c 0x4>; + clocks = <&syspll>, + <&avpll 1 4>, <&avpll 1 5>, + <&avpll 1 6>, <&avpll 1 7>; + clock-names = "mux_bypass", + "mux0", "mux1", "mux2", "mux3"; + }; + + sdio1xin_clk: sdio1xin@ea0240 { + compatible = "marvell,berlin2-clk-div"; + #clock-cells = <0>; + reg = <0xea0240 0x4>; + clocks = <&syspll>, + <&avpll 1 4>, <&avpll 1 5>, + <&avpll 1 6>, <&avpll 1 7>; + clock-names = "mux_bypass", + "mux0", "mux1", "mux2", "mux3"; + }; + + gfx3dextra_clk: gfx3dextra@ea0244 { + compatible = "marvell,berlin2-clk-div"; + #clock-cells = <0>; + reg = <0xea0244 0x4>; + clocks = <&syspll>, + <&avpll 1 4>, <&avpll 1 5>, + <&avpll 1 6>, <&avpll 1 7>; + clock-names = "mux_bypass", + "mux0", "mux1", "mux2", "mux3"; + }; + + gc360_clk: gc360@ea024c { + compatible = "marvell,berlin2-clk-div"; + #clock-cells = <0>; + reg = <0xea024c 0x4>; + clocks = <&syspll>, + <&avpll 1 4>, <&avpll 1 5>, + <&avpll 1 6>, <&avpll 1 7>; + clock-names = "mux_bypass", + "mux0", "mux1", "mux2", "mux3"; + }; + + sdio_dllmst_clk: sdio_dllmst@ea0250 { + compatible = "marvell,berlin2-clk-div"; + #clock-cells = <0>; + reg = <0xea0250 0x4>; + clocks = <&syspll>, + <&avpll 1 4>, <&avpll 1 5>, + <&avpll 1 6>, <&avpll 1 7>; + clock-names = "mux_bypass", + "mux0", "mux1", "mux2", "mux3"; + }; + apb@fc0000 { compatible = "simple-bus"; #address-cells = <1>; @@ -285,7 +434,7 @@ reg-shift = <2>; reg-io-width = <1>; interrupts = <8>; - clocks = <&smclk>; + clocks = <&refclk>; status = "disabled"; }; @@ -295,7 +444,7 @@ reg-shift = <2>; reg-io-width = <1>; interrupts = <9>; - clocks = <&smclk>; + clocks = <&refclk>; status = "disabled"; }; -- 1.9.1 ^ permalink raw reply related [flat|nested] 24+ messages in thread
* [PATCH v2 09/10] ARM: dts: berlin: convert BG2 to DT clock nodes 2014-05-14 20:15 ` [PATCH v2 00/10] Marvell Berlin full clock support Sebastian Hesselbarth ` (2 preceding siblings ...) 2014-05-14 20:15 ` [PATCH v2 08/10] ARM: dts: berlin: convert BG2CD to DT clock nodes Sebastian Hesselbarth @ 2014-05-14 20:15 ` Sebastian Hesselbarth 2014-05-14 20:15 ` [PATCH v2 10/10] ARM: dts: berlin: convert BG2Q " Sebastian Hesselbarth 4 siblings, 0 replies; 24+ messages in thread From: Sebastian Hesselbarth @ 2014-05-14 20:15 UTC (permalink / raw) To: Sebastian Hesselbarth Cc: Rob Herring, Pawel Moll, Mark Rutland, Ian Campbell, Kumar Gala, Mike Turquette, Alexandre Belloni, Jisheng Zhang, devicetree, linux-arm-kernel, linux-kernel This converts Berlin BG2 SoC dtsi to make use of the new DT clock nodes for Berlin SoCs. While at it, also fix up twdclk which is running at cpuclk/3 instead of sysclk. Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com> --- Changelog: v1->v2: - dropped of_clk_create_name() usage required unique node names for clocks and plls - added clock-output-names to allow fixed-factor-clock to find its parent name Cc: Rob Herring <robh+dt@kernel.org> Cc: Pawel Moll <pawel.moll@arm.com> Cc: Mark Rutland <mark.rutland@arm.com> Cc: Ian Campbell <ijc+devicetree@hellion.org.uk> Cc: Kumar Gala <galak@codeaurora.org> Cc: Mike Turquette <mturquette@linaro.org> Cc: Alexandre Belloni <alexandre.belloni@free-electrons.com> Cc: Jisheng Zhang <jszhang@marvell.com> Cc: devicetree@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org --- arch/arm/boot/dts/berlin2.dtsi | 207 +++++++++++++++++++++++++++++++++++------ 1 file changed, 178 insertions(+), 29 deletions(-) diff --git a/arch/arm/boot/dts/berlin2.dtsi b/arch/arm/boot/dts/berlin2.dtsi index 57cadd31f4e1..edeecb711e97 100644 --- a/arch/arm/boot/dts/berlin2.dtsi +++ b/arch/arm/boot/dts/berlin2.dtsi @@ -12,6 +12,7 @@ */ #include "skeleton.dtsi" +#include <dt-bindings/clock/berlin2.h> #include <dt-bindings/interrupt-controller/arm-gic.h> / { @@ -37,24 +38,18 @@ }; }; - clocks { - smclk: sysmgr-clock { - compatible = "fixed-clock"; - #clock-cells = <0>; - clock-frequency = <25000000>; - }; - - cfgclk: cfg-clock { - compatible = "fixed-clock"; - #clock-cells = <0>; - clock-frequency = <100000000>; - }; + refclk: oscillator { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = <25000000>; + }; - sysclk: system-clock { - compatible = "fixed-clock"; - #clock-cells = <0>; - clock-frequency = <400000000>; - }; + twdclk: twdclk { + compatible = "fixed-factor-clock"; + #clock-cells = <0>; + clocks = <&coreclk CLKID_CPU>; + clock-mult = <1>; + clock-div = <3>; }; soc { @@ -88,7 +83,7 @@ compatible = "arm,cortex-a9-twd-timer"; reg = <0xad0600 0x20>; interrupts = <GIC_PPI 13 IRQ_TYPE_LEVEL_HIGH>; - clocks = <&sysclk>; + clocks = <&twdclk>; }; apb@e80000 { @@ -175,7 +170,7 @@ compatible = "snps,dw-apb-timer"; reg = <0x2c00 0x14>; interrupts = <8>; - clocks = <&cfgclk>; + clocks = <&coreclk CLKID_CFG>; clock-names = "timer"; status = "okay"; }; @@ -184,7 +179,7 @@ compatible = "snps,dw-apb-timer"; reg = <0x2c14 0x14>; interrupts = <9>; - clocks = <&cfgclk>; + clocks = <&coreclk CLKID_CFG>; clock-names = "timer"; status = "okay"; }; @@ -193,7 +188,7 @@ compatible = "snps,dw-apb-timer"; reg = <0x2c28 0x14>; interrupts = <10>; - clocks = <&cfgclk>; + clocks = <&coreclk CLKID_CFG>; clock-names = "timer"; status = "disabled"; }; @@ -202,7 +197,7 @@ compatible = "snps,dw-apb-timer"; reg = <0x2c3c 0x14>; interrupts = <11>; - clocks = <&cfgclk>; + clocks = <&coreclk CLKID_CFG>; clock-names = "timer"; status = "disabled"; }; @@ -211,7 +206,7 @@ compatible = "snps,dw-apb-timer"; reg = <0x2c50 0x14>; interrupts = <12>; - clocks = <&cfgclk>; + clocks = <&coreclk CLKID_CFG>; clock-names = "timer"; status = "disabled"; }; @@ -220,7 +215,7 @@ compatible = "snps,dw-apb-timer"; reg = <0x2c64 0x14>; interrupts = <13>; - clocks = <&cfgclk>; + clocks = <&coreclk CLKID_CFG>; clock-names = "timer"; status = "disabled"; }; @@ -229,7 +224,7 @@ compatible = "snps,dw-apb-timer"; reg = <0x2c78 0x14>; interrupts = <14>; - clocks = <&cfgclk>; + clocks = <&coreclk CLKID_CFG>; clock-names = "timer"; status = "disabled"; }; @@ -238,7 +233,7 @@ compatible = "snps,dw-apb-timer"; reg = <0x2c8c 0x14>; interrupts = <15>; - clocks = <&cfgclk>; + clocks = <&coreclk CLKID_CFG>; clock-names = "timer"; status = "disabled"; }; @@ -253,11 +248,165 @@ }; }; + syspll: syspll@ea0014 { + compatible = "marvell,berlin2-pll"; + #clock-cells = <0>; + reg = <0xea0014 0x14>; + clocks = <&refclk>; + }; + + mempll: mempll@ea0028 { + compatible = "marvell,berlin2-pll"; + #clock-cells = <0>; + reg = <0xea0028 0x14>; + clocks = <&refclk>; + }; + + cpupll: cpupll@ea003c { + compatible = "marvell,berlin2-pll"; + #clock-cells = <0>; + reg = <0xea003c 0x14>; + clocks = <&refclk>; + }; + + avpll: avpll@ea0040 { + compatible = "marvell,berlin2-avpll"; + #clock-cells = <2>; + reg = <0xea0050 0x100>; + clocks = <&refclk>; + }; + + coreclk: core-clock@ea0150 { + compatible = "marvell,berlin2-core-clocks"; + #clock-cells = <1>; + reg = <0xea0150 0x1c>; + clocks = <&refclk>, <&syspll>, <&mempll>, <&cpupll>, + <&avpll 0 1>, <&avpll 0 2>, + <&avpll 0 3>, <&avpll 0 4>, + <&avpll 0 5>, <&avpll 0 6>, + <&avpll 0 7>, <&avpll 0 8>, + <&avpll 1 1>, <&avpll 1 2>, + <&avpll 1 3>, <&avpll 1 4>, + <&avpll 1 5>, <&avpll 1 6>, + <&avpll 1 7>, <&avpll 1 8>; + clock-names = "refclk", "syspll", "mempll", "cpupll", + "avpll_a1", "avpll_a2", "avpll_a3", "avpll_a4", + "avpll_a5", "avpll_a6", "avpll_a7", "avpll_a8", + "avpll_b1", "avpll_b2", "avpll_b3", "avpll_b4", + "avpll_b5", "avpll_b6", "avpll_b7", "avpll_b8"; + clock-output-names = "sys", "cpu", "drmfigo", "cfg", + "gfx", "zsp", "perif", "pcube", "vscope", + "nfc_ecc", "vpp", "app", "audio0", "audio2", + "audio3", "audio1", "geth0", "geth1", "sata", + "ahbapb", "usb0", "usb1", "pbridge", "sdio0", + "sdio1", "nfc", "smemc", "audiohd", "video0", + "video1", "video2"; + }; + generic-regs@ea0184 { compatible = "marvell,berlin-generic-regs", "syscon"; reg = <0xea0184 0x10>; }; + gfx3dcore_clk: gfx3dcore@ea022c { + compatible = "marvell,berlin2-clk-div"; + #clock-cells = <0>; + reg = <0xea022c 0x4>; + clocks = <&syspll>, + <&avpll 1 4>, <&avpll 1 5>, + <&avpll 1 6>, <&avpll 1 7>; + clock-names = "mux_bypass", + "mux0", "mux1", "mux2", "mux3"; + }; + + gfx3dsys_clk: gfx3dsys@ea0230 { + compatible = "marvell,berlin2-clk-div"; + #clock-cells = <0>; + reg = <0xea0230 0x4>; + clocks = <&syspll>, + <&avpll 1 4>, <&avpll 1 5>, + <&avpll 1 6>, <&avpll 1 7>; + clock-names = "mux_bypass", + "mux0", "mux1", "mux2", "mux3"; + }; + + arc_clk: arc@ea0234 { + compatible = "marvell,berlin2-clk-div"; + #clock-cells = <0>; + reg = <0xea0234 0x4>; + clocks = <&syspll>, + <&avpll 1 4>, <&avpll 1 5>, + <&avpll 1 6>, <&avpll 1 7>; + clock-names = "mux_bypass", + "mux0", "mux1", "mux2", "mux3"; + }; + + vip_clk: vip@ea0238 { + compatible = "marvell,berlin2-clk-div"; + #clock-cells = <0>; + reg = <0xea0238 0x4>; + clocks = <&syspll>, + <&avpll 1 4>, <&avpll 1 5>, + <&avpll 1 6>, <&avpll 1 7>; + clock-names = "mux_bypass", + "mux0", "mux1", "mux2", "mux3"; + }; + + sdio0xin_clk: sdio0xin@ea023c { + compatible = "marvell,berlin2-clk-div"; + #clock-cells = <0>; + reg = <0xea023c 0x4>; + clocks = <&syspll>, + <&avpll 1 4>, <&avpll 1 5>, + <&avpll 1 6>, <&avpll 1 7>; + clock-names = "mux_bypass", + "mux0", "mux1", "mux2", "mux3"; + }; + + sdio1xin_clk: sdio1xin@ea0240 { + compatible = "marvell,berlin2-clk-div"; + #clock-cells = <0>; + reg = <0xea0240 0x4>; + clocks = <&syspll>, + <&avpll 1 4>, <&avpll 1 5>, + <&avpll 1 6>, <&avpll 1 7>; + clock-names = "mux_bypass", + "mux0", "mux1", "mux2", "mux3"; + }; + + gfx3dextra_clk: gfx3dextra@ea0244 { + compatible = "marvell,berlin2-clk-div"; + #clock-cells = <0>; + reg = <0xea0244 0x4>; + clocks = <&syspll>, + <&avpll 1 4>, <&avpll 1 5>, + <&avpll 1 6>, <&avpll 1 7>; + clock-names = "mux_bypass", + "mux0", "mux1", "mux2", "mux3"; + }; + + gc360_clk: gc360@ea024c { + compatible = "marvell,berlin2-clk-div"; + #clock-cells = <0>; + reg = <0xea024c 0x4>; + clocks = <&syspll>, + <&avpll 1 4>, <&avpll 1 5>, + <&avpll 1 6>, <&avpll 1 7>; + clock-names = "mux_bypass", + "mux0", "mux1", "mux2", "mux3"; + }; + + sdio_dllmst_clk: sdio_dllmst@ea0250 { + compatible = "marvell,berlin2-clk-div"; + #clock-cells = <0>; + reg = <0xea0250 0x4>; + clocks = <&syspll>, + <&avpll 1 4>, <&avpll 1 5>, + <&avpll 1 6>, <&avpll 1 7>; + clock-names = "mux_bypass", + "mux0", "mux1", "mux2", "mux3"; + }; + apb@fc0000 { compatible = "simple-bus"; #address-cells = <1>; @@ -305,7 +454,7 @@ reg-shift = <2>; reg-io-width = <1>; interrupts = <8>; - clocks = <&smclk>; + clocks = <&refclk>; status = "disabled"; }; @@ -315,7 +464,7 @@ reg-shift = <2>; reg-io-width = <1>; interrupts = <9>; - clocks = <&smclk>; + clocks = <&refclk>; status = "disabled"; }; @@ -325,7 +474,7 @@ reg-shift = <2>; reg-io-width = <1>; interrupts = <10>; - clocks = <&smclk>; + clocks = <&refclk>; status = "disabled"; }; -- 1.9.1 ^ permalink raw reply related [flat|nested] 24+ messages in thread
* [PATCH v2 10/10] ARM: dts: berlin: convert BG2Q to DT clock nodes 2014-05-14 20:15 ` [PATCH v2 00/10] Marvell Berlin full clock support Sebastian Hesselbarth ` (3 preceding siblings ...) 2014-05-14 20:15 ` [PATCH v2 09/10] ARM: dts: berlin: convert BG2 " Sebastian Hesselbarth @ 2014-05-14 20:15 ` Sebastian Hesselbarth 4 siblings, 0 replies; 24+ messages in thread From: Sebastian Hesselbarth @ 2014-05-14 20:15 UTC (permalink / raw) To: Sebastian Hesselbarth Cc: Alexandre Belloni, Rob Herring, Pawel Moll, Mark Rutland, Ian Campbell, Kumar Gala, Mike Turquette, Jisheng Zhang, devicetree, linux-arm-kernel, linux-kernel From: Alexandre Belloni <alexandre.belloni@free-electrons.com> This converts Berlin BG2Q SoC dtsi to make use of the new DT clock nodes for Berlin SoCs. Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com> Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com> --- Changelog: v1->v2: - initial version Cc: Rob Herring <robh+dt@kernel.org> Cc: Pawel Moll <pawel.moll@arm.com> Cc: Mark Rutland <mark.rutland@arm.com> Cc: Ian Campbell <ijc+devicetree@hellion.org.uk> Cc: Kumar Gala <galak@codeaurora.org> Cc: Mike Turquette <mturquette@linaro.org> Cc: Alexandre Belloni <alexandre.belloni@free-electrons.com> Cc: Jisheng Zhang <jszhang@marvell.com> Cc: devicetree@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org --- arch/arm/boot/dts/berlin2q.dtsi | 80 ++++++++++++++++++++++++++++------------- 1 file changed, 56 insertions(+), 24 deletions(-) diff --git a/arch/arm/boot/dts/berlin2q.dtsi b/arch/arm/boot/dts/berlin2q.dtsi index 52c7d644e492..8128c2b5ac07 100644 --- a/arch/arm/boot/dts/berlin2q.dtsi +++ b/arch/arm/boot/dts/berlin2q.dtsi @@ -6,6 +6,7 @@ * warranty of any kind, whether express or implied. */ +#include <dt-bindings/clock/berlin2q.h> #include <dt-bindings/interrupt-controller/arm-gic.h> #include "skeleton.dtsi" @@ -47,28 +48,16 @@ }; }; - smclk: sysmgr-clock { + refclk: oscillator { compatible = "fixed-clock"; #clock-cells = <0>; clock-frequency = <25000000>; }; - cfgclk: config-clock { - compatible = "fixed-clock"; - #clock-cells = <0>; - clock-frequency = <100000000>; - }; - - cpuclk: cpu-clock { - compatible = "fixed-clock"; - #clock-cells = <0>; - clock-frequency = <1200000000>; - }; - twdclk: twdclk { compatible = "fixed-factor-clock"; #clock-cells = <0>; - clocks = <&cpuclk>; + clocks = <&cpupll>; clock-mult = <1>; clock-div = <3>; }; @@ -106,6 +95,13 @@ #interrupt-cells = <3>; }; + cpupll: cpupll@dd0170 { + compatible = "marvell,berlin2q-pll"; + clocks = <&refclk>; + #clock-cells = <0>; + reg = <0xdd0170 0x8>; + }; + apb@e80000 { compatible = "simple-bus"; #address-cells = <1>; @@ -189,7 +185,7 @@ timer0: timer@2c00 { compatible = "snps,dw-apb-timer"; reg = <0x2c00 0x14>; - clocks = <&cfgclk>; + clocks = <&coreclk CLKID_CFG>; clock-names = "timer"; interrupts = <8>; }; @@ -197,7 +193,7 @@ timer1: timer@2c14 { compatible = "snps,dw-apb-timer"; reg = <0x2c14 0x14>; - clocks = <&cfgclk>; + clocks = <&coreclk CLKID_CFG>; clock-names = "timer"; status = "disabled"; }; @@ -205,7 +201,7 @@ timer2: timer@2c28 { compatible = "snps,dw-apb-timer"; reg = <0x2c28 0x14>; - clocks = <&cfgclk>; + clocks = <&coreclk CLKID_CFG>; clock-names = "timer"; status = "disabled"; }; @@ -213,7 +209,7 @@ timer3: timer@2c3c { compatible = "snps,dw-apb-timer"; reg = <0x2c3c 0x14>; - clocks = <&cfgclk>; + clocks = <&coreclk CLKID_CFG>; clock-names = "timer"; status = "disabled"; }; @@ -221,7 +217,7 @@ timer4: timer@2c50 { compatible = "snps,dw-apb-timer"; reg = <0x2c50 0x14>; - clocks = <&cfgclk>; + clocks = <&coreclk CLKID_CFG>; clock-names = "timer"; status = "disabled"; }; @@ -229,7 +225,7 @@ timer5: timer@2c64 { compatible = "snps,dw-apb-timer"; reg = <0x2c64 0x14>; - clocks = <&cfgclk>; + clocks = <&coreclk CLKID_CFG>; clock-names = "timer"; status = "disabled"; }; @@ -237,7 +233,7 @@ timer6: timer@2c78 { compatible = "snps,dw-apb-timer"; reg = <0x2c78 0x14>; - clocks = <&cfgclk>; + clocks = <&coreclk CLKID_CFG>; clock-names = "timer"; status = "disabled"; }; @@ -245,7 +241,7 @@ timer7: timer@2c8c { compatible = "snps,dw-apb-timer"; reg = <0x2c8c 0x14>; - clocks = <&cfgclk>; + clocks = <&coreclk CLKID_CFG>; clock-names = "timer"; status = "disabled"; }; @@ -290,11 +286,47 @@ }; }; + syspll: syspll@ea0030 { + compatible = "marvell,berlin2q-pll"; + clocks = <&refclk>; + #clock-cells = <0>; + reg = <0xea0030 0x8>; + }; + + coreclk: core-clock@ea00e8 { + compatible = "marvell,berlin2q-core-clocks"; + #clock-cells = <1>; + reg = <0xea00e8 0x18>; + clocks = <&refclk>, <&syspll>; + clock-names = "refclk", "syspll"; + clock-output-names = "sys", "drmfigo", "cfg", + "gfx2d", "zsp", "perif", "pcube", "vscope", + "nfc_ecc", "vpp", "app", "gfx2daxi", "geth0", + "ahbapb", "usb0", "usb1", "usb2", "usb3", + "pbridge", "sdio", "nfc", "smemc", "pcie"; + }; + generic-regs@ea0110 { compatible = "marvell,berlin-generic-regs", "syscon"; reg = <0xea0110 0x10>; }; + sdio0xin_clk: sdio0xinclk@ea0158 { + compatible = "marvell,berlin2-clk-div"; + #clock-cells = <0>; + reg = <0xea0158 0x4>; + clocks = <&syspll>; + clock-names = "mux_bypass"; + }; + + sdio1xin_clk: sdio1xinclk@ea015c { + compatible = "marvell,berlin2-clk-div"; + #clock-cells = <0>; + reg = <0xea015c 0x4>; + clocks = <&syspll>; + clock-names = "mux_bypass"; + }; + apb@fc0000 { compatible = "simple-bus"; #address-cells = <1>; @@ -308,7 +340,7 @@ reg = <0x9000 0x100>; interrupt-parent = <&sic>; interrupts = <8>; - clocks = <&smclk>; + clocks = <&refclk>; reg-shift = <2>; status = "disabled"; }; @@ -318,7 +350,7 @@ reg = <0xa000 0x100>; interrupt-parent = <&sic>; interrupts = <9>; - clocks = <&smclk>; + clocks = <&refclk>; reg-shift = <2>; status = "disabled"; }; -- 1.9.1 ^ permalink raw reply related [flat|nested] 24+ messages in thread
end of thread, other threads:[~2014-05-15 8:34 UTC | newest] Thread overview: 24+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2014-05-11 20:24 [PATCH 0/8] Marvell Berlin full clock support Sebastian Hesselbarth [not found] ` <1399839881-29895-1-git-send-email-sebastian.hesselbarth-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> 2014-05-11 20:24 ` [PATCH 1/8] clk: add helper for unique DT clock names Sebastian Hesselbarth 2014-05-13 19:49 ` Mike Turquette 2014-05-13 20:19 ` Sebastian Hesselbarth 2014-05-13 20:51 ` Mike Turquette 2014-05-13 21:25 ` Sebastian Hesselbarth 2014-05-11 20:24 ` [PATCH 2/8] clk: berlin: add clock binding docs for Marvell Berlin2 SoCs Sebastian Hesselbarth 2014-05-13 8:38 ` Sebastian Hesselbarth 2014-05-13 14:47 ` Alexandre Belloni 2014-05-14 22:32 ` Mike Turquette 2014-05-14 23:17 ` Sebastian Hesselbarth 2014-05-15 4:41 ` Mike Turquette 2014-05-15 6:53 ` Sebastian Hesselbarth 2014-05-15 8:34 ` Alexandre Belloni 2014-05-11 20:24 ` [PATCH 7/8] ARM: dts: berlin: convert BG2CD to DT clock nodes Sebastian Hesselbarth [not found] ` <1399839881-29895-8-git-send-email-sebastian.hesselbarth-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> 2014-05-12 19:55 ` Sebastian Hesselbarth 2014-05-13 8:42 ` Sebastian Hesselbarth 2014-05-11 20:24 ` [PATCH 8/8] ARM: dts: berlin: convert BG2 " Sebastian Hesselbarth 2014-05-14 20:15 ` [PATCH v2 00/10] Marvell Berlin full clock support Sebastian Hesselbarth 2014-05-14 20:15 ` [PATCH v2 01/10] dt-binding: clk: add clock binding docs for Marvell Berlin2 SoCs Sebastian Hesselbarth 2014-05-14 20:15 ` [PATCH v2 02/10] clk: berlin: add binding include for BG2/BG2CD clock ids Sebastian Hesselbarth 2014-05-14 20:15 ` [PATCH v2 08/10] ARM: dts: berlin: convert BG2CD to DT clock nodes Sebastian Hesselbarth 2014-05-14 20:15 ` [PATCH v2 09/10] ARM: dts: berlin: convert BG2 " Sebastian Hesselbarth 2014-05-14 20:15 ` [PATCH v2 10/10] ARM: dts: berlin: convert BG2Q " Sebastian Hesselbarth
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).