diff mbox

[3/4] ARM: AT91: Add AT91RM9200 support to DT board

Message ID 1349993126-9519-3-git-send-email-manabian@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Joachim Eastwood Oct. 11, 2012, 10:05 p.m. UTC
Signed-off-by: Joachim Eastwood <manabian@gmail.com>
---

Hi,

This patch has some potential issues.
Before this patch board-dt would fail building when only AT91RM9200 was enabled because at91sam926x_timer symbol would be missing. This patch uses the at91rm9200_timer which
will fail if AT91RM9200 is not enabled.

Any thoughts on solving this? As mention above this bug exists in mainline now.

I had to create a new at91rm9200_dt_initialize since at91_dt_initialize will panic when it tries to add rstc and shdwc.
Is it okay to add at91rm9200_dt_initialize or should we fix at91_dt_rstc and at91_dt_shdwc to not panic when DT nodes are not found?

regards
Joachim Eastwood

 arch/arm/mach-at91/board-dt.c | 15 +++++++++++++++
 arch/arm/mach-at91/generic.h  |  1 +
 arch/arm/mach-at91/setup.c    | 14 ++++++++++++++
 3 files changed, 30 insertions(+)

Comments

Jean-Christophe PLAGNIOL-VILLARD Oct. 12, 2012, 2:22 p.m. UTC | #1
On 00:05 Fri 12 Oct     , Joachim Eastwood wrote:
> Signed-off-by: Joachim Eastwood <manabian@gmail.com>
> ---
> 
> Hi,
> 
> This patch has some potential issues.
> Before this patch board-dt would fail building when only AT91RM9200 was enabled because at91sam926x_timer symbol would be missing. This patch uses the at91rm9200_timer which
> will fail if AT91RM9200 is not enabled.
this need work with ot wtihout rm9200
> 
> Any thoughts on solving this? As mention above this bug exists in mainline now.
duplicate the board-dt with one for rm9200 only
as rm9200 ans sam9 are 2 distict familly
> 
> I had to create a new at91rm9200_dt_initialize since at91_dt_initialize will panic when it tries to add rstc and shdwc.
> Is it okay to add at91rm9200_dt_initialize or should we fix at91_dt_rstc and at91_dt_shdwc to not panic when DT nodes are not found?
it's ok
> 

can you add a board too rm9200ek will be good

