Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 26 Feb 2015 02:05:46 +0000 (UTC)
From:      "Jayachandran C." <jchandra@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r279305 - in head/sys: boot/fdt/dts/mips mips/nlm
Message-ID:  <201502260205.t1Q25ktg073943@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jchandra
Date: Thu Feb 26 02:05:45 2015
New Revision: 279305
URL: https://svnweb.freebsd.org/changeset/base/279305

Log:
  Add netlogic,xlp-pic as interrupt controller for XLP
  
  Add an empty driver for netlogic,xlp-pic to ensure that the device tree
  is correct and has an interrupt controller.

Modified:
  head/sys/boot/fdt/dts/mips/xlp-basic.dts
  head/sys/mips/nlm/intr_machdep.c

Modified: head/sys/boot/fdt/dts/mips/xlp-basic.dts
==============================================================================
--- head/sys/boot/fdt/dts/mips/xlp-basic.dts	Thu Feb 26 01:53:24 2015	(r279304)
+++ head/sys/boot/fdt/dts/mips/xlp-basic.dts	Thu Feb 26 02:05:45 2015	(r279305)
@@ -47,12 +47,21 @@
 		ranges = <0x0 0x18000000 0x04000000>;
 		bus-frequency = <0>;
 
+		pic: pic@4000 {
+			compatible = "netlogic,xlp-pic";
+			interrupt-controller;
+			#address-cells = <0>;
+			#interrupt-cells = <1>;
+			reg = <0x4000 0x200>;
+		};
+
 		serial0: serial@30100 {
 			compatible = "ns16550";
 			reg = <0x30100 0x200>;
 			reg-shift = <2>;
 			current-speed = <115200>;
 			clock-frequency = <133000000>;
+			interrupt-parent = <&pic>;
 			interrupts = <9>;
 		};
 

Modified: head/sys/mips/nlm/intr_machdep.c
==============================================================================
--- head/sys/mips/nlm/intr_machdep.c	Thu Feb 26 01:53:24 2015	(r279304)
+++ head/sys/mips/nlm/intr_machdep.c	Thu Feb 26 02:05:45 2015	(r279305)
@@ -35,6 +35,10 @@ __FBSDID("$FreeBSD$");
 #include <sys/bus.h>
 #include <sys/interrupt.h>
 #include <sys/kernel.h>
+#include <sys/module.h>
+
+#include <dev/ofw/ofw_bus.h>
+#include <dev/ofw/ofw_bus_subr.h>
 
 #include <machine/cpu.h>
 #include <machine/cpufunc.h>
@@ -251,3 +255,39 @@ cpu_init_interrupts()
 		mips_intr_counters[i] = mips_intrcnt_create(name);
 	}
 }
+
+static int	xlp_pic_probe(device_t);
+static int	xlp_pic_attach(device_t);
+
+static int
+xlp_pic_probe(device_t dev)
+{
+
+	if (!ofw_bus_is_compatible(dev, "netlogic,xlp-pic"))
+		return (ENXIO);
+	device_set_desc(dev, "XLP PIC");
+	return (0);
+}
+
+static int
+xlp_pic_attach(device_t dev)
+{
+
+	return (0);
+}
+
+static device_method_t xlp_pic_methods[] = {
+	DEVMETHOD(device_probe,		xlp_pic_probe),
+	DEVMETHOD(device_attach,	xlp_pic_attach),
+
+	DEVMETHOD_END
+};
+
+static driver_t xlp_pic_driver = {
+	"xlp_pic",
+	xlp_pic_methods,
+	1,		/* no softc */
+};
+
+static devclass_t xlp_pic_devclass;
+DRIVER_MODULE(xlp_pic, simplebus, xlp_pic_driver, xlp_pic_devclass, 0, 0);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201502260205.t1Q25ktg073943>