All of lore.kernel.org
 help / color / mirror / Atom feed
* [Xenomai-core] [PATCH] Support for Atmel AT91SAM9G20 processor
@ 2009-06-04 11:08 martin mangard
  2009-06-04 11:15 ` Gilles Chanteperdrix
  0 siblings, 1 reply; 5+ messages in thread
From: martin mangard @ 2009-06-04 11:08 UTC (permalink / raw)
  To: xenomai

Hello

I made a patch in order to support the Atmel AT91SAM9G20 processor,
which has to be applied after the "adeos-ipipe-2.6.27-arm-*" patch.
Due to the similarities between the AT91SAM9260 and the AT91SAM9G20
processor, only a few changes were necessary. I booted the system on a
"AT91SAM9G20-EK" development
board and executed "latencytest" and "clocktest". Are there plans to
officially support this processor in the future?

Martin

Thu Jun  4 12:19:58 UTC 2009
running: ./run -- -p 200 -t0 # latency
*
*
* Type ^C to stop this application.
*
*
== Sampling period: 200 us
== Test mode: periodic user-mode task
== All results in microseconds
warming up...
RTT|  00:00:01  (periodic user-mode task, 200 us period, priority 99)
RTH|-----lat min|-----lat avg|-----lat max|-overrun|----lat best|---lat worst
RTD|      37.790|      47.480|      71.705|       0|      37.790|      71.705
RTD|      10.658|      47.480|      74.612|       0|      10.658|      74.612
RTD|      21.317|      47.480|      71.705|       0|      10.658|      74.612
RTD|      21.317|      47.480|      71.705|       0|      10.658|      74.612
RTD|      20.348|      47.480|      71.705|       0|      10.658|      74.612
RTD|      20.348|      47.480|      71.705|       0|      10.658|      74.612
.
.

root@domain.hid# ./clocktest
== Tested clock: 0 (CLOCK_REALTIME)
CPU      ToD offset [us] ToD drift [us/s]      warps max delta [us]
--- -------------------- ---------------- ---------- --------------
  0  -1244111499212379.2           -0.040          0            0.0

--------------------


diff -urp a/arch/arm/mach-at91/at91_ipipe_time.c
b/arch/arm/mach-at91/at91_ipipe_time.c
--- a/arch/arm/mach-at91/at91_ipipe_time.c      2009-06-03
15:23:30.000000000 +0200
+++ b/arch/arm/mach-at91/at91_ipipe_time.c      2009-06-03
15:24:59.000000000 +0200
@@ -34,7 +34,7 @@
 #define AT91_ID_TC0 AT91RM9200_ID_TC0
 #define AT91_ID_TC1 AT91RM9200_ID_TC1
 #define AT91_ID_TC2 AT91RM9200_ID_TC2
-#elif defined(CONFIG_ARCH_AT91SAM9260)
+#elif defined(CONFIG_ARCH_AT91SAM9260) || defined(CONFIG_ARCH_AT91SAM9G20)
 #define AT91_ID_TC0 AT91SAM9260_ID_TC0
 #define AT91_ID_TC1 AT91SAM9260_ID_TC1
 #define AT91_ID_TC2 AT91SAM9260_ID_TC2
@@ -339,7 +339,7 @@ void __init at91_timer_init(void)
        at91_sys_write(AT91_ST_IDR, AT91_ST_PITS | AT91_ST_WDOVF |
AT91_ST_RTTINC | AT91_ST_ALMS);
        (void) at91_sys_read(AT91_ST_SR);       /* Clear any pending
interrupts */
 #elif defined(CONFIG_ARCH_AT91SAM9260) || defined(CONFIG_ARCH_AT91SAM9261) \
-       || defined(CONFIG_ARCH_AT91SAM9263) || defined(CONFIG_ARCH_AT91SAM9RL)
+       || defined(CONFIG_ARCH_AT91SAM9263) ||
defined(CONFIG_ARCH_AT91SAM9RL) || defined(CONFIG_ARCH_AT91SAM9G20)
        at91_sys_write(AT91_PIT_MR, 0);

        /* Clear any pending interrupts */
@@ -399,7 +399,7 @@ void __init at91_timer_init(void)
 #ifdef CONFIG_ARCH_AT91RM9200
 struct sys_timer at91rm9200_timer = {
 #elif defined(CONFIG_ARCH_AT91SAM9260) || defined(CONFIG_ARCH_AT91SAM9261) \
-       || defined(CONFIG_ARCH_AT91SAM9263) || defined(CONFIG_ARCH_AT91SAM9RL)
+       || defined(CONFIG_ARCH_AT91SAM9263) ||
defined(CONFIG_ARCH_AT91SAM9RL)|| defined(CONFIG_ARCH_AT91SAM9RL) ||
defined(CONFIG_ARCH_AT91SAM9G20)
 struct sys_timer at91sam926x_timer = {
 #elif defined(CONFIG_ARCH_AT91X40)
 struct sys_timer at91x40_timer = {
diff -urp a/arch/arm/mach-at91/include/mach/cpu.h
b/arch/arm/mach-at91/include/mach/cpu.h
--- a/arch/arm/mach-at91/include/mach/cpu.h     2009-06-03
15:23:30.000000000 +0200
+++ b/arch/arm/mach-at91/include/mach/cpu.h     2009-06-03
15:24:59.000000000 +0200
@@ -69,7 +69,7 @@ static inline unsigned long at91cap9_rev

 #ifdef CONFIG_ARCH_AT91SAM9260
 #define cpu_is_at91sam9xe()    (at91_arch_identify() == ARCH_FAMILY_AT91SAM9XE)
-#define cpu_is_at91sam9260()   ((at91_cpu_identify() ==
ARCH_ID_AT91SAM9260) || cpu_is_at91sam9xe())
+#define cpu_is_at91sam9260()   ((at91_cpu_identify() ==
ARCH_ID_AT91SAM9260) || cpu_is_at91sam9xe() ||
(at91_cpu_identify()==ARCH_ID_AT91SAM9G20)))
 #else
 #define cpu_is_at91sam9xe()    (0)
 #define cpu_is_at91sam9260()   (0)
diff -urp a/arch/arm/mach-at91/include/mach/hardware.h
b/arch/arm/mach-at91/include/mach/hardware.h
--- a/arch/arm/mach-at91/include/mach/hardware.h        2009-06-03
15:23:30.000000000 +0200
+++ b/arch/arm/mach-at91/include/mach/hardware.h        2009-06-03
15:24:59.000000000 +0200
@@ -64,7 +64,7 @@
 #ifdef CONFIG_IPIPE
 #if defined(CONFIG_ARCH_AT91RM9200)
 #define AT91_BASE_TCB0 AT91RM9200_BASE_TCB0
-#elif defined(CONFIG_ARCH_AT91SAM9260)
+#elif defined(CONFIG_ARCH_AT91SAM9260) || defined(CONFIG_ARCH_AT91SAM9G20)
 #define AT91_BASE_TCB0 AT91SAM9260_BASE_TCB0
 #elif defined(CONFIG_ARCH_AT91SAM9261)
 #define AT91_BASE_TCB0 AT91SAM9261_BASE_TCB0
diff -urp a/arch/arm/mach-at91/include/mach/irqs.h
b/arch/arm/mach-at91/include/mach/irqs.h
--- a/arch/arm/mach-at91/include/mach/irqs.h    2009-06-03
15:23:30.000000000 +0200
+++ b/arch/arm/mach-at91/include/mach/irqs.h    2009-06-03
15:24:59.000000000 +0200
@@ -52,7 +52,7 @@ extern unsigned __ipipe_at91_gpio_banks;
 #define __ipipe_mach_irq_mux_p(irq)                                    \
        ((unsigned) (irq - AT91RM9200_ID_PIOA) < __ipipe_at91_gpio_banks)

-#elif defined(CONFIG_ARCH_AT91SAM9260)
+#elif defined(CONFIG_ARCH_AT91SAM9260) || defined(CONFIG_ARCH_AT91SAM9G20)
 #define __ipipe_mach_irq_mux_p(irq)                                    \
        ((unsigned) (irq - AT91SAM9260_ID_PIOA) < __ipipe_at91_gpio_banks)

diff -urp a/arch/arm/mach-at91/Makefile b/arch/arm/mach-at91/Makefile
--- a/arch/arm/mach-at91/Makefile       2009-06-03 15:23:30.000000000 +0200
+++ b/arch/arm/mach-at91/Makefile       2009-06-03 15:24:59.000000000 +0200
@@ -82,6 +82,7 @@ ifeq ($(CONFIG_IPIPE),y)
 obj-y := $(filter-out at91rm9200_time.o at91sam926x_time.o
at91x40_time.o, $(obj-y))
 obj-$(CONFIG_ARCH_AT91RM9200)   += at91_ipipe_time.o
 obj-$(CONFIG_ARCH_AT91SAM9260)  += at91_ipipe_time.o
+obj-$(CONFIG_ARCH_AT91SAM9G20)  += at91_ipipe_time.o
 obj-$(CONFIG_ARCH_AT91SAM9261)  += at91_ipipe_time.o
 obj-$(CONFIG_ARCH_AT91SAM9263) += at91_ipipe_time.o
 obj-$(CONFIG_ARCH_AT91SAM9RL)  += at91_ipipe_time.o


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

* Re: [Xenomai-core] [PATCH] Support for Atmel AT91SAM9G20 processor
  2009-06-04 11:08 [Xenomai-core] [PATCH] Support for Atmel AT91SAM9G20 processor martin mangard
@ 2009-06-04 11:15 ` Gilles Chanteperdrix
  2009-06-04 11:25   ` Gilles Chanteperdrix
  2009-06-04 13:01   ` martin mangard
  0 siblings, 2 replies; 5+ messages in thread
