''%%NEW_PCIB%%'' is a kernel option to enable a "new" PCI-PCI bridge driver. The "new" driver actively manages the resource windows in the PCI-PCI bridge from which resources for child devices are allocated. The "old" driver used whatever ranges the firmware provided. This includes the resources managed include ''%%SYS_RES_MEMORY%%'' and ''%%SYS_RES_IOPORT%%'' for memory and I/O BARs as well as the recently added ''%%PCI_RES_BUS%%'' to manage the PCI bus numbers assigned to secondary buses behind bridges. Currently, the ''%%NEW_PCIB%%'' driver is not enabled on all platforms. The goal of this page is to coordinate making that happen. ===== NEW_PCIB Platforms ===== ^ Platform ^ NEW_PCIB Enabled ^ PCI_RES_BUS Enabled ^ Notes ^ | amd64 | Yes | Yes | | | arm | No | No | | | arm64 | Yes | Yes | | | i386 | Yes | Yes | | | mips | No | No | | | pc98 | Yes | Yes | | | powerpc | Yes | No | | | riscv | Yes | Yes | | | sparc64 | Yes | No | | ===== Steps to support NEW_PCIB ===== To support, the base ''%%NEW_PCIB%%'' driver (which supports managing memory and I/O port windows), the platform specific code needs the following changes: - The Host-PCI bridge drivers need to properly handle ''%%bus_adjust_resource()%%'' calls for ''%%SYS_RES_MEMORY%%'' and ''%%SYS_RES_IOPORT%%'' resources. Typically, this means forwarding the requests up the tree to the device that allocates the resource from a resource manager (''%%struct rman%%''). That driver's ''%%bus_adjust_resource%%'' method should use ''%%rman_adjust_resource()%%''. For an example, see ''%%nexus_adjust_resource()%%'' in ''%%sys/x86/x86/nexus.c%%''. - Any bus drivers that provide resources to child PCI devices (e.g. Host-PCI bridge drivers and any parent devices that the bridge drivers pass ''%%bus_alloc_resource%%'' up to) need to only configure bus space handles and tags in the ''%%bus_activate_resource%%'' and ''%%bus_deactivate_resource%%'' methods. Currently, the ''%%NEW_PCIB%%'' driver relies on the ability to initialize its own resource managers to manage the resource ranges assigned to its I/O windows. When a child device allocates a resource from a PCI-PCI bridge, a resource is allocated from that rman, but that resource is then passed up the tree via ''%%bus_activate_resource%%'' to obtain a bus space tag and handle. This only works if the bus space tag and handle logic is self-contained in ''%%bus_activate_resource%%'' and ''%%bus_deactivate_resource%%''. - Test and then enable in the platform's ''%%DEFAULTS%%'' config file. ===== Steps to support PCI_RES_BUS ===== Once a platform supports the base ''%%NEW_PCIB%%'' driver, the next step is to add support for PCI bus number management. This requires the following changes: - Define a value for ''%%PCI_RES_BUS%%'' in ''%%Project}}