* [PATCH 01/03] ARM: shmobile: Introduce shmobile_clk_workaround()
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
2014-02-28 19:55 ` Wolfram Sang
2014-02-24 7:29 ` [PATCH 02/03] ARM: shmobile: Use shmobile_clk_workaround() on Lager Magnus Damm
` (2 subsequent siblings)
3 siblings, 1 reply; 17+ messages in thread
From: Magnus Damm @ 2014-02-24 7:29 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>
---
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(-)
--- 0016/arch/arm/mach-shmobile/Makefile
+++ work/arch/arm/mach-shmobile/Makefile 2014-02-24 15:45:31.000000000 +0900
@@ -23,8 +23,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
--- 0013/arch/arm/mach-shmobile/clock.c
+++ work/arch/arm/mach-shmobile/clock.c 2014-02-24 15:56:51.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 "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 "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-02-24 15:45:31.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] 17+ 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 ` [PATCH 01/03] ARM: shmobile: Introduce shmobile_clk_workaround() Magnus Damm
@ 2014-02-24 7:29 ` Magnus Damm
2014-06-05 5:32 ` [PATCH 02/03] ARM: shmobile: Use shmobile_init_delay() on EMEV2 Magnus Damm
2014-06-05 6:47 ` [PATCH 02/03] ARM: shmobile: Use shmobile_init_delay() on Genmai boards Magnus Damm
2014-02-24 7:30 ` [PATCH 03/03] ARM: shmobile: Use shmobile_clk_workaround() on Koelsch Magnus Damm
2014-03-07 2:05 ` [PATCH 00/03] ARM: shmobile: Break out and extend clock workaround Simon Horman
3 siblings, 2 replies; 17+ 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] 17+ messages in thread* [PATCH 02/03] ARM: shmobile: Use shmobile_init_delay() on EMEV2
2014-02-24 7:29 ` [PATCH 02/03] ARM: shmobile: Use shmobile_clk_workaround() on Lager Magnus Damm
@ 2014-06-05 5:32 ` Magnus Damm
2014-06-05 6:47 ` [PATCH 02/03] ARM: shmobile: Use shmobile_init_delay() on Genmai boards Magnus Damm
1 sibling, 0 replies; 17+ messages in thread
From: Magnus Damm @ 2014-06-05 5:32 UTC (permalink / raw)
To: linux-sh
From: Magnus Damm <damm+renesas@opensource.se>
Adjust EMEV2 to use shmobile_init_delay() together with
CPU Frequency settings from the DTS.
Signed-off-by: Magnus Damm <damm+renesas@opensource.se>
---
arch/arm/mach-shmobile/setup-emev2.c | 7 +------
1 file changed, 1 insertion(+), 6 deletions(-)
--- 0001/arch/arm/mach-shmobile/setup-emev2.c
+++ work/arch/arm/mach-shmobile/setup-emev2.c 2014-05-29 17:08:51.000000000 +0900
@@ -42,11 +42,6 @@ static void __init emev2_map_io(void)
iotable_init(emev2_io_desc, ARRAY_SIZE(emev2_io_desc));
}
-static void __init emev2_init_delay(void)
-{
- shmobile_setup_delay(533, 1, 3); /* Cortex-A9 @ 533MHz */
-}
-
static void __init emev2_add_standard_devices_dt(void)
{
of_clk_init(NULL);
@@ -63,7 +58,7 @@ extern struct smp_operations emev2_smp_o
DT_MACHINE_START(EMEV2_DT, "Generic Emma Mobile EV2 (Flattened Device Tree)")
.smp = smp_ops(emev2_smp_ops),
.map_io = emev2_map_io,
- .init_early = emev2_init_delay,
+ .init_early = shmobile_init_delay,
.init_machine = emev2_add_standard_devices_dt,
.init_late = shmobile_init_late,
.dt_compat = emev2_boards_compat_dt,
^ permalink raw reply [flat|nested] 17+ messages in thread* [PATCH 02/03] ARM: shmobile: Use shmobile_init_delay() on Genmai boards
2014-02-24 7:29 ` [PATCH 02/03] ARM: shmobile: Use shmobile_clk_workaround() on Lager Magnus Damm
2014-06-05 5:32 ` [PATCH 02/03] ARM: shmobile: Use shmobile_init_delay() on EMEV2 Magnus Damm
@ 2014-06-05 6:47 ` Magnus Damm
1 sibling, 0 replies; 17+ messages in thread
From: Magnus Damm @ 2014-06-05 6:47 UTC (permalink / raw)
To: linux-sh
From: Magnus Damm <damm+renesas@opensource.se>
Adjust Genmai board support to use shmobile_init_delay() together
with r7s72100 CPU Frequency settings from the DTS.
Signed-off-by: Magnus Damm <damm+renesas@opensource.se>
---
arch/arm/mach-shmobile/board-genmai-reference.c | 2 +-
arch/arm/mach-shmobile/board-genmai.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
--- 0001/arch/arm/mach-shmobile/board-genmai-reference.c
+++ work/arch/arm/mach-shmobile/board-genmai-reference.c 2014-05-29 17:50:54.000000000 +0900
@@ -47,7 +47,7 @@ static const char * const genmai_boards_
};
DT_MACHINE_START(GENMAI_DT, "genmai")
- .init_early = r7s72100_init_early,
+ .init_early = shmobile_init_delay,
.init_machine = genmai_add_standard_devices,
.dt_compat = genmai_boards_compat_dt,
MACHINE_END
--- 0001/arch/arm/mach-shmobile/board-genmai.c
+++ work/arch/arm/mach-shmobile/board-genmai.c 2014-05-29 17:50:39.000000000 +0900
@@ -154,7 +154,7 @@ static const char * const genmai_boards_
};
DT_MACHINE_START(GENMAI_DT, "genmai")
- .init_early = r7s72100_init_early,
+ .init_early = shmobile_init_delay,
.init_machine = genmai_add_standard_devices,
.dt_compat = genmai_boards_compat_dt,
MACHINE_END
^ permalink raw reply [flat|nested] 17+ messages in thread
* [PATCH 03/03] ARM: shmobile: Use shmobile_clk_workaround() on Koelsch
2014-02-24 7:29 [PATCH 00/03] ARM: shmobile: Break out and extend clock workaround Magnus Damm
2014-02-24 7:29 ` [PATCH 01/03] ARM: shmobile: Introduce shmobile_clk_workaround() Magnus Damm
2014-02-24 7:29 ` [PATCH 02/03] ARM: shmobile: Use shmobile_clk_workaround() on Lager Magnus Damm
@ 2014-02-24 7:30 ` Magnus Damm
2014-06-05 6:47 ` [PATCH 03/03] ARM: shmobile: Use shmobile_init_delay() on r7s72100 Magnus Damm
` (2 more replies)
2014-03-07 2:05 ` [PATCH 00/03] ARM: shmobile: Break out and extend clock workaround Simon Horman
3 siblings, 3 replies; 17+ messages in thread
From: Magnus Damm @ 2014-02-24 7:30 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] 17+ messages in thread* [PATCH 03/03] ARM: shmobile: Use shmobile_init_delay() on r7s72100
2014-02-24 7:30 ` [PATCH 03/03] ARM: shmobile: Use shmobile_clk_workaround() on Koelsch Magnus Damm
@ 2014-06-05 6:47 ` Magnus Damm
2014-06-05 8:22 ` Geert Uytterhoeven
2014-06-05 21:44 ` Magnus Damm
2 siblings, 0 replies; 17+ messages in thread
From: Magnus Damm @ 2014-06-05 6:47 UTC (permalink / raw)
To: linux-sh
From: Magnus Damm <damm+renesas@opensource.se>
Adjust Genmai board support to use shmobile_init_delay() together
with r7s72100 CPU Frequency settings from the DTS.
Signed-off-by: Magnus Damm <damm+renesas@opensource.se>
---
arch/arm/mach-shmobile/board-genmai-reference.c | 2 +-
arch/arm/mach-shmobile/board-genmai.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
--- 0001/arch/arm/mach-shmobile/board-genmai-reference.c
+++ work/arch/arm/mach-shmobile/board-genmai-reference.c 2014-05-29 17:50:54.000000000 +0900
@@ -47,7 +47,7 @@ static const char * const genmai_boards_
};
DT_MACHINE_START(GENMAI_DT, "genmai")
- .init_early = r7s72100_init_early,
+ .init_early = shmobile_init_delay,
.init_machine = genmai_add_standard_devices,
.dt_compat = genmai_boards_compat_dt,
MACHINE_END
--- 0001/arch/arm/mach-shmobile/board-genmai.c
+++ work/arch/arm/mach-shmobile/board-genmai.c 2014-05-29 17:50:39.000000000 +0900
@@ -154,7 +154,7 @@ static const char * const genmai_boards_
};
DT_MACHINE_START(GENMAI_DT, "genmai")
- .init_early = r7s72100_init_early,
+ .init_early = shmobile_init_delay,
.init_machine = genmai_add_standard_devices,
.dt_compat = genmai_boards_compat_dt,
MACHINE_END
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH 03/03] ARM: shmobile: Use shmobile_init_delay() on r7s72100
2014-02-24 7:30 ` [PATCH 03/03] ARM: shmobile: Use shmobile_clk_workaround() on Koelsch Magnus Damm
2014-06-05 6:47 ` [PATCH 03/03] ARM: shmobile: Use shmobile_init_delay() on r7s72100 Magnus Damm
@ 2014-06-05 8:22 ` Geert Uytterhoeven
2014-06-05 21:44 ` Magnus Damm
2 siblings, 0 replies; 17+ messages in thread
From: Geert Uytterhoeven @ 2014-06-05 8:22 UTC (permalink / raw)
To: linux-sh
Hi Magnus,
On Thu, Jun 5, 2014 at 8:47 AM, Magnus Damm <magnus.damm@gmail.com> wrote:
> From: Magnus Damm <damm+renesas@opensource.se>
>
> Adjust Genmai board support to use shmobile_init_delay() together
> with r7s72100 CPU Frequency settings from the DTS.
>
> Signed-off-by: Magnus Damm <damm+renesas@opensource.se>
> ---
>
> arch/arm/mach-shmobile/board-genmai-reference.c | 2 +-
> arch/arm/mach-shmobile/board-genmai.c | 2 +-
> 2 files changed, 2 insertions(+), 2 deletions(-)
The contents of this patch are identical to "[PATCH 02/03] ARM: shmobile:
Use shmobile_init_delay() on Genmai boards"?
I had expected it to touch arch/arm/mach-shmobile/setup-r7s72100.c and
arch/arm/mach-shmobile/include/mach/r7s72100.h.
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
^ permalink raw reply [flat|nested] 17+ messages in thread* Re: [PATCH 03/03] ARM: shmobile: Use shmobile_init_delay() on r7s72100
2014-02-24 7:30 ` [PATCH 03/03] ARM: shmobile: Use shmobile_clk_workaround() on Koelsch Magnus Damm
2014-06-05 6:47 ` [PATCH 03/03] ARM: shmobile: Use shmobile_init_delay() on r7s72100 Magnus Damm
2014-06-05 8:22 ` Geert Uytterhoeven
@ 2014-06-05 21:44 ` Magnus Damm
2 siblings, 0 replies; 17+ messages in thread
From: Magnus Damm @ 2014-06-05 21:44 UTC (permalink / raw)
To: linux-sh
Hi Geert,
On Thu, Jun 5, 2014 at 5:22 PM, Geert Uytterhoeven <geert@linux-m68k.org> wrote:
> Hi Magnus,
>
> On Thu, Jun 5, 2014 at 8:47 AM, Magnus Damm <magnus.damm@gmail.com> wrote:
>> From: Magnus Damm <damm+renesas@opensource.se>
>>
>> Adjust Genmai board support to use shmobile_init_delay() together
>> with r7s72100 CPU Frequency settings from the DTS.
>>
>> Signed-off-by: Magnus Damm <damm+renesas@opensource.se>
>> ---
>>
>> arch/arm/mach-shmobile/board-genmai-reference.c | 2 +-
>> arch/arm/mach-shmobile/board-genmai.c | 2 +-
>> 2 files changed, 2 insertions(+), 2 deletions(-)
>
> The contents of this patch are identical to "[PATCH 02/03] ARM: shmobile:
> Use shmobile_init_delay() on Genmai boards"?
>
> I had expected it to touch arch/arm/mach-shmobile/setup-r7s72100.c and
> arch/arm/mach-shmobile/include/mach/r7s72100.h.
I was about to explain how the patches are split this way between SoC
and board because ARM SoC likes to merge things that way, but now I
realize that you are telling me that I sent the wrong patch. =)
Thanks for pointing this out. I will fix up and resend (hopefully the
right code this time).
Cheers,
/ magnus
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH 00/03] ARM: shmobile: Break out and extend clock workaround
2014-02-24 7:29 [PATCH 00/03] ARM: shmobile: Break out and extend clock workaround Magnus Damm
` (2 preceding siblings ...)
2014-02-24 7:30 ` [PATCH 03/03] ARM: shmobile: Use shmobile_clk_workaround() on Koelsch Magnus Damm
@ 2014-03-07 2:05 ` Simon Horman
2014-03-11 4:11 ` Simon Horman
3 siblings, 1 reply; 17+ messages in thread
From: Simon Horman @ 2014-03-07 2:05 UTC (permalink / raw)
To: linux-arm-kernel
On Mon, Feb 24, 2014 at 04:29:21PM +0900, Magnus Damm wrote:
> ARM: shmobile: Break out and extend clock workaround
>
> [PATCH 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
>
> 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
> will be posted shortly.
>
> Signed-off-by: Magnus Damm <damm@opensource.se>
Thanks, I have queued these up.
^ permalink raw reply [flat|nested] 17+ messages in thread* Re: [PATCH 00/03] ARM: shmobile: Break out and extend clock workaround
2014-03-07 2:05 ` [PATCH 00/03] ARM: shmobile: Break out and extend clock workaround Simon Horman
@ 2014-03-11 4:11 ` Simon Horman
0 siblings, 0 replies; 17+ messages in thread
From: Simon Horman @ 2014-03-11 4:11 UTC (permalink / raw)
To: linux-arm-kernel
On Fri, Mar 07, 2014 at 11:05:26AM +0900, Simon Horman wrote:
> On Mon, Feb 24, 2014 at 04:29:21PM +0900, Magnus Damm wrote:
> > ARM: shmobile: Break out and extend clock workaround
> >
> > [PATCH 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
> >
> > 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
> > will be posted shortly.
> >
> > Signed-off-by: Magnus Damm <damm@opensource.se>
>
> Thanks, I have queued these up.
It seems that the #include "clock.h" line in the
first patch of the series depends on "ARM: shmobile: Add temporary include
workaround" which I have dropped as Olof objected to it.
Accordingly I am dropping this series too.
^ permalink raw reply [flat|nested] 17+ 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 ` Magnus Damm
2014-03-12 23:59 ` Simon Horman
0 siblings, 1 reply; 17+ 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] 17+ messages in thread* Re: [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; 17+ 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] 17+ messages in thread* Re: [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; 17+ 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@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
^ permalink raw reply [flat|nested] 17+ messages in thread* Re: [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; 17+ 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] 17+ messages in thread* Re: [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; 17+ 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] 17+ messages in thread