aboutsummaryrefslogtreecommitdiff
path: root/src/arch/x86
diff options
context:
space:
mode:
authorMichael Brown <mcb30@ipxe.org>2020-09-24 21:45:03 +0100
committerMichael Brown <mcb30@ipxe.org>2020-09-25 14:17:07 +0100
commiteecb75ba4809bd5d3e6d63413a45c5fccbda2bc2 (patch)
treedcb9379c726dd4a02566c6866803fa45d7ee0649 /src/arch/x86
parent371af4eef2dfa1facf6645a5704d8a55ff45c965 (diff)
downloadipxe-eecb75ba4809bd5d3e6d63413a45c5fccbda2bc2.zip
ipxe-eecb75ba4809bd5d3e6d63413a45c5fccbda2bc2.tar.gz
ipxe-eecb75ba4809bd5d3e6d63413a45c5fccbda2bc2.tar.bz2
[pci] Update drivers to use pci_ioremap()
Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/arch/x86')
-rw-r--r--src/arch/x86/drivers/xen/hvm.c6
-rw-r--r--src/arch/x86/drivers/xen/hvm.h2
2 files changed, 6 insertions, 2 deletions
diff --git a/src/arch/x86/drivers/xen/hvm.c b/src/arch/x86/drivers/xen/hvm.c
index 57196f5..311f343 100644
--- a/src/arch/x86/drivers/xen/hvm.c
+++ b/src/arch/x86/drivers/xen/hvm.c
@@ -175,7 +175,7 @@ static void * hvm_ioremap ( struct hvm_device *hvm, unsigned int space,
}
/* Map this space */
- mmio = ioremap ( ( hvm->mmio + hvm->mmio_offset ), len );
+ mmio = pci_ioremap ( hvm->pci, ( hvm->mmio + hvm->mmio_offset ), len );
if ( ! mmio ) {
DBGC ( hvm, "HVM could not map MMIO space [%08lx,%08lx)\n",
( hvm->mmio + hvm->mmio_offset ),
@@ -371,7 +371,8 @@ static int hvm_map_xenstore ( struct hvm_device *hvm ) {
xenstore_phys = ( xenstore_pfn * PAGE_SIZE );
/* Map XenStore */
- hvm->xen.store.intf = ioremap ( xenstore_phys, PAGE_SIZE );
+ hvm->xen.store.intf = pci_ioremap ( hvm->pci, xenstore_phys,
+ PAGE_SIZE );
if ( ! hvm->xen.store.intf ) {
DBGC ( hvm, "HVM could not map XenStore at [%08lx,%08lx)\n",
xenstore_phys, ( xenstore_phys + PAGE_SIZE ) );
@@ -420,6 +421,7 @@ static int hvm_probe ( struct pci_device *pci ) {
rc = -ENOMEM;
goto err_alloc;
}
+ hvm->pci = pci;
hvm->mmio = pci_bar_start ( pci, HVM_MMIO_BAR );
hvm->mmio_len = pci_bar_size ( pci, HVM_MMIO_BAR );
DBGC2 ( hvm, "HVM has MMIO space [%08lx,%08lx)\n",
diff --git a/src/arch/x86/drivers/xen/hvm.h b/src/arch/x86/drivers/xen/hvm.h
index 72ed94f..88e4908 100644
--- a/src/arch/x86/drivers/xen/hvm.h
+++ b/src/arch/x86/drivers/xen/hvm.h
@@ -39,6 +39,8 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
struct hvm_device {
/** Xen hypervisor */
struct xen_hypervisor xen;
+ /** PCI device */
+ struct pci_device *pci;
/** CPUID base */
uint32_t cpuid_base;
/** Length of hypercall table */