* [PATCH 2/4] ARM: AT91: Add usart/tc DT clock lookup to AT91RM9200
2012-10-11 22:05 [PATCH 1/4] ARM: AT91: Add DT support to AT91RM9200 System Timer Joachim Eastwood
@ 2012-10-11 22:05 ` 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
` (2 subsequent siblings)
3 siblings, 1 reply; 15+ messages in thread
From: Joachim Eastwood @ 2012-10-11 22:05 UTC (permalink / raw)
To: linux-arm-kernel
Signed-off-by: Joachim Eastwood <manabian@gmail.com>
---
arch/arm/mach-at91/at91rm9200.c | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/arch/arm/mach-at91/at91rm9200.c b/arch/arm/mach-at91/at91rm9200.c
index b4f0565..eef3f53 100644
--- a/arch/arm/mach-at91/at91rm9200.c
+++ b/arch/arm/mach-at91/at91rm9200.c
@@ -188,6 +188,19 @@ static struct clk_lookup periph_clocks_lookups[] = {
CLKDEV_CON_DEV_ID("pclk", "ssc.1", &ssc1_clk),
CLKDEV_CON_DEV_ID("pclk", "ssc.2", &ssc2_clk),
CLKDEV_CON_DEV_ID(NULL, "i2c-at91rm9200", &twi_clk),
+ /* usart lookup table for DT entries */
+ CLKDEV_CON_DEV_ID("usart", "fffff200.serial", &mck),
+ CLKDEV_CON_DEV_ID("usart", "fffc0000.serial", &usart0_clk),
+ CLKDEV_CON_DEV_ID("usart", "fffc4000.serial", &usart1_clk),
+ CLKDEV_CON_DEV_ID("usart", "fffc8000.serial", &usart2_clk),
+ CLKDEV_CON_DEV_ID("usart", "fffcc000.serial", &usart3_clk),
+ /* tc lookup table for DT entries */
+ CLKDEV_CON_DEV_ID("t0_clk", "fffa0000.timer", &tc0_clk),
+ CLKDEV_CON_DEV_ID("t1_clk", "fffa0000.timer", &tc1_clk),
+ CLKDEV_CON_DEV_ID("t2_clk", "fffa0000.timer", &tc2_clk),
+ CLKDEV_CON_DEV_ID("t0_clk", "fffa4000.timer", &tc3_clk),
+ CLKDEV_CON_DEV_ID("t1_clk", "fffa4000.timer", &tc4_clk),
+ CLKDEV_CON_DEV_ID("t2_clk", "fffa4000.timer", &tc5_clk),
/* fake hclk clock */
CLKDEV_CON_DEV_ID("hclk", "at91_ohci", &ohci_clk),
CLKDEV_CON_ID("pioA", &pioA_clk),
--
1.7.12.2
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH 2/4] ARM: AT91: Add usart/tc DT clock lookup to AT91RM9200
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
0 siblings, 0 replies; 15+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2012-10-12 14:16 UTC (permalink / raw)
To: linux-arm-kernel
Hi,
You need to rebase your patch over the pinctrl
Best Regards,
J.
On 00:05 Fri 12 Oct , Joachim Eastwood wrote:
> Signed-off-by: Joachim Eastwood <manabian@gmail.com>
> ---
> arch/arm/mach-at91/at91rm9200.c | 13 +++++++++++++
> 1 file changed, 13 insertions(+)
>
> diff --git a/arch/arm/mach-at91/at91rm9200.c b/arch/arm/mach-at91/at91rm9200.c
> index b4f0565..eef3f53 100644
> --- a/arch/arm/mach-at91/at91rm9200.c
> +++ b/arch/arm/mach-at91/at91rm9200.c
> @@ -188,6 +188,19 @@ static struct clk_lookup periph_clocks_lookups[] = {
> CLKDEV_CON_DEV_ID("pclk", "ssc.1", &ssc1_clk),
> CLKDEV_CON_DEV_ID("pclk", "ssc.2", &ssc2_clk),
> CLKDEV_CON_DEV_ID(NULL, "i2c-at91rm9200", &twi_clk),
> + /* usart lookup table for DT entries */
> + CLKDEV_CON_DEV_ID("usart", "fffff200.serial", &mck),
> + CLKDEV_CON_DEV_ID("usart", "fffc0000.serial", &usart0_clk),
> + CLKDEV_CON_DEV_ID("usart", "fffc4000.serial", &usart1_clk),
> + CLKDEV_CON_DEV_ID("usart", "fffc8000.serial", &usart2_clk),
> + CLKDEV_CON_DEV_ID("usart", "fffcc000.serial", &usart3_clk),
> + /* tc lookup table for DT entries */
> + CLKDEV_CON_DEV_ID("t0_clk", "fffa0000.timer", &tc0_clk),
> + CLKDEV_CON_DEV_ID("t1_clk", "fffa0000.timer", &tc1_clk),
> + CLKDEV_CON_DEV_ID("t2_clk", "fffa0000.timer", &tc2_clk),
> + CLKDEV_CON_DEV_ID("t0_clk", "fffa4000.timer", &tc3_clk),
> + CLKDEV_CON_DEV_ID("t1_clk", "fffa4000.timer", &tc4_clk),
> + CLKDEV_CON_DEV_ID("t2_clk", "fffa4000.timer", &tc5_clk),
> /* fake hclk clock */
> CLKDEV_CON_DEV_ID("hclk", "at91_ohci", &ohci_clk),
> CLKDEV_CON_ID("pioA", &pioA_clk),
> --
> 1.7.12.2
>
^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCH 3/4] ARM: AT91: Add AT91RM9200 support to DT board
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-11 22:05 ` Joachim Eastwood
2012-10-12 14:22 ` Jean-Christophe PLAGNIOL-VILLARD
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
3 siblings, 1 reply; 15+ messages in thread
From: Joachim Eastwood @ 2012-10-11 22:05 UTC (permalink / raw)
To: linux-arm-kernel
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(+)
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
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH 3/4] ARM: AT91: Add AT91RM9200 support to DT board
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
0 siblings, 1 reply; 15+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2012-10-12 14:22 UTC (permalink / raw)
To: linux-arm-kernel
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
>
^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCH 3/4] ARM: AT91: Add AT91RM9200 support to DT board
2012-10-12 14:22 ` Jean-Christophe PLAGNIOL-VILLARD
@ 2012-10-12 15:28 ` ludovic.desroches
2012-10-12 16:27 ` Jean-Christophe PLAGNIOL-VILLARD
0 siblings, 1 reply; 15+ messages in thread
From: ludovic.desroches @ 2012-10-12 15:28 UTC (permalink / raw)
To: linux-arm-kernel
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
>
>
^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCH 3/4] ARM: AT91: Add AT91RM9200 support to DT board
2012-10-12 15:28 ` ludovic.desroches
@ 2012-10-12 16:27 ` Jean-Christophe PLAGNIOL-VILLARD
2012-10-12 17:08 ` Joachim Eastwood
0 siblings, 1 reply; 15+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2012-10-12 16:27 UTC (permalink / raw)
To: linux-arm-kernel
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 at lists.infradead.org
> >http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
> >
> >
>
^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCH 3/4] ARM: AT91: Add AT91RM9200 support to DT board
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
0 siblings, 1 reply; 15+ messages in thread
From: Joachim Eastwood @ 2012-10-12 17:08 UTC (permalink / raw)
To: linux-arm-kernel
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
^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCH 3/4] ARM: AT91: Add AT91RM9200 support to DT board
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-15 8:23 ` Nicolas Ferre
0 siblings, 2 replies; 15+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2012-10-14 14:54 UTC (permalink / raw)
To: linux-arm-kernel
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.
^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCH 3/4] ARM: AT91: Add AT91RM9200 support to DT board
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
1 sibling, 2 replies; 15+ messages in thread
From: Joachim Eastwood @ 2012-10-14 16:39 UTC (permalink / raw)
To: linux-arm-kernel
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.
^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCH 3/4] ARM: AT91: Add AT91RM9200 support to DT board
2012-10-14 16:39 ` Joachim Eastwood
@ 2012-10-14 21:11 ` Jean-Christophe PLAGNIOL-VILLARD
2012-10-15 8:28 ` Nicolas Ferre
1 sibling, 0 replies; 15+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2012-10-14 21:11 UTC (permalink / raw)
To: linux-arm-kernel
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.
^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCH 3/4] ARM: AT91: Add AT91RM9200 support to DT board
2012-10-14 16:39 ` Joachim Eastwood
2012-10-14 21:11 ` Jean-Christophe PLAGNIOL-VILLARD
@ 2012-10-15 8:28 ` Nicolas Ferre
1 sibling, 0 replies; 15+ messages in thread
From: Nicolas Ferre @ 2012-10-15 8:28 UTC (permalink / raw)
To: linux-arm-kernel
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,
--
Nicolas Ferre
^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCH 3/4] ARM: AT91: Add AT91RM9200 support to DT board
2012-10-14 14:54 ` Jean-Christophe PLAGNIOL-VILLARD
2012-10-14 16:39 ` Joachim Eastwood
@ 2012-10-15 8:23 ` Nicolas Ferre
1 sibling, 0 replies; 15+ messages in thread
From: Nicolas Ferre @ 2012-10-15 8:23 UTC (permalink / raw)
To: linux-arm-kernel
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
^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCH 4/4] ARM: AT91: Add AT91RM9200 device tree
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-11 22:05 ` [PATCH 3/4] ARM: AT91: Add AT91RM9200 support to DT board Joachim Eastwood
@ 2012-10-11 22:05 ` Joachim Eastwood
2012-10-12 14:23 ` [PATCH 1/4] ARM: AT91: Add DT support to AT91RM9200 System Timer Jean-Christophe PLAGNIOL-VILLARD
3 siblings, 0 replies; 15+ messages in thread
From: Joachim Eastwood @ 2012-10-11 22:05 UTC (permalink / raw)
To: linux-arm-kernel
Signed-off-by: Joachim Eastwood <manabian@gmail.com>
---
arch/arm/boot/dts/at91rm9200.dtsi | 218 ++++++++++++++++++++++++++++++++++++++
1 file changed, 218 insertions(+)
create mode 100644 arch/arm/boot/dts/at91rm9200.dtsi
diff --git a/arch/arm/boot/dts/at91rm9200.dtsi b/arch/arm/boot/dts/at91rm9200.dtsi
new file mode 100644
index 0000000..81a344c
--- /dev/null
+++ b/arch/arm/boot/dts/at91rm9200.dtsi
@@ -0,0 +1,218 @@
+/*
+ * at91rm9200.dtsi - Device Tree Include file for AT91RM9200 family SoC
+ *
+ * Copyright (C) 2011 Atmel,
+ * 2011 Nicolas Ferre <nicolas.ferre@atmel.com>,
+ * 2012 Joachim Eastwood <manabian@gmail.com>
+ *
+ * Based on at91sam9260.dtsi
+ *
+ * Licensed under GPLv2 or later.
+ */
+
+/include/ "skeleton.dtsi"
+
+/ {
+ model = "Atmel AT91RM9200 family SoC";
+ compatible = "atmel,at91rm9200";
+ interrupt-parent = <&aic>;
+
+ aliases {
+ serial0 = &dbgu;
+ serial1 = &usart0;
+ serial2 = &usart1;
+ serial3 = &usart2;
+ serial4 = &usart3;
+ gpio0 = &pioA;
+ gpio1 = &pioB;
+ gpio2 = &pioC;
+ gpio3 = &pioD;
+ tcb0 = &tcb0;
+ tcb1 = &tcb1;
+ };
+ cpus {
+ cpu at 0 {
+ compatible = "arm,arm920t";
+ };
+ };
+
+ memory {
+ reg = <0x20000000 0x04000000>;
+ };
+
+ ahb {
+ compatible = "simple-bus";
+ #address-cells = <1>;
+ #size-cells = <1>;
+ ranges;
+
+ apb {
+ compatible = "simple-bus";
+ #address-cells = <1>;
+ #size-cells = <1>;
+ ranges;
+
+ aic: interrupt-controller at fffff000 {
+ #interrupt-cells = <3>;
+ compatible = "atmel,at91rm9200-aic";
+ interrupt-controller;
+ reg = <0xfffff000 0x200>;
+ atmel,external-irqs = <25 26 27 28 29 30 31>;
+ };
+
+ ramc0: ramc at ffffff00 {
+ compatible = "atmel,at91rm9200-sdramc";
+ reg = <0xffffff00 0x100>;
+ };
+
+ pmc: pmc at fffffc00 {
+ compatible = "atmel,at91rm9200-pmc";
+ reg = <0xfffffc00 0x100>;
+ };
+
+ st: timer at fffffd00 {
+ compatible = "atmel,at91rm9200-st";
+ reg = <0xfffffd00 0x100>;
+ interrupts = <1 4 7>;
+ };
+
+ tcb0: timer at fffa0000 {
+ compatible = "atmel,at91rm9200-tcb";
+ reg = <0xfffa0000 0x100>;
+ interrupts = <17 4 0 18 4 0 19 4 0>;
+ };
+
+ tcb1: timer at fffa4000 {
+ compatible = "atmel,at91rm9200-tcb";
+ reg = <0xfffa4000 0x100>;
+ interrupts = <20 4 0 21 4 0 22 4 0>;
+ };
+
+ pioA: gpio at fffff400 {
+ compatible = "atmel,at91rm9200-gpio";
+ reg = <0xfffff400 0x100>;
+ interrupts = <2 4 1>;
+ #gpio-cells = <2>;
+ gpio-controller;
+ interrupt-controller;
+ #interrupt-cells = <2>;
+ };
+
+ pioB: gpio at fffff600 {
+ compatible = "atmel,at91rm9200-gpio";
+ reg = <0xfffff600 0x100>;
+ interrupts = <3 4 1>;
+ #gpio-cells = <2>;
+ gpio-controller;
+ interrupt-controller;
+ #interrupt-cells = <2>;
+ };
+
+ pioC: gpio at fffff800 {
+ compatible = "atmel,at91rm9200-gpio";
+ reg = <0xfffff800 0x100>;
+ interrupts = <4 4 1>;
+ #gpio-cells = <2>;
+ gpio-controller;
+ interrupt-controller;
+ #interrupt-cells = <2>;
+ };
+
+ pioD: gpio at fffffa00 {
+ compatible = "atmel,at91rm9200-gpio";
+ reg = <0xfffffa00 0x100>;
+ interrupts = <5 4 1>;
+ #gpio-cells = <2>;
+ gpio-controller;
+ interrupt-controller;
+ #interrupt-cells = <2>;
+ status = "disabled";
+ };
+
+ dbgu: serial at fffff200 {
+ compatible = "atmel,at91rm9200-usart";
+ reg = <0xfffff200 0x200>;
+ interrupts = <1 4 7>;
+ status = "disabled";
+ };
+
+ usart0: serial at fffc0000 {
+ compatible = "atmel,at91rm9200-usart";
+ reg = <0xfffc0000 0x200>;
+ interrupts = <6 4 5>;
+ atmel,use-dma-rx;
+ atmel,use-dma-tx;
+ status = "disabled";
+ };
+
+ usart1: serial at fffc4000 {
+ compatible = "atmel,at91rm9200-usart";
+ reg = <0xfffc4000 0x200>;
+ interrupts = <7 4 5>;
+ atmel,use-dma-rx;
+ atmel,use-dma-tx;
+ status = "disabled";
+ };
+
+ usart2: serial at fffc8000 {
+ compatible = "atmel,at91rm9200-usart";
+ reg = <0xfffc8000 0x200>;
+ interrupts = <8 4 5>;
+ atmel,use-dma-rx;
+ atmel,use-dma-tx;
+ status = "disabled";
+ };
+
+ usart3: serial at fffcc000 {
+ compatible = "atmel,at91rm9200-usart";
+ reg = <0xfffcc000 0x200>;
+ interrupts = <23 4 5>;
+ atmel,use-dma-rx;
+ atmel,use-dma-tx;
+ status = "disabled";
+ };
+
+ usb1: gadget at fffb0000 {
+ compatible = "atmel,at91rm9200-udc";
+ reg = <0xfffb0000 0x4000>;
+ interrupts = <11 4 2>;
+ status = "disabled";
+ };
+ };
+
+ nand0: nand at 40000000 {
+ compatible = "atmel,at91rm9200-nand";
+ #address-cells = <1>;
+ #size-cells = <1>;
+ reg = <0x40000000 0x10000000>;
+ atmel,nand-addr-offset = <21>;
+ atmel,nand-cmd-offset = <22>;
+ nand-ecc-mode = "soft";
+ gpios = <&pioC 2 0
+ 0
+ &pioB 1 0
+ >;
+ status = "disabled";
+ };
+
+ usb0: ohci at 00300000 {
+ compatible = "atmel,at91rm9200-ohci", "usb-ohci";
+ reg = <0x00300000 0x100000>;
+ interrupts = <23 4 2>;
+ status = "disabled";
+ };
+ };
+
+ i2c at 0 {
+ compatible = "i2c-gpio";
+ gpios = <&pioA 23 0 /* sda */
+ &pioA 24 0 /* scl */
+ >;
+ i2c-gpio,sda-open-drain;
+ i2c-gpio,scl-open-drain;
+ i2c-gpio,delay-us = <2>; /* ~100 kHz */
+ #address-cells = <1>;
+ #size-cells = <0>;
+ status = "disabled";
+ };
+};
--
1.7.12.2
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH 1/4] ARM: AT91: Add DT support to AT91RM9200 System Timer
2012-10-11 22:05 [PATCH 1/4] ARM: AT91: Add DT support to AT91RM9200 System Timer Joachim Eastwood
` (2 preceding siblings ...)
2012-10-11 22:05 ` [PATCH 4/4] ARM: AT91: Add AT91RM9200 device tree Joachim Eastwood
@ 2012-10-12 14:23 ` Jean-Christophe PLAGNIOL-VILLARD
3 siblings, 0 replies; 15+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2012-10-12 14:23 UTC (permalink / raw)
To: linux-arm-kernel
On 00:05 Fri 12 Oct , Joachim Eastwood wrote:
> Based on AT91 PIT DT patch from Jean-Christophe PLAGNIOL-VILLARD.
ok for this one
>
> Signed-off-by: Joachim Eastwood <manabian@gmail.com>
> ---
> .../devicetree/bindings/arm/atmel-at91.txt | 6 +++
> arch/arm/mach-at91/at91rm9200_time.c | 63 +++++++++++++++++++++-
> 2 files changed, 67 insertions(+), 2 deletions(-)
>
> diff --git a/Documentation/devicetree/bindings/arm/atmel-at91.txt b/Documentation/devicetree/bindings/arm/atmel-at91.txt
> index ecc81e3..8adc9a8 100644
> --- a/Documentation/devicetree/bindings/arm/atmel-at91.txt
> +++ b/Documentation/devicetree/bindings/arm/atmel-at91.txt
> @@ -7,6 +7,12 @@ PIT Timer required properties:
> - interrupts: Should contain interrupt for the PIT which is the IRQ line
> shared across all System Controller members.
>
> +System Timer (ST) required properties:
> +- compatible: Should be "atmel,at91rm9200-st"
> +- reg: Should contain registers location and length
> +- interrupts: Should contain interrupt for the ST which is the IRQ line
> + shared across all System Controller members.
> +
> TC/TCLIB Timer required properties:
> - compatible: Should be "atmel,<chip>-pit".
> <chip> can be "at91rm9200" or "at91sam9x5"
> diff --git a/arch/arm/mach-at91/at91rm9200_time.c b/arch/arm/mach-at91/at91rm9200_time.c
> index aaa443b..cafe988 100644
> --- a/arch/arm/mach-at91/at91rm9200_time.c
> +++ b/arch/arm/mach-at91/at91rm9200_time.c
> @@ -24,6 +24,9 @@
> #include <linux/irq.h>
> #include <linux/clockchips.h>
> #include <linux/export.h>
> +#include <linux/of.h>
> +#include <linux/of_address.h>
> +#include <linux/of_irq.h>
>
> #include <asm/mach/time.h>
>
> @@ -91,7 +94,8 @@ static irqreturn_t at91rm9200_timer_interrupt(int irq, void *dev_id)
> static struct irqaction at91rm9200_timer_irq = {
> .name = "at91_tick",
> .flags = IRQF_SHARED | IRQF_DISABLED | IRQF_TIMER | IRQF_IRQPOLL,
> - .handler = at91rm9200_timer_interrupt
> + .handler = at91rm9200_timer_interrupt,
> + .irq = NR_IRQS_LEGACY + AT91_ID_SYS,
> };
>
> static cycle_t read_clk32k(struct clocksource *cs)
> @@ -179,8 +183,60 @@ static struct clock_event_device clkevt = {
> void __iomem *at91_st_base;
> EXPORT_SYMBOL_GPL(at91_st_base);
>
> +#ifdef CONFIG_OF
> +static struct of_device_id at91rm9200_st_timer_ids[] = {
> + { .compatible = "atmel,at91rm9200-st" },
> + { /* sentinel */ }
> +};
> +
> +static int __init of_at91rm9200_st_init(void)
> +{
> + struct device_node *np;
> + int ret;
> +
> + np = of_find_matching_node(NULL, at91rm9200_st_timer_ids);
> + if (!np)
> + goto err;
> +
> + at91_st_base = of_iomap(np, 0);
> + if (!at91_st_base)
> + goto node_err;
> +
> + /* Get the interrupts property */
> + ret = irq_of_parse_and_map(np, 0);
> + if (!ret)
> + goto ioremap_err;
> + at91rm9200_timer_irq.irq = ret;
> +
> + of_node_put(np);
> +
> + return 0;
> +
> +ioremap_err:
> + iounmap(at91_st_base);
> +node_err:
> + of_node_put(np);
> +err:
> + return -EINVAL;
> +}
> +#else
> +static int __init of_at91rm9200_st_init(void)
> +{
> + return -EINVAL;
> +}
> +#endif
> +
> void __init at91rm9200_ioremap_st(u32 addr)
> {
> +#ifdef CONFIG_OF
> + struct device_node *np;
> +
> + np = of_find_matching_node(NULL, at91rm9200_st_timer_ids);
> + if (np) {
> + of_node_put(np);
> + return;
> + }
> +#endif
> at91_st_base = ioremap(addr, 256);
> if (!at91_st_base)
> panic("Impossible to ioremap ST\n");
> @@ -191,13 +247,16 @@ void __init at91rm9200_ioremap_st(u32 addr)
> */
> void __init at91rm9200_timer_init(void)
> {
> + /* For device tree enabled device: initialize here */
> + of_at91rm9200_st_init();
> +
> /* Disable all timer interrupts, and clear any pending ones */
> at91_st_write(AT91_ST_IDR,
> AT91_ST_PITS | AT91_ST_WDOVF | AT91_ST_RTTINC | AT91_ST_ALMS);
> at91_st_read(AT91_ST_SR);
>
> /* Make IRQs happen for the system timer */
> - setup_irq(NR_IRQS_LEGACY + AT91_ID_SYS, &at91rm9200_timer_irq);
> + setup_irq(at91rm9200_timer_irq.irq, &at91rm9200_timer_irq);
>
> /* The 32KiHz "Slow Clock" (tick every 30517.58 nanoseconds) is used
> * directly for the clocksource and all clockevents, after adjusting
> --
> 1.7.12.2
>
^ permalink raw reply [flat|nested] 15+ messages in thread