All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 05/10] ARM: shmobile: lager-reference: Switch to multiplaform
@ 2013-10-29 15:04 Laurent Pinchart
  2013-11-06  8:23 ` Simon Horman
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: Laurent Pinchart @ 2013-10-29 15:04 UTC (permalink / raw)
  To: linux-sh

Move the Lager reference board to multiplaform ARM architecture. As
multiplatform requires usage of the common clock framework, switch from
legacy clocks to CCF by replacing the legacy clock framework
initialization code in the machine init handler with a common clock
framework initialization call in the time init handler.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
---
 arch/arm/mach-shmobile/Kconfig                 |  7 +++++++
 arch/arm/mach-shmobile/Makefile                |  1 +
 arch/arm/mach-shmobile/board-lager-reference.c | 13 +++++++++----
 3 files changed, 17 insertions(+), 4 deletions(-)

diff --git a/arch/arm/mach-shmobile/Kconfig b/arch/arm/mach-shmobile/Kconfig
index 4bb548f..b39f6b6 100644
--- a/arch/arm/mach-shmobile/Kconfig
+++ b/arch/arm/mach-shmobile/Kconfig
@@ -20,6 +20,9 @@ comment "SH-Mobile System Type"
 config ARCH_EMEV2
 	bool "Emma Mobile EV2"
 
+config ARCH_R8A7790
+	bool "R-Car H2 (R8A77900)"
+
 comment "SH-Mobile Board Type"
 
 config MACH_KZM9D
@@ -27,6 +30,10 @@ config MACH_KZM9D
 	depends on ARCH_EMEV2
 	select REGULATOR_FIXED_VOLTAGE if REGULATOR
 
+config MACH_LAGER
+	bool "Lager board"
+	depends on ARCH_R8A7790
+
 comment "SH-Mobile System Configuration"
 endif
 
diff --git a/arch/arm/mach-shmobile/Makefile b/arch/arm/mach-shmobile/Makefile
index cc48f14..32f3975 100644
--- a/arch/arm/mach-shmobile/Makefile
+++ b/arch/arm/mach-shmobile/Makefile
@@ -57,6 +57,7 @@ obj-$(CONFIG_ARCH_R8A7779)	+= pm-r8a7779.o
 # Board objects
 ifdef CONFIG_ARCH_SHMOBILE_MULTI
 obj-$(CONFIG_MACH_KZM9D)	+= board-kzm9d-reference.o
+obj-$(CONFIG_MACH_LAGER)	+= board-lager-reference.o
 else
 obj-$(CONFIG_MACH_APE6EVM)	+= board-ape6evm.o
 obj-$(CONFIG_MACH_APE6EVM_REFERENCE)	+= board-ape6evm-reference.o
diff --git a/arch/arm/mach-shmobile/board-lager-reference.c b/arch/arm/mach-shmobile/board-lager-reference.c
index 1a1a4a8..e436d06 100644
--- a/arch/arm/mach-shmobile/board-lager-reference.c
+++ b/arch/arm/mach-shmobile/board-lager-reference.c
@@ -18,16 +18,21 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
+#include <linux/clk/shmobile.h>
 #include <linux/init.h>
 #include <linux/of_platform.h>
 #include <mach/r8a7790.h>
 #include <asm/mach/arch.h>
 
-static void __init lager_add_standard_devices(void)
+static void __init lager_init_time(void)
 {
-	/* clocks are setup late during boot in the case of DT */
-	r8a7790_clock_init();
+	r8a7790_clocks_init(rcar_gen2_read_mode_pins());
+
+	rcar_gen2_timer_init();
+}
 
+static void __init lager_add_standard_devices(void)
+{
 	r8a7790_add_dt_devices();
         of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
 }
@@ -40,7 +45,7 @@ static const char *lager_boards_compat_dt[] __initdata = {
 DT_MACHINE_START(LAGER_DT, "lager")
 	.smp		= smp_ops(r8a7790_smp_ops),
 	.init_early	= r8a7790_init_early,
-	.init_time	= rcar_gen2_timer_init,
+	.init_time	= lager_init_time,
 	.init_machine	= lager_add_standard_devices,
 	.dt_compat	= lager_boards_compat_dt,
 MACHINE_END
-- 
1.8.1.5


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

* Re: [PATCH 05/10] ARM: shmobile: lager-reference: Switch to multiplaform
  2013-10-29 15:04 [PATCH 05/10] ARM: shmobile: lager-reference: Switch to multiplaform Laurent Pinchart
@ 2013-11-06  8:23 ` Simon Horman
  2013-11-06  9:15 ` Magnus Damm
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: Simon Horman @ 2013-11-06  8:23 UTC (permalink / raw)
  To: linux-sh

On Tue, Oct 29, 2013 at 04:04:37PM +0100, Laurent Pinchart wrote:
> Move the Lager reference board to multiplaform ARM architecture. As
> multiplatform requires usage of the common clock framework, switch from
> legacy clocks to CCF by replacing the legacy clock framework
> initialization code in the machine init handler with a common clock
> framework initialization call in the time init handler.
> 
> Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
> ---
>  arch/arm/mach-shmobile/Kconfig                 |  7 +++++++
>  arch/arm/mach-shmobile/Makefile                |  1 +
>  arch/arm/mach-shmobile/board-lager-reference.c | 13 +++++++++----
>  3 files changed, 17 insertions(+), 4 deletions(-)
> 
> diff --git a/arch/arm/mach-shmobile/Kconfig b/arch/arm/mach-shmobile/Kconfig
> index 4bb548f..b39f6b6 100644
> --- a/arch/arm/mach-shmobile/Kconfig
> +++ b/arch/arm/mach-shmobile/Kconfig
> @@ -20,6 +20,9 @@ comment "SH-Mobile System Type"
>  config ARCH_EMEV2
>  	bool "Emma Mobile EV2"
>  
> +config ARCH_R8A7790
> +	bool "R-Car H2 (R8A77900)"
> +

I realise that up until now there has only been one entry,
but in keeping with the non-SHMOBILE_MULTI entries I think it
would be good to have the SHMOBILE_MULTI entries sorted in alphabetical
order. With this in mind could you move ARCH_R8A7790 to
above ARCH_EMEV2?

>  comment "SH-Mobile Board Type"
>  
>  config MACH_KZM9D
> @@ -27,6 +30,10 @@ config MACH_KZM9D
>  	depends on ARCH_EMEV2
>  	select REGULATOR_FIXED_VOLTAGE if REGULATOR
>  
> +config MACH_LAGER
> +	bool "Lager board"
> +	depends on ARCH_R8A7790
> +
>  comment "SH-Mobile System Configuration"
>  endif
>  
> diff --git a/arch/arm/mach-shmobile/Makefile b/arch/arm/mach-shmobile/Makefile
> index cc48f14..32f3975 100644
> --- a/arch/arm/mach-shmobile/Makefile
> +++ b/arch/arm/mach-shmobile/Makefile
> @@ -57,6 +57,7 @@ obj-$(CONFIG_ARCH_R8A7779)	+= pm-r8a7779.o
>  # Board objects
>  ifdef CONFIG_ARCH_SHMOBILE_MULTI
>  obj-$(CONFIG_MACH_KZM9D)	+= board-kzm9d-reference.o
> +obj-$(CONFIG_MACH_LAGER)	+= board-lager-reference.o
>  else
>  obj-$(CONFIG_MACH_APE6EVM)	+= board-ape6evm.o
>  obj-$(CONFIG_MACH_APE6EVM_REFERENCE)	+= board-ape6evm-reference.o
> diff --git a/arch/arm/mach-shmobile/board-lager-reference.c b/arch/arm/mach-shmobile/board-lager-reference.c
> index 1a1a4a8..e436d06 100644
> --- a/arch/arm/mach-shmobile/board-lager-reference.c
> +++ b/arch/arm/mach-shmobile/board-lager-reference.c
> @@ -18,16 +18,21 @@
>   * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
>   */
>  
> +#include <linux/clk/shmobile.h>
>  #include <linux/init.h>
>  #include <linux/of_platform.h>
>  #include <mach/r8a7790.h>
>  #include <asm/mach/arch.h>
>  
> -static void __init lager_add_standard_devices(void)
> +static void __init lager_init_time(void)
>  {
> -	/* clocks are setup late during boot in the case of DT */
> -	r8a7790_clock_init();
> +	r8a7790_clocks_init(rcar_gen2_read_mode_pins());
> +
> +	rcar_gen2_timer_init();
> +}
>  
> +static void __init lager_add_standard_devices(void)
> +{
>  	r8a7790_add_dt_devices();
>          of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
>  }
> @@ -40,7 +45,7 @@ static const char *lager_boards_compat_dt[] __initdata = {
>  DT_MACHINE_START(LAGER_DT, "lager")
>  	.smp		= smp_ops(r8a7790_smp_ops),
>  	.init_early	= r8a7790_init_early,
> -	.init_time	= rcar_gen2_timer_init,
> +	.init_time	= lager_init_time,
>  	.init_machine	= lager_add_standard_devices,
>  	.dt_compat	= lager_boards_compat_dt,
>  MACHINE_END
> -- 
> 1.8.1.5
> 
> --
> 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] 10+ messages in thread

* Re: [PATCH 05/10] ARM: shmobile: lager-reference: Switch to multiplaform
  2013-10-29 15:04 [PATCH 05/10] ARM: shmobile: lager-reference: Switch to multiplaform Laurent Pinchart
  2013-11-06  8:23 ` Simon Horman
