linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* get_irq fix for 8260 platform
@ 2002-01-17  7:15 Murray Jensen
  2002-01-17 16:08 ` Dan Malek
  0 siblings, 1 reply; 2+ messages in thread
From: Murray Jensen @ 2002-01-17  7:15 UTC (permalink / raw)
  To: linuxppc-embedded; +Cc: Tom Rini


Hi All, if you have an 8260 and are wondering why the latest revisions of
the devel kernel hang during boot, then this patch might help you.

Things were changed recently to call the *_get_irq() function repeatedly
until it indicated there were no more interrupts pending by returning -1.

The appropriate changes were made to ppc8xx_pic.c for the 8xx platform, but
not to ppc8260_pic.c for the 8260 platform. I simply mirrored the changes.

I have no idea whether the end_irq function addition is required, but it
doesn't appear to do any harm (for me). The important change is to make
m8260_get_irq() return -1 if the SIVEC register contains zero (which is
documented - poorly - to be an Error condition - no interrupt pending).

Cheers!
								Murray...

--- linuxppc_2_4_devel_vanilla/arch/ppc/kernel/ppc8260_pic.c	Thu Dec 13 16:45:43 2001
+++ linuxppc_2_4_devel_hymod/arch/ppc/kernel/ppc8260_pic.c	Wed Jan 16 15:14:31 2002
@@ -85,6 +85,21 @@
 	sipnr[word] = 1 << (31 - bit);
 }

+static void m8260_end_irq(unsigned int irq_nr)
+{
+	if (!(irq_desc[irq_nr].status & (IRQ_DISABLED|IRQ_INPROGRESS))) {
+		int	bit, word;
+		volatile uint	*simr;
+
+		bit = irq_to_siubit[irq_nr];
+		word = irq_to_siureg[irq_nr];
+
+		simr = &(immr->im_intctl.ic_simrh);
+		ppc_cached_irq_mask[word] |= (1 << (31 - bit));
+		simr[word] = ppc_cached_irq_mask[word];
+	}
+}
+
 struct hw_interrupt_type ppc8260_pic = {
 	" 8260 SIU  ",
 	NULL,
@@ -92,6 +107,7 @@
 	m8260_unmask_irq,
 	m8260_mask_irq,
 	m8260_mask_and_ack,
+	m8260_end_irq,
 	0
 };

@@ -106,6 +122,14 @@
          * to get the irq number.         */
         bits = immr->im_intctl.ic_sivec;
         irq = bits >> 26;
+
+	/*
+	 * When we read the sivec without an interrupt to process, we will
+	 * get back a vector of 0.  In this case, return -1
+	 */
+	if (irq == 0)
+		return -1;
+
 #if 0
         irq += ppc8260_pic.irq_offset;
 #endif


** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

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

* Re: get_irq fix for 8260 platform
  2002-01-17  7:15 get_irq fix for 8260 platform Murray Jensen
@ 2002-01-17 16:08 ` Dan Malek
  0 siblings, 0 replies; 2+ messages in thread
From: Dan Malek @ 2002-01-17 16:08 UTC (permalink / raw)
  To: Murray Jensen; +Cc: linuxppc-embedded, Tom Rini


Murray Jensen wrote:

> Hi All, if you have an 8260 and are wondering why the latest revisions of
> the devel kernel hang during boot, then this patch might help you.

Heh :-).  Thanks, I just fixed this yesterday, too.  It appears the 8260
has been neglected for a while, and now that I am doing something with
it again I'll have more updates as well.

I didn't do the 'end' function, but I'll include this.  I'm also thinking
about a real  priority interrupt scheme like was done for the 8xx a month
or so ago.  It's a bit more complicated here, though.

Thanks again.


	-- Dan


** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

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

end of thread, other threads:[~2002-01-17 16:08 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-01-17  7:15 get_irq fix for 8260 platform Murray Jensen
2002-01-17 16:08 ` Dan Malek

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).