linux-sh.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v5 12/15] ARM: shmobile: r8a7778: Switch to new style TMU device
@ 2014-04-23 11:15 Laurent Pinchart
  2014-05-02  3:51 ` Geert Uytterhoeven
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Laurent Pinchart @ 2014-04-23 11:15 UTC (permalink / raw)
  To: linux-sh

The TMU (Timer Unit) driver implements a new style of platform data that
handles the timer as a single device with multiple channel. Switch from
the old-style platform data to the new-style platform data.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
---
 arch/arm/mach-shmobile/clock-r8a7778.c |  4 ++--
 arch/arm/mach-shmobile/setup-r8a7778.c | 30 ++++++++----------------------
 2 files changed, 10 insertions(+), 24 deletions(-)

diff --git a/arch/arm/mach-shmobile/clock-r8a7778.c b/arch/arm/mach-shmobile/clock-r8a7778.c
index 2009a9b..683bc41 100644
--- a/arch/arm/mach-shmobile/clock-r8a7778.c
+++ b/arch/arm/mach-shmobile/clock-r8a7778.c
@@ -211,8 +211,6 @@ static struct clk_lookup lookups[] = {
 	CLKDEV_DEV_ID("sh-sci.3", &mstp_clks[MSTP023]), /* SCIF3 */
 	CLKDEV_DEV_ID("sh-sci.4", &mstp_clks[MSTP022]), /* SCIF4 */
 	CLKDEV_DEV_ID("sh-sci.5", &mstp_clks[MSTP021]), /* SCIF6 */
-	CLKDEV_DEV_ID("sh_tmu.0", &mstp_clks[MSTP016]), /* TMU00 */
-	CLKDEV_DEV_ID("sh_tmu.1", &mstp_clks[MSTP015]), /* TMU01 */
 	CLKDEV_DEV_ID("sh-hspi.0", &mstp_clks[MSTP007]), /* HSPI0 */
 	CLKDEV_DEV_ID("fffc7000.spi", &mstp_clks[MSTP007]), /* HSPI0 */
 	CLKDEV_DEV_ID("sh-hspi.1", &mstp_clks[MSTP007]), /* HSPI1 */
@@ -243,6 +241,8 @@ static struct clk_lookup lookups[] = {
 	CLKDEV_ICK_ID("scu.6", "rcar_sound", &mstp_clks[MSTP525]),
 	CLKDEV_ICK_ID("scu.7", "rcar_sound", &mstp_clks[MSTP524]),
 	CLKDEV_ICK_ID("scu.8", "rcar_sound", &mstp_clks[MSTP523]),
+	CLKDEV_ICK_ID("fck", "sh-tmu.0", &mstp_clks[MSTP016]),
+	CLKDEV_ICK_ID("fck", "sh-tmu.1", &mstp_clks[MSTP015]),
 };
 
 void __init r8a7778_clock_init(void)
diff --git a/arch/arm/mach-shmobile/setup-r8a7778.c b/arch/arm/mach-shmobile/setup-r8a7778.c
index 6d69452..57c8277 100644
--- a/arch/arm/mach-shmobile/setup-r8a7778.c
+++ b/arch/arm/mach-shmobile/setup-r8a7778.c
@@ -71,33 +71,20 @@ R8A7778_SCIF(5, 0xffe45000, gic_iid(0x6b));
 					  sizeof(scif##index##_platform_data))
 
 /* TMU */
-static struct resource sh_tmu0_resources[] __initdata = {
-	DEFINE_RES_MEM(0xffd80008, 12),
-	DEFINE_RES_IRQ(gic_iid(0x40)),
+static struct sh_timer_config sh_tmu0_platform_data = {
+	.channels_mask = 7,
 };
 
-static struct sh_timer_config sh_tmu0_platform_data __initdata = {
-	.name			= "TMU00",
-	.channel_offset		= 0x4,
-	.timer_bit		= 0,
-	.clockevent_rating	= 200,
-};
-
-static struct resource sh_tmu1_resources[] __initdata = {
-	DEFINE_RES_MEM(0xffd80014, 12),
-	DEFINE_RES_IRQ(gic_iid(0x41)),
-};
-
-static struct sh_timer_config sh_tmu1_platform_data __initdata = {
-	.name			= "TMU01",
-	.channel_offset		= 0x10,
-	.timer_bit		= 1,
-	.clocksource_rating	= 200,
+static struct resource sh_tmu0_resources[] = {
+	DEFINE_RES_MEM(0xffd80000, 0x30),
+	DEFINE_RES_IRQ(gic_spi(0x40)),
+	DEFINE_RES_IRQ(gic_spi(0x41)),
+	DEFINE_RES_IRQ(gic_spi(0x42)),
 };
 
 #define r8a7778_register_tmu(idx)			\
 	platform_device_register_resndata(		\
-		&platform_bus, "sh_tmu", idx,		\
+		&platform_bus, "sh-tmu", idx,		\
 		sh_tmu##idx##_resources,		\
 		ARRAY_SIZE(sh_tmu##idx##_resources),	\
 		&sh_tmu##idx##_platform_data,		\
@@ -312,7 +299,6 @@ void __init r8a7778_add_dt_devices(void)
 	r8a7778_register_scif(4);
 	r8a7778_register_scif(5);
 	r8a7778_register_tmu(0);
-	r8a7778_register_tmu(1);
 }
 
 /* HPB-DMA */
-- 
1.8.3.2


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH v5 12/15] ARM: shmobile: r8a7778: Switch to new style TMU device
  2014-04-23 11:15 [PATCH v5 12/15] ARM: shmobile: r8a7778: Switch to new style TMU device Laurent Pinchart
@ 2014-05-02  3:51 ` Geert Uytterhoeven
  2014-05-02 17:09 ` Laurent Pinchart
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Geert Uytterhoeven @ 2014-05-02  3:51 UTC (permalink / raw)
  To: linux-sh

Hi Laurent,

On Wed, Apr 23, 2014 at 1:15 PM, Laurent Pinchart
<laurent.pinchart+renesas@ideasonboard.com> wrote:
> --- a/arch/arm/mach-shmobile/setup-r8a7778.c
> +++ b/arch/arm/mach-shmobile/setup-r8a7778.c
> @@ -71,33 +71,20 @@ R8A7778_SCIF(5, 0xffe45000, gic_iid(0x6b));
>                                           sizeof(scif##index##_platform_data))
>
>  /* TMU */
> -static struct resource sh_tmu0_resources[] __initdata = {
> -       DEFINE_RES_MEM(0xffd80008, 12),
> -       DEFINE_RES_IRQ(gic_iid(0x40)),

gic_iid(0x40)

> +static struct sh_timer_config sh_tmu0_platform_data = {
> +       .channels_mask = 7,
>  };
>
> -static struct sh_timer_config sh_tmu0_platform_data __initdata = {
> -       .name                   = "TMU00",
> -       .channel_offset         = 0x4,
> -       .timer_bit              = 0,
> -       .clockevent_rating      = 200,
> -};
> -
> -static struct resource sh_tmu1_resources[] __initdata = {
> -       DEFINE_RES_MEM(0xffd80014, 12),
> -       DEFINE_RES_IRQ(gic_iid(0x41)),
> -};
> -
> -static struct sh_timer_config sh_tmu1_platform_data __initdata = {
> -       .name                   = "TMU01",
> -       .channel_offset         = 0x10,
> -       .timer_bit              = 1,
> -       .clocksource_rating     = 200,
> +static struct resource sh_tmu0_resources[] = {
> +       DEFINE_RES_MEM(0xffd80000, 0x30),
> +       DEFINE_RES_IRQ(gic_spi(0x40)),
> +       DEFINE_RES_IRQ(gic_spi(0x41)),
> +       DEFINE_RES_IRQ(gic_spi(0x42)),
>  };

So these should be gic_iid(x04x), too?

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] 5+ messages in thread

* [PATCH v5 12/15] ARM: shmobile: r8a7778: Switch to new style TMU device
  2014-04-23 11:15 [PATCH v5 12/15] ARM: shmobile: r8a7778: Switch to new style TMU device Laurent Pinchart
  2014-05-02  3:51 ` Geert Uytterhoeven