@ 2013-11-06  9:15 ` Magnus Damm
  2013-11-06 11:59 ` Laurent Pinchart
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: Magnus Damm @ 2013-11-06  9:15 UTC (permalink / raw)
  To: linux-sh

Hi Simon, Laurent,

On Wed, Nov 6, 2013 at 5:23 PM, Simon Horman <horms@verge.net.au> wrote:
> On Tue, Oct 29, 2013 at 04:04:37PM +0100, Laurent Pinchart wrote:
>> Move the Lager reference board to multiplaform ARM architecture. As
>> multiplatform requires usage of the common clock framework, switch from
>> legacy clocks to CCF by replacing the legacy clock framework
>> initialization code in the machine init handler with a common clock
>> framework initialization call in the time init handler.
>>
>> Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
>> ---
>>  arch/arm/mach-shmobile/Kconfig                 |  7 +++++++
>>  arch/arm/mach-shmobile/Makefile                |  1 +
>>  arch/arm/mach-shmobile/board-lager-reference.c | 13 +++++++++----
>>  3 files changed, 17 insertions(+), 4 deletions(-)
>>
>> diff --git a/arch/arm/mach-shmobile/Kconfig b/arch/arm/mach-shmobile/Kconfig
>> index 4bb548f..b39f6b6 100644
>> --- a/arch/arm/mach-shmobile/Kconfig
>> +++ b/arch/arm/mach-shmobile/Kconfig
>> @@ -20,6 +20,9 @@ comment "SH-Mobile System Type"
>>  config ARCH_EMEV2
>>       bool "Emma Mobile EV2"
>>
>> +config ARCH_R8A7790
>> +     bool "R-Car H2 (R8A77900)"
>> +
>
> I realise that up until now there has only been one entry,
> but in keeping with the non-SHMOBILE_MULTI entries I think it
> would be good to have the SHMOBILE_MULTI entries sorted in alphabetical
> order. With this in mind could you move ARCH_R8A7790 to
> above ARCH_EMEV2?

Actually, since we have multiple boards that all want to go into
SHMOBILE_MULTI, I wonder if we can merge the initial code early
somehow?