Best Regards,
J.
> regards
> Joachim Eastwood
> 
>  arch/arm/mach-at91/board-dt.c | 15 +++++++++++++++
>  arch/arm/mach-at91/generic.h  |  1 +
>  arch/arm/mach-at91/setup.c    | 14 ++++++++++++++
>  3 files changed, 30 insertions(+)
> 
> diff --git a/arch/arm/mach-at91/board-dt.c b/arch/arm/mach-at91/board-dt.c
> index e8f45c4..0e73317 100644
> --- a/arch/arm/mach-at91/board-dt.c
> +++ b/arch/arm/mach-at91/board-dt.c
> @@ -45,11 +45,26 @@ static void __init at91_dt_device_init(void)
>  	of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
>  }
>  
> +static const char *at91rm9200_dt_board_compat[] __initdata = {
> +	"atmel,at91rm9200",
> +	NULL
> +};
> +
>  static const char *at91_dt_board_compat[] __initdata = {
>  	"atmel,at91sam9",
>  	NULL
>  };
>  
> +DT_MACHINE_START(at91rm9200_dt, "Atmel AT91RM9200 (Device Tree)")
> +	.timer		= &at91rm9200_timer,
> +	.map_io		= at91_map_io,
> +	.handle_irq	= at91_aic_handle_irq,
> +	.init_early	= at91rm9200_dt_initialize,
> +	.init_irq	= at91_dt_init_irq,
> +	.init_machine	= at91_dt_device_init,
> +	.dt_compat	= at91rm9200_dt_board_compat,
> +MACHINE_END
> +
>  DT_MACHINE_START(at91sam_dt, "Atmel AT91SAM (Device Tree)")
>  	/* Maintainer: Atmel */
>  	.timer		= &at91sam926x_timer,
> diff --git a/arch/arm/mach-at91/generic.h b/arch/arm/mach-at91/generic.h
> index f496506..9bb5ce5 100644
> --- a/arch/arm/mach-at91/generic.h
> +++ b/arch/arm/mach-at91/generic.h
> @@ -20,6 +20,7 @@ extern void __init at91_init_sram(int bank, unsigned long base,
>  extern void __init at91rm9200_set_type(int type);
>  extern void __init at91_initialize(unsigned long main_clock);
>  extern void __init at91x40_initialize(unsigned long main_clock);
> +extern void __init at91rm9200_dt_initialize(void);
>  extern void __init at91_dt_initialize(void);
>  
>   /* Interrupts */
> diff --git a/arch/arm/mach-at91/setup.c b/arch/arm/mach-at91/setup.c
> index da9881b..2c1fdd4 100644
> --- a/arch/arm/mach-at91/setup.c
> +++ b/arch/arm/mach-at91/setup.c
> @@ -338,6 +338,7 @@ static void at91_dt_rstc(void)
>  }
>  
>  static struct of_device_id ramc_ids[] = {
> +	{ .compatible = "atmel,at91rm9200-sdramc" },
>  	{ .compatible = "atmel,at91sam9260-sdramc" },
>  	{ .compatible = "atmel,at91sam9g45-ddramc" },
>  	{ /*sentinel*/ }
> @@ -436,6 +437,19 @@ end:
>  	of_node_put(np);
>  }
>  
> +void __init at91rm9200_dt_initialize(void)
> +{
> +	at91_dt_ramc();
> +
> +	/* Init clock subsystem */
> +	at91_dt_clock_init();
> +
> +	/* Register the processor-specific clocks */
> +	at91_boot_soc.register_clocks();
> +
> +	at91_boot_soc.init();
> +}
> +
>  void __init at91_dt_initialize(void)
>  {
>  	at91_dt_rstc();
> -- 
> 1.7.12.2
>
Ludovic Desroches Oct. 12, 2012, 3:28 p.m. UTC | #2
Le 10/12/2012 04:22 PM, Jean-Christophe PLAGNIOL-VILLARD a écrit :
> On 00:05 Fri 12 Oct     , Joachim Eastwood wrote:
>> Signed-off-by: Joachim Eastwood <manabian@gmail.com>
>> ---
>>
>> Hi,
>>
>> This patch has some potential issues.
>> Before this patch board-dt would fail building when only AT91RM9200 was enabled because at91sam926x_timer symbol would be missing. This patch uses the at91rm9200_timer which
>> will fail if AT91RM9200 is not enabled.
> this need work with ot wtihout rm9200
>>
>> Any thoughts on solving this? As mention above this bug exists in mainline now.
> duplicate the board-dt with one for rm9200 only
> as rm9200 ans sam9 are 2 distict familly

Why not adding a new machine descriptor for rm9200 in order to prevent 
file duplication?

Regards

Ludovic

>>
>> I had to create a new at91rm9200_dt_initialize since at91_dt_initialize will panic when it tries to add rstc and shdwc.
>> Is it okay to add at91rm9200_dt_initialize or should we fix at91_dt_rstc and at91_dt_shdwc to not panic when DT nodes are not found?
> it's ok
>>
>
> can you add a board too rm9200ek will be good
>
> Best Regards,
> J.
>> regards
>> Joachim Eastwood
>>
>>   arch/arm/mach-at91/board-dt.c | 15 +++++++++++++++
>>   arch/arm/mach-at91/generic.h  |  1 +
>>   arch/arm/mach-at91/setup.c    | 14 ++++++++++++++
>>   3 files changed, 30 insertions(+)
>>
>> diff --git a/arch/arm/mach-at91/board-dt.c b/arch/arm/mach-at91/board-dt.c
>> index e8f45c4..0e73317 100644
>> --- a/arch/arm/mach-at91/board-dt.c
>> +++ b/arch/arm/mach-at91/board-dt.c
>> @@ -45,11 +45,26 @@ static void __init at91_dt_device_init(void)
>>   	of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
>>   }
>>
>> +static const char *at91rm9200_dt_board_compat[] __initdata = {
>> +	"atmel,at91rm9200",
>> +	NULL
>> +};
>> +
>>   static const char *at91_dt_board_compat[] __initdata = {
>>   	"atmel,at91sam9",
>>   	NULL
>>   };
>>
>> +DT_MACHINE_START(at91rm9200_dt, "Atmel AT91RM9200 (Device Tree)")
>> +	.timer		= &at91rm9200_timer,
>> +	.map_io		= at91_map_io,
>> +	.handle_irq	= at91_aic_handle_irq,
>> +	.init_early	= at91rm9200_dt_initialize,
>> +	.init_irq	= at91_dt_init_irq,
>> +	.init_machine	= at91_dt_device_init,
>> +	.dt_compat	= at91rm9200_dt_board_compat,
>> +MACHINE_END
>> +
>>   DT_MACHINE_START(at91sam_dt, "Atmel AT91SAM (Device Tree)")
>>   	/* Maintainer: Atmel */
>>   	.timer		= &at91sam926x_timer,
>> diff --git a/arch/arm/mach-at91/generic.h b/arch/arm/mach-at91/generic.h
>> index f496506..9bb5ce5 100644
>> --- a/arch/arm/mach-at91/generic.h
>> +++ b/arch/arm/mach-at91/generic.h
>> @@ -20,6 +20,7 @@ extern void __init at91_init_sram(int bank, unsigned long base,
>>   extern void __init at91rm9200_set_type(int type);
>>   extern void __init at91_initialize(unsigned long main_clock);
>>   extern void __init at91x40_initialize(unsigned long main_clock);
>> +extern void __init at91rm9200_dt_initialize(void);
>>   extern void __init at91_dt_initialize(void);
>>
>>    /* Interrupts */
>> diff --git a/arch/arm/mach-at91/setup.c b/arch/arm/mach-at91/setup.c
>> index da9881b..2c1fdd4 100644
>> --- a/arch/arm/mach-at91/setup.c
>> +++ b/arch/arm/mach-at91/setup.c
>> @@ -338,6 +338,7 @@ static void at91_dt_rstc(void)
>>   }
>>
>>   static struct of_device_id ramc_ids[] = {
>> +	{ .compatible = "atmel,at91rm9200-sdramc" },
>>   	{ .compatible = "atmel,at91sam9260-sdramc" },
>>   	{ .compatible = "atmel,at91sam9g45-ddramc" },
>>   	{ /*sentinel*/ }
>> @@ -436,6 +437,19 @@ end:
>>   	of_node_put(np);
>>   }
>>
>> +void __init at91rm9200_dt_initialize(void)
>> +{
>> +	at91_dt_ramc();
>> +
>> +	/* Init clock subsystem */
>> +	at91_dt_clock_init();
>> +
>> +	/* Register the processor-specific clocks */
>> +	at91_boot_soc.register_clocks();
>> +
>> +	at91_boot_soc.init();
>> +}
>> +
>>   void __init at91_dt_initialize(void)
>>   {
>>   	at91_dt_rstc();
>> --
>> 1.7.12.2
>>
>
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
>
>
Jean-Christophe PLAGNIOL-VILLARD Oct. 12, 2012, 4:27 p.m. UTC | #3
On 17:28 Fri 12 Oct     , ludovic.desroches wrote:
> Le 10/12/2012 04:22 PM, Jean-Christophe PLAGNIOL-VILLARD a écrit :
> >On 00:05 Fri 12 Oct     , Joachim Eastwood wrote:
> >>Signed-off-by: Joachim Eastwood <manabian@gmail.com>
> >>---
> >>
> >>Hi,
> >>
> >>This patch has some potential issues.
> >>Before this patch board-dt would fail building when only AT91RM9200 was enabled because at91sam926x_timer symbol would be missing. This patch uses the at91rm9200_timer which
> >>will fail if AT91RM9200 is not enabled.
> >this need work with ot wtihout rm9200
> >>
> >>Any thoughts on solving this? As mention above this bug exists in mainline now.
> >duplicate the board-dt with one for rm9200 only
> >as rm9200 ans sam9 are 2 distict familly
> 
> Why not adding a new machine descriptor for rm9200 in order to
> prevent file duplication?
because the soc are different and can only be compile if the timer is enable
and I do not want to enable the rm9200 timer on sam9 so instead of a ifdef i
the board-dt create a new board is better as we have a 50 lines file

with different board_compat and different machine descriptor

Best Regards,
J.
> 
> Regards
> 
> Ludovic
> 
> >>
> >>I had to create a new at91rm9200_dt_initialize since at91_dt_initialize will panic when it tries to add rstc and shdwc.
> >>Is it okay to add at91rm9200_dt_initialize or should we fix at91_dt_rstc and at91_dt_shdwc to not panic when DT nodes are not found?
> >it's ok
> >>
> >
> >can you add a board too rm9200ek will be good
> >
> >Best Regards,
> >J.
> >>regards
> >>Joachim Eastwood
> >>
> >>  arch/arm/mach-at91/board-dt.c | 15 +++++++++++++++
> >>  arch/arm/mach-at91/generic.h  |  1 +
> >>  arch/arm/mach-at91/setup.c    | 14 ++++++++++++++
> >>  3 files changed, 30 insertions(+)
> >>
> >>diff --git a/arch/arm/mach-at91/board-dt.c b/arch/arm/mach-at91/board-dt.c
> >>index e8f45c4..0e73317 100644
> >>--- a/arch/arm/mach-at91/board-dt.c
> >>+++ b/arch/arm/mach-at91/board-dt.c
> >>@@ -45,11 +45,26 @@ static void __init at91_dt_device_init(void)
> >>  	of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
> >>  }
> >>
> >>+static const char *at91rm9200_dt_board_compat[] __initdata = {
> >>+	"atmel,at91rm9200",
> >>+	NULL
> >>+};
> >>+
> >>  static const char *at91_dt_board_compat[] __initdata = {
> >>  	"atmel,at91sam9",
> >>  	NULL
> >>  };
> >>
> >>+DT_MACHINE_START(at91rm9200_dt, "Atmel AT91RM9200 (Device Tree)")
> >>+	.timer		= &at91rm9200_timer,
> >>+	.map_io		= at91_map_io,
> >>+	.handle_irq	= at91_aic_handle_irq,
> >>+	.init_early	= at91rm9200_dt_initialize,
> >>+	.init_irq	= at91_dt_init_irq,
> >>+	.init_machine	= at91_dt_device_init,
> >>+	.dt_compat	= at91rm9200_dt_board_compat,
> >>+MACHINE_END
> >>+
> >>  DT_MACHINE_START(at91sam_dt, "Atmel AT91SAM (Device Tree)")
> >>  	/* Maintainer: Atmel */
> >>  	.timer		= &at91sam926x_timer,
> >>diff --git a/arch/arm/mach-at91/generic.h b/arch/arm/mach-at91/generic.h
> >>index f496506..9bb5ce5 100644
> >>--- a/arch/arm/mach-at91/generic.h
> >>+++ b/arch/arm/mach-at91/generic.h
> >>@@ -20,6 +20,7 @@ extern void __init at91_init_sram(int bank, unsigned long base,
> >>  extern void __init at91rm9200_set_type(int type);
> >>  extern void __init at91_initialize(unsigned long main_clock);
> >>  extern void __init at91x40_initialize(unsigned long main_clock);
> >>+extern void __init at91rm9200_dt_initialize(void);
> >>  extern void __init at91_dt_initialize(void);
> >>
> >>   /* Interrupts */
> >>diff --git a/arch/arm/mach-at91/setup.c b/arch/arm/mach-at91/setup.c
> >>index da9881b..2c1fdd4 100644
> >>--- a/arch/arm/mach-at91/setup.c
> >>+++ b/arch/arm/mach-at91/setup.c
> >>@@ -338,6 +338,7 @@ static void at91_dt_rstc(void)
> >>  }
> >>
> >>  static struct of_device_id ramc_ids[] = {
> >>+	{ .compatible = "atmel,at91rm9200-sdramc" },
> >>  	{ .compatible = "atmel,at91sam9260-sdramc" },
> >>  	{ .compatible = "atmel,at91sam9g45-ddramc" },
> >>  	{ /*sentinel*/ }
> >>@@ -436,6 +437,19 @@ end:
> >>  	of_node_put(np);
> >>  }
> >>
> >>+void __init at91rm9200_dt_initialize(void)
> >>+{
> >>+	at91_dt_ramc();
> >>+
> >>+	/* Init clock subsystem */
> >>+	at91_dt_clock_init();
> >>+
> >>+	/* Register the processor-specific clocks */
> >>+	at91_boot_soc.register_clocks();
> >>+
> >>+	at91_boot_soc.init();
> >>+}
> >>+
> >>  void __init at91_dt_initialize(void)
> >>  {
> >>  	at91_dt_rstc();
> >>--
> >>1.7.12.2
> >>
> >
> >_______________________________________________
> >linux-arm-kernel mailing list
> >linux-arm-kernel@lists.infradead.org
> >http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
> >
> >
>
Joachim Eastwood Oct. 12, 2012, 5:08 p.m. UTC | #4
On Fri, Oct 12, 2012 at 6:27 PM, Jean-Christophe PLAGNIOL-VILLARD
<plagnioj@jcrosoft.com> wrote:
> On 17:28 Fri 12 Oct     , ludovic.desroches wrote:
>> Le 10/12/2012 04:22 PM, Jean-Christophe PLAGNIOL-VILLARD a écrit :
>> >On 00:05 Fri 12 Oct     , Joachim Eastwood wrote:
>> >>Signed-off-by: Joachim Eastwood <manabian@gmail.com>
>> >>---
>> >>
>> >>Hi,
>> >>
>> >>This patch has some potential issues.
>> >>Before this patch board-dt would fail building when only AT91RM9200 was enabled because at91sam926x_timer symbol would be missing. This patch uses the at91rm9200_timer which
>> >>will fail if AT91RM9200 is not enabled.
>> >this need work with ot wtihout rm9200

btw, to solve the build issue with board-dt in mainline now we need to
add a select CONFIG_SOC_AT91SAM9 to config MACH_AT91SAM_DT.

>> >>
>> >>Any thoughts on solving this? As mention above this bug exists in mainline now.
>> >duplicate the board-dt with one for rm9200 only
>> >as rm9200 ans sam9 are 2 distict familly
>>
>> Why not adding a new machine descriptor for rm9200 in order to
>> prevent file duplication?
> because the soc are different and can only be compile if the timer is enable
> and I do not want to enable the rm9200 timer on sam9 so instead of a ifdef i
> the board-dt create a new board is better as we have a 50 lines file
>
> with different board_compat and different machine descriptor

I am okey with either approach, but I would like to hear what Nicolas
Ferre has to say since he is the on the one that added board-dt. It
would be nice to have everything in one board DT file, but I
understand your concern with the RM9200 timer.

We will also bump into this again on AT91X40 I guess.

regards
Joachim Eastwood
Jean-Christophe PLAGNIOL-VILLARD Oct. 14, 2012, 2:54 p.m. UTC | #5
On 19:08 Fri 12 Oct     , Joachim Eastwood wrote:
> On Fri, Oct 12, 2012 at 6:27 PM, Jean-Christophe PLAGNIOL-VILLARD
> <plagnioj@jcrosoft.com> wrote:
> > On 17:28 Fri 12 Oct     , ludovic.desroches wrote:
> >> Le 10/12/2012 04:22 PM, Jean-Christophe PLAGNIOL-VILLARD a écrit :
> >> >On 00:05 Fri 12 Oct     , Joachim Eastwood wrote:
> >> >>Signed-off-by: Joachim Eastwood <manabian@gmail.com>
> >> >>---
> >> >>
> >> >>Hi,
> >> >>
> >> >>This patch has some potential issues.
> >> >>Before this patch board-dt would fail building when only AT91RM9200 was enabled because at91sam926x_timer symbol would be missing. This patch uses the at91rm9200_timer which
> >> >>will fail if AT91RM9200 is not enabled.
> >> >this need work with ot wtihout rm9200
> 
> btw, to solve the build issue with board-dt in mainline now we need to
> add a select CONFIG_SOC_AT91SAM9 to config MACH_AT91SAM_DT.
> 
> >> >>
> >> >>Any thoughts on solving this? As mention above this bug exists in mainline now.
> >> >duplicate the board-dt with one for rm9200 only
> >> >as rm9200 ans sam9 are 2 distict familly
> >>
> >> Why not adding a new machine descriptor for rm9200 in order to
> >> prevent file duplication?
> > because the soc are different and can only be compile if the timer is enable
> > and I do not want to enable the rm9200 timer on sam9 so instead of a ifdef i
> > the board-dt create a new board is better as we have a 50 lines file
> >
> > with different board_compat and different machine descriptor
> 
> I am okey with either approach, but I would like to hear what Nicolas
> Ferre has to say since he is the on the one that added board-dt. It
> would be nice to have everything in one board DT file, but I
> understand your concern with the RM9200 timer.
> 
> We will also bump into this again on AT91X40 I guess.
simple on x40 forget about it the x40 is no MMU only SoC

so you can not enable  it by default as the all other at91 are use with MMU

I did the necessary to make the board-dt nearly empty and the same for all the
sam9 but the board-dt is sam9 only and need to be keeped this way

Nico will tell you the same

Best Regards,
J.
Joachim Eastwood Oct. 14, 2012, 4:39 p.m. UTC | #6
On Sun, Oct 14, 2012 at 4:54 PM, Jean-Christophe PLAGNIOL-VILLARD
<plagnioj@jcrosoft.com> wrote:
> On 19:08 Fri 12 Oct     , Joachim Eastwood wrote:
>> On Fri, Oct 12, 2012 at 6:27 PM, Jean-Christophe PLAGNIOL-VILLARD
>> <plagnioj@jcrosoft.com> wrote:
>> > On 17:28 Fri 12 Oct     , ludovic.desroches wrote:
>> >> Le 10/12/2012 04:22 PM, Jean-Christophe PLAGNIOL-VILLARD a écrit :
>> >> >On 00:05 Fri 12 Oct     , Joachim Eastwood wrote:
>> >> >>Signed-off-by: Joachim Eastwood <manabian@gmail.com>
>> >> >>---
>> >> >>
>> >> >>Hi,
>> >> >>
>> >> >>This patch has some potential issues.
>> >> >>Before this patch board-dt would fail building when only AT91RM9200 was enabled because at91sam926x_timer symbol would be missing. This patch uses the at91rm9200_timer which
>> >> >>will fail if AT91RM9200 is not enabled.
>> >> >this need work with ot wtihout rm9200
>>
>> btw, to solve the build issue with board-dt in mainline now we need to
>> add a select CONFIG_SOC_AT91SAM9 to config MACH_AT91SAM_DT.
>>
>> >> >>
>> >> >>Any thoughts on solving this? As mention above this bug exists in mainline now.
>> >> >duplicate the board-dt with one for rm9200 only
>> >> >as rm9200 ans sam9 are 2 distict familly
>> >>
>> >> Why not adding a new machine descriptor for rm9200 in order to
>> >> prevent file duplication?
>> > because the soc are different and can only be compile if the timer is enable
>> > and I do not want to enable the rm9200 timer on sam9 so instead of a ifdef i
>> > the board-dt create a new board is better as we have a 50 lines file
>> >
>> > with different board_compat and different machine descriptor
>>
>> I am okey with either approach, but I would like to hear what Nicolas
>> Ferre has to say since he is the on the one that added board-dt. It
>> would be nice to have everything in one board DT file, but I
>> understand your concern with the RM9200 timer.
>>
>> We will also bump into this again on AT91X40 I guess.
> simple on x40 forget about it the x40 is no MMU only SoC
>
> so you can not enable  it by default as the all other at91 are use with MMU
>
> I did the necessary to make the board-dt nearly empty and the same for all the
> sam9 but the board-dt is sam9 only and need to be keeped this way
>
> Nico will tell you the same

okay. I'll make the necessary changes to the patch set.

I'll also include a fix for board-dt (select CONFIG_SOC_AT91SAM9) to
stop the build failure when it's enabled on a RM9200 only config.

Secondly I'll rebase on linux-next which includes your at91-pinctrl stuff.

regards
Joachim Eastwood


> Best Regards,
> J.
Jean-Christophe PLAGNIOL-VILLARD Oct. 14, 2012, 9:11 p.m. UTC | #7
On 18:39 Sun 14 Oct     , Joachim Eastwood wrote:
> On Sun, Oct 14, 2012 at 4:54 PM, Jean-Christophe PLAGNIOL-VILLARD
> <plagnioj@jcrosoft.com> wrote:
> > On 19:08 Fri 12 Oct     , Joachim Eastwood wrote:
> >> On Fri, Oct 12, 2012 at 6:27 PM, Jean-Christophe PLAGNIOL-VILLARD
> >> <plagnioj@jcrosoft.com> wrote:
> >> > On 17:28 Fri 12 Oct     , ludovic.desroches wrote:
> >> >> Le 10/12/2012 04:22 PM, Jean-Christophe PLAGNIOL-VILLARD a écrit :
> >> >> >On 00:05 Fri 12 Oct     , Joachim Eastwood wrote:
> >> >> >>Signed-off-by: Joachim Eastwood <manabian@gmail.com>
> >> >> >>---
> >> >> >>
> >> >> >>Hi,
> >> >> >>
> >> >> >>This patch has some potential issues.
> >> >> >>Before this patch board-dt would fail building when only AT91RM9200 was enabled because at91sam926x_timer symbol would be missing. This patch uses the at91rm9200_timer which
> >> >> >>will fail if AT91RM9200 is not enabled.
> >> >> >this need work with ot wtihout rm9200
> >>
> >> btw, to solve the build issue with board-dt in mainline now we need to
> >> add a select CONFIG_SOC_AT91SAM9 to config MACH_AT91SAM_DT.
> >>
> >> >> >>
> >> >> >>Any thoughts on solving this? As mention above this bug exists in mainline now.
> >> >> >duplicate the board-dt with one for rm9200 only
> >> >> >as rm9200 ans sam9 are 2 distict familly
> >> >>
> >> >> Why not adding a new machine descriptor for rm9200 in order to
> >> >> prevent file duplication?
> >> > because the soc are different and can only be compile if the timer is enable
> >> > and I do not want to enable the rm9200 timer on sam9 so instead of a ifdef i
> >> > the board-dt create a new board is better as we have a 50 lines file
> >> >
> >> > with different board_compat and different machine descriptor
> >>
> >> I am okey with either approach, but I would like to hear what Nicolas
> >> Ferre has to say since he is the on the one that added board-dt. It
> >> would be nice to have everything in one board DT file, but I
> >> understand your concern with the RM9200 timer.
> >>
> >> We will also bump into this again on AT91X40 I guess.
> > simple on x40 forget about it the x40 is no MMU only SoC
> >
> > so you can not enable  it by default as the all other at91 are use with MMU
> >
> > I did the necessary to make the board-dt nearly empty and the same for all the
> > sam9 but the board-dt is sam9 only and need to be keeped this way
> >
> > Nico will tell you the same
> 
> okay. I'll make the necessary changes to the patch set.
> 
> I'll also include a fix for board-dt (select CONFIG_SOC_AT91SAM9) to
> stop the build failure when it's enabled on a RM9200 only config.
if rm9200 only the board-dt does not have to be enabled

as you do not have the clock for any of the soc

Best Regards,
J.
Nicolas Ferre Oct. 15, 2012, 8:23 a.m. UTC | #8
On 10/14/2012 04:54 PM, Jean-Christophe PLAGNIOL-VILLARD :
> On 19:08 Fri 12 Oct     , Joachim Eastwood wrote:
>> On Fri, Oct 12, 2012 at 6:27 PM, Jean-Christophe PLAGNIOL-VILLARD
>> <plagnioj@jcrosoft.com> wrote:
>>> On 17:28 Fri 12 Oct     , ludovic.desroches wrote:
>>>> Le 10/12/2012 04:22 PM, Jean-Christophe PLAGNIOL-VILLARD a écrit :
>>>>> On 00:05 Fri 12 Oct     , Joachim Eastwood wrote:
>>>>>> Signed-off-by: Joachim Eastwood <manabian@gmail.com>
>>>>>> ---
>>>>>>
>>>>>> Hi,
>>>>>>
>>>>>> This patch has some potential issues.
>>>>>> Before this patch board-dt would fail building when only AT91RM9200 was enabled because at91sam926x_timer symbol would be missing. This patch uses the at91rm9200_timer which
>>>>>> will fail if AT91RM9200 is not enabled.
>>>>> this need work with ot wtihout rm9200
>>
>> btw, to solve the build issue with board-dt in mainline now we need to
>> add a select CONFIG_SOC_AT91SAM9 to config MACH_AT91SAM_DT.
>>
>>>>>>
>>>>>> Any thoughts on solving this? As mention above this bug exists in mainline now.
>>>>> duplicate the board-dt with one for rm9200 only
>>>>> as rm9200 ans sam9 are 2 distict familly
>>>>
>>>> Why not adding a new machine descriptor for rm9200 in order to
>>>> prevent file duplication?
>>> because the soc are different and can only be compile if the timer is enable
>>> and I do not want to enable the rm9200 timer on sam9 so instead of a ifdef i
>>> the board-dt create a new board is better as we have a 50 lines file
>>>
>>> with different board_compat and different machine descriptor
>>
>> I am okey with either approach, but I would like to hear what Nicolas
>> Ferre has to say since he is the on the one that added board-dt. It
>> would be nice to have everything in one board DT file, but I
>> understand your concern with the RM9200 timer.
>>
>> We will also bump into this again on AT91X40 I guess.
> simple on x40 forget about it the x40 is no MMU only SoC
> 
> so you can not enable  it by default as the all other at91 are use with MMU
> 
> I did the necessary to make the board-dt nearly empty and the same for all the
> sam9 but the board-dt is sam9 only and need to be keeped this way
> 
> Nico will tell you the same

Please, do not speak instead of me!

And even if I often agree with you, it is far from being automatic ;-)


