Skip to contentSkip to conversation

ipipe i.MXL freeze's boot

PATCH In review Gwenhaël 2 participants 6 messages Feb 25, 2009 – Feb 27, 2009

Subsystems (3)
lore
Share & tools
lore

Gwenhaël

author
#0 lore raw

PATCH 1/1 ipipe i.MXL freeze's boot

With i.MXL processor, kernel patched with adeos-2.6.27-ipipe-1.12-00.patch wait indefinitly for timer calibration.
Tick event never appear. This patch modify acktimer() in arch/arm/mach-imx/time.c.

I need to know if this modification is good (without adding new errors).

Thank you very much

Gwenhael

Signed-off-by [email protected]

---- diff -ru a/arch/arm/mach-imx/irq.c b/arch/arm/mach-imx/irq.c

arch/arm/mach-imx/irq.c 2009-02-23 14:12:43.000000000 +0100 renamed from arch/arm/mach-imx/irq.c 2009-02-17 11:32:52.000000000 +0100 +1 -1
@@ -35,7 +35,7 @@
 #include <asm/io.h>
 
 #include <asm/mach/irq.h>
-#include <asm/arch/imx-regs.h>
+#include <mach/imx-regs.h>
 
 
 /* Used for IMX INTERRUPT priority: Still Experimental */ 
arch/arm/mach-imx/time.c 2009-02-24 15:24:45.000000000 +0100 renamed from arch/arm/mach-imx/time.c 2009-02-24 15:26:42.000000000 +0100 +5 -0
diff -ru a/arch/arm/mach-imx/time.c b/arch/arm/mach-imx/time.c
@@ -294,7 +294,12 @@
 #ifdef CONFIG_IPIPE
 void __ipipe_mach_acktimer(void)
 {  
+  uint32_t tstat;
+  tstat = IMX_TSTAT(TIMER_BASE);
   IMX_TSTAT(TIMER_BASE) = 0;
+  if (likely(tstat & TSTAT_COMP)) {
+    ipipe_mach_update_tsc(void);
+  }
 }
 
 static void ipipe_mach_update_tsc(void)
#1 lore raw
Quoted 8 lines · Gwenhaël

With i.MXL processor, kernel patched with adeos-2.6.27-ipipe-1.12-00.patch wait indefinitly for timer calibration.
Tick event never appear. This patch modify acktimer() in arch/arm/mach-imx/time.c.

I need to know if this modification is good (without adding new errors).

ipipe_mach_update_tsc should be called from imx_timer_interrupt, so, there is no need to call it from acktimer (and in fact, avoiding the call to update_tsc in acktimer reduces the timer interrupt latency). So, maybe what is needed and is missing is simply to read IMX_TSTAT(TIMER_BASE) ?

Signature · 1 line
                                                 Gilles.
author
#2 lore raw
Quoted 7 lines · Gilles Chanteperdrix
Quoted 6 lines · Gwenhaël

With i.MXL processor, kernel patched with adeos-2.6.27-ipipe-1.12-00.patch wait indefinitly for timer calibration.
Tick event never appear. This patch modify acktimer() in arch/arm/mach-imx/time.c.

Quoted 8 lines
Quoted 2 lines

I need to know if this modification is good (without adding new errors).

ipipe_mach_update_tsc should be called from imx_timer_interrupt, so, there is no need to call it from acktimer (and in fact, avoiding the call to update_tsc in acktimer reduces the timer interrupt latency). So, maybe what is needed and is missing is simply to read IMX_TSTAT(TIMER_BASE) ?

I've made modifications on patch thanks to your assumption. The new patch work fine.

Thank you very much

Gwenhael

Signed-off-by [email protected]
arch/arm/mach-imx/irq.c 2009-02-23 14:12:43.000000000 +0100 renamed from arch/arm/mach-imx/irq.c 2009-02-17 11:32:52.000000000 +0100 +1 -1
diff -ru a/arch/arm/mach-imx/irq.c b/arch/arm/mach-imx/irq.c
@@ -35,7 +35,7 @@
 #include <asm/io.h>
 
 #include <asm/mach/irq.h>
-#include <asm/arch/imx-regs.h>
+#include <mach/imx-regs.h>
 
 
 /* Used for IMX INTERRUPT priority: Still Experimental */ 
