* [PATCH v2 01/03] ARM: shmobile: Introduce shmobile_clk_workaround()
2014-03-12 23:36 [PATCH v2 00/03] ARM: shmobile: Break out and extend clock workaround V2 Magnus Damm
@ 2014-03-12 23:36 ` Magnus Damm
2014-03-13 1:23 ` Simon Horman
2014-03-12 23:36 ` [PATCH 02/03] ARM: shmobile: Use shmobile_clk_workaround() on Lager Magnus Damm
` (2 subsequent siblings)
3 siblings, 1 reply; 12+ messages in thread
From: Magnus Damm @ 2014-03-12 23:36 UTC (permalink / raw)
To: linux-arm-kernel
From: Magnus Damm <damm@opensource.se>
Introduce a new clock workaround function used by DT reference
code on the mach-shmobile subarchitecture. The new function
shmobile_clk_workaround() is used to configure clkdev to
allow DT and platform devices to coexist. It is possible for
the DT reference board code to also request enabling of the clock
in case the driver does not implement clock control.
Signed-off-by: Magnus Damm <damm@opensource.se>
---
Changes since V1:
- Reworked patch dependency, updated include file path
arch/arm/mach-shmobile/Makefile | 2 -
arch/arm/mach-shmobile/clock.c | 29 +++++++++++++++++++++++++++
arch/arm/mach-shmobile/include/mach/clock.h | 16 ++++++++++++++
3 files changed, 46 insertions(+), 1 deletion(-)
--- 0001/arch/arm/mach-shmobile/Makefile
+++ work/arch/arm/mach-shmobile/Makefile 2014-03-13 08:29:12.000000000 +0900
@@ -21,8 +21,8 @@ obj-$(CONFIG_ARCH_EMEV2) += setup-emev2.
obj-$(CONFIG_ARCH_R7S72100) += setup-r7s72100.o
# Clock objects
-ifndef CONFIG_COMMON_CLK
obj-y += clock.o
+ifndef CONFIG_COMMON_CLK
obj-$(CONFIG_ARCH_SH7372) += clock-sh7372.o
obj-$(CONFIG_ARCH_SH73A0) += clock-sh73a0.o
obj-$(CONFIG_ARCH_R8A73A4) += clock-r8a73a4.o
--- 0001/arch/arm/mach-shmobile/clock.c
+++ work/arch/arm/mach-shmobile/clock.c 2014-03-13 08:29:35.000000000 +0900
@@ -21,6 +21,32 @@
*/
#include <linux/kernel.h>
#include <linux/init.h>
+
+#ifdef CONFIG_COMMON_CLK
+#include <linux/clk.h>
+#include <linux/clkdev.h>
+#include <mach/clock.h>
+
+void __init shmobile_clk_workaround(const struct clk_name *clks,
+ int nr_clks, bool enable)
+{
+ const struct clk_name *clkn;
+ struct clk *clk;
+ unsigned int i;
+
+ for (i = 0; i < nr_clks; ++i) {
+ clkn = clks + i;
+ clk = clk_get(NULL, clkn->clk);
+ if (!IS_ERR(clk)) {
+ clk_register_clkdev(clk, clkn->con_id, clkn->dev_id);
+ if (enable)
+ clk_prepare_enable(clk);
+ clk_put(clk);
+ }
+ }
+}
+
+#else /* CONFIG_COMMON_CLK */
#include <linux/sh_clk.h>
#include <linux/export.h>
#include <mach/clock.h>
@@ -58,3 +84,6 @@ void __clk_put(struct clk *clk)
{
}
EXPORT_SYMBOL(__clk_put);
+
+#endif /* CONFIG_COMMON_CLK */
+
--- 0001/arch/arm/mach-shmobile/include/mach/clock.h
+++ work/arch/arm/mach-shmobile/include/mach/clock.h 2014-03-13 08:29:12.000000000 +0900
@@ -1,6 +1,21 @@
#ifndef CLOCK_H
#define CLOCK_H
+#ifdef CONFIG_COMMON_CLK
+/* temporary clock configuration helper for platform devices */
+
+struct clk_name {
+ const char *clk;
+ const char *con_id;
+ const char *dev_id;
+};
+
+void shmobile_clk_workaround(const struct clk_name *clks, int nr_clks,
+ bool enable);
+
+#else /* CONFIG_COMMON_CLK */
+/* legacy clock implementation */
+
unsigned long shmobile_fixed_ratio_clk_recalc(struct clk *clk);
extern struct sh_clk_ops shmobile_fixed_ratio_clk_ops;
@@ -36,4 +51,5 @@ do { \
(p)->div = d; \
} while (0)
+#endif /* CONFIG_COMMON_CLK */
#endif
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH v2 01/03] ARM: shmobile: Introduce shmobile_clk_workaround()
2014-03-12 23:36 ` [PATCH v2 01/03] ARM: shmobile: Introduce shmobile_clk_workaround() Magnus Damm
@ 2014-03-13 1:23 ` Simon Horman
0 siblings, 0 replies; 12+ messages in thread
From: Simon Horman @ 2014-03-13 1:23 UTC (permalink / raw)
To: linux-arm-kernel
On Thu, Mar 13, 2014 at 08:36:17AM +0900, Magnus Damm wrote:
> From: Magnus Damm <damm@opensource.se>
>
> Introduce a new clock workaround function used by DT reference
> code on the mach-shmobile subarchitecture. The new function
> shmobile_clk_workaround() is used to configure clkdev to
> allow DT and platform devices to coexist. It is possible for
> the DT reference board code to also request enabling of the clock
> in case the driver does not implement clock control.
>
> Signed-off-by: Magnus Damm <damm@opensource.se>
Thanks, I have queued this up with Wolfram's Reviewed-by
and Tested-by which he supplied for v1.
I have also removed the trailing empty line that this
patch adds to clock.c.
> ---
>
> Changes since V1:
> - Reworked patch dependency, updated include file path
>
> arch/arm/mach-shmobile/Makefile | 2 -
> arch/arm/mach-shmobile/clock.c | 29 +++++++++++++++++++++++++++
> arch/arm/mach-shmobile/include/mach/clock.h | 16 ++++++++++++++
> 3 files changed, 46 insertions(+), 1 deletion(-)
>
> --- 0001/arch/arm/mach-shmobile/Makefile
> +++ work/arch/arm/mach-shmobile/Makefile 2014-03-13 08:29:12.000000000 +0900
> @@ -21,8 +21,8 @@ obj-$(CONFIG_ARCH_EMEV2) += setup-emev2.
> obj-$(CONFIG_ARCH_R7S72100) += setup-r7s72100.o
>
> # Clock objects
> -ifndef CONFIG_COMMON_CLK
> obj-y += clock.o
> +ifndef CONFIG_COMMON_CLK
> obj-$(CONFIG_ARCH_SH7372) += clock-sh7372.o
> obj-$(CONFIG_ARCH_SH73A0) += clock-sh73a0.o
> obj-$(CONFIG_ARCH_R8A73A4) += clock-r8a73a4.o
> --- 0001/arch/arm/mach-shmobile/clock.c
> +++ work/arch/arm/mach-shmobile/clock.c 2014-03-13 08:29:35.000000000 +0900
> @@ -21,6 +21,32 @@
> */
> #include <linux/kernel.h>
> #include <linux/init.h>
> +
> +#ifdef CONFIG_COMMON_CLK
> +#include <linux/clk.h>
> +#include <linux/clkdev.h>
> +#include <mach/clock.h>
> +
> +void __init shmobile_clk_workaround(const struct clk_name *clks,
> + int nr_clks, bool enable)
> +{
> + const struct clk_name *clkn;
> + struct clk *clk;
> + unsigned int i;
> +
> + for (i = 0; i < nr_clks; ++i) {
> + clkn = clks + i;
> + clk = clk_get(NULL, clkn->clk);
> + if (!IS_ERR(clk)) {
> + clk_register_clkdev(clk, clkn->con_id, clkn->dev_id);
> + if (enable)
> + clk_prepare_enable(clk);
> + clk_put(clk);
> + }
> + }
> +}
> +
> +#else /* CONFIG_COMMON_CLK */
> #include <linux/sh_clk.h>
> #include <linux/export.h>
> #include <mach/clock.h>
> @@ -58,3 +84,6 @@ void __clk_put(struct clk *clk)
> {
> }
> EXPORT_SYMBOL(__clk_put);
> +
> +#endif /* CONFIG_COMMON_CLK */
> +
> --- 0001/arch/arm/mach-shmobile/include/mach/clock.h
> +++ work/arch/arm/mach-shmobile/include/mach/clock.h 2014-03-13 08:29:12.000000000 +0900
> @@ -1,6 +1,21 @@
> #ifndef CLOCK_H
> #define CLOCK_H
>
> +#ifdef CONFIG_COMMON_CLK
> +/* temporary clock configuration helper for platform devices */
> +
> +struct clk_name {
> + const char *clk;
> + const char *con_id;
> + const char *dev_id;
> +};
> +
> +void shmobile_clk_workaround(const struct clk_name *clks, int nr_clks,
> + bool enable);
> +
> +#else /* CONFIG_COMMON_CLK */
> +/* legacy clock implementation */
> +
> unsigned long shmobile_fixed_ratio_clk_recalc(struct clk *clk);
> extern struct sh_clk_ops shmobile_fixed_ratio_clk_ops;
>
> @@ -36,4 +51,5 @@ do { \
> (p)->div = d; \
> } while (0)
>
> +#endif /* CONFIG_COMMON_CLK */
> #endif
>
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH 02/03] ARM: shmobile: Use shmobile_clk_workaround() on Lager
2014-03-12 23:36 [PATCH v2 00/03] ARM: shmobile: Break out and extend clock workaround V2 Magnus Damm
2014-03-12 23:36 ` [PATCH v2 01/03] ARM: shmobile: Introduce shmobile_clk_workaround() Magnus Damm
@ 2014-03-12 23:36 ` Magnus Damm
2014-03-12 23:59 ` Simon Horman
2014-03-12 23:36 ` [PATCH 03/03] ARM: shmobile: Use shmobile_clk_workaround() on Koelsch Magnus Damm
2014-03-13 1:16 ` [PATCH v2 00/03] ARM: shmobile: Break out and extend clock workaround V2 Simon Horman
3 siblings, 1 reply; 12+ messages in thread
From: Magnus Damm @ 2014-03-12 23:36 UTC (permalink / raw)
To: linux-arm-kernel
From: Magnus Damm <damm@opensource.se>
Convert the Lager DT reference code to use the newly introduced
function shmobile_clk_workaround().
Signed-off-by: Magnus Damm <damm@opensource.se>
---
arch/arm/mach-shmobile/board-lager-reference.c | 65 +++++++++---------------
1 file changed, 25 insertions(+), 40 deletions(-)
--- 0001/arch/arm/mach-shmobile/board-lager-reference.c
+++ work/arch/arm/mach-shmobile/board-lager-reference.c 2014-02-24 16:17:32.000000000 +0900
@@ -18,12 +18,11 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include <linux/clk.h>
-#include <linux/clkdev.h>
#include <linux/dma-mapping.h>
#include <linux/init.h>
#include <linux/of_platform.h>
#include <linux/platform_data/rcar-du.h>
+#include <mach/clock.h>
#include <mach/common.h>
#include <mach/irqs.h>
#include <mach/rcar-gen2.h>
@@ -86,46 +85,32 @@ static void __init lager_add_du_device(v
platform_device_register_full(&info);
}
+/*
+ * This is a really crude hack to provide clkdev support to platform
+ * devices until they get moved to DT.
+ */
+static const struct clk_name clk_names[] = {
+ { "cmt0", NULL, "sh_cmt.0" },
+ { "scifa0", NULL, "sh-sci.0" },
+ { "scifa1", NULL, "sh-sci.1" },
+ { "scifb0", NULL, "sh-sci.2" },
+ { "scifb1", NULL, "sh-sci.3" },
+ { "scifb2", NULL, "sh-sci.4" },
+ { "scifa2", NULL, "sh-sci.5" },
+ { "scif0", NULL, "sh-sci.6" },
+ { "scif1", NULL, "sh-sci.7" },
+ { "hscif0", NULL, "sh-sci.8" },
+ { "hscif1", NULL, "sh-sci.9" },
+ { "du0", "du.0", "rcar-du-r8a7790" },
+ { "du1", "du.1", "rcar-du-r8a7790" },
+ { "du2", "du.2", "rcar-du-r8a7790" },
+ { "lvds0", "lvds.0", "rcar-du-r8a7790" },
+ { "lvds1", "lvds.1", "rcar-du-r8a7790" },
+};
+
static void __init lager_add_standard_devices(void)
{
- /*
- * This is a really crude hack to provide clkdev support to platform
- * devices until they get moved to DT.
- */
- static const struct clk_name {
- const char *clk;
- const char *con_id;
- const char *dev_id;
- } clk_names[] = {
- { "cmt0", NULL, "sh_cmt.0" },
- { "scifa0", NULL, "sh-sci.0" },
- { "scifa1", NULL, "sh-sci.1" },
- { "scifb0", NULL, "sh-sci.2" },
- { "scifb1", NULL, "sh-sci.3" },
- { "scifb2", NULL, "sh-sci.4" },
- { "scifa2", NULL, "sh-sci.5" },
- { "scif0", NULL, "sh-sci.6" },
- { "scif1", NULL, "sh-sci.7" },
- { "hscif0", NULL, "sh-sci.8" },
- { "hscif1", NULL, "sh-sci.9" },
- { "du0", "du.0", "rcar-du-r8a7790" },
- { "du1", "du.1", "rcar-du-r8a7790" },
- { "du2", "du.2", "rcar-du-r8a7790" },
- { "lvds0", "lvds.0", "rcar-du-r8a7790" },
- { "lvds1", "lvds.1", "rcar-du-r8a7790" },
- };
- struct clk *clk;
- unsigned int i;
-
- for (i = 0; i < ARRAY_SIZE(clk_names); ++i) {
- clk = clk_get(NULL, clk_names[i].clk);
- if (!IS_ERR(clk)) {
- clk_register_clkdev(clk, clk_names[i].con_id,
- clk_names[i].dev_id);
- clk_put(clk);
- }
- }
-
+ shmobile_clk_workaround(clk_names, ARRAY_SIZE(clk_names), false);
r8a7790_add_dt_devices();
of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH 02/03] ARM: shmobile: Use shmobile_clk_workaround() on Lager
2014-03-12 23:36 ` [PATCH 02/03] ARM: shmobile: Use shmobile_clk_workaround() on Lager Magnus Damm
@ 2014-03-12 23:59 ` Simon Horman
2014-03-13 1:23 ` Simon Horman
0 siblings, 1 reply; 12+ messages in thread
From: Simon Horman @ 2014-03-12 23:59 UTC (permalink / raw)
To: linux-arm-kernel
On Thu, Mar 13, 2014 at 08:36:26AM +0900, Magnus Damm wrote:
> From: Magnus Damm <damm@opensource.se>
>
> Convert the Lager DT reference code to use the newly introduced
> function shmobile_clk_workaround().
>
> Signed-off-by: Magnus Damm <damm@opensource.se>
> ---
>
> arch/arm/mach-shmobile/board-lager-reference.c | 65 +++++++++---------------
> 1 file changed, 25 insertions(+), 40 deletions(-)
>
> --- 0001/arch/arm/mach-shmobile/board-lager-reference.c
> +++ work/arch/arm/mach-shmobile/board-lager-reference.c 2014-02-24 16:17:32.000000000 +0900
> @@ -18,12 +18,11 @@
> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
> */
>
> -#include <linux/clk.h>
> -#include <linux/clkdev.h>
> #include <linux/dma-mapping.h>
> #include <linux/init.h>
> #include <linux/of_platform.h>
> #include <linux/platform_data/rcar-du.h>
> +#include <mach/clock.h>
> #include <mach/common.h>
> #include <mach/irqs.h>
> #include <mach/rcar-gen2.h>
> @@ -86,46 +85,32 @@ static void __init lager_add_du_device(v
> platform_device_register_full(&info);
> }
>
> +/*
> + * This is a really crude hack to provide clkdev support to platform
> + * devices until they get moved to DT.
> + */
> +static const struct clk_name clk_names[] = {
Should this be annotated as __initconst?
Likewise for the Koelsch variant of this patch.
> + { "cmt0", NULL, "sh_cmt.0" },
> + { "scifa0", NULL, "sh-sci.0" },
> + { "scifa1", NULL, "sh-sci.1" },
> + { "scifb0", NULL, "sh-sci.2" },
> + { "scifb1", NULL, "sh-sci.3" },
> + { "scifb2", NULL, "sh-sci.4" },
> + { "scifa2", NULL, "sh-sci.5" },
> + { "scif0", NULL, "sh-sci.6" },
> + { "scif1", NULL, "sh-sci.7" },
> + { "hscif0", NULL, "sh-sci.8" },
> + { "hscif1", NULL, "sh-sci.9" },
> + { "du0", "du.0", "rcar-du-r8a7790" },
> + { "du1", "du.1", "rcar-du-r8a7790" },
> + { "du2", "du.2", "rcar-du-r8a7790" },
> + { "lvds0", "lvds.0", "rcar-du-r8a7790" },
> + { "lvds1", "lvds.1", "rcar-du-r8a7790" },
> +};
> +
> static void __init lager_add_standard_devices(void)
> {
> - /*
> - * This is a really crude hack to provide clkdev support to platform
> - * devices until they get moved to DT.
> - */
> - static const struct clk_name {
> - const char *clk;
> - const char *con_id;
> - const char *dev_id;
> - } clk_names[] = {
> - { "cmt0", NULL, "sh_cmt.0" },
> - { "scifa0", NULL, "sh-sci.0" },
> - { "scifa1", NULL, "sh-sci.1" },
> - { "scifb0", NULL, "sh-sci.2" },
> - { "scifb1", NULL, "sh-sci.3" },
> - { "scifb2", NULL, "sh-sci.4" },
> - { "scifa2", NULL, "sh-sci.5" },
> - { "scif0", NULL, "sh-sci.6" },
> - { "scif1", NULL, "sh-sci.7" },
> - { "hscif0", NULL, "sh-sci.8" },
> - { "hscif1", NULL, "sh-sci.9" },
> - { "du0", "du.0", "rcar-du-r8a7790" },
> - { "du1", "du.1", "rcar-du-r8a7790" },
> - { "du2", "du.2", "rcar-du-r8a7790" },
> - { "lvds0", "lvds.0", "rcar-du-r8a7790" },
> - { "lvds1", "lvds.1", "rcar-du-r8a7790" },
> - };
> - struct clk *clk;
> - unsigned int i;
> -
> - for (i = 0; i < ARRAY_SIZE(clk_names); ++i) {
> - clk = clk_get(NULL, clk_names[i].clk);
> - if (!IS_ERR(clk)) {
> - clk_register_clkdev(clk, clk_names[i].con_id,
> - clk_names[i].dev_id);
> - clk_put(clk);
> - }
> - }
> -
> + shmobile_clk_workaround(clk_names, ARRAY_SIZE(clk_names), false);
> r8a7790_add_dt_devices();
> of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
>
>
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH 02/03] ARM: shmobile: Use shmobile_clk_workaround() on Lager
2014-03-12 23:59 ` Simon Horman
@ 2014-03-13 1:23 ` Simon Horman
2014-03-13 5:14 ` Magnus Damm
0 siblings, 1 reply; 12+ messages in thread
From: Simon Horman @ 2014-03-13 1:23 UTC (permalink / raw)
To: linux-arm-kernel
On Thu, Mar 13, 2014 at 08:59:45AM +0900, Simon Horman wrote:
> On Thu, Mar 13, 2014 at 08:36:26AM +0900, Magnus Damm wrote:
> > From: Magnus Damm <damm@opensource.se>
> >
> > Convert the Lager DT reference code to use the newly introduced
> > function shmobile_clk_workaround().
> >
> > Signed-off-by: Magnus Damm <damm@opensource.se>
> > ---
> >
> > arch/arm/mach-shmobile/board-lager-reference.c | 65 +++++++++---------------
> > 1 file changed, 25 insertions(+), 40 deletions(-)
> >
> > --- 0001/arch/arm/mach-shmobile/board-lager-reference.c
> > +++ work/arch/arm/mach-shmobile/board-lager-reference.c 2014-02-24 16:17:32.000000000 +0900
> > @@ -18,12 +18,11 @@
> > * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
> > */
> >
> > -#include <linux/clk.h>
> > -#include <linux/clkdev.h>
> > #include <linux/dma-mapping.h>
> > #include <linux/init.h>
> > #include <linux/of_platform.h>
> > #include <linux/platform_data/rcar-du.h>
> > +#include <mach/clock.h>
> > #include <mach/common.h>
> > #include <mach/irqs.h>
> > #include <mach/rcar-gen2.h>
> > @@ -86,46 +85,32 @@ static void __init lager_add_du_device(v
> > platform_device_register_full(&info);
> > }
> >
> > +/*
> > + * This is a really crude hack to provide clkdev support to platform
> > + * devices until they get moved to DT.
> > + */
> > +static const struct clk_name clk_names[] = {
>
> Should this be annotated as __initconst?
> Likewise for the Koelsch variant of this patch.
Btw, I'm happy to handle this as an incremental patch if you like.
>
> > + { "cmt0", NULL, "sh_cmt.0" },
> > + { "scifa0", NULL, "sh-sci.0" },
> > + { "scifa1", NULL, "sh-sci.1" },
> > + { "scifb0", NULL, "sh-sci.2" },
> > + { "scifb1", NULL, "sh-sci.3" },
> > + { "scifb2", NULL, "sh-sci.4" },
> > + { "scifa2", NULL, "sh-sci.5" },
> > + { "scif0", NULL, "sh-sci.6" },
> > + { "scif1", NULL, "sh-sci.7" },
> > + { "hscif0", NULL, "sh-sci.8" },
> > + { "hscif1", NULL, "sh-sci.9" },
> > + { "du0", "du.0", "rcar-du-r8a7790" },
> > + { "du1", "du.1", "rcar-du-r8a7790" },
> > + { "du2", "du.2", "rcar-du-r8a7790" },
> > + { "lvds0", "lvds.0", "rcar-du-r8a7790" },
> > + { "lvds1", "lvds.1", "rcar-du-r8a7790" },
> > +};
> > +
> > static void __init lager_add_standard_devices(void)
> > {
> > - /*
> > - * This is a really crude hack to provide clkdev support to platform
> > - * devices until they get moved to DT.
> > - */
> > - static const struct clk_name {
> > - const char *clk;
> > - const char *con_id;
> > - const char *dev_id;
> > - } clk_names[] = {
> > - { "cmt0", NULL, "sh_cmt.0" },
> > - { "scifa0", NULL, "sh-sci.0" },
> > - { "scifa1", NULL, "sh-sci.1" },
> > - { "scifb0", NULL, "sh-sci.2" },
> > - { "scifb1", NULL, "sh-sci.3" },
> > - { "scifb2", NULL, "sh-sci.4" },
> > - { "scifa2", NULL, "sh-sci.5" },
> > - { "scif0", NULL, "sh-sci.6" },
> > - { "scif1", NULL, "sh-sci.7" },
> > - { "hscif0", NULL, "sh-sci.8" },
> > - { "hscif1", NULL, "sh-sci.9" },
> > - { "du0", "du.0", "rcar-du-r8a7790" },
> > - { "du1", "du.1", "rcar-du-r8a7790" },
> > - { "du2", "du.2", "rcar-du-r8a7790" },
> > - { "lvds0", "lvds.0", "rcar-du-r8a7790" },
> > - { "lvds1", "lvds.1", "rcar-du-r8a7790" },
> > - };
> > - struct clk *clk;
> > - unsigned int i;
> > -
> > - for (i = 0; i < ARRAY_SIZE(clk_names); ++i) {
> > - clk = clk_get(NULL, clk_names[i].clk);
> > - if (!IS_ERR(clk)) {
> > - clk_register_clkdev(clk, clk_names[i].con_id,
> > - clk_names[i].dev_id);
> > - clk_put(clk);
> > - }
> > - }
> > -
> > + shmobile_clk_workaround(clk_names, ARRAY_SIZE(clk_names), false);
> > r8a7790_add_dt_devices();
> > of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
> >
> >
> --
> To unsubscribe from this list: send the line "unsubscribe linux-sh" in
> the body of a message to majordomo at vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH 02/03] ARM: shmobile: Use shmobile_clk_workaround() on Lager
2014-03-13 1:23 ` Simon Horman
@ 2014-03-13 5:14 ` Magnus Damm
2014-03-13 5:46 ` Simon Horman
0 siblings, 1 reply; 12+ messages in thread
From: Magnus Damm @ 2014-03-13 5:14 UTC (permalink / raw)
To: linux-arm-kernel
On Thu, Mar 13, 2014 at 10:23 AM, Simon Horman <horms@verge.net.au> wrote:
> On Thu, Mar 13, 2014 at 08:59:45AM +0900, Simon Horman wrote:
>> On Thu, Mar 13, 2014 at 08:36:26AM +0900, Magnus Damm wrote:
>> > From: Magnus Damm <damm@opensource.se>
>> >
>> > Convert the Lager DT reference code to use the newly introduced
>> > function shmobile_clk_workaround().
>> >
>> > Signed-off-by: Magnus Damm <damm@opensource.se>
>> > ---
>> >
>> > arch/arm/mach-shmobile/board-lager-reference.c | 65 +++++++++---------------
>> > 1 file changed, 25 insertions(+), 40 deletions(-)
>> >
>> > --- 0001/arch/arm/mach-shmobile/board-lager-reference.c
>> > +++ work/arch/arm/mach-shmobile/board-lager-reference.c 2014-02-24 16:17:32.000000000 +0900
>> > @@ -18,12 +18,11 @@
>> > * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
>> > */
>> >
>> > -#include <linux/clk.h>
>> > -#include <linux/clkdev.h>
>> > #include <linux/dma-mapping.h>
>> > #include <linux/init.h>
>> > #include <linux/of_platform.h>
>> > #include <linux/platform_data/rcar-du.h>
>> > +#include <mach/clock.h>
>> > #include <mach/common.h>
>> > #include <mach/irqs.h>
>> > #include <mach/rcar-gen2.h>
>> > @@ -86,46 +85,32 @@ static void __init lager_add_du_device(v
>> > platform_device_register_full(&info);
>> > }
>> >
>> > +/*
>> > + * This is a really crude hack to provide clkdev support to platform
>> > + * devices until they get moved to DT.
>> > + */
>> > +static const struct clk_name clk_names[] = {
>>
>> Should this be annotated as __initconst?
>> Likewise for the Koelsch variant of this patch.
>
> Btw, I'm happy to handle this as an incremental patch if you like.
Yes, that would be greatly appreciated!
Thanks,
/ magnus
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH 02/03] ARM: shmobile: Use shmobile_clk_workaround() on Lager
2014-03-13 5:14 ` Magnus Damm
@ 2014-03-13 5:46 ` Simon Horman
0 siblings, 0 replies; 12+ messages in thread
From: Simon Horman @ 2014-03-13 5:46 UTC (permalink / raw)
To: linux-arm-kernel
On Thu, Mar 13, 2014 at 02:14:57PM +0900, Magnus Damm wrote:
> On Thu, Mar 13, 2014 at 10:23 AM, Simon Horman <horms@verge.net.au> wrote:
> > On Thu, Mar 13, 2014 at 08:59:45AM +0900, Simon Horman wrote:
> >> On Thu, Mar 13, 2014 at 08:36:26AM +0900, Magnus Damm wrote:
> >> > From: Magnus Damm <damm@opensource.se>
> >> >
> >> > Convert the Lager DT reference code to use the newly introduced
> >> > function shmobile_clk_workaround().
> >> >
> >> > Signed-off-by: Magnus Damm <damm@opensource.se>
> >> > ---
> >> >
> >> > arch/arm/mach-shmobile/board-lager-reference.c | 65 +++++++++---------------
> >> > 1 file changed, 25 insertions(+), 40 deletions(-)
> >> >
> >> > --- 0001/arch/arm/mach-shmobile/board-lager-reference.c
> >> > +++ work/arch/arm/mach-shmobile/board-lager-reference.c 2014-02-24 16:17:32.000000000 +0900
> >> > @@ -18,12 +18,11 @@
> >> > * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
> >> > */
> >> >
> >> > -#include <linux/clk.h>
> >> > -#include <linux/clkdev.h>
> >> > #include <linux/dma-mapping.h>
> >> > #include <linux/init.h>
> >> > #include <linux/of_platform.h>
> >> > #include <linux/platform_data/rcar-du.h>
> >> > +#include <mach/clock.h>
> >> > #include <mach/common.h>
> >> > #include <mach/irqs.h>
> >> > #include <mach/rcar-gen2.h>
> >> > @@ -86,46 +85,32 @@ static void __init lager_add_du_device(v
> >> > platform_device_register_full(&info);
> >> > }
> >> >
> >> > +/*
> >> > + * This is a really crude hack to provide clkdev support to platform
> >> > + * devices until they get moved to DT.
> >> > + */
> >> > +static const struct clk_name clk_names[] = {
> >>
> >> Should this be annotated as __initconst?
> >> Likewise for the Koelsch variant of this patch.
> >
> > Btw, I'm happy to handle this as an incremental patch if you like.
>
> Yes, that would be greatly appreciated!
Thanks, I have queued it up.
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH 03/03] ARM: shmobile: Use shmobile_clk_workaround() on Koelsch
2014-03-12 23:36 [PATCH v2 00/03] ARM: shmobile: Break out and extend clock workaround V2 Magnus Damm
2014-03-12 23:36 ` [PATCH v2 01/03] ARM: shmobile: Introduce shmobile_clk_workaround() Magnus Damm
2014-03-12 23:36 ` [PATCH 02/03] ARM: shmobile: Use shmobile_clk_workaround() on Lager Magnus Damm
@ 2014-03-12 23:36 ` Magnus Damm
2014-03-13 6:11 ` Simon Horman
2014-03-13 1:16 ` [PATCH v2 00/03] ARM: shmobile: Break out and extend clock workaround V2 Simon Horman
3 siblings, 1 reply; 12+ messages in thread
From: Magnus Damm @ 2014-03-12 23:36 UTC (permalink / raw)
To: linux-arm-kernel
From: Magnus Damm <damm@opensource.se>
Convert the Koelsch DT reference code to use the newly introduced
function shmobile_clk_workaround().
Signed-off-by: Magnus Damm <damm@opensource.se>
---
arch/arm/mach-shmobile/board-koelsch-reference.c | 71 ++++++++--------------
1 file changed, 28 insertions(+), 43 deletions(-)
--- 0001/arch/arm/mach-shmobile/board-koelsch-reference.c
+++ work/arch/arm/mach-shmobile/board-koelsch-reference.c 2014-02-24 15:50:57.000000000 +0900
@@ -19,12 +19,11 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include <linux/clk.h>
-#include <linux/clkdev.h>
#include <linux/dma-mapping.h>
#include <linux/kernel.h>
#include <linux/of_platform.h>
#include <linux/platform_data/rcar-du.h>
+#include <mach/clock.h>
#include <mach/common.h>
#include <mach/irqs.h>
#include <mach/rcar-gen2.h>
@@ -82,49 +81,35 @@ static void __init koelsch_add_du_device
platform_device_register_full(&info);
}
+/*
+ * This is a really crude hack to provide clkdev support to platform
+ * devices until they get moved to DT.
+ */
+static const struct clk_name clk_names[] = {
+ { "cmt0", NULL, "sh_cmt.0" },
+ { "scifa0", NULL, "sh-sci.0" },
+ { "scifa1", NULL, "sh-sci.1" },
+ { "scifb0", NULL, "sh-sci.2" },
+ { "scifb1", NULL, "sh-sci.3" },
+ { "scifb2", NULL, "sh-sci.4" },
+ { "scifa2", NULL, "sh-sci.5" },
+ { "scif0", NULL, "sh-sci.6" },
+ { "scif1", NULL, "sh-sci.7" },
+ { "scif2", NULL, "sh-sci.8" },
+ { "scif3", NULL, "sh-sci.9" },
+ { "scif4", NULL, "sh-sci.10" },
+ { "scif5", NULL, "sh-sci.11" },
+ { "scifa3", NULL, "sh-sci.12" },
+ { "scifa4", NULL, "sh-sci.13" },
+ { "scifa5", NULL, "sh-sci.14" },
+ { "du0", "du.0", "rcar-du-r8a7791" },
+ { "du1", "du.1", "rcar-du-r8a7791" },
+ { "lvds0", "lvds.0", "rcar-du-r8a7791" },
+};
+
static void __init koelsch_add_standard_devices(void)
{
- /*
- * This is a really crude hack to provide clkdev support to the CMT and
- * DU devices until they get moved to DT.
- */
- static const struct clk_name {
- const char *clk;
- const char *con_id;
- const char *dev_id;
- } clk_names[] = {
- { "cmt0", NULL, "sh_cmt.0" },
- { "scifa0", NULL, "sh-sci.0" },
- { "scifa1", NULL, "sh-sci.1" },
- { "scifb0", NULL, "sh-sci.2" },
- { "scifb1", NULL, "sh-sci.3" },
- { "scifb2", NULL, "sh-sci.4" },
- { "scifa2", NULL, "sh-sci.5" },
- { "scif0", NULL, "sh-sci.6" },
- { "scif1", NULL, "sh-sci.7" },
- { "scif2", NULL, "sh-sci.8" },
- { "scif3", NULL, "sh-sci.9" },
- { "scif4", NULL, "sh-sci.10" },
- { "scif5", NULL, "sh-sci.11" },
- { "scifa3", NULL, "sh-sci.12" },
- { "scifa4", NULL, "sh-sci.13" },
- { "scifa5", NULL, "sh-sci.14" },
- { "du0", "du.0", "rcar-du-r8a7791" },
- { "du1", "du.1", "rcar-du-r8a7791" },
- { "lvds0", "lvds.0", "rcar-du-r8a7791" },
- };
- struct clk *clk;
- unsigned int i;
-
- for (i = 0; i < ARRAY_SIZE(clk_names); ++i) {
- clk = clk_get(NULL, clk_names[i].clk);
- if (!IS_ERR(clk)) {
- clk_register_clkdev(clk, clk_names[i].con_id,
- clk_names[i].dev_id);
- clk_put(clk);
- }
- }
-
+ shmobile_clk_workaround(clk_names, ARRAY_SIZE(clk_names), false);
r8a7791_add_dt_devices();
of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH v2 00/03] ARM: shmobile: Break out and extend clock workaround V2
2014-03-12 23:36 [PATCH v2 00/03] ARM: shmobile: Break out and extend clock workaround V2 Magnus Damm
` (2 preceding siblings ...)
2014-03-12 23:36 ` [PATCH 03/03] ARM: shmobile: Use shmobile_clk_workaround() on Koelsch Magnus Damm
@ 2014-03-13 1:16 ` Simon Horman
3 siblings, 0 replies; 12+ messages in thread
From: Simon Horman @ 2014-03-13 1:16 UTC (permalink / raw)
To: linux-arm-kernel
On Thu, Mar 13, 2014 at 08:36:08AM +0900, Magnus Damm wrote:
> ARM: shmobile: Break out and extend clock workaround V2
>
> [PATCH v2 01/03] ARM: shmobile: Introduce shmobile_clk_workaround()
> [PATCH 02/03] ARM: shmobile: Use shmobile_clk_workaround() on Lager
> [PATCH 03/03] ARM: shmobile: Use shmobile_clk_workaround() on Koelsch
If the series is v2 please annotate all patches in the series as v2,
even if they haven't changed.
> These patches consolidates the clkdev workaround present in the DT
> reference version of board code for Lager and Koelsch, and it also
> extends it to allow static enablement of a selected set of clocks
> during boot. The latter is needed for USB PCI support patches that
> have been posted.
>
> Signed-off-by: Magnus Damm <damm@opensource.se>
> ---
>
> Changes since V1:
> - Reworked dependencies, updated header file path in patch [1/3].
>
> Written against renesas.git tag renesas-devel-v3.14-rc6-20140311
>
> arch/arm/mach-shmobile/Makefile | 2
> arch/arm/mach-shmobile/board-koelsch-reference.c | 71 ++++++++--------------
> arch/arm/mach-shmobile/board-lager-reference.c | 65 +++++++-------------
> arch/arm/mach-shmobile/clock.c | 29 ++++++++
> arch/arm/mach-shmobile/include/mach/clock.h | 16 ++++
> 5 files changed, 99 insertions(+), 84 deletions(-)
> --
> To unsubscribe from this list: send the line "unsubscribe linux-sh" in
> the body of a message to majordomo at vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH 02/03] ARM: shmobile: Use shmobile_clk_workaround() on Lager
2014-02-24 7:29 [PATCH 00/03] ARM: shmobile: Break out and extend clock workaround Magnus Damm
@ 2014-02-24 7:29 ` Magnus Damm
0 siblings, 0 replies; 12+ messages in thread
From: Magnus Damm @ 2014-02-24 7:29 UTC (permalink / raw)
To: linux-arm-kernel
From: Magnus Damm <damm@opensource.se>
Convert the Lager DT reference code to use the newly introduced
function shmobile_clk_workaround().
Signed-off-by: Magnus Damm <damm@opensource.se>
---
arch/arm/mach-shmobile/board-lager-reference.c | 65 +++++++++---------------
1 file changed, 25 insertions(+), 40 deletions(-)
--- 0001/arch/arm/mach-shmobile/board-lager-reference.c
+++ work/arch/arm/mach-shmobile/board-lager-reference.c 2014-02-24 16:17:32.000000000 +0900
@@ -18,12 +18,11 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include <linux/clk.h>
-#include <linux/clkdev.h>
#include <linux/dma-mapping.h>
#include <linux/init.h>
#include <linux/of_platform.h>
#include <linux/platform_data/rcar-du.h>
+#include <mach/clock.h>
#include <mach/common.h>
#include <mach/irqs.h>
#include <mach/rcar-gen2.h>
@@ -86,46 +85,32 @@ static void __init lager_add_du_device(v
platform_device_register_full(&info);
}
+/*
+ * This is a really crude hack to provide clkdev support to platform
+ * devices until they get moved to DT.
+ */
+static const struct clk_name clk_names[] = {
+ { "cmt0", NULL, "sh_cmt.0" },
+ { "scifa0", NULL, "sh-sci.0" },
+ { "scifa1", NULL, "sh-sci.1" },
+ { "scifb0", NULL, "sh-sci.2" },
+ { "scifb1", NULL, "sh-sci.3" },
+ { "scifb2", NULL, "sh-sci.4" },
+ { "scifa2", NULL, "sh-sci.5" },
+ { "scif0", NULL, "sh-sci.6" },
+ { "scif1", NULL, "sh-sci.7" },
+ { "hscif0", NULL, "sh-sci.8" },
+ { "hscif1", NULL, "sh-sci.9" },
+ { "du0", "du.0", "rcar-du-r8a7790" },
+ { "du1", "du.1", "rcar-du-r8a7790" },
+ { "du2", "du.2", "rcar-du-r8a7790" },
+ { "lvds0", "lvds.0", "rcar-du-r8a7790" },
+ { "lvds1", "lvds.1", "rcar-du-r8a7790" },
+};
+
static void __init lager_add_standard_devices(void)
{
- /*
- * This is a really crude hack to provide clkdev support to platform
- * devices until they get moved to DT.
- */
- static const struct clk_name {
- const char *clk;
- const char *con_id;
- const char *dev_id;
- } clk_names[] = {
- { "cmt0", NULL, "sh_cmt.0" },
- { "scifa0", NULL, "sh-sci.0" },
- { "scifa1", NULL, "sh-sci.1" },
- { "scifb0", NULL, "sh-sci.2" },
- { "scifb1", NULL, "sh-sci.3" },
- { "scifb2", NULL, "sh-sci.4" },
- { "scifa2", NULL, "sh-sci.5" },
- { "scif0", NULL, "sh-sci.6" },
- { "scif1", NULL, "sh-sci.7" },
- { "hscif0", NULL, "sh-sci.8" },
- { "hscif1", NULL, "sh-sci.9" },
- { "du0", "du.0", "rcar-du-r8a7790" },
- { "du1", "du.1", "rcar-du-r8a7790" },
- { "du2", "du.2", "rcar-du-r8a7790" },
- { "lvds0", "lvds.0", "rcar-du-r8a7790" },
- { "lvds1", "lvds.1", "rcar-du-r8a7790" },
- };
- struct clk *clk;
- unsigned int i;
-
- for (i = 0; i < ARRAY_SIZE(clk_names); ++i) {
- clk = clk_get(NULL, clk_names[i].clk);
- if (!IS_ERR(clk)) {
- clk_register_clkdev(clk, clk_names[i].con_id,
- clk_names[i].dev_id);
- clk_put(clk);
- }
- }
-
+ shmobile_clk_workaround(clk_names, ARRAY_SIZE(clk_names), false);
r8a7790_add_dt_devices();
of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
^ permalink raw reply [flat|nested] 12+ messages in thread