From 788c03c3d8ac06d5ab9e7e6801a9b19337f7a763 Mon Sep 17 00:00:00 2001 From: "Bjoern A. Zeeb" Date: Wed, 2 Mar 2016 15:26:55 +0000 Subject: [PATCH] Add gem5 support, so we attach there as well. Fix the boundary limit to end at the end of the region and not one beyond (1). Diagnosed by: andrew (1) Reviewed by: andrew, br Sponsored by: DARPA/AFRL Differential Revision: https://reviews.freebsd.org/D5493 --- sys/dev/pci/pci_host_generic.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/sys/dev/pci/pci_host_generic.c b/sys/dev/pci/pci_host_generic.c index 8335383111e2..f0c8d45dca0f 100644 --- a/sys/dev/pci/pci_host_generic.c +++ b/sys/dev/pci/pci_host_generic.c @@ -143,6 +143,10 @@ generic_pcie_probe(device_t dev) device_set_desc(dev, "Generic PCI host controller"); return (BUS_PROBE_GENERIC); } + if (ofw_bus_is_compatible(dev, "arm,gem5_pcie")) { + device_set_desc(dev, "GEM5 PCIe host controller"); + return (BUS_PROBE_DEFAULT); + } return (ENXIO); } @@ -208,12 +212,11 @@ pci_host_generic_attach(device_t dev) continue; /* empty range element */ if (sc->ranges[tuple].flags & FLAG_MEM) { error = rman_manage_region(&sc->mem_rman, - phys_base, - phys_base + size); + phys_base, phys_base + size - 1); } else if (sc->ranges[tuple].flags & FLAG_IO) { error = rman_manage_region(&sc->io_rman, - pci_base + PCI_IO_WINDOW_OFFSET, - pci_base + PCI_IO_WINDOW_OFFSET + size); + pci_base + PCI_IO_WINDOW_OFFSET, + pci_base + PCI_IO_WINDOW_OFFSET + size - 1); } else continue; if (error) {