Author: marcel
Date: Wed Jun 23 23:16:27 2010
New Revision: 209489
URL: http://svn.freebsd.org/changeset/base/209489

Log:
  With openpic(4) using active-low as the default polarity, reconfigure
  the internal interrupt sources as active-high. The internal interrupt
  sources are disabled when programmed as active-low.
  
  Note that the internal interrupts have no sense bit like the external
  interrupts. We program them as edge-triggered to make sure we write a
  0 value to a reserved register. It does not in any way say anything
  about the sense of internal interrupt.

Modified:
  head/sys/powerpc/mpc85xx/ocpbus.c

Modified: head/sys/powerpc/mpc85xx/ocpbus.c
==============================================================================
--- head/sys/powerpc/mpc85xx/ocpbus.c   Wed Jun 23 23:07:57 2010        
(r209488)
+++ head/sys/powerpc/mpc85xx/ocpbus.c   Wed Jun 23 23:16:27 2010        
(r209489)
@@ -277,8 +277,15 @@ ocpbus_attach(device_t dev)
                    ccsr_read4(OCP85XX_PORDEVSR),
                    ccsr_read4(OCP85XX_PORDEVSR2));
 
-       for (i = INTR_VEC(OPIC_ID, 0); i < INTR_VEC(OPIC_ID, 4); i++)
-               powerpc_config_intr(i, INTR_TRIGGER_LEVEL, INTR_POLARITY_LOW);
+       /*
+        * Internal interrupt are always active-high. Since the sense cannot
+        * be specified, we program as edge-triggered to make sure we write
+        * a 0 value to the reserved bit in the OpenPIC compliant PIC. This
+        * is not to say anything about the sense of any of the internal
+        * interrupt sources.
+        */
+       for (i = PIC_IRQ_INT(0); i < PIC_IRQ_INT(32); i++)
+               powerpc_config_intr(i, INTR_TRIGGER_EDGE, INTR_POLARITY_HIGH);
 
        return (bus_generic_attach(dev));
 }
_______________________________________________
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to