Ideally I'd like to keep the DT reference board build for both CCF and
legacy clocks for a while. So we want the same code to be built with
SHMOBILE and SHMOBILE_MULTI. When we have got the CCF DT bindings
merged then we can get rid of the legacy DT reference build option.

See the following commit for an example:

cbc60e7c04f3c1390144d4a881f0a7b98b49da98

>>  comment "SH-Mobile Board Type"
>>
>>  config MACH_KZM9D
>> @@ -27,6 +30,10 @@ config MACH_KZM9D
>>       depends on ARCH_EMEV2
>>       select REGULATOR_FIXED_VOLTAGE if REGULATOR
>>
>> +config MACH_LAGER
>> +     bool "Lager board"
>> +     depends on ARCH_R8A7790
>> +
>>  comment "SH-Mobile System Configuration"
>>  endif
>>
>> diff --git a/arch/arm/mach-shmobile/Makefile b/arch/arm/mach-shmobile/Makefile
>> index cc48f14..32f3975 100644
>> --- a/arch/arm/mach-shmobile/Makefile
>> +++ b/arch/arm/mach-shmobile/Makefile
>> @@ -57,6 +57,7 @@ obj-$(CONFIG_ARCH_R8A7779)  += pm-r8a7779.o
>>  # Board objects
>>  ifdef CONFIG_ARCH_SHMOBILE_MULTI
>>  obj-$(CONFIG_MACH_KZM9D)     += board-kzm9d-reference.o
>> +obj-$(CONFIG_MACH_LAGER)     += board-lager-reference.o
>>  else
>>  obj-$(CONFIG_MACH_APE6EVM)   += board-ape6evm.o
>>  obj-$(CONFIG_MACH_APE6EVM_REFERENCE) += board-ape6evm-reference.o
>> diff --git a/arch/arm/mach-shmobile/board-lager-reference.c b/arch/arm/mach-shmobile/board-lager-reference.c
>> index 1a1a4a8..e436d06 100644
>> --- a/arch/arm/mach-shmobile/board-lager-reference.c
>> +++ b/arch/arm/mach-shmobile/board-lager-reference.c
>> @@ -18,16 +18,21 @@
>>   * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
>>   */
>>
>> +#include <linux/clk/shmobile.h>
>>  #include <linux/init.h>
>>  #include <linux/of_platform.h>
>>  #include <mach/r8a7790.h>
>>  #include <asm/mach/arch.h>
>>
>> -static void __init lager_add_standard_devices(void)
>> +static void __init lager_init_time(void)
>>  {
>> -     /* clocks are setup late during boot in the case of DT */
>> -     r8a7790_clock_init();
>> +     r8a7790_clocks_init(rcar_gen2_read_mode_pins());
>> +
>> +     rcar_gen2_timer_init();
>> +}
>>
>> +static void __init lager_add_standard_devices(void)
>> +{
>>       r8a7790_add_dt_devices();
>>          of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
>>  }
>> @@ -40,7 +45,7 @@ static const char *lager_boards_compat_dt[] __initdata = {
>>  DT_MACHINE_START(LAGER_DT, "lager")
>>       .smp            = smp_ops(r8a7790_smp_ops),
>>       .init_early     = r8a7790_init_early,
>> -     .init_time      = rcar_gen2_timer_init,
>> +     .init_time      = lager_init_time,

This looks like it needs some more work. Simon pointed out a typo
related to the MSTP for CMT and that makes me think that this code
wasn't tested with broadcast SMP. So please start by getting the code
working with CMT timer and SMP=n, then gradually enable SMP and
ARCH_TIMER.

Cheers,

/ magnus

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

* Re: [PATCH 05/10] ARM: shmobile: lager-reference: Switch to multiplaform
  2013-10-29 15:04 [PATCH 05/10] ARM: shmobile: lager-reference: Switch to multiplaform Laurent Pinchart
  2013-11-06  8:23 ` Simon Horman
  2013-11-06  9:15 ` Magnus Damm
@ 2013-11-06 11:59 ` Laurent Pinchart
  2013-11-06 12:37 ` Laurent Pinchart
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: Laurent Pinchart @ 2013-11-06 11:59 UTC (permalink / raw)
  To: linux-sh

Hi Simon,

On Wednesday 06 November 2013 17:23:39 Simon Horman wrote:
> On Tue, Oct 29, 2013 at 04:04:37PM +0100, Laurent Pinchart wrote:
> > Move the Lager reference board to multiplaform ARM architecture. As
> > multiplatform requires usage of the common clock framework, switch from
> > legacy clocks to CCF by replacing the legacy clock framework
> > initialization code in the machine init handler with a common clock
> > framework initialization call in the time init handler.
> > 
> > Signed-off-by: Laurent Pinchart
> > <laurent.pinchart+renesas@ideasonboard.com>
> > ---
> > 
> >  arch/arm/mach-shmobile/Kconfig                 |  7 +++++++
> >  arch/arm/mach-shmobile/Makefile                |  1 +
> >  arch/arm/mach-shmobile/board-lager-reference.c | 13 +++++++++----
> >  3 files changed, 17 insertions(+), 4 deletions(-)
> > 
> > diff --git a/arch/arm/mach-shmobile/Kconfig
> > b/arch/arm/mach-shmobile/Kconfig index 4bb548f..b39f6b6 100644
> > --- a/arch/arm/mach-shmobile/Kconfig
> > +++ b/arch/arm/mach-shmobile/Kconfig
> > @@ -20,6 +20,9 @@ comment "SH-Mobile System Type"
> >  config ARCH_EMEV2
> >  	bool "Emma Mobile EV2"
> > 
> > +config ARCH_R8A7790
> > +	bool "R-Car H2 (R8A77900)"
> > +
> 
> I realise that up until now there has only been one entry,
> but in keeping with the non-SHMOBILE_MULTI entries I think it
> would be good to have the SHMOBILE_MULTI entries sorted in alphabetical
> order. With this in mind could you move ARCH_R8A7790 to
> above ARCH_EMEV2?

In my alphabet ARCH_EMEV2 comes before ARCH_R8A7790 :-)

