If PCI_MAP_FIXUP is defined, following fixes will be applied:
commit41f96e698e71a2e79702cc6ec04840b7ed3eebbe
authorsephe <sephe>
Fri, 8 Jun 2007 13:52:09 +0000 (8 13:52 +0000)
committersephe <sephe>
Fri, 8 Jun 2007 13:52:09 +0000 (8 13:52 +0000)
tree5318909686cab49474f57f08ddd838cb74219725
parentc4986d7921a5999a728f803c39c8bc60dae9496e
If PCI_MAP_FIXUP is defined, following fixes will be applied:
- For PCI/PCI bridge, adjust requested IO port/memory's start/range according
  to bridge's base/limit register value.
- For Host/PCI bridge, if requested IO port/memory's starts from 0 and range
  is ~0,
  o  If the request is for IO port, the start address is set to 0x1000.
  o  If the request is for IO memory, the start address is set to tunable
     hw.pci.host_mem_start, which is 0x80000000 by default.

This unbreaks cardbus bridge support, if PCI_MAP_FIXUP is defined.

My laptop's cardbus bridge is on the PCI bus mastered by a PCI/PCI bridge,
while swildner@'s laptop's cardbus bridge is on the PCI bus mastered by
Host/PCI bridge.

Tested-by: swildner@ and me
Obtained-from: FreeBSD (imp@freebsd.org)

#
# It seems BIOS does not set cardbus bridge's BAR for most of the system,
# so in the original code, the resource_list_alloc() in pci_alloc_resource()
# will return NULL for cardbus bridge's IO memory allocation request; cardbus
# bridge's code actually depends on that to reallocate IO memory using
# hw.cbb.start_memory as start address.
#
# Before this commit, if PCI_MAP_FIXUP is defined, cardbus bridge's invalid
# IO memory request will be delivered to various PCI bridge code, which does
# not validate/fixup the request and returns "successful" result bindly.
#
sys/bus/pci/i386/pcibus.c
sys/bus/pci/pci_pcib.c