@ 2014-05-02 17:09 ` Laurent Pinchart
  2014-05-02 18:19 ` Laurent Pinchart
  2014-05-02 18:21 ` Laurent Pinchart
  3 siblings, 0 replies; 5+ messages in thread
From: Laurent Pinchart @ 2014-05-02 17:09 UTC (permalink / raw)
  To: linux-sh

The TMU (Timer Unit) driver implements a new style of platform data that
handles the timer as a single device with multiple channel. Switch from
the old-style platform data to the new-style platform data.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
---
 arch/arm/mach-shmobile/clock-r8a7778.c |  4 ++--
 arch/arm/mach-shmobile/setup-r8a7778.c | 28 +++++++---------------------
 2 files changed, 9 insertions(+), 23 deletions(-)

Changes since v4:

- Fixed TMU interrupts that mistakenly used gic_spi instead of gic_iid

diff --git a/arch/arm/mach-shmobile/clock-r8a7778.c b/arch/arm/mach-shmobile/clock-r8a7778.c
index 201fc48..65f08f7 100644
--- a/arch/arm/mach-shmobile/clock-r8a7778.c
+++ b/arch/arm/mach-shmobile/clock-r8a7778.c
@@ -207,8 +207,6 @@ static struct clk_lookup lookups[] = {
 	CLKDEV_DEV_ID("sh-sci.3", &mstp_clks[MSTP023]), /* SCIF3 */
 	CLKDEV_DEV_ID("sh-sci.4", &mstp_clks[MSTP022]), /* SCIF4 */
 	CLKDEV_DEV_ID("sh-sci.5", &mstp_clks[MSTP021]), /* SCIF6 */
-	CLKDEV_DEV_ID("sh_tmu.0", &mstp_clks[MSTP016]), /* TMU00 */
-	CLKDEV_DEV_ID("sh_tmu.1", &mstp_clks[MSTP015]), /* TMU01 */
 	CLKDEV_DEV_ID("sh-hspi.0", &mstp_clks[MSTP007]), /* HSPI0 */
 	CLKDEV_DEV_ID("fffc7000.spi", &mstp_clks[MSTP007]), /* HSPI0 */
 	CLKDEV_DEV_ID("sh-hspi.1", &mstp_clks[MSTP007]), /* HSPI1 */
@@ -239,6 +237,8 @@ static struct clk_lookup lookups[] = {
 	CLKDEV_ICK_ID("src.6", "rcar_sound", &mstp_clks[MSTP525]),
 	CLKDEV_ICK_ID("src.7", "rcar_sound", &mstp_clks[MSTP524]),
 	CLKDEV_ICK_ID("src.8", "rcar_sound", &mstp_clks[MSTP523]),
+	CLKDEV_ICK_ID("fck", "sh-tmu.0", &mstp_clks[MSTP016]),
+	CLKDEV_ICK_ID("fck", "sh-tmu.1", &mstp_clks[MSTP015]),
 };
 
 void __init r8a7778_clock_init(void)
diff --git a/arch/arm/mach-shmobile/setup-r8a7778.c b/arch/arm/mach-shmobile/setup-r8a7778.c
index 6d69452..8c02e24 100644
--- a/arch/arm/mach-shmobile/setup-r8a7778.c
+++ b/arch/arm/mach-shmobile/setup-r8a7778.c
@@ -71,33 +71,20 @@ R8A7778_SCIF(5, 0xffe45000, gic_iid(0x6b));
 					  sizeof(scif##index##_platform_data))
 
 /* TMU */
-static struct resource sh_tmu0_resources[] __initdata = {
-	DEFINE_RES_MEM(0xffd80008, 12),
-	DEFINE_RES_IRQ(gic_iid(0x40)),
-};
-
-static struct sh_timer_config sh_tmu0_platform_data __initdata = {
-	.name			= "TMU00",
-	.channel_offset		= 0x4,
-	.timer_bit		= 0,
-	.clockevent_rating	= 200,
+static struct sh_timer_config sh_tmu0_platform_data = {
+	.channels_mask = 7,
 };
 
-static struct resource sh_tmu1_resources[] __initdata = {
-	DEFINE_RES_MEM(0xffd80014, 12),
+static struct resource sh_tmu0_resources[] = {
+	DEFINE_RES_MEM(0xffd80000, 0x30),
+	DEFINE_RES_IRQ(gic_iid(0x40)),
 	DEFINE_RES_IRQ(gic_iid(0x41)),
-};
-
-static struct sh_timer_config sh_tmu1_platform_data __initdata = {
-	.name			= "TMU01",
-	.channel_offset		= 0x10,
-	.timer_bit		= 1,
-	.clocksource_rating	= 200,
+	DEFINE_RES_IRQ(gic_iid(0x42)),
 };
 
 #define r8a7778_register_tmu(idx)			\
 	platform_device_register_resndata(		\
-		&platform_bus, "sh_tmu", idx,		\
+		&platform_bus, "sh-tmu", idx,		\
 		sh_tmu##idx##_resources,		\
 		ARRAY_SIZE(sh_tmu##idx##_resources),	\
 		&sh_tmu##idx##_platform_data,		\
@@ -312,7 +299,6 @@ void __init r8a7778_add_dt_devices(void)
 	r8a7778_register_scif(4);
 	r8a7778_register_scif(5);
 	r8a7778_register_tmu(0);
-	r8a7778_register_tmu(1);
 }
 
 /* HPB-DMA */
-- 
Regards,

Laurent Pinchart


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH v5 12/15] ARM: shmobile: r8a7778: Switch to new style TMU device
  2014-04-23 11:15 [PATCH v5 12/15] ARM: shmobile: r8a7778: Switch to new style TMU device Laurent Pinchart
  2014-05-02  3:51 ` Geert Uytterhoeven
  2014-05-02 17:09 ` Laurent Pinchart
@ 2014-05-02 18:19 ` Laurent Pinchart
  2014-05-02 18:21 ` Laurent Pinchart
  3 siblings, 0 replies; 5+ messages in thread
From: Laurent Pinchart @ 2014-05-02 18:19 UTC (permalink / raw)
  To: linux-sh

This should be v6, not v5, sorry.

On Friday 02 May 2014 19:09:35 Laurent Pinchart wrote:
> The TMU (Timer Unit) driver implements a new style of platform data that
> handles the timer as a single device with multiple channel. Switch from
> the old-style platform data to the new-style platform data.
> 
> Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
> ---
>  arch/arm/mach-shmobile/clock-r8a7778.c |  4 ++--
>  arch/arm/mach-shmobile/setup-r8a7778.c | 28 +++++++---------------------
>  2 files changed, 9 insertions(+), 23 deletions(-)
> 
> Changes since v4:
> 
> - Fixed TMU interrupts that mistakenly used gic_spi instead of gic_iid
> 
> diff --git a/arch/arm/mach-shmobile/clock-r8a7778.c
> b/arch/arm/mach-shmobile/clock-r8a7778.c index 201fc48..65f08f7 100644
> --- a/arch/arm/mach-shmobile/clock-r8a7778.c
> +++ b/arch/arm/mach-shmobile/clock-r8a7778.c
> @@ -207,8 +207,6 @@ static struct clk_lookup lookups[] = {
>  	CLKDEV_DEV_ID("sh-sci.3", &mstp_clks[MSTP023]), /* SCIF3 */
>  	CLKDEV_DEV_ID("sh-sci.4", &mstp_clks[MSTP022]), /* SCIF4 */
>  	CLKDEV_DEV_ID("sh-sci.5", &mstp_clks[MSTP021]), /* SCIF6 */
> -	CLKDEV_DEV_ID("sh_tmu.0", &mstp_clks[MSTP016]), /* TMU00 */
> -	CLKDEV_DEV_ID("sh_tmu.1", &mstp_clks[MSTP015]), /* TMU01 */
>  	CLKDEV_DEV_ID("sh-hspi.0", &mstp_clks[MSTP007]), /* HSPI0 */
>  	CLKDEV_DEV_ID("fffc7000.spi", &mstp_clks[MSTP007]), /* HSPI0 */
>  	CLKDEV_DEV_ID("sh-hspi.1", &mstp_clks[MSTP007]), /* HSPI1 */
> @@ -239,6 +237,8 @@ static struct clk_lookup lookups[] = {
>  	CLKDEV_ICK_ID("src.6", "rcar_sound", &mstp_clks[MSTP525]),
>  	CLKDEV_ICK_ID("src.7", "rcar_sound", &mstp_clks[MSTP524]),
>  	CLKDEV_ICK_ID("src.8", "rcar_sound", &mstp_clks[MSTP523]),
> +	CLKDEV_ICK_ID("fck", "sh-tmu.0", &mstp_clks[MSTP016]),
> +	CLKDEV_ICK_ID("fck", "sh-tmu.1", &mstp_clks[MSTP015]),
>  };
> 
>  void __init r8a7778_clock_init(void)
> diff --git a/arch/arm/mach-shmobile/setup-r8a7778.c
> b/arch/arm/mach-shmobile/setup-r8a7778.c index 6d69452..8c02e24 100644
> --- a/arch/arm/mach-shmobile/setup-r8a7778.c
> +++ b/arch/arm/mach-shmobile/setup-r8a7778.c
> @@ -71,33 +71,20 @@ R8A7778_SCIF(5, 0xffe45000, gic_iid(0x6b));
>  					  sizeof(scif##index##_platform_data))
> 
>  /* TMU */
> -static struct resource sh_tmu0_resources[] __initdata = {
> -	DEFINE_RES_MEM(0xffd80008, 12),
> -	DEFINE_RES_IRQ(gic_iid(0x40)),
> -};
> -
> -static struct sh_timer_config sh_tmu0_platform_data __initdata = {
> -	.name			= "TMU00",
> -	.channel_offset		= 0x4,
> -	.timer_bit		= 0,
> -	.clockevent_rating	= 200,
> +static struct sh_timer_config sh_tmu0_platform_data = {
> +	.channels_mask = 7,
>  };
> 
> -static struct resource sh_tmu1_resources[] __initdata = {
> -	DEFINE_RES_MEM(0xffd80014, 12),
> +static struct resource sh_tmu0_resources[] = {
> +	DEFINE_RES_MEM(0xffd80000, 0x30),
> +	DEFINE_RES_IRQ(gic_iid(0x40)),
>  	DEFINE_RES_IRQ(gic_iid(0x41)),
> -};
> -
> -static struct sh_timer_config sh_tmu1_platform_data __initdata = {
> -	.name			= "TMU01",
> -	.channel_offset		= 0x10,
> -	.timer_bit		= 1,
> -	.clocksource_rating	= 200,
> +	DEFINE_RES_IRQ(gic_iid(0x42)),
>  };
> 
>  #define r8a7778_register_tmu(idx)			\
>  	platform_device_register_resndata(		\
> -		&platform_bus, "sh_tmu", idx,		\
> +		&platform_bus, "sh-tmu", idx,		\
>  		sh_tmu##idx##_resources,		\
>  		ARRAY_SIZE(sh_tmu##idx##_resources),	\
>  		&sh_tmu##idx##_platform_data,		\
> @@ -312,7 +299,6 @@ void __init r8a7778_add_dt_devices(void)
>  	r8a7778_register_scif(4);
>  	r8a7778_register_scif(5);
>  	r8a7778_register_tmu(0);
> -	r8a7778_register_tmu(1);
>  }
> 
>  /* HPB-DMA */

-- 
Regards,

Laurent Pinchart


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v5 12/15] ARM: shmobile: r8a7778: Switch to new style TMU device
  2014-04-23 11:15 [PATCH v5 12/15] ARM: shmobile: r8a7778: Switch to new style TMU device Laurent Pinchart
                   ` (2 preceding siblings ...)
  2014-05-02 18:19 ` Laurent Pinchart
@ 2014-05-02 18:21 ` Laurent Pinchart
  3 siblings, 0 replies; 5+ messages in thread
