PERFORCE change 176863 for review

Rafal Jaworowski raj at FreeBSD.org
Tue Apr 13 15:15:52 UTC 2010


http://p4web.freebsd.org/@@176863?ac=10

Change 176863 by raj at raj_fdt on 2010/04/13 15:15:11

	Provide decoding handler for the legacy CHRP PIC (8259).

Affected files ...

.. //depot/projects/fdt/sys/dev/fdt/fdt_powerpc.c#4 edit

Differences ...

==== //depot/projects/fdt/sys/dev/fdt/fdt_powerpc.c#4 (text+ko) ====

@@ -85,9 +85,37 @@
 fdt_pic_decode_iic(phandle_t node, pcell_t *intr, int *interrupt, int *trig,
     int *pol)
 {
+	if (!fdt_is_compatible(node, "chrp,iic"))
+		return (ENXIO);
+
+	*interrupt = intr[0];
 
-	/* TODO */
-	return (ENXIO);
+	switch (intr[1]) {
+	case 0:
+		/* Active L level */
+		*trig = INTR_TRIGGER_LEVEL;
+		*pol = INTR_POLARITY_LOW;
+		break;
+	case 1:
+		/* Active H level */
+		*trig = INTR_TRIGGER_LEVEL;
+		*pol = INTR_POLARITY_HIGH;
+		break;
+	case 2:
+		/* H to L edge */
+		*trig = INTR_TRIGGER_EDGE;
+		*pol = INTR_POLARITY_LOW;
+		break;
+	case 3:
+		/* L to H edge */
+		*trig = INTR_TRIGGER_EDGE;
+		*pol = INTR_POLARITY_HIGH;
+		break;
+	default:
+		*trig = INTR_TRIGGER_CONFORM;
+		*pol = INTR_POLARITY_CONFORM;
+	}
+	return (0);
 }
 
 static int


More information about the p4-projects mailing list