]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - sys/mips/rmi/xlr_pci.c
Import tzdata 2017c
[FreeBSD/FreeBSD.git] / sys / mips / rmi / xlr_pci.c
1 /*-
2  * Copyright (c) 2003-2009 RMI Corporation
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions
7  * are met:
8  * 1. Redistributions of source code must retain the above copyright
9  *    notice, this list of conditions and the following disclaimer.
10  * 2. Redistributions in binary form must reproduce the above copyright
11  *    notice, this list of conditions and the following disclaimer in the
12  *    documentation and/or other materials provided with the distribution.
13  * 3. Neither the name of RMI Corporation, nor the names of its contributors,
14  *    may be used to endorse or promote products derived from this software
15  *    without specific prior written permission.
16  *
17  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
18  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
21  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27  * SUCH DAMAGE.
28  *
29  * RMI_BSD */
30 #include <sys/cdefs.h>
31 __FBSDID("$FreeBSD$");
32
33 #include <sys/param.h>
34 #include <sys/systm.h>
35 #include <sys/types.h>
36 #include <sys/kernel.h>
37 #include <sys/module.h>
38 #include <sys/malloc.h>
39 #include <sys/bus.h>
40 #include <sys/endian.h>
41 #include <sys/rman.h>
42
43 #include <vm/vm.h>
44 #include <vm/vm_param.h>
45 #include <vm/pmap.h>
46
47 #include <dev/pci/pcivar.h>
48 #include <dev/pci/pcireg.h>
49
50 #include <machine/bus.h>
51 #include <machine/md_var.h>
52 #include <machine/intr_machdep.h>
53 #include <machine/cpuregs.h>
54
55 #include <mips/rmi/rmi_mips_exts.h>
56 #include <mips/rmi/interrupt.h>
57 #include <mips/rmi/iomap.h>
58 #include <mips/rmi/pic.h>
59 #include <mips/rmi/board.h>
60 #include <mips/rmi/pcibus.h>
61
62 #include "pcib_if.h"
63 #include <dev/pci/pcib_private.h>
64
65 #define pci_cfg_offset(bus,slot,devfn,where) (((bus)<<16) + ((slot) << 11)+((devfn)<<8)+(where))
66 #define PCIE_LINK_STATE    0x4000
67
68 #define LSU_CFG0_REGID       0
69 #define LSU_CERRLOG_REGID    9
70 #define LSU_CERROVF_REGID    10
71 #define LSU_CERRINT_REGID    11
72
73 /* MSI support */
74 #define MSI_MIPS_ADDR_DEST              0x000ff000
75 #define MSI_MIPS_ADDR_RH                0x00000008
76 #define MSI_MIPS_ADDR_RH_OFF            0x00000000
77 #define MSI_MIPS_ADDR_RH_ON             0x00000008
78 #define MSI_MIPS_ADDR_DM                0x00000004
79 #define MSI_MIPS_ADDR_DM_PHYSICAL       0x00000000
80 #define MSI_MIPS_ADDR_DM_LOGICAL        0x00000004
81
82 /* Fields in data for Intel MSI messages. */
83 #define MSI_MIPS_DATA_TRGRMOD           0x00008000      /* Trigger mode */
84 #define MSI_MIPS_DATA_TRGREDG           0x00000000      /* edge */
85 #define MSI_MIPS_DATA_TRGRLVL           0x00008000      /* level */
86
87 #define MSI_MIPS_DATA_LEVEL             0x00004000      /* Polarity. */
88 #define MSI_MIPS_DATA_DEASSERT          0x00000000
89 #define MSI_MIPS_DATA_ASSERT            0x00004000
90
91 #define MSI_MIPS_DATA_DELMOD            0x00000700      /* Delivery Mode */
92 #define MSI_MIPS_DATA_DELFIXED          0x00000000      /* fixed */
93 #define MSI_MIPS_DATA_DELLOPRI          0x00000100      /* lowest priority */
94
95 #define MSI_MIPS_DATA_INTVEC            0x000000ff
96
97 /*
98  * Build Intel MSI message and data values from a source.  AMD64 systems
99  * seem to be compatible, so we use the same function for both.
100  */
101 #define MIPS_MSI_ADDR(cpu)                                             \
102         (MSI_MIPS_ADDR_BASE | (cpu) << 12 |                            \
103          MSI_MIPS_ADDR_RH_OFF | MSI_MIPS_ADDR_DM_PHYSICAL)
104
105 #define MIPS_MSI_DATA(irq)                                             \
106         (MSI_MIPS_DATA_TRGRLVL | MSI_MIPS_DATA_DELFIXED |              \
107          MSI_MIPS_DATA_ASSERT | (irq))
108
109 struct xlr_pcib_softc {
110         bus_dma_tag_t   sc_pci_dmat;    /* PCI DMA tag pointer */
111 };
112
113 static devclass_t pcib_devclass;
114 static void *xlr_pci_config_base;
115 static struct rman irq_rman, port_rman, mem_rman;
116
117 static void
118 xlr_pci_init_resources(void)
119 {
120
121         irq_rman.rm_start = 0;
122         irq_rman.rm_end = 255;
123         irq_rman.rm_type = RMAN_ARRAY;
124         irq_rman.rm_descr = "PCI Mapped Interrupts";
125         if (rman_init(&irq_rman)
126             || rman_manage_region(&irq_rman, 0, 255))
127                 panic("pci_init_resources irq_rman");
128
129         port_rman.rm_type = RMAN_ARRAY;
130         port_rman.rm_descr = "I/O ports";
131         if (rman_init(&port_rman)
132             || rman_manage_region(&port_rman, 0x10000000, 0x1fffffff))
133                 panic("pci_init_resources port_rman");
134
135         mem_rman.rm_type = RMAN_ARRAY;
136         mem_rman.rm_descr = "I/O memory";
137         if (rman_init(&mem_rman)
138             || rman_manage_region(&mem_rman, 0xd0000000, 0xdfffffff))
139                 panic("pci_init_resources mem_rman");
140 }
141
142 static int
143 xlr_pcib_probe(device_t dev)
144 {
145
146         if (xlr_board_info.is_xls)
147                 device_set_desc(dev, "XLS PCIe bus");
148         else
149                 device_set_desc(dev, "XLR PCI bus");
150
151         xlr_pci_init_resources();
152         xlr_pci_config_base = (void *)MIPS_PHYS_TO_KSEG1(DEFAULT_PCI_CONFIG_BASE);
153
154         return (0);
155 }
156
157 static int
158 xlr_pcib_read_ivar(device_t dev, device_t child, int which, uintptr_t *result)
159 {
160
161         switch (which) {
162         case PCIB_IVAR_DOMAIN:
163                 *result = 0;
164                 return (0);
165         case PCIB_IVAR_BUS:
166                 *result = 0;
167                 return (0);
168         }
169         return (ENOENT);
170 }
171
172 static int
173 xlr_pcib_write_ivar(device_t dev, device_t child, int which, uintptr_t result)
174 {
175         switch (which) {
176         case PCIB_IVAR_DOMAIN:
177                 return (EINVAL);
178         case PCIB_IVAR_BUS:
179                 return (EINVAL);
180         }
181         return (ENOENT);
182 }
183
184 static int
185 xlr_pcib_maxslots(device_t dev)
186 {
187
188         return (PCI_SLOTMAX);
189 }
190
191 static __inline__ void 
192 disable_and_clear_cache_error(void)
193 {
194         uint64_t lsu_cfg0;
195
196         lsu_cfg0 = read_xlr_ctrl_register(CPU_BLOCKID_LSU, LSU_CFG0_REGID);
197         lsu_cfg0 = lsu_cfg0 & ~0x2e;
198         write_xlr_ctrl_register(CPU_BLOCKID_LSU, LSU_CFG0_REGID, lsu_cfg0);
199         /* Clear cache error log */
200         write_xlr_ctrl_register(CPU_BLOCKID_LSU, LSU_CERRLOG_REGID, 0);
201 }
202
203 static __inline__ void 
204 clear_and_enable_cache_error(void)
205 {
206         uint64_t lsu_cfg0 = 0;
207
208         /* first clear the cache error logging register */
209         write_xlr_ctrl_register(CPU_BLOCKID_LSU, LSU_CERRLOG_REGID, 0);
210         write_xlr_ctrl_register(CPU_BLOCKID_LSU, LSU_CERROVF_REGID, 0);
211         write_xlr_ctrl_register(CPU_BLOCKID_LSU, LSU_CERRINT_REGID, 0);
212
213         lsu_cfg0 = read_xlr_ctrl_register(CPU_BLOCKID_LSU, LSU_CFG0_REGID);
214         lsu_cfg0 = lsu_cfg0 | 0x2e;
215         write_xlr_ctrl_register(CPU_BLOCKID_LSU, LSU_CFG0_REGID, lsu_cfg0);
216 }
217
218 static uint32_t 
219 pci_cfg_read_32bit(uint32_t addr)
220 {
221         uint32_t temp = 0;
222         uint32_t *p = (uint32_t *)xlr_pci_config_base + addr / sizeof(uint32_t);
223         uint64_t cerr_cpu_log = 0;
224
225         disable_and_clear_cache_error();
226         temp = bswap32(*p);
227
228         /* Read cache err log */
229         cerr_cpu_log = read_xlr_ctrl_register(CPU_BLOCKID_LSU,
230             LSU_CERRLOG_REGID);
231         if (cerr_cpu_log) {
232                 /* Device don't exist. */
233                 temp = ~0x0;
234         }
235         clear_and_enable_cache_error();
236         return (temp);
237 }
238
239 static u_int32_t
240 xlr_pcib_read_config(device_t dev, u_int b, u_int s, u_int f,
241                         u_int reg, int width)
242 {
243         uint32_t data = 0;
244
245         if ((width == 2) && (reg & 1))
246                 return 0xFFFFFFFF;
247         else if ((width == 4) && (reg & 3))
248                 return 0xFFFFFFFF;
249
250         data = pci_cfg_read_32bit(pci_cfg_offset(b, s, f, reg));
251
252         if (width == 1)
253                 return ((data >> ((reg & 3) << 3)) & 0xff);
254         else if (width == 2)
255                 return ((data >> ((reg & 3) << 3)) & 0xffff);
256         else
257                 return (data);
258 }
259
260 static void
261 xlr_pcib_write_config(device_t dev, u_int b, u_int s, u_int f,
262                 u_int reg, u_int32_t val, int width)
263 {
264         uint32_t cfgaddr = pci_cfg_offset(b, s, f, reg);
265         uint32_t data = 0, *p;
266
267         if ((width == 2) && (reg & 1))
268                 return;
269         else if ((width == 4) && (reg & 3))
270                 return;
271
272         if (width == 1) {
273                 data = pci_cfg_read_32bit(cfgaddr);
274                 data = (data & ~(0xff << ((reg & 3) << 3))) |
275                     (val << ((reg & 3) << 3));
276         } else if (width == 2) {
277                 data = pci_cfg_read_32bit(cfgaddr);
278                 data = (data & ~(0xffff << ((reg & 3) << 3))) |
279                     (val << ((reg & 3) << 3));
280         } else {
281                 data = val;
282         }
283
284         p = (uint32_t *)xlr_pci_config_base + cfgaddr / sizeof(uint32_t);
285         *p = bswap32(data);
286
287         return;
288 }
289
290 static int 
291 xlr_pcib_attach(device_t dev)
292 {
293         struct xlr_pcib_softc *sc;
294         sc = device_get_softc(dev);
295         
296         /*
297          * XLR C revision chips cannot do DMA above 2G physical address
298          * create a parent tag with this lowaddr
299          */
300         if (xlr_is_c_revision()) {
301                 if (bus_dma_tag_create(bus_get_dma_tag(dev), 1, 0,
302                     0x7fffffff, ~0, NULL, NULL, 0x7fffffff,
303                     0xff, 0x7fffffff, 0, NULL, NULL, &sc->sc_pci_dmat) != 0)
304                         panic("%s: bus_dma_tag_create failed", __func__);
305         }
306         device_add_child(dev, "pci", -1);
307         bus_generic_attach(dev);
308         return (0);
309 }
310
311 static void
312 xlr_pcib_identify(driver_t * driver, device_t parent)
313 {
314
315         BUS_ADD_CHILD(parent, 0, "pcib", 0);
316 }
317
318 /*
319  * XLS PCIe can have upto 4 links, and each link has its on IRQ
320  * Find the link on which the device is on 
321  */
322 static int
323 xls_pcie_link(device_t pcib, device_t dev)
324 {
325         device_t parent, tmp;
326
327         /* find the lane on which the slot is connected to */
328         printf("xls_pcie_link : bus %s dev %s\n", device_get_nameunit(pcib),
329                 device_get_nameunit(dev));
330         tmp = dev;
331         while (1) {
332                 parent = device_get_parent(tmp);
333                 if (parent == NULL || parent == pcib) {
334                         device_printf(dev, "Cannot find parent bus\n");
335                         return (-1);
336                 }
337                 if (strcmp(device_get_nameunit(parent), "pci0") == 0)
338                         break;
339                 tmp = parent;
340         }
341         return (pci_get_slot(tmp));
342 }
343
344 /*
345  * Find the IRQ for the link, each link has a different interrupt 
346  * at the XLS pic
347  */
348 static int
349 xls_pcie_link_irq(int link)
350 {
351
352         switch (link) {
353         case 0:
354                 return (PIC_PCIE_LINK0_IRQ);
355         case 1:
356                 return (PIC_PCIE_LINK1_IRQ);
357         case 2:
358                 if (xlr_is_xls_b0())
359                         return (PIC_PCIE_B0_LINK2_IRQ);
360                 else
361                         return (PIC_PCIE_LINK2_IRQ);
362         case 3:
363                 if (xlr_is_xls_b0())
364                         return (PIC_PCIE_B0_LINK3_IRQ);
365                 else
366                         return (PIC_PCIE_LINK3_IRQ);
367         }
368         return (-1);
369 }
370
371 static int
372 xlr_alloc_msi(device_t pcib, device_t dev, int count, int maxcount, int *irqs)
373 {
374         int i, link;
375
376         /*
377          * Each link has 32 MSIs that can be allocated, but for now
378          * we only support one device per link.
379          * msi_alloc() equivalent is needed when we start supporting 
380          * bridges on the PCIe link.
381          */
382         link = xls_pcie_link(pcib, dev);
383         if (link == -1)
384                 return (ENXIO);
385
386         /*
387          * encode the irq so that we know it is a MSI interrupt when we
388          * setup interrupts
389          */
390         for (i = 0; i < count; i++)
391                 irqs[i] = 64 + link * 32 + i;
392
393         return (0);
394 }
395
396 static int
397 xlr_release_msi(device_t pcib, device_t dev, int count, int *irqs)
398 {
399         device_printf(dev, "%s: msi release %d\n", device_get_nameunit(pcib),
400             count);
401         return (0);
402 }
403
404 static int
405 xlr_map_msi(device_t pcib, device_t dev, int irq, uint64_t *addr,
406     uint32_t *data)
407 {
408         int msi;
409
410         if (irq >= 64) {
411                 msi = irq - 64;
412                 *addr = MIPS_MSI_ADDR(0);
413                 *data = MIPS_MSI_DATA(msi);
414                 return (0);
415         } else {
416                 device_printf(dev, "%s: map_msi for irq %d  - ignored", 
417                     device_get_nameunit(pcib), irq);
418                 return (ENXIO);
419         }
420 }
421
422 static void
423 bridge_pcix_ack(int irq)
424 {
425
426         (void)xlr_read_reg(xlr_io_mmio(XLR_IO_PCIX_OFFSET), 0x140 >> 2);
427 }
428
429 static void
430 bridge_pcie_ack(int irq)
431 {
432         uint32_t reg;
433         xlr_reg_t *pcie_mmio_le = xlr_io_mmio(XLR_IO_PCIE_1_OFFSET);
434
435         switch (irq) {
436         case PIC_PCIE_LINK0_IRQ:
437                 reg = PCIE_LINK0_MSI_STATUS;
438                 break;
439         case PIC_PCIE_LINK1_IRQ:
440                 reg = PCIE_LINK1_MSI_STATUS;
441                 break;
442         case PIC_PCIE_LINK2_IRQ:
443         case PIC_PCIE_B0_LINK2_IRQ:
444                 reg = PCIE_LINK2_MSI_STATUS;
445                 break;
446         case PIC_PCIE_LINK3_IRQ:
447         case PIC_PCIE_B0_LINK3_IRQ:
448                 reg = PCIE_LINK3_MSI_STATUS;
449                 break;
450         default:
451                 return;
452         }
453         xlr_write_reg(pcie_mmio_le, reg>>2, 0xffffffff);
454 }
455
456 static int
457 mips_platform_pci_setup_intr(device_t dev, device_t child,
458     struct resource *irq, int flags, driver_filter_t *filt,
459     driver_intr_t *intr, void *arg, void **cookiep)
460 {
461         int error = 0;
462         int xlrirq;
463
464         error = rman_activate_resource(irq);
465         if (error)
466                 return error;
467         if (rman_get_start(irq) != rman_get_end(irq)) {
468                 device_printf(dev, "Interrupt allocation %ju != %ju\n",
469                     rman_get_start(irq), rman_get_end(irq));
470                 return (EINVAL);
471         }
472         xlrirq = rman_get_start(irq);
473
474         if (strcmp(device_get_name(dev), "pcib") != 0)
475                 return (0);
476
477         if (xlr_board_info.is_xls == 0) {
478                 xlr_establish_intr(device_get_name(child), filt,
479                     intr, arg, PIC_PCIX_IRQ, flags, cookiep, bridge_pcix_ack);
480                 pic_setup_intr(PIC_IRT_PCIX_INDEX, PIC_PCIX_IRQ, 0x1, 1);
481         } else {
482                 /* 
483                  * temporary hack for MSI, we support just one device per
484                  * link, and assign the link interrupt to the device interrupt
485                  */
486                 if (xlrirq >= 64) {
487                         xlrirq -= 64;
488                         if (xlrirq % 32 != 0)
489                                 return (0);
490                         xlrirq = xls_pcie_link_irq(xlrirq / 32);
491                         if (xlrirq == -1)
492                                 return (EINVAL);
493                 }
494                 xlr_establish_intr(device_get_name(child), filt,
495                     intr, arg, xlrirq, flags, cookiep, bridge_pcie_ack);
496                 pic_setup_intr(xlrirq - PIC_IRQ_BASE, xlrirq, 0x1, 1);
497         }
498
499         return (bus_generic_setup_intr(dev, child, irq, flags, filt, intr,
500             arg, cookiep));
501 }
502
503 static int
504 mips_platform_pci_teardown_intr(device_t dev, device_t child,
505     struct resource *irq, void *cookie)
506 {
507         if (strcmp(device_get_name(child), "pci") == 0) {
508                 /* if needed reprogram the pic to clear pcix related entry */
509                 device_printf(dev, "teardown intr\n");
510         }
511         return (bus_generic_teardown_intr(dev, child, irq, cookie));
512 }
513
514 static struct resource *
515 xlr_pci_alloc_resource(device_t bus, device_t child, int type, int *rid,
516         rman_res_t start, rman_res_t end, rman_res_t count, u_int flags)
517 {
518         struct rman *rm;
519         struct resource *rv;
520         vm_offset_t va;
521         int needactivate = flags & RF_ACTIVE;
522
523         switch (type) {
524         case SYS_RES_IRQ:
525                 rm = &irq_rman;
526                 break;
527
528         case SYS_RES_IOPORT:
529                 rm = &port_rman;
530                 break;
531
532         case SYS_RES_MEMORY:
533                 rm = &mem_rman;
534                 break;
535
536         default:
537                 return (0);
538         }
539
540         rv = rman_reserve_resource(rm, start, end, count, flags, child);
541         if (rv == NULL)
542                 return (0);
543
544         rman_set_rid(rv, *rid);
545
546         if (type == SYS_RES_MEMORY || type == SYS_RES_IOPORT) {
547                 va = (vm_offset_t)pmap_mapdev(start, count);
548                 rman_set_bushandle(rv, va);
549                 /* bushandle is same as virtual addr */
550                 rman_set_virtual(rv, (void *)va);
551                 rman_set_bustag(rv, rmi_pci_bus_space);
552         }
553
554         if (needactivate) {
555                 if (bus_activate_resource(child, type, *rid, rv)) {
556                         rman_release_resource(rv);
557                         return (NULL);
558                 }
559         }
560         return (rv);
561 }
562
563 static int
564 xlr_pci_release_resource(device_t bus, device_t child, int type, int rid,
565                        struct resource *r)
566 {
567
568         return (rman_release_resource(r));
569 }
570
571 static bus_dma_tag_t
572 xlr_pci_get_dma_tag(device_t bus, device_t child)
573 {
574         struct xlr_pcib_softc *sc;
575
576         sc = device_get_softc(bus);
577         return (sc->sc_pci_dmat);
578 }
579
580 static int
581 xlr_pci_activate_resource(device_t bus, device_t child, int type, int rid,
582                       struct resource *r)
583 {
584
585         return (rman_activate_resource(r));
586 }
587
588 static int
589 xlr_pci_deactivate_resource(device_t bus, device_t child, int type, int rid,
590                           struct resource *r)
591 {
592
593         return (rman_deactivate_resource(r));
594 }
595
596 static int
597 mips_pci_route_interrupt(device_t bus, device_t dev, int pin)
598 {
599         int irq, link;
600
601         /*
602          * Validate requested pin number.
603          */
604         if ((pin < 1) || (pin > 4))
605                 return (255);
606
607         if (xlr_board_info.is_xls) {
608                 link = xls_pcie_link(bus, dev);
609                 irq = xls_pcie_link_irq(link);
610                 if (irq != -1)
611                         return (irq);
612         } else {
613                 if (pin == 1)
614                         return (PIC_PCIX_IRQ);
615         }
616
617         return (255);
618 }
619
620 static device_method_t xlr_pcib_methods[] = {
621         /* Device interface */
622         DEVMETHOD(device_identify, xlr_pcib_identify),
623         DEVMETHOD(device_probe, xlr_pcib_probe),
624         DEVMETHOD(device_attach, xlr_pcib_attach),
625
626         /* Bus interface */
627         DEVMETHOD(bus_read_ivar, xlr_pcib_read_ivar),
628         DEVMETHOD(bus_write_ivar, xlr_pcib_write_ivar),
629         DEVMETHOD(bus_alloc_resource, xlr_pci_alloc_resource),
630         DEVMETHOD(bus_release_resource, xlr_pci_release_resource),
631         DEVMETHOD(bus_get_dma_tag, xlr_pci_get_dma_tag),
632         DEVMETHOD(bus_activate_resource, xlr_pci_activate_resource),
633         DEVMETHOD(bus_deactivate_resource, xlr_pci_deactivate_resource),
634         DEVMETHOD(bus_setup_intr, mips_platform_pci_setup_intr),
635         DEVMETHOD(bus_teardown_intr, mips_platform_pci_teardown_intr),
636
637         /* pcib interface */
638         DEVMETHOD(pcib_maxslots, xlr_pcib_maxslots),
639         DEVMETHOD(pcib_read_config, xlr_pcib_read_config),
640         DEVMETHOD(pcib_write_config, xlr_pcib_write_config),
641         DEVMETHOD(pcib_route_interrupt, mips_pci_route_interrupt),
642         DEVMETHOD(pcib_request_feature, pcib_request_feature_allow),
643
644         DEVMETHOD(pcib_alloc_msi, xlr_alloc_msi),
645         DEVMETHOD(pcib_release_msi, xlr_release_msi),
646         DEVMETHOD(pcib_map_msi, xlr_map_msi),
647
648         DEVMETHOD_END
649 };
650
651 static driver_t xlr_pcib_driver = {
652         "pcib",
653         xlr_pcib_methods,
654         sizeof(struct xlr_pcib_softc),
655 };
656
657 DRIVER_MODULE(pcib, iodi, xlr_pcib_driver, pcib_devclass, 0, 0);