From: ludovic.desroches@atmel.com (ludovic.desroches)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 3/4] ARM: AT91: Add AT91RM9200 support to DT board
Date: Fri, 12 Oct 2012 17:28:20 +0200 [thread overview]
Message-ID: <50783714.2000702@atmel.com> (raw)
In-Reply-To: <20121012142251.GC12801@game.jcrosoft.org>
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 at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
>
>
next prev parent reply other threads:[~2012-10-12 15:28 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-10-11 22:05 [PATCH 1/4] ARM: AT91: Add DT support to AT91RM9200 System Timer Joachim Eastwood
2012-10-11 22:05 ` [PATCH 2/4] ARM: AT91: Add usart/tc DT clock lookup to AT91RM9200 Joachim Eastwood
2012-10-12 14:16 ` Jean-Christophe PLAGNIOL-VILLARD
2012-10-11 22:05 ` [PATCH 3/4] ARM: AT91: Add AT91RM9200 support to DT board Joachim Eastwood
2012-10-12 14:22 ` Jean-Christophe PLAGNIOL-VILLARD
2012-10-12 15:28 ` ludovic.desroches [this message]
2012-10-12 16:27 ` Jean-Christophe PLAGNIOL-VILLARD
2012-10-12 17:08 ` Joachim Eastwood
2012-10-14 14:54 ` Jean-Christophe PLAGNIOL-VILLARD
2012-10-14 16:39 ` Joachim Eastwood
2012-10-14 21:11 ` Jean-Christophe PLAGNIOL-VILLARD
2012-10-15 8:28 ` Nicolas Ferre
2012-10-15 8:23 ` Nicolas Ferre
2012-10-11 22:05 ` [PATCH 4/4] ARM: AT91: Add AT91RM9200 device tree Joachim Eastwood
2012-10-12 14:23 ` [PATCH 1/4] ARM: AT91: Add DT support to AT91RM9200 System Timer Jean-Christophe PLAGNIOL-VILLARD
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=50783714.2000702@atmel.com \
--to=ludovic.desroches@atmel.com \
--cc=linux-arm-kernel@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).