Page MenuHomeFreeBSD

D17601.id49446.diff
No OneTemporary

D17601.id49446.diff

Index: head/sys/powerpc/powernv/opal_pci.c
===================================================================
--- head/sys/powerpc/powernv/opal_pci.c
+++ head/sys/powerpc/powernv/opal_pci.c
@@ -96,6 +96,9 @@
static void opalpic_pic_enable(device_t dev, u_int irq, u_int vector);
static void opalpic_pic_eoi(device_t dev, u_int irq);
+/* Bus interface */
+static bus_dma_tag_t opalpci_get_dma_tag(device_t dev, device_t child);
+
/*
* Commands
*/
@@ -119,6 +122,8 @@
*/
#define OPAL_PCI_DEFAULT_PE 1
+#define OPAL_PCI_BUS_SPACE_LOWADDR_32BIT 0x7FFFFFFFUL
+
/*
* Driver methods.
*/
@@ -142,6 +147,9 @@
DEVMETHOD(pic_enable, opalpic_pic_enable),
DEVMETHOD(pic_eoi, opalpic_pic_eoi),
+ /* Bus interface */
+ DEVMETHOD(bus_get_dma_tag, opalpci_get_dma_tag),
+
DEVMETHOD_END
};
@@ -424,6 +432,23 @@
msi_ranges[1], msi_ranges[0]);
}
+ /* Create the parent DMA tag */
+ err = bus_dma_tag_create(bus_get_dma_tag(dev), /* parent */
+ 1, 0, /* alignment, bounds */
+ OPAL_PCI_BUS_SPACE_LOWADDR_32BIT, /* lowaddr */
+ BUS_SPACE_MAXADDR_32BIT, /* highaddr */
+ NULL, NULL, /* filter, filterarg */
+ BUS_SPACE_MAXSIZE, /* maxsize */
+ BUS_SPACE_UNRESTRICTED, /* nsegments */
+ BUS_SPACE_MAXSIZE, /* maxsegsize */
+ 0, /* flags */
+ NULL, NULL, /* lockfunc, lockarg */
+ &sc->ofw_sc.sc_dmat);
+ if (err != 0) {
+ device_printf(dev, "Failed to create DMA tag\n");
+ return (err);
+ }
+
/*
* General OFW PCI attach
*/
@@ -660,4 +685,13 @@
opal_call(OPAL_PCI_MSI_EOI, sc->phb_id, irq);
PIC_EOI(root_pic, irq);
+}
+
+static bus_dma_tag_t
+opalpci_get_dma_tag(device_t dev, device_t child)
+{
+ struct opalpci_softc *sc;
+
+ sc = device_get_softc(dev);
+ return (sc->ofw_sc.sc_dmat);
}

File Metadata

Mime Type
text/plain
Expires
Mon, May 18, 11:36 AM (11 h, 2 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
33237974
Default Alt Text
D17601.id49446.diff (1 KB)

Event Timeline