> >  comment "SH-Mobile Board Type"
> >  
> >  config MACH_KZM9D
> > @@ -27,6 +30,10 @@ config MACH_KZM9D
> >  	depends on ARCH_EMEV2
> >  	select REGULATOR_FIXED_VOLTAGE if REGULATOR
> > 
> > +config MACH_LAGER
> > +	bool "Lager board"
> > +	depends on ARCH_R8A7790
> > +
> >  comment "SH-Mobile System Configuration"
> >  endif

-- 
Regards,

Laurent Pinchart


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

* Re: [PATCH 05/10] ARM: shmobile: lager-reference: Switch to multiplaform
  2013-10-29 15:04 [PATCH 05/10] ARM: shmobile: lager-reference: Switch to multiplaform Laurent Pinchart
                   ` (2 preceding siblings ...)
  2013-11-06 11:59 ` Laurent Pinchart
@ 2013-11-06 12:37 ` Laurent Pinchart
  2013-11-08  6:24 ` Simon Horman
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: Laurent Pinchart @ 2013-11-06 12:37 UTC (permalink / raw)
  To: linux-sh

Hi Magnus,

On Wednesday 06 November 2013 18:15:33 Magnus Damm wrote:
> On Wed, Nov 6, 2013 at 5:23 PM, Simon Horman <horms@verge.net.au> wrote:
> > On Tue, Oct 29, 2013 at 04:04:37PM +0100, Laurent Pinchart wrote:
> >> Move the Lager reference board to multiplaform ARM architecture. As
> >> multiplatform requires usage of the common clock framework, switch from
> >> legacy clocks to CCF by replacing the legacy clock framework
> >> initialization code in the machine init handler with a common clock
> >> framework initialization call in the time init handler.
> >> 
> >> Signed-off-by: Laurent Pinchart
> >> <laurent.pinchart+renesas@ideasonboard.com>
> >> ---
> >> 
> >>  arch/arm/mach-shmobile/Kconfig                 |  7 +++++++
> >>  arch/arm/mach-shmobile/Makefile                |  1 +
> >>  arch/arm/mach-shmobile/board-lager-reference.c | 13 +++++++++----
> >>  3 files changed, 17 insertions(+), 4 deletions(-)
> >> 
> >> diff --git a/arch/arm/mach-shmobile/Kconfig
> >> b/arch/arm/mach-shmobile/Kconfig index 4bb548f..b39f6b6 100644
> >> --- a/arch/arm/mach-shmobile/Kconfig
> >> +++ b/arch/arm/mach-shmobile/Kconfig
> >> @@ -20,6 +20,9 @@ comment "SH-Mobile System Type"
> >>  config ARCH_EMEV2
> >>       bool "Emma Mobile EV2"
> >> 
> >> +config ARCH_R8A7790
> >> +     bool "R-Car H2 (R8A77900)"
> >> +
> > 
> > I realise that up until now there has only been one entry, but in keeping
> > with the non-SHMOBILE_MULTI entries I think it would be good to have the
> > SHMOBILE_MULTI entries sorted in alphabetical order. With this in mind
> > could you move ARCH_R8A7790 to above ARCH_EMEV2?
> 
> Actually, since we have multiple boards that all want to go into
> SHMOBILE_MULTI, I wonder if we can merge the initial code early somehow?
> 
> Ideally I'd like to keep the DT reference board build for both CCF and
> legacy clocks for a while. So we want the same code to be built with
> SHMOBILE and SHMOBILE_MULTI.
>
> When we have got the CCF DT bindings merged then we can get rid of the
> legacy DT reference build option.

How long is "a while" ? My patch set switches lager-reference to CCF only, as 
it uses the CCF DT bindings. Is that an issue ?

