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
This commit is contained in:
Bjoern A. Zeeb 2016-03-02 15:26:55 +00:00
parent 3d9ac4ecfc
commit 788c03c3d8
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=296316

View File

@ -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) {