svn commit: r257522 - in stable/10/sys: dev/fdt mips/beri

Brooks Davis brooks at FreeBSD.org
Fri Nov 1 20:28:15 UTC 2013


Author: brooks
Date: Fri Nov  1 20:28:13 2013
New Revision: 257522
URL: http://svnweb.freebsd.org/changeset/base/257522

Log:
  MFC r256911, r256936
  
  MFP4: 223121 (PIC portion), 225861, 227822, 229692 (PIC only), 229693,
  230523, 1123614
  
  Implement a driver for Robert Norton's PIC as an FDT interrupt
  controller.  Devices whose interrupt-parent property points to a beripic
  
  device will have their interrupt allocation, activation, and setup
  operations routed through the IC rather than down the traditional bus
  hierarchy.
  
  This driver largely abstracts the underlying CPU away allowing the
  PIC to be implemented on CPU's other than BERI.  Due to insufficient
  abstractions a small amount of MIPS specific code is currently required
  in fdt_mips.c and to implement counters.
  
  Sponsored by:	DARPA/AFRL
  Approved by:	re (gjb)

Added:
  stable/10/sys/mips/beri/beri_pic.c
     - copied, changed from r256911, head/sys/mips/beri/beri_pic.c
Modified:
  stable/10/sys/dev/fdt/fdt_mips.c
  stable/10/sys/mips/beri/files.beri
Directory Properties:
  stable/10/sys/   (props changed)

Modified: stable/10/sys/dev/fdt/fdt_mips.c
==============================================================================
--- stable/10/sys/dev/fdt/fdt_mips.c	Fri Nov  1 19:50:30 2013	(r257521)
+++ stable/10/sys/dev/fdt/fdt_mips.c	Fri Nov  1 20:28:13 2013	(r257522)
@@ -68,7 +68,26 @@ fdt_pic_decode_mips4k_cp0(phandle_t node
 	return (0);
 }
 
+/*
+ * CHERI PIC decoder.
+ */
+static int
+fdt_pic_decode_beri(phandle_t node, pcell_t *intr, int *interrupt,
+    int *trig, int *pol)
+{
+
+	if (!fdt_is_compatible(node, "sri-cambridge,beri-pic"))
+		return (ENXIO);
+
+	*interrupt = fdt32_to_cpu(intr[0]);
+	*trig = INTR_TRIGGER_CONFORM;
+	*pol = INTR_POLARITY_CONFORM;
+
+	return (0);
+}
+
 fdt_pic_decode_t fdt_pic_table[] = {
 	&fdt_pic_decode_mips4k_cp0,
+	&fdt_pic_decode_beri,
 	NULL
 };

Copied and modified: stable/10/sys/mips/beri/beri_pic.c (from r256911, head/sys/mips/beri/beri_pic.c)
==============================================================================
--- head/sys/mips/beri/beri_pic.c	Tue Oct 22 15:29:59 2013	(r256911, copy source)
+++ stable/10/sys/mips/beri/beri_pic.c	Fri Nov  1 20:28:13 2013	(r257522)
@@ -646,15 +646,9 @@ beripic_send_ipi(device_t ic, u_int tid)
 
 	KASSERT(tid < sc->bp_nsoft, ("tid (%d) too large\n", tid));
 
-	printf("sending ipi to %d soft intrs %jx\n", tid,
-	    bus_space_read_8(sc->bp_read_bst, sc->bp_read_bsh, 8));
-
 	bit = 1ULL << (tid % 64);
 	bus_space_write_8(sc->bp_set_bst, sc->bp_set_bsh, 
 	    (BP_FIRST_SOFT / 8) + (tid / 64), bit);
-
-	printf("sent ipi to %d soft intrs %jx\n", tid,
-	    bus_space_read_8(sc->bp_read_bst, sc->bp_read_bsh, 8));
 }
 
 static void

Modified: stable/10/sys/mips/beri/files.beri
==============================================================================
--- stable/10/sys/mips/beri/files.beri	Fri Nov  1 19:50:30 2013	(r257521)
+++ stable/10/sys/mips/beri/files.beri	Fri Nov  1 20:28:13 2013	(r257522)
@@ -17,5 +17,6 @@ dev/terasic/mtl/terasic_mtl_reg.c	option
 dev/terasic/mtl/terasic_mtl_syscons.c	optional terasic_mtl
 dev/terasic/mtl/terasic_mtl_text.c	optional terasic_mtl
 mips/beri/beri_machdep.c		standard
+mips/beri/beri_pic.c			optional fdt
 mips/mips/intr_machdep.c		standard
 mips/mips/tick.c			standard


More information about the svn-src-all mailing list