Move the iommu stubs to a generic place, so they are available on all the
platforms. This allows to not depend on the IOMMU macro in AHCI driver. Requested by: kib Suggested by: andrew Reviewed by: kib Sponsored by: Innovate DSbD Differential Revision: https://reviews.freebsd.org/D26887
This commit is contained in:
parent
116bc58260
commit
9729b14985
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=366980
@ -27,8 +27,6 @@
|
|||||||
#include <sys/cdefs.h>
|
#include <sys/cdefs.h>
|
||||||
__FBSDID("$FreeBSD$");
|
__FBSDID("$FreeBSD$");
|
||||||
|
|
||||||
#include "opt_iommu.h"
|
|
||||||
|
|
||||||
#include <sys/param.h>
|
#include <sys/param.h>
|
||||||
#include <sys/module.h>
|
#include <sys/module.h>
|
||||||
#include <sys/systm.h>
|
#include <sys/systm.h>
|
||||||
@ -501,7 +499,6 @@ ahci_pci_attach(device_t dev)
|
|||||||
i++;
|
i++;
|
||||||
ctlr->quirks = ahci_ids[i].quirks;
|
ctlr->quirks = ahci_ids[i].quirks;
|
||||||
|
|
||||||
#ifdef IOMMU
|
|
||||||
if (ctlr->quirks & AHCI_Q_IOMMU_BUSWIDE) {
|
if (ctlr->quirks & AHCI_Q_IOMMU_BUSWIDE) {
|
||||||
/*
|
/*
|
||||||
* The controller issues DMA requests from PCI function 1,
|
* The controller issues DMA requests from PCI function 1,
|
||||||
@ -510,7 +507,6 @@ ahci_pci_attach(device_t dev)
|
|||||||
*/
|
*/
|
||||||
bus_dma_iommu_set_buswide(dev);
|
bus_dma_iommu_set_buswide(dev);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Limit speed for my onboard JMicron external port.
|
/* Limit speed for my onboard JMicron external port.
|
||||||
* It is not eSATA really, limit to SATA 1 */
|
* It is not eSATA really, limit to SATA 1 */
|
||||||
|
@ -33,6 +33,7 @@
|
|||||||
__FBSDID("$FreeBSD$");
|
__FBSDID("$FreeBSD$");
|
||||||
|
|
||||||
#include "opt_bus.h"
|
#include "opt_bus.h"
|
||||||
|
#include "opt_iommu.h"
|
||||||
|
|
||||||
#include <sys/param.h>
|
#include <sys/param.h>
|
||||||
#include <sys/conf.h>
|
#include <sys/conf.h>
|
||||||
@ -785,3 +786,21 @@ bus_dma_template_fill(bus_dma_template_t *t, bus_dma_param_t *kv, u_int count)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef IOMMU
|
||||||
|
bool bus_dma_iommu_set_buswide(device_t dev);
|
||||||
|
int bus_dma_iommu_load_ident(bus_dma_tag_t dmat, bus_dmamap_t map,
|
||||||
|
vm_paddr_t start, vm_size_t length, int flags);
|
||||||
|
|
||||||
|
bool
|
||||||
|
bus_dma_iommu_set_buswide(device_t dev)
|
||||||
|
{
|
||||||
|
return (false);
|
||||||
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
bus_dma_iommu_load_ident(bus_dma_tag_t dmat, bus_dmamap_t map,
|
||||||
|
vm_paddr_t start, vm_size_t length, int flags)
|
||||||
|
{
|
||||||
|
return (0);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
@ -34,7 +34,6 @@
|
|||||||
__FBSDID("$FreeBSD$");
|
__FBSDID("$FreeBSD$");
|
||||||
|
|
||||||
#include "opt_acpi.h"
|
#include "opt_acpi.h"
|
||||||
#include "opt_iommu.h"
|
|
||||||
|
|
||||||
#include <sys/param.h>
|
#include <sys/param.h>
|
||||||
#include <sys/systm.h>
|
#include <sys/systm.h>
|
||||||
@ -268,22 +267,3 @@ bus_dma_tag_destroy(bus_dma_tag_t dmat)
|
|||||||
tc = (struct bus_dma_tag_common *)dmat;
|
tc = (struct bus_dma_tag_common *)dmat;
|
||||||
return (tc->impl->tag_destroy(dmat));
|
return (tc->impl->tag_destroy(dmat));
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef IOMMU
|
|
||||||
bool bus_dma_iommu_set_buswide(device_t dev);
|
|
||||||
int bus_dma_iommu_load_ident(bus_dma_tag_t dmat, bus_dmamap_t map,
|
|
||||||
vm_paddr_t start, vm_size_t length, int flags);
|
|
||||||
|
|
||||||
bool
|
|
||||||
bus_dma_iommu_set_buswide(device_t dev)
|
|
||||||
{
|
|
||||||
return (false);
|
|
||||||
}
|
|
||||||
|
|
||||||
int
|
|
||||||
bus_dma_iommu_load_ident(bus_dma_tag_t dmat, bus_dmamap_t map,
|
|
||||||
vm_paddr_t start, vm_size_t length, int flags)
|
|
||||||
{
|
|
||||||
return (0);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
Loading…
Reference in New Issue
Block a user