> See the following commit for an example:
> 
> cbc60e7c04f3c1390144d4a881f0a7b98b49da98
>
> >>  comment "SH-Mobile Board Type"
> >>  
> >>  config MACH_KZM9D
> >> 
> >> @@ -27,6 +30,10 @@ config MACH_KZM9D
> >> 
> >>       depends on ARCH_EMEV2
> >>       select REGULATOR_FIXED_VOLTAGE if REGULATOR
> >> 
> >> +config MACH_LAGER
> >> +     bool "Lager board"
> >> +     depends on ARCH_R8A7790
> >> +
> >> 
> >>  comment "SH-Mobile System Configuration"
> >>  endif
> >> 
> >> diff --git a/arch/arm/mach-shmobile/Makefile
> >> b/arch/arm/mach-shmobile/Makefile index cc48f14..32f3975 100644
> >> --- a/arch/arm/mach-shmobile/Makefile
> >> +++ b/arch/arm/mach-shmobile/Makefile
> >> @@ -57,6 +57,7 @@ obj-$(CONFIG_ARCH_R8A7779)  += pm-r8a7779.o
> >> 
> >>  # Board objects
> >>  ifdef CONFIG_ARCH_SHMOBILE_MULTI
> >>  obj-$(CONFIG_MACH_KZM9D)     += board-kzm9d-reference.o
> >> 
> >> +obj-$(CONFIG_MACH_LAGER)     += board-lager-reference.o
> >> 
> >>  else
> >>  obj-$(CONFIG_MACH_APE6EVM)   += board-ape6evm.o
> >>  obj-$(CONFIG_MACH_APE6EVM_REFERENCE) += board-ape6evm-reference.o
> >> 
> >> diff --git a/arch/arm/mach-shmobile/board-lager-reference.c
> >> b/arch/arm/mach-shmobile/board-lager-reference.c index 1a1a4a8..e436d06
> >> 100644
> >> --- a/arch/arm/mach-shmobile/board-lager-reference.c
> >> +++ b/arch/arm/mach-shmobile/board-lager-reference.c
> >> @@ -18,16 +18,21 @@
> >> 
> >>   * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301
> >>    USA */
> >> 
> >> +#include <linux/clk/shmobile.h>
> >> 
> >>  #include <linux/init.h>
> >>  #include <linux/of_platform.h>
> >>  #include <mach/r8a7790.h>
> >>  #include <asm/mach/arch.h>
> >> 
> >> -static void __init lager_add_standard_devices(void)
> >> +static void __init lager_init_time(void)
> >> 
> >>  {
> >> 
> >> -     /* clocks are setup late during boot in the case of DT */
> >> -     r8a7790_clock_init();
> >> +     r8a7790_clocks_init(rcar_gen2_read_mode_pins());
> >> +
> >> +     rcar_gen2_timer_init();
> >> +}
> >> 
> >> +static void __init lager_add_standard_devices(void)
> >> +{
> >> 
> >>       r8a7790_add_dt_devices();
> >>       
> >>          of_platform_populate(NULL, of_default_bus_match_table, NULL,
> >>          NULL);
> >>  
> >>  }
> >> 
> >> @@ -40,7 +45,7 @@ static const char *lager_boards_compat_dt[] __initdata
> >> = {>> 
> >>  DT_MACHINE_START(LAGER_DT, "lager")
> >>  
> >>       .smp            = smp_ops(r8a7790_smp_ops),
> >>       .init_early     = r8a7790_init_early,
> >> 
> >> -     .init_time      = rcar_gen2_timer_init,
> >> +     .init_time      = lager_init_time,
> 
> This looks like it needs some more work. Simon pointed out a typo related to
> the MSTP for CMT and that makes me think that this code wasn't tested with
> broadcast SMP. So please start by getting the code working with CMT timer
> and SMP=n, then gradually enable SMP and ARCH_TIMER.

The code was tested successfully with CMT, SMP and ARCH_TIMER before the typo 
got introduced. I'll retest it now.

-- 
Regards,

Laurent Pinchart


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

* Re: [PATCH 05/10] ARM: shmobile: lager-reference: Switch to multiplaform
  2013-10-29 15:04 [PATCH 05/10] ARM: shmobile: lager-reference: Switch to multiplaform Laurent Pinchart
                   ` (3 preceding siblings ...)
  2013-11-06 12:37 ` Laurent Pinchart
@ 2013-11-08  6:24 ` Simon Horman
  2013-11-08  6:25 ` Simon Horman
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: Simon Horman @ 2013-11-08  6:24 UTC (permalink / raw)
  To: linux-sh

On Wed, Nov 06, 2013 at 12:59:27PM +0100, Laurent Pinchart wrote:
> Hi Simon,
> 
> On Wednesday 06 November 2013 17:23:39 Simon Horman wrote:
> > On Tue, Oct 29, 2013 at 04:04:37PM +0100, Laurent Pinchart wrote:
> > > Move the Lager reference board to multiplaform ARM architecture. As
> > > multiplatform requires usage of the common clock framework, switch from
> > > legacy clocks to CCF by replacing the legacy clock framework
> > > initialization code in the machine init handler with a common clock
> > > framework initialization call in the time init handler.
> > > 
> > > Signed-off-by: Laurent Pinchart
> > > <laurent.pinchart+renesas@ideasonboard.com>
> > > ---
> > > 
> > >  arch/arm/mach-shmobile/Kconfig                 |  7 +++++++
> > >  arch/arm/mach-shmobile/Makefile                |  1 +
> > >  arch/arm/mach-shmobile/board-lager-reference.c | 13 +++++++++----
> > >  3 files changed, 17 insertions(+), 4 deletions(-)
> > > 
> > > diff --git a/arch/arm/mach-shmobile/Kconfig
> > > b/arch/arm/mach-shmobile/Kconfig index 4bb548f..b39f6b6 100644
> > > --- a/arch/arm/mach-shmobile/Kconfig
> > > +++ b/arch/arm/mach-shmobile/Kconfig
> > > @@ -20,6 +20,9 @@ comment "SH-Mobile System Type"
> > >  config ARCH_EMEV2
> > >  	bool "Emma Mobile EV2"
> > > 
> > > +config ARCH_R8A7790
> > > +	bool "R-Car H2 (R8A77900)"
> > > +
> > 
> > I realise that up until now there has only been one entry,
> > but in keeping with the non-SHMOBILE_MULTI entries I think it
> > would be good to have the SHMOBILE_MULTI entries sorted in alphabetical
> > order. With this in mind could you move ARCH_R8A7790 to
> > above ARCH_EMEV2?
> 
> In my alphabet ARCH_EMEV2 comes before ARCH_R8A7790 :-)

:-)

> 
> > >  comment "SH-Mobile Board Type"
> > >  
> > >  config MACH_KZM9D
> > > @@ -27,6 +30,10 @@ config MACH_KZM9D
> > >  	depends on ARCH_EMEV2
> > >  	select REGULATOR_FIXED_VOLTAGE if REGULATOR
> > > 
> > > +config MACH_LAGER
> > > +	bool "Lager board"
> > > +	depends on ARCH_R8A7790
> > > +
> > >  comment "SH-Mobile System Configuration"
> > >  endif
> 
> -- 
> Regards,
> 
> Laurent Pinchart
> 
> --
> 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] 10+ messages in thread

* Re: [PATCH 05/10] ARM: shmobile: lager-reference: Switch to multiplaform
  2013-10-29 15:04 [PATCH 05/10] ARM: shmobile: lager-reference: Switch to multiplaform Laurent Pinchart
                   ` (4 preceding siblings ...)
  2013-11-08  6:24 ` Simon Horman
@ 2013-11-08  6:25 ` Simon Horman
  2013-11-08 13:50 ` Laurent Pinchart
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: Simon Horman @ 2013-11-08  6:25 UTC (permalink / raw)
  To: linux-sh

