diff --git a/sys/boot/fdt/dts/mips/xlp-basic.dts b/sys/boot/fdt/dts/mips/xlp-basic.dts index a66c11d67e17..18cb04c927d0 100644 --- a/sys/boot/fdt/dts/mips/xlp-basic.dts +++ b/sys/boot/fdt/dts/mips/xlp-basic.dts @@ -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>; }; diff --git a/sys/mips/nlm/intr_machdep.c b/sys/mips/nlm/intr_machdep.c index 84a5fbb5f8ff..442cdced9a2f 100644 --- a/sys/mips/nlm/intr_machdep.c +++ b/sys/mips/nlm/intr_machdep.c @@ -35,6 +35,10 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include + +#include +#include #include #include @@ -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);