Bye,
Nicolas Ferre Oct. 15, 2012, 8:28 a.m. UTC | #9
On 10/14/2012 06:39 PM, Joachim Eastwood :
> On Sun, Oct 14, 2012 at 4:54 PM, Jean-Christophe PLAGNIOL-VILLARD
> <plagnioj@jcrosoft.com> wrote:
>> On 19:08 Fri 12 Oct     , Joachim Eastwood wrote:
>>> On Fri, Oct 12, 2012 at 6:27 PM, Jean-Christophe PLAGNIOL-VILLARD
>>> <plagnioj@jcrosoft.com> wrote:
>>>> On 17:28 Fri 12 Oct     , ludovic.desroches wrote:
>>>>> Le 10/12/2012 04:22 PM, Jean-Christophe PLAGNIOL-VILLARD a écrit :
>>>>>> On 00:05 Fri 12 Oct     , Joachim Eastwood wrote:
>>>>>>> Signed-off-by: Joachim Eastwood <manabian@gmail.com>
>>>>>>> ---
>>>>>>>
>>>>>>> Hi,
>>>>>>>
>>>>>>> This patch has some potential issues.
>>>>>>> Before this patch board-dt would fail building when only AT91RM9200 was enabled because at91sam926x_timer symbol would be missing. This patch uses the at91rm9200_timer which
>>>>>>> will fail if AT91RM9200 is not enabled.
>>>>>> this need work with ot wtihout rm9200
>>>
>>> btw, to solve the build issue with board-dt in mainline now we need to
>>> add a select CONFIG_SOC_AT91SAM9 to config MACH_AT91SAM_DT.
>>>
>>>>>>>
>>>>>>> Any thoughts on solving this? As mention above this bug exists in mainline now.
>>>>>> duplicate the board-dt with one for rm9200 only
>>>>>> as rm9200 ans sam9 are 2 distict familly
>>>>>
>>>>> Why not adding a new machine descriptor for rm9200 in order to
>>>>> prevent file duplication?
>>>> because the soc are different and can only be compile if the timer is enable
>>>> and I do not want to enable the rm9200 timer on sam9 so instead of a ifdef i
>>>> the board-dt create a new board is better as we have a 50 lines file
>>>>
>>>> with different board_compat and different machine descriptor
>>>
>>> I am okey with either approach, but I would like to hear what Nicolas
>>> Ferre has to say since he is the on the one that added board-dt. It
>>> would be nice to have everything in one board DT file, but I
>>> understand your concern with the RM9200 timer.
>>>
>>> We will also bump into this again on AT91X40 I guess.
>> simple on x40 forget about it the x40 is no MMU only SoC
>>
>> so you can not enable  it by default as the all other at91 are use with MMU
>>
>> I did the necessary to make the board-dt nearly empty and the same for all the
>> sam9 but the board-dt is sam9 only and need to be keeped this way
>>
>> Nico will tell you the same
> 
> okay. I'll make the necessary changes to the patch set.