On Wed, Nov 06, 2013 at 06:15:33PM +0900, Magnus Damm wrote:
> Hi Simon, Laurent,
> 
> On Wed, Nov 6, 2013 at 5:23 PM, Simon Horman <horms@verge.net.au> wrote:
> > On Tue, Oct 29, 2013 at 04:04:37PM +0100, Laurent Pinchart wrote:
> >> Move the Lager reference board to multiplaform ARM architecture. As
> >> multiplatform requires usage of the common clock framework, switch from
> >> legacy clocks to CCF by replacing the legacy clock framework
> >> initialization code in the machine init handler with a common clock
> >> framework initialization call in the time init handler.
> >>
> >> Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
> >> ---
> >>  arch/arm/mach-shmobile/Kconfig                 |  7 +++++++
> >>  arch/arm/mach-shmobile/Makefile                |  1 +
> >>  arch/arm/mach-shmobile/board-lager-reference.c | 13 +++++++++----
> >>  3 files changed, 17 insertions(+), 4 deletions(-)
> >>
> >> diff --git a/arch/arm/mach-shmobile/Kconfig b/arch/arm/mach-shmobile/Kconfig
> >> index 4bb548f..b39f6b6 100644
> >> --- a/arch/arm/mach-shmobile/Kconfig
> >> +++ b/arch/arm/mach-shmobile/Kconfig
> >> @@ -20,6 +20,9 @@ comment "SH-Mobile System Type"
> >>  config ARCH_EMEV2
> >>       bool "Emma Mobile EV2"
> >>
> >> +config ARCH_R8A7790
> >> +     bool "R-Car H2 (R8A77900)"
> >> +
> >
> > I realise that up until now there has only been one entry,
> > but in keeping with the non-SHMOBILE_MULTI entries I think it
> > would be good to have the SHMOBILE_MULTI entries sorted in alphabetical
> > order. With this in mind could you move ARCH_R8A7790 to
> > above ARCH_EMEV2?
> 
> Actually, since we have multiple boards that all want to go into
> SHMOBILE_MULTI, I wonder if we can merge the initial code early
> somehow?
> 
> Ideally I'd like to keep the DT reference board build for both CCF and
> legacy clocks for a while. So we want the same code to be built with
> SHMOBILE and SHMOBILE_MULTI. When we have got the CCF DT bindings
> merged then we can get rid of the legacy DT reference build option.
> 
> See the following commit for an example:
> 
> cbc60e7c04f3c1390144d4a881f0a7b98b49da98