From: Gilles Chanteperdrix @ 2009-06-04 11:15 UTC (permalink / raw)
  To: martin mangard; +Cc: xenomai

martin mangard wrote:
> Hello
> 
> I made a patch in order to support the Atmel AT91SAM9G20 processor,
> which has to be applied after the "adeos-ipipe-2.6.27-arm-*" patch.
> Due to the similarities between the AT91SAM9260 and the AT91SAM9G20
> processor, only a few changes were necessary. I booted the system on a
> "AT91SAM9G20-EK" development
> board and executed "latencytest" and "clocktest". Are there plans to
> officially support this processor in the future?

Well, now that you sent the patch, this should be included in the next
adeos patch. However:
- your mailer mangled the patch, so I can not apply it, please configure
your mailer to avoid mangling the patch, or if that is not possible,
send the patch as attachment;
-  there is one change in your patch that I do not like:

>  #ifdef CONFIG_ARCH_AT91SAM9260
>  #define cpu_is_at91sam9xe()    (at91_arch_identify() == ARCH_FAMILY_AT91SAM9XE)
> -#define cpu_is_at91sam9260()   ((at91_cpu_identify() ==
> ARCH_ID_AT91SAM9260) || cpu_is_at91sam9xe())
> +#define cpu_is_at91sam9260()   ((at91_cpu_identify() ==
> ARCH_ID_AT91SAM9260) || cpu_is_at91sam9xe() ||
> (at91_cpu_identify()==ARCH_ID_AT91SAM9G20)))