Well, even if did not see the advantage of a new board-dt specifically
for rm9200 (and armv4 and armv5 may share the same zImage in the
future...), I understand the fact that compiling the rm9200 timer for a
sam9 machine is a bit surprising.

So I have a pretty mixed feelings about that, but I will not go against
Jean-Christophe nor you Joachim: so continue in this path, we will be
able to merge all board-*-dt later if needed anyway...

Bye,
diff mbox

Patch

diff --git a/arch/arm/mach-at91/board-dt.c b/arch/arm/mach-at91/board-dt.c
index e8f45c4..0e73317 100644
--- a/arch/arm/mach-at91/board-dt.c
+++ b/arch/arm/mach-at91/board-dt.c
@@ -45,11 +45,26 @@  static void __init at91_dt_device_init(void)
 	of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
 }
 
+static const char *at91rm9200_dt_board_compat[] __initdata = {
+	"atmel,at91rm9200",
+	NULL
+};
+
 static const char *at91_dt_board_compat[] __initdata = {
 	"atmel,at91sam9",
 	NULL
 };
 
+DT_MACHINE_START(at91rm9200_dt, "Atmel AT91RM9200 (Device Tree)")
+	.timer		= &at91rm9200_timer,
+	.map_io		= at91_map_io,
+	.handle_irq	= at91_aic_handle_irq,
+	.init_early	= at91rm9200_dt_initialize,
+	.init_irq	= at91_dt_init_irq,
+	.init_machine	= at91_dt_device_init,
+	.dt_compat	= at91rm9200_dt_board_compat,
+MACHINE_END
+
 DT_MACHINE_START(at91sam_dt, "Atmel AT91SAM (Device Tree)")
 	/* Maintainer: Atmel */
 	.timer		= &at91sam926x_timer,
