Skip to contentSkip to conversation

INTC woes on HP Jornada 600-series

PATCH Kristoffer Ericson 2 participants 2 messages Nov 27, 2008 – Nov 28, 2008 SuperH

lore
Share & tools
lore
#0 lore raw

Greetings,

I recall bugging Magnus about adding this patch. Rediscoverd it when I couldn't get the Compact Flash going (se earlier mail).
Anyhow, I'm looking for the correct place to put this.

With this patch applied, matt's patch works fine.

drivers/sh/intc.c +12 -0
index 58d24c5..8508f89 100644
@@ -230,6 +230,18 @@ static void intc_disable(unsigned int irq)
 		intc_disable_fns[_INTC_MODE(handle)](addr, handle,intc_reg_fns\
 						     [_INTC_FN(handle)], irq);
 	}
+
+	#ifdef CONFIG_CPU_SUBTYPE_SH7709
+	/* We need to unmask IRQ0->IRQ5
+	 * to keep the interrupts coming.
+	 * Otherwise we end up with timeouts
+	 * on PCMCIA/CF devices. */
+	if ((irq > 31) && (irq < 37)) {
+		cpu = __raw_readb(0xA4000004); /* IRR0 */
+		cpu &= ~(1 << (irq - 32));
+		__raw_writeb(cpu, 0xA4000004);
+	}
+	#endif
 }
 
 #if defined(CONFIG_CPU_SH3) || defined(CONFIG_CPU_SH4A)
Signature · 1 line
Kristoffer Ericson <[email protected]>
drivers/sh/intc.c +12 -0
index 58d24c5..8508f89 100644
@@ -230,6 +230,18 @@ static void intc_disable(unsigned int irq)
 		intc_disable_fns[_INTC_MODE(handle)](addr, handle,intc_reg_fns\
 						     [_INTC_FN(handle)], irq);
 	}
+
+	#ifdef CONFIG_CPU_SUBTYPE_SH7709
+	/* We need to unmask IRQ0->IRQ5
+	 * to keep the interrupts coming.
+	 * Otherwise we end up with timeouts
+	 * on PCMCIA/CF devices. */
+	if ((irq > 31) && (irq < 37)) {
+		cpu = __raw_readb(0xA4000004); /* IRR0 */
+		cpu &= ~(1 << (irq - 32));
+		__raw_writeb(cpu, 0xA4000004);
+	}
+	#endif
 }
 
 #if defined(CONFIG_CPU_SH3) || defined(CONFIG_CPU_SH4A)
#1 lore raw

Hi Kristoffer,

Your patch seems to be acknowleding external interrupt sources using the IRR0 register. The intc code is supposed to handle this already, but maybe there is some case that's not fully covered. I suggest you look into how ack_registers[] in setup-sh3.c is being used.

/ magnus

Quoted 38 lines · Kristoffer Ericson

Greetings,

I recall bugging Magnus about adding this patch. Rediscoverd it when I couldn't get the Compact Flash going (se earlier mail).
Anyhow, I'm looking for the correct place to put this.

With this patch applied, matt's patch works fine.

drivers/sh/intc.c +12 -1
index 58d24c5..8508f89 100644
@@ -230,6 +230,18 @@ static void intc_disable(unsigned int irq)
               intc_disable_fns[_INTC_MODE(handle)](addr, handle,intc_reg_fns\
                                                    [_INTC_FN(handle)], irq);
       }
+
+       #ifdef CONFIG_CPU_SUBTYPE_SH7709
+       /* We need to unmask IRQ0->IRQ5
+        * to keep the interrupts coming.
+        * Otherwise we end up with timeouts
+        * on PCMCIA/CF devices. */
+       if ((irq > 31) && (irq < 37)) {
+               cpu = __raw_readb(0xA4000004); /* IRR0 */
+               cpu &= ~(1 << (irq - 32));
+               __raw_writeb(cpu, 0xA4000004);
+       }
+       #endif
 }
 
 #if defined(CONFIG_CPU_SH3) || defined(CONFIG_CPU_SH4A)
 
 
--

Kristoffer Ericson <[email protected]>