arch/arm/mach-imx/time.c +4 -6
diff -ru a/arch/arm/mach-imx/time.c b/arch/arm/mach-imx/time.c
@@ -89,25 +89,23 @@
 imx_timer_interrupt(int irq, void *dev_id)
 {
 	struct clock_event_device *evt = &clockevent_imx;
-#ifndef CONFIG_IPIPE
 	uint32_t tstat;
 	irqreturn_t ret = IRQ_NONE;
 
 	/* clear the interrupt */
 	tstat = IMX_TSTAT(TIMER_BASE);
+#ifndef CONFIG_IPIPE
 	IMX_TSTAT(TIMER_BASE) = 0;
+#endif
 	if (tstat & TSTAT_COMP) {
+#ifdef CONFIG_IPIPE
 		ipipe_mach_update_tsc();
+#endif
 		evt->event_handler(evt);
 		ret = IRQ_HANDLED;
 	}
 
 	return ret;
-#else /* CONFIG_IPIPE */
-	ipipe_mach_update_tsc();
-	evt->event_handler(evt);
-	return  IRQ_HANDLED;
-#endif /* CONFIG_IPIPE */
 }
 
 static struct irqaction imx_timer_irq = {
#3 lore raw
Quoted 62 lines · Gwenhaël
Quoted 7 lines · Gilles Chanteperdrix
Quoted 6 lines · Gwenhaël

With i.MXL processor, kernel patched with adeos-2.6.27-ipipe-1.12-00.patch wait indefinitly for timer calibration.
Tick event never appear. This patch modify acktimer() in arch/arm/mach-imx/time.c.

Quoted 7 lines
Quoted 2 lines

I need to know if this modification is good (without adding new errors).

ipipe_mach_update_tsc should be called from imx_timer_interrupt, so, there is no need to call it from acktimer (and in fact, avoiding the call to update_tsc in acktimer reduces the timer interrupt latency). So, maybe what is needed and is missing is simply to read IMX_TSTAT(TIMER_BASE) ?

I've made modifications on patch thanks to your assumption. The new patch work fine.

Thank you very much

Gwenhael

Signed-off-by [email protected]

diff -ru a/arch/arm/mach-imx/irq.c b/arch/arm/mach-imx/irq.c

arch/arm/mach-imx/irq.c 2009-02-23 14:12:43.000000000 +0100 renamed from arch/arm/mach-imx/irq.c 2009-02-17 11:32:52.000000000 +0100 +1 -1
@@ -35,7 +35,7 @@
 #include <asm/io.h>
 
 #include <asm/mach/irq.h>
-#include <asm/arch/imx-regs.h>
+#include <mach/imx-regs.h>
 
 
 /* Used for IMX INTERRUPT priority: Still Experimental */ 

diff -ru a/arch/arm/mach-imx/time.c b/arch/arm/mach-imx/time.c

arch/arm/mach-imx/time.c +4 -1
@@ -89,25 +89,23 @@
 imx_timer_interrupt(int irq, void *dev_id)
 {
 	struct clock_event_device *evt = &clockevent_imx;
-#ifndef CONFIG_IPIPE
 	uint32_t tstat;
 	irqreturn_t ret = IRQ_NONE;
 
 	/* clear the interrupt */
 	tstat = IMX_TSTAT(TIMER_BASE);
+#ifndef CONFIG_IPIPE
 	IMX_TSTAT(TIMER_BASE) = 0;
+#endif
 	if (tstat & TSTAT_COMP) {
+#ifdef CONFIG_IPIPE
 		ipipe_mach_update_tsc();
+#endif
 		evt->event_handler(evt);
 		ret = IRQ_HANDLED;
 	}

arch/arm/mach-imx/time.c line 111

Quoted 10 lines
arch/arm/mach-imx/time.c +0 -5
 
 	return ret;
-#else /* CONFIG_IPIPE */
-	ipipe_mach_update_tsc();
-	evt->event_handler(evt);
-	return  IRQ_HANDLED;
-#endif /* CONFIG_IPIPE */
 }
 
 static struct irqaction imx_timer_irq = {

No, that is still wrong. You should read IMX_TSTAT(TIMER_BASE) in acktimer not in linux timer interrupt. When running with xenomai, the linux timer interrupt is a virtual interrupt and should not touch hardware.

Signature · 1 line
                                                 Gilles.
#4 lore raw
Quoted 71 lines · Gilles Chanteperdrix
Quoted 70 lines · Gwenhaël
Quoted 7 lines · Gilles Chanteperdrix
Quoted 6 lines · Gwenhaël

With i.MXL processor, kernel patched with adeos-2.6.27-ipipe-1.12-00.patch wait indefinitly for timer calibration.
Tick event never appear. This patch modify acktimer() in arch/arm/mach-imx/time.c.

Quoted 7 lines
Quoted 2 lines

I need to know if this modification is good (without adding new errors).

ipipe_mach_update_tsc should be called from imx_timer_interrupt, so, there is no need to call it from acktimer (and in fact, avoiding the call to update_tsc in acktimer reduces the timer interrupt latency). So, maybe what is needed and is missing is simply to read IMX_TSTAT(TIMER_BASE) ?

I've made modifications on patch thanks to your assumption. The new patch work fine.

Thank you very much

Gwenhael

Signed-off-by [email protected]

diff -ru a/arch/arm/mach-imx/irq.c b/arch/arm/mach-imx/irq.c

arch/arm/mach-imx/irq.c 2009-02-23 14:12:43.000000000 +0100 renamed from arch/arm/mach-imx/irq.c 2009-02-17 11:32:52.000000000 +0100 +1 -1
@@ -35,7 +35,7 @@
 #include <asm/io.h>
 
 #include <asm/mach/irq.h>
-#include <asm/arch/imx-regs.h>
+#include <mach/imx-regs.h>
 
 
 /* Used for IMX INTERRUPT priority: Still Experimental */ 

diff -ru a/arch/arm/mach-imx/time.c b/arch/arm/mach-imx/time.c

arch/arm/mach-imx/time.c +4 -6
@@ -89,25 +89,23 @@
 imx_timer_interrupt(int irq, void *dev_id)
 {
 	struct clock_event_device *evt = &clockevent_imx;
-#ifndef CONFIG_IPIPE
 	uint32_t tstat;
 	irqreturn_t ret = IRQ_NONE;
 
 	/* clear the interrupt */
 	tstat = IMX_TSTAT(TIMER_BASE);
+#ifndef CONFIG_IPIPE
 	IMX_TSTAT(TIMER_BASE) = 0;
+#endif
 	if (tstat & TSTAT_COMP) {
+#ifdef CONFIG_IPIPE
 		ipipe_mach_update_tsc();
+#endif
 		evt->event_handler(evt);
 		ret = IRQ_HANDLED;
 	}
 
 	return ret;
-#else /* CONFIG_IPIPE */
-	ipipe_mach_update_tsc();
-	evt->event_handler(evt);
-	return  IRQ_HANDLED;
-#endif /* CONFIG_IPIPE */
 }
 
Quoted 6 lines

arch/arm/mach-imx/time.c line 111

Quoted 1 line
arch/arm/mach-imx/time.c +0 -0
 static struct irqaction imx_timer_irq = {

No, that is still wrong. You should read IMX_TSTAT(TIMER_BASE) in acktimer not in linux timer interrupt. When running with xenomai, the linux timer interrupt is a virtual interrupt and should not touch hardware.

Hi Gwenhaël,

any news about this issue ?

Regards.

Signature · 1 line
                                                 Gilles.
#5 lore raw
Quoted 11 lines · On Thu, 26 Feb 2009 17:33:12 +0100 Gilles Chanteperdrix…
Quoted 1 line

Hi Gwenhaël,

any news about this issue ?

Regards.

Signature · 1 line
                                                 Gilles.

Yes,
I'm sorry for the late.
This patch seem correct for the Adeos i'MXL support. The first part is only usefull for 2.6.27 and 2.6.28. The second part is for 2.6.2{6,7,8}

Regards

Gwenhaël

Signed-off-by [email protected]
arch/arm/mach-imx/irq.c 2009-02-23 14:12:43.000000000 +0100 renamed from arch/arm/mach-imx/irq.c 2009-02-17 11:32:52.000000000 +0100 +1 -1
diff -ru a/arch/arm/mach-imx/irq.c b/arch/arm/mach-imx/irq.c
@@ -35,7 +35,7 @@
 #include <asm/io.h>
 
 #include <asm/mach/irq.h>
-#include <asm/arch/imx-regs.h>
+#include <mach/imx-regs.h>
 
 
 /* Used for IMX INTERRUPT priority: Still Experimental */ 
arch/arm/mach-imx/time.c +2 -0
diff -ru a/arch/arm/mach-imx/time.c b/arch/arm/mach-imx/time.c
@@ -294,6 +294,8 @@
 #ifdef CONFIG_IPIPE
 void __ipipe_mach_acktimer(void)
 {
+	uint32_t tstat;
+	tstat = IMX_TSTAT(TIMER_BASE);
 	IMX_TSTAT(TIMER_BASE) = 0;
 }