cbc60e7c04f3c139 ("ARM: shmobile: Add EMEV2 and KZM9D to
ARCH_SHMOBILE_MULTI") seems like a reasonable approach to me.

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

* Re: [PATCH 05/10] ARM: shmobile: lager-reference: Switch to multiplaform
  2013-10-29 15:04 [PATCH 05/10] ARM: shmobile: lager-reference: Switch to multiplaform Laurent Pinchart
                   ` (5 preceding siblings ...)
  2013-11-08  6:25 ` Simon Horman
@ 2013-11-08 13:50 ` Laurent Pinchart
  2013-11-08 15:02 ` Magnus Damm
  2013-11-08 15:25 ` Laurent Pinchart
  8 siblings, 0 replies; 10+ messages in thread
From: Laurent Pinchart @ 2013-11-08 13:50 UTC (permalink / raw)
  To: linux-sh

Hi Simon,

On Friday 08 November 2013 15:25:47 Simon Horman wrote:
> On Wed, Nov 06, 2013 at 06:15:33PM +0900, Magnus Damm wrote:
> > Hi Simon, Laurent,
> > 
> > On Wed, Nov 6, 2013 at 5:23 PM, Simon Horman <horms@verge.net.au> wrote:
> > > On Tue, Oct 29, 2013 at 04:04:37PM +0100, Laurent Pinchart wrote:
> > >> Move the Lager reference board to multiplaform ARM architecture. As
> > >> multiplatform requires usage of the common clock framework, switch from
> > >> legacy clocks to CCF by replacing the legacy clock framework
> > >> initialization code in the machine init handler with a common clock
> > >> framework initialization call in the time init handler.
> > >> 
> > >> Signed-off-by: Laurent Pinchart
> > >> <laurent.pinchart+renesas@ideasonboard.com>
> > >> ---
> > >> 
> > >>  arch/arm/mach-shmobile/Kconfig                 |  7 +++++++
> > >>  arch/arm/mach-shmobile/Makefile                |  1 +
> > >>  arch/arm/mach-shmobile/board-lager-reference.c | 13 +++++++++----
> > >>  3 files changed, 17 insertions(+), 4 deletions(-)
> > >> 
> > >> diff --git a/arch/arm/mach-shmobile/Kconfig
> > >> b/arch/arm/mach-shmobile/Kconfig index 4bb548f..b39f6b6 100644
> > >> --- a/arch/arm/mach-shmobile/Kconfig
> > >> +++ b/arch/arm/mach-shmobile/Kconfig
> > >> @@ -20,6 +20,9 @@ comment "SH-Mobile System Type"
> > >> 
> > >>  config ARCH_EMEV2
> > >>  
> > >>       bool "Emma Mobile EV2"
> > >> 
> > >> +config ARCH_R8A7790
> > >> +     bool "R-Car H2 (R8A77900)"
> > >> +
> > > 
> > > I realise that up until now there has only been one entry,
> > > but in keeping with the non-SHMOBILE_MULTI entries I think it
> > > would be good to have the SHMOBILE_MULTI entries sorted in alphabetical
> > > order. With this in mind could you move ARCH_R8A7790 to
> > > above ARCH_EMEV2?
> > 
> > Actually, since we have multiple boards that all want to go into
> > SHMOBILE_MULTI, I wonder if we can merge the initial code early
> > somehow?
> > 
> > Ideally I'd like to keep the DT reference board build for both CCF and
> > legacy clocks for a while. So we want the same code to be built with
> > SHMOBILE and SHMOBILE_MULTI. When we have got the CCF DT bindings
> > merged then we can get rid of the legacy DT reference build option.
> > 
> > See the following commit for an example:
> > 
> > cbc60e7c04f3c1390144d4a881f0a7b98b49da98
> 
> cbc60e7c04f3c139 ("ARM: shmobile: Add EMEV2 and KZM9D to
> ARCH_SHMOBILE_MULTI") seems like a reasonable approach to me.

On r8a7790 board code needs to explicitly call a function exported by the 
drivers/clk/shmobile/clk-r8a7790.c driver. I thus need to merge that driver 
before modifying board code, which can be done unconditionally at that point.

-- 
Regards,

Laurent Pinchart


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

* Re: [PATCH 05/10] ARM: shmobile: lager-reference: Switch to multiplaform
  2013-10-29 15:04 [PATCH 05/10] ARM: shmobile: lager-reference: Switch to multiplaform Laurent Pinchart
                   ` (6 preceding siblings ...)
  2013-11-08 13:50 ` Laurent Pinchart
@ 2013-11-08 15:02 ` Magnus Damm
  2013-11-08 15:25 ` Laurent Pinchart
  8 siblings, 0 replies; 10+ messages in thread
From: Magnus Damm @ 2013-11-08 15:02 UTC (permalink / raw)
  To: linux-sh

Hi Laurent,

On Fri, Nov 8, 2013 at 10:50 PM, Laurent Pinchart
<laurent.pinchart@ideasonboard.com> wrote:
> Hi Simon,
>
> On Friday 08 November 2013 15:25:47 Simon Horman wrote:
>> On Wed, Nov 06, 2013 at 06:15:33PM +0900, Magnus Damm wrote:
>> > Hi Simon, Laurent,
>> >
>> > On Wed, Nov 6, 2013 at 5:23 PM, Simon Horman <horms@verge.net.au> wrote:
>> > > On Tue, Oct 29, 2013 at 04:04:37PM +0100, Laurent Pinchart wrote:
>> > >> Move the Lager reference board to multiplaform ARM architecture. As
>> > >> multiplatform requires usage of the common clock framework, switch from
>> > >> legacy clocks to CCF by replacing the legacy clock framework
>> > >> initialization code in the machine init handler with a common clock
>> > >> framework initialization call in the time init handler.
>> > >>
>> > >> Signed-off-by: Laurent Pinchart
>> > >> <laurent.pinchart+renesas@ideasonboard.com>
>> > >> ---
>> > >>
>> > >>  arch/arm/mach-shmobile/Kconfig                 |  7 +++++++
>> > >>  arch/arm/mach-shmobile/Makefile                |  1 +
>> > >>  arch/arm/mach-shmobile/board-lager-reference.c | 13 +++++++++----
>> > >>  3 files changed, 17 insertions(+), 4 deletions(-)
>> > >>
>> > >> diff --git a/arch/arm/mach-shmobile/Kconfig
>> > >> b/arch/arm/mach-shmobile/Kconfig index 4bb548f..b39f6b6 100644
>> > >> --- a/arch/arm/mach-shmobile/Kconfig
>> > >> +++ b/arch/arm/mach-shmobile/Kconfig
>> > >> @@ -20,6 +20,9 @@ comment "SH-Mobile System Type"
>> > >>
>> > >>  config ARCH_EMEV2
>> > >>
>> > >>       bool "Emma Mobile EV2"
>> > >>
>> > >> +config ARCH_R8A7790
>> > >> +     bool "R-Car H2 (R8A77900)"
>> > >> +
>> > >
>> > > I realise that up until now there has only been one entry,
>> > > but in keeping with the non-SHMOBILE_MULTI entries I think it
>> > > would be good to have the SHMOBILE_MULTI entries sorted in alphabetical
>> > > order. With this in mind could you move ARCH_R8A7790 to
>> > > above ARCH_EMEV2?
>> >
>> > Actually, since we have multiple boards that all want to go into
>> > SHMOBILE_MULTI, I wonder if we can merge the initial code early
>> > somehow?
>> >
>> > Ideally I'd like to keep the DT reference board build for both CCF and
>> > legacy clocks for a while. So we want the same code to be built with
>> > SHMOBILE and SHMOBILE_MULTI. When we have got the CCF DT bindings
>> > merged then we can get rid of the legacy DT reference build option.
>> >
>> > See the following commit for an example:
>> >
>> > cbc60e7c04f3c1390144d4a881f0a7b98b49da98
>>
>> cbc60e7c04f3c139 ("ARM: shmobile: Add EMEV2 and KZM9D to
>> ARCH_SHMOBILE_MULTI") seems like a reasonable approach to me.
>
> On r8a7790 board code needs to explicitly call a function exported by the
> drivers/clk/shmobile/clk-r8a7790.c driver. I thus need to merge that driver
> before modifying board code, which can be done unconditionally at that point.

I guess we still need to work on figuring out what the interface
between arch/arm and drivers/clk will look like. This will affect a
whole bunch of SoCs that use the boot mode to determine clock
dividers. So instead of thinking of this as an issue specific to the
r8a7790 SoC or the Lager board we need to include at least r8a7791 and
probably r8a7779 as well.

When you've posted your next version of r8a7790 patches for testing
then I'd like to spend some time seeing how good or bad it will look
like with using a dt property for this. So in my mind I sort of see
the SoC and board code making use of a single shared function to pass
the boot mode to the CCF code. This will among other things make it
possible to merge these bits independently.

But for now, please cook up your next version so we can give it a try.
Since we still are a bit away from merge timing it would be good to
optimize for easy consumption, so a single complete series of patches
would be really nice to see.

Cheers,

/ magnus

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

* Re: [PATCH 05/10] ARM: shmobile: lager-reference: Switch to multiplaform
  2013-10-29 15:04 [PATCH 05/10] ARM: shmobile: lager-reference: Switch to multiplaform Laurent Pinchart
                   ` (7 preceding siblings ...)
  2013-11-08 15:02 ` Magnus Damm
@ 2013-11-08 15:25 ` Laurent Pinchart
  8 siblings, 0 replies; 10+ messages in thread
From: Laurent Pinchart @ 2013-11-08 15:25 UTC (permalink / raw)
  To: linux-sh

Hi Magnus,

On Saturday 09 November 2013 00:02:35 Magnus Damm wrote:
> On Fri, Nov 8, 2013 at 10:50 PM, Laurent Pinchart wrote:
> > On Friday 08 November 2013 15:25:47 Simon Horman wrote:
> >> On Wed, Nov 06, 2013 at 06:15:33PM +0900, Magnus Damm wrote:
> >> > On Wed, Nov 6, 2013 at 5:23 PM, Simon Horman wrote:
> >> > > On Tue, Oct 29, 2013 at 04:04:37PM +0100, Laurent Pinchart wrote:
> >> > >> Move the Lager reference board to multiplaform ARM architecture. As
> >> > >> multiplatform requires usage of the common clock framework, switch
> >> > >> from
> >> > >> legacy clocks to CCF by replacing the legacy clock framework
> >> > >> initialization code in the machine init handler with a common clock
> >> > >> framework initialization call in the time init handler.
> >> > >> 
> >> > >> Signed-off-by: Laurent Pinchart
> >> > >> <laurent.pinchart+renesas@ideasonboard.com>
> >> > >> ---
> >> > >> 
> >> > >>  arch/arm/mach-shmobile/Kconfig                 |  7 +++++++
> >> > >>  arch/arm/mach-shmobile/Makefile                |  1 +
> >> > >>  arch/arm/mach-shmobile/board-lager-reference.c | 13 +++++++++----
> >> > >>  3 files changed, 17 insertions(+), 4 deletions(-)
> >> > >> 
> >> > >> diff --git a/arch/arm/mach-shmobile/Kconfig
> >> > >> b/arch/arm/mach-shmobile/Kconfig index 4bb548f..b39f6b6 100644
> >> > >> --- a/arch/arm/mach-shmobile/Kconfig
> >> > >> +++ b/arch/arm/mach-shmobile/Kconfig
> >> > >> @@ -20,6 +20,9 @@ comment "SH-Mobile System Type"
> >> > >> 
> >> > >>  config ARCH_EMEV2
> >> > >>  
> >> > >>       bool "Emma Mobile EV2"
> >> > >> 
> >> > >> +config ARCH_R8A7790
> >> > >> +     bool "R-Car H2 (R8A77900)"
> >> > >> +
> >> > > 
> >> > > I realise that up until now there has only been one entry,
> >> > > but in keeping with the non-SHMOBILE_MULTI entries I think it
> >> > > would be good to have the SHMOBILE_MULTI entries sorted in
> >> > > alphabetical
> >> > > order. With this in mind could you move ARCH_R8A7790 to
> >> > > above ARCH_EMEV2?
> >> > 
> >> > Actually, since we have multiple boards that all want to go into
> >> > SHMOBILE_MULTI, I wonder if we can merge the initial code early
> >> > somehow?
> >> > 
> >> > Ideally I'd like to keep the DT reference board build for both CCF and
> >> > legacy clocks for a while. So we want the same code to be built with
> >> > SHMOBILE and SHMOBILE_MULTI. When we have got the CCF DT bindings
> >> > merged then we can get rid of the legacy DT reference build option.
> >> > 
> >> > See the following commit for an example:
> >> > 
> >> > cbc60e7c04f3c1390144d4a881f0a7b98b49da98
> >> 
> >> cbc60e7c04f3c139 ("ARM: shmobile: Add EMEV2 and KZM9D to
> >> ARCH_SHMOBILE_MULTI") seems like a reasonable approach to me.
> > 
> > On r8a7790 board code needs to explicitly call a function exported by the
> > drivers/clk/shmobile/clk-r8a7790.c driver. I thus need to merge that
> > driver before modifying board code, which can be done unconditionally at
> > that point.
>
> I guess we still need to work on figuring out what the interface between
> arch/arm and drivers/clk will look like. This will affect a whole bunch of
> SoCs that use the boot mode to determine clock dividers. So instead of
> thinking of this as an issue specific to the r8a7790 SoC or the Lager board
> we need to include at least r8a7791 and probably r8a7779 as well.

Absolutely. I'll thus defer reworking this patch until we agree on the way 
forward to pass clock configuration data from platform code to the clock 
driver.

> When you've posted your next version of r8a7790 patches for testing then I'd
> like to spend some time seeing how good or bad it will look like with using
> a dt property for this. So in my mind I sort of see the SoC and board code
> making use of a single shared function to pass the boot mode to the CCF
> code. This will among other things make it possible to merge these bits
> independently.

I don't think using a DT property to pass information from one Linux kernel 
piece of code to another will be perceived very positively, but I'll wait for 
Mike and Grant to comment.

> But for now, please cook up your next version so we can give it a try. Since
> we still are a bit away from merge timing it would be good to optimize for
> easy consumption, so a single complete series of patches would be really
> nice to see.

I'll try to post it today.

-- 
Regards,

Laurent Pinchart


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

end of thread, other threads:[~2013-11-08 15:25 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-10-29 15:04 [PATCH 05/10] ARM: shmobile: lager-reference: Switch to multiplaform Laurent Pinchart
2013-11-06  8:23 ` Simon Horman
2013-11-06  9:15 ` Magnus Damm
2013-11-06 11:59 ` Laurent Pinchart
2013-11-06 12:37 ` Laurent Pinchart
2013-11-08  6:24 ` Simon Horman
2013-11-08  6:25 ` Simon Horman
2013-11-08 13:50 ` Laurent Pinchart
2013-11-08 15:02 ` Magnus Damm
2013-11-08 15:25 ` Laurent Pinchart

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.