You are touching mailine code here. It this patch is really needed by
mainline, then post it to the linux arm kernel mailing list.

-- 
					    Gilles.


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

* Re: [Xenomai-core] [PATCH] Support for Atmel AT91SAM9G20 processor
  2009-06-04 11:15 ` Gilles Chanteperdrix
@ 2009-06-04 11:25   ` Gilles Chanteperdrix
  2009-06-04 13:01   ` martin mangard
  1 sibling, 0 replies; 5+ messages in thread
From: Gilles Chanteperdrix @ 2009-06-04 11:25 UTC (permalink / raw)
  To: martin mangard; +Cc: xenomai

Gilles Chanteperdrix wrote:
> martin mangard wrote:
>> Hello
>>
>> I made a patch in order to support the Atmel AT91SAM9G20 processor,
>> which has to be applied after the "adeos-ipipe-2.6.27-arm-*" patch.
>> Due to the similarities between the AT91SAM9260 and the AT91SAM9G20
>> processor, only a few changes were necessary. I booted the system on a
>> "AT91SAM9G20-EK" development
>> board and executed "latencytest" and "clocktest". Are there plans to
>> officially support this processor in the future?
> 
> Well, now that you sent the patch, this should be included in the next
> adeos patch. However:
> - your mailer mangled the patch, so I can not apply it, please configure
> your mailer to avoid mangling the patch, or if that is not possible,
> send the patch as attachment;
> -  there is one change in your patch that I do not like:
> 
>>  #ifdef CONFIG_ARCH_AT91SAM9260
>>  #define cpu_is_at91sam9xe()    (at91_arch_identify() == ARCH_FAMILY_AT91SAM9XE)
>> -#define cpu_is_at91sam9260()   ((at91_cpu_identify() ==
>> ARCH_ID_AT91SAM9260) || cpu_is_at91sam9xe())
>> +#define cpu_is_at91sam9260()   ((at91_cpu_identify() ==
>> ARCH_ID_AT91SAM9260) || cpu_is_at91sam9xe() ||
>> (at91_cpu_identify()==ARCH_ID_AT91SAM9G20)))
> 
> You are touching mailine code here. It this patch is really needed by
> mainline, then post it to the linux arm kernel mailing list.
> 

Also, please send it as a patch to the current kernel i.e. 2.6.29.

-- 
					    Gilles.


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

* Re: [Xenomai-core] [PATCH] Support for Atmel AT91SAM9G20 processor
  2009-06-04 11:15 ` Gilles Chanteperdrix
  2009-06-04 11:25   ` Gilles Chanteperdrix
@ 2009-06-04 13:01   ` martin mangard
  2009-06-04 14:01     ` Gilles Chanteperdrix
  1 sibling, 1 reply; 5+ messages in thread
From: martin mangard @ 2009-06-04 13:01 UTC (permalink / raw)
  To: Gilles Chanteperdrix; +Cc: xenomai

[-- Attachment #1: Type: text/plain, Size: 1874 bytes --]

Hello

You are right! This part of the patch is not necessary and is ignored
if the AT91SAM9G20 is selected in the kernel configuration. I made
this  change  during a test with another kernel configuration. Sadly
this change was still present during the creation of the patch. The
attached patch does not contain this part any more.


On Thu, Jun 4, 2009 at 1:15 PM, Gilles Chanteperdrix
<gilles.chanteperdrix@xenomai.org> wrote:
> martin mangard wrote:
>> Hello
>>
>> I made a patch in order to support the Atmel AT91SAM9G20 processor,
>> which has to be applied after the "adeos-ipipe-2.6.27-arm-*" patch.
>> Due to the similarities between the AT91SAM9260 and the AT91SAM9G20
>> processor, only a few changes were necessary. I booted the system on a
>> "AT91SAM9G20-EK" development
>> board and executed "latencytest" and "clocktest". Are there plans to
>> officially support this processor in the future?
>
> Well, now that you sent the patch, this should be included in the next
> adeos patch. However:
> - your mailer mangled the patch, so I can not apply it, please configure
> your mailer to avoid mangling the patch, or if that is not possible,
> send the patch as attachment;
> -  there is one change in your patch that I do not like:
>
>>  #ifdef CONFIG_ARCH_AT91SAM9260
>>  #define cpu_is_at91sam9xe()    (at91_arch_identify() == ARCH_FAMILY_AT91SAM9XE)
>> -#define cpu_is_at91sam9260()   ((at91_cpu_identify() ==
>> ARCH_ID_AT91SAM9260) || cpu_is_at91sam9xe())
>> +#define cpu_is_at91sam9260()   ((at91_cpu_identify() ==
>> ARCH_ID_AT91SAM9260) || cpu_is_at91sam9xe() ||
>> (at91_cpu_identify()==ARCH_ID_AT91SAM9G20)))
>
> You are touching mailine code here. It this patch is really needed by
> mainline, then post it to the linux arm kernel mailing list.
>
> --
>                                            Gilles.
>

[-- Attachment #2: adeos-ipipe-2.6.27-arm-9G20.patch --]
[-- Type: text/x-diff, Size: 3658 bytes --]

diff -urp a/arch/arm/mach-at91/at91_ipipe_time.c b/arch/arm/mach-at91/at91_ipipe_time.c
--- a/arch/arm/mach-at91/at91_ipipe_time.c	2009-06-03 15:23:30.000000000 +0200
+++ b/arch/arm/mach-at91/at91_ipipe_time.c	2009-06-03 15:24:59.000000000 +0200
@@ -34,7 +34,7 @@
 #define AT91_ID_TC0 AT91RM9200_ID_TC0
 #define AT91_ID_TC1 AT91RM9200_ID_TC1
 #define AT91_ID_TC2 AT91RM9200_ID_TC2
-#elif defined(CONFIG_ARCH_AT91SAM9260)
+#elif defined(CONFIG_ARCH_AT91SAM9260) || defined(CONFIG_ARCH_AT91SAM9G20)
 #define AT91_ID_TC0 AT91SAM9260_ID_TC0
 #define AT91_ID_TC1 AT91SAM9260_ID_TC1
 #define AT91_ID_TC2 AT91SAM9260_ID_TC2
@@ -339,7 +339,7 @@ void __init at91_timer_init(void)
 	at91_sys_write(AT91_ST_IDR, AT91_ST_PITS | AT91_ST_WDOVF | AT91_ST_RTTINC | AT91_ST_ALMS);
 	(void) at91_sys_read(AT91_ST_SR);	/* Clear any pending interrupts */	
 #elif defined(CONFIG_ARCH_AT91SAM9260) || defined(CONFIG_ARCH_AT91SAM9261) \
-	|| defined(CONFIG_ARCH_AT91SAM9263) || defined(CONFIG_ARCH_AT91SAM9RL)
+	|| defined(CONFIG_ARCH_AT91SAM9263) || defined(CONFIG_ARCH_AT91SAM9RL) || defined(CONFIG_ARCH_AT91SAM9G20) 
 	at91_sys_write(AT91_PIT_MR, 0);
 
 	/* Clear any pending interrupts */
@@ -399,7 +399,7 @@ void __init at91_timer_init(void)
 #ifdef CONFIG_ARCH_AT91RM9200
 struct sys_timer at91rm9200_timer = {
 #elif defined(CONFIG_ARCH_AT91SAM9260) || defined(CONFIG_ARCH_AT91SAM9261) \
-	|| defined(CONFIG_ARCH_AT91SAM9263) || defined(CONFIG_ARCH_AT91SAM9RL)
+	|| defined(CONFIG_ARCH_AT91SAM9263) || defined(CONFIG_ARCH_AT91SAM9RL)|| defined(CONFIG_ARCH_AT91SAM9RL) || defined(CONFIG_ARCH_AT91SAM9G20) 
 struct sys_timer at91sam926x_timer = {
 #elif defined(CONFIG_ARCH_AT91X40)
 struct sys_timer at91x40_timer = {
diff -urp a/arch/arm/mach-at91/include/mach/hardware.h b/arch/arm/mach-at91/include/mach/hardware.h
--- a/arch/arm/mach-at91/include/mach/hardware.h	2009-06-03 15:23:30.000000000 +0200
+++ b/arch/arm/mach-at91/include/mach/hardware.h	2009-06-03 15:24:59.000000000 +0200
@@ -64,7 +64,7 @@
 #ifdef CONFIG_IPIPE
 #if defined(CONFIG_ARCH_AT91RM9200)
 #define AT91_BASE_TCB0 AT91RM9200_BASE_TCB0
-#elif defined(CONFIG_ARCH_AT91SAM9260)
+#elif defined(CONFIG_ARCH_AT91SAM9260) || defined(CONFIG_ARCH_AT91SAM9G20) 
 #define AT91_BASE_TCB0 AT91SAM9260_BASE_TCB0
 #elif defined(CONFIG_ARCH_AT91SAM9261)
 #define AT91_BASE_TCB0 AT91SAM9261_BASE_TCB0
diff -urp a/arch/arm/mach-at91/include/mach/irqs.h b/arch/arm/mach-at91/include/mach/irqs.h
--- a/arch/arm/mach-at91/include/mach/irqs.h	2009-06-03 15:23:30.000000000 +0200
+++ b/arch/arm/mach-at91/include/mach/irqs.h	2009-06-03 15:24:59.000000000 +0200
@@ -52,7 +52,7 @@ extern unsigned __ipipe_at91_gpio_banks;
 #define __ipipe_mach_irq_mux_p(irq)					\
 	((unsigned) (irq - AT91RM9200_ID_PIOA) < __ipipe_at91_gpio_banks)
 
-#elif defined(CONFIG_ARCH_AT91SAM9260)
+#elif defined(CONFIG_ARCH_AT91SAM9260) || defined(CONFIG_ARCH_AT91SAM9G20) 
 #define __ipipe_mach_irq_mux_p(irq)					\
 	((unsigned) (irq - AT91SAM9260_ID_PIOA) < __ipipe_at91_gpio_banks)
 
diff -urp a/arch/arm/mach-at91/Makefile b/arch/arm/mach-at91/Makefile
--- a/arch/arm/mach-at91/Makefile	2009-06-03 15:23:30.000000000 +0200
+++ b/arch/arm/mach-at91/Makefile	2009-06-03 15:24:59.000000000 +0200
@@ -82,6 +82,7 @@ ifeq ($(CONFIG_IPIPE),y)
 obj-y := $(filter-out at91rm9200_time.o at91sam926x_time.o at91x40_time.o, $(obj-y))
 obj-$(CONFIG_ARCH_AT91RM9200)   += at91_ipipe_time.o
 obj-$(CONFIG_ARCH_AT91SAM9260)  += at91_ipipe_time.o
+obj-$(CONFIG_ARCH_AT91SAM9G20)  += at91_ipipe_time.o
 obj-$(CONFIG_ARCH_AT91SAM9261)  += at91_ipipe_time.o
 obj-$(CONFIG_ARCH_AT91SAM9263)	+= at91_ipipe_time.o
 obj-$(CONFIG_ARCH_AT91SAM9RL)	+= at91_ipipe_time.o

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

* Re: [Xenomai-core] [PATCH] Support for Atmel AT91SAM9G20 processor
  2009-06-04 13:01   ` martin mangard
@ 2009-06-04 14:01     ` Gilles Chanteperdrix
  0 siblings, 0 replies; 5+ messages in thread
From: Gilles Chanteperdrix @ 2009-06-04 14:01 UTC (permalink / raw)
  To: martin mangard; +Cc: xenomai

martin mangard wrote:
> Hello
> 
> You are right! This part of the patch is not necessary and is ignored
> if the AT91SAM9G20 is selected in the kernel configuration. I made
> this  change  during a test with another kernel configuration. Sadly
> this change was still present during the creation of the patch. The
> attached patch does not contain this part any more.

Applied, thanks.

-- 
					    Gilles.


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

end of thread, other threads:[~2009-06-04 14:01 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-06-04 11:08 [Xenomai-core] [PATCH] Support for Atmel AT91SAM9G20 processor martin mangard
2009-06-04 11:15 ` Gilles Chanteperdrix
2009-06-04 11:25   ` Gilles Chanteperdrix
2009-06-04 13:01   ` martin mangard
2009-06-04 14:01     ` Gilles Chanteperdrix

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.