From: Laurent Pinchart @ 2014-05-02 18:21 UTC (permalink / raw)
  To: linux-sh

Hi Geert,

On Friday 02 May 2014 05:51:07 Geert Uytterhoeven wrote:
> Hi Laurent,
> 
> On Wed, Apr 23, 2014 at 1:15 PM, Laurent Pinchart wrote:
> > --- a/arch/arm/mach-shmobile/setup-r8a7778.c
> > +++ b/arch/arm/mach-shmobile/setup-r8a7778.c
> > @@ -71,33 +71,20 @@ R8A7778_SCIF(5, 0xffe45000, gic_iid(0x6b));
> > 
> >                                           sizeof(scif##index##_platform_da
> >                                           ta))
> >  
> >  /* TMU */
> > 
> > -static struct resource sh_tmu0_resources[] __initdata = {
> > -       DEFINE_RES_MEM(0xffd80008, 12),
> > -       DEFINE_RES_IRQ(gic_iid(0x40)),
> 
> gic_iid(0x40)
> 
> > +static struct sh_timer_config sh_tmu0_platform_data = {
> > +       .channels_mask = 7,
> > 
> >  };
> > 
> > -static struct sh_timer_config sh_tmu0_platform_data __initdata = {
> > -       .name                   = "TMU00",
> > -       .channel_offset         = 0x4,
> > -       .timer_bit              = 0,
> > -       .clockevent_rating      = 200,
> > -};
> > -
> > -static struct resource sh_tmu1_resources[] __initdata = {
> > -       DEFINE_RES_MEM(0xffd80014, 12),
> > -       DEFINE_RES_IRQ(gic_iid(0x41)),
> > -};
> > -
> > -static struct sh_timer_config sh_tmu1_platform_data __initdata = {
> > -       .name                   = "TMU01",
> > -       .channel_offset         = 0x10,
> > -       .timer_bit              = 1,
> > -       .clocksource_rating     = 200,
> > +static struct resource sh_tmu0_resources[] = {
> > +       DEFINE_RES_MEM(0xffd80000, 0x30),
> > +       DEFINE_RES_IRQ(gic_spi(0x40)),
> > +       DEFINE_RES_IRQ(gic_spi(0x41)),
> > +       DEFINE_RES_IRQ(gic_spi(0x42)),
> > 
> >  };
> 
> So these should be gic_iid(x04x), too?

Definitely. I've sent a fixed v6 patch.

-- 
Regards,

Laurent Pinchart


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2014-05-02 18:21 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-04-23 11:15 [PATCH v5 12/15] ARM: shmobile: r8a7778: Switch to new style TMU device Laurent Pinchart
2014-05-02  3:51 ` Geert Uytterhoeven
2014-05-02 17:09 ` Laurent Pinchart
2014-05-02 18:19 ` Laurent Pinchart
2014-05-02 18:21 ` Laurent Pinchart

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).