diff --git a/arch/arm/mach-at91/generic.h b/arch/arm/mach-at91/generic.h
index f496506..9bb5ce5 100644
--- a/arch/arm/mach-at91/generic.h
+++ b/arch/arm/mach-at91/generic.h
@@ -20,6 +20,7 @@  extern void __init at91_init_sram(int bank, unsigned long base,
 extern void __init at91rm9200_set_type(int type);
 extern void __init at91_initialize(unsigned long main_clock);
 extern void __init at91x40_initialize(unsigned long main_clock);
+extern void __init at91rm9200_dt_initialize(void);
 extern void __init at91_dt_initialize(void);
 
  /* Interrupts */
diff --git a/arch/arm/mach-at91/setup.c b/arch/arm/mach-at91/setup.c
index da9881b..2c1fdd4 100644
--- a/arch/arm/mach-at91/setup.c
+++ b/arch/arm/mach-at91/setup.c
@@ -338,6 +338,7 @@  static void at91_dt_rstc(void)
 }
 
 static struct of_device_id ramc_ids[] = {
+	{ .compatible = "atmel,at91rm9200-sdramc" },
 	{ .compatible = "atmel,at91sam9260-sdramc" },
 	{ .compatible = "atmel,at91sam9g45-ddramc" },
 	{ /*sentinel*/ }
@@ -436,6 +437,19 @@  end:
 	of_node_put(np);
 }
 
+void __init at91rm9200_dt_initialize(void)
+{
+	at91_dt_ramc();
+
+	/* Init clock subsystem */
+	at91_dt_clock_init();
+
+	/* Register the processor-specific clocks */
+	at91_boot_soc.register_clocks();
+
+	at91_boot_soc.init();
+}
+
 void __init at91_dt_initialize(void)
 {
 	at91_dt_rstc();