Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F110666410
D32954.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
45 KB
Referenced Files
None
Subscribers
None
D32954.diff
View Options
diff --git a/sys/amd64/conf/DEFAULTS b/sys/amd64/conf/DEFAULTS
--- a/sys/amd64/conf/DEFAULTS
+++ b/sys/amd64/conf/DEFAULTS
@@ -25,6 +25,4 @@
# Default congestion control algorithm
options CC_CUBIC # include CUBIC congestion control
-options NEW_PCIB
-
options NETLINK # netlink(4) support
diff --git a/sys/amd64/include/resource.h b/sys/amd64/include/resource.h
--- a/sys/amd64/include/resource.h
+++ b/sys/amd64/include/resource.h
@@ -39,8 +39,6 @@
#define SYS_RES_DRQ 2 /* isa dma lines */
#define SYS_RES_MEMORY 3 /* i/o memory */
#define SYS_RES_IOPORT 4 /* i/o ports */
-#ifdef NEW_PCIB
#define PCI_RES_BUS 5 /* PCI bus numbers */
-#endif
#endif /* !_MACHINE_RESOURCE_H_ */
diff --git a/sys/arm/conf/DEFAULTS b/sys/arm/conf/DEFAULTS
--- a/sys/arm/conf/DEFAULTS
+++ b/sys/arm/conf/DEFAULTS
@@ -7,5 +7,4 @@
# Default congestion control algorithm
options CC_CUBIC # include CUBIC congestion control
-options NEW_PCIB
options INTRNG # All arm systems use INTRNG these days
diff --git a/sys/arm/include/resource.h b/sys/arm/include/resource.h
--- a/sys/arm/include/resource.h
+++ b/sys/arm/include/resource.h
@@ -40,8 +40,6 @@
#define SYS_RES_MEMORY 3 /* i/o memory */
#define SYS_RES_IOPORT 4 /* i/o ports */
#define SYS_RES_GPIO 5 /* general purpose i/o */
-#ifdef NEW_PCIB
#define PCI_RES_BUS 6 /* PCI bus numbers */
-#endif
#endif /* !_MACHINE_RESOURCE_H_ */
diff --git a/sys/arm64/cavium/thunder_pcie_pem.c b/sys/arm64/cavium/thunder_pcie_pem.c
--- a/sys/arm64/cavium/thunder_pcie_pem.c
+++ b/sys/arm64/cavium/thunder_pcie_pem.c
@@ -254,13 +254,13 @@
static int
thunder_pem_activate_resource(device_t dev, device_t child, struct resource *r)
{
-#if defined(NEW_PCIB) && defined(PCI_RES_BUS)
+#if defined(PCI_RES_BUS)
struct thunder_pem_softc *sc;
sc = device_get_softc(dev);
#endif
switch (rman_get_type(r)) {
-#if defined(NEW_PCIB) && defined(PCI_RES_BUS)
+#if defined(PCI_RES_BUS)
case PCI_RES_BUS:
return (pci_domain_activate_bus(sc->id, child, r));
#endif
@@ -276,13 +276,13 @@
thunder_pem_deactivate_resource(device_t dev, device_t child,
struct resource *r)
{
-#if defined(NEW_PCIB) && defined(PCI_RES_BUS)
+#if defined(PCI_RES_BUS)
struct thunder_pem_softc *sc;
sc = device_get_softc(dev);
#endif
switch (rman_get_type(r)) {
-#if defined(NEW_PCIB) && defined(PCI_RES_BUS)
+#if defined(PCI_RES_BUS)
case PCI_RES_BUS:
return (pci_domain_deactivate_bus(sc->id, child, r));
#endif
@@ -350,13 +350,13 @@
thunder_pem_adjust_resource(device_t dev, device_t child, struct resource *res,
rman_res_t start, rman_res_t end)
{
-#if defined(NEW_PCIB) && defined(PCI_RES_BUS)
+#if defined(PCI_RES_BUS)
struct thunder_pem_softc *sc;
sc = device_get_softc(dev);
#endif
switch (rman_get_type(res)) {
-#if defined(NEW_PCIB) && defined(PCI_RES_BUS)
+#if defined(PCI_RES_BUS)
case PCI_RES_BUS:
return (pci_domain_adjust_bus(sc->id, child, res, start, end));
#endif
@@ -671,7 +671,7 @@
device_t parent_dev;
switch (type) {
-#if defined(NEW_PCIB) && defined(PCI_RES_BUS)
+#if defined(PCI_RES_BUS)
case PCI_RES_BUS:
return (pci_domain_alloc_bus(sc->id, child, rid, start, end,
count, flags));
@@ -718,12 +718,12 @@
thunder_pem_release_resource(device_t dev, device_t child, struct resource *res)
{
device_t parent_dev;
-#if defined(NEW_PCIB) && defined(PCI_RES_BUS)
+#if defined(PCI_RES_BUS)
struct thunder_pem_softc *sc = device_get_softc(dev);
#endif
switch (rman_get_type(res)) {
-#if defined(NEW_PCIB) && defined(PCI_RES_BUS)
+#if defined(PCI_RES_BUS)
case PCI_RES_BUS:
return (pci_domain_release_bus(sc->id, child, res));
#endif
diff --git a/sys/arm64/conf/DEFAULTS b/sys/arm64/conf/DEFAULTS
--- a/sys/arm64/conf/DEFAULTS
+++ b/sys/arm64/conf/DEFAULTS
@@ -15,7 +15,6 @@
# Default congestion control algorithm
options CC_CUBIC # include CUBIC congestion control
-options NEW_PCIB
options INTRNG
options NETLINK # netlink(4) support
diff --git a/sys/arm64/include/resource.h b/sys/arm64/include/resource.h
--- a/sys/arm64/include/resource.h
+++ b/sys/arm64/include/resource.h
@@ -44,9 +44,7 @@
#define SYS_RES_MEMORY 3 /* i/o memory */
#define SYS_RES_IOPORT 4 /* i/o ports */
#define SYS_RES_GPIO 5 /* general purpose i/o */
-#ifdef NEW_PCIB
#define PCI_RES_BUS 6 /* PCI bus numbers */
-#endif
#endif /* !_MACHINE_RESOURCE_H_ */
diff --git a/sys/conf/config.mk b/sys/conf/config.mk
--- a/sys/conf/config.mk
+++ b/sys/conf/config.mk
@@ -59,9 +59,9 @@
opt_wlan.h:
echo "#define IEEE80211_DEBUG 1" > ${.TARGET}
echo "#define IEEE80211_SUPPORT_MESH 1" >> ${.TARGET}
-KERN_OPTS.i386=NEW_PCIB DEV_PCI
-KERN_OPTS.amd64=NEW_PCIB DEV_PCI
-KERN_OPTS.powerpc=NEW_PCIB DEV_PCI
+KERN_OPTS.i386=DEV_PCI
+KERN_OPTS.amd64=DEV_PCI
+KERN_OPTS.powerpc=DEV_PCI
KERN_OPTS=MROUTING IEEE80211_DEBUG \
IEEE80211_SUPPORT_MESH DEV_BPF \
${KERN_OPTS.${MACHINE}} ${KERN_OPTS_EXTRA}
diff --git a/sys/conf/options b/sys/conf/options
--- a/sys/conf/options
+++ b/sys/conf/options
@@ -186,7 +186,6 @@
MFI_DECODE_LOG opt_mfi.h
MPROF_BUFFERS opt_mprof.h
MPROF_HASH_SIZE opt_mprof.h
-NEW_PCIB opt_global.h
NO_ADAPTIVE_MUTEXES opt_adaptive_mutexes.h
NO_ADAPTIVE_RWLOCKS
NO_ADAPTIVE_SX
diff --git a/sys/dev/acpica/acpi_pcib_acpi.c b/sys/dev/acpica/acpi_pcib_acpi.c
--- a/sys/dev/acpica/acpi_pcib_acpi.c
+++ b/sys/dev/acpica/acpi_pcib_acpi.c
@@ -67,9 +67,7 @@
int ap_addr; /* device/func of PCI-Host bridge */
ACPI_BUFFER ap_prt; /* interrupt routing table */
-#ifdef NEW_PCIB
struct pcib_host_resources ap_host_res;
-#endif
};
static int acpi_pcib_acpi_probe(device_t bus);
@@ -95,7 +93,6 @@
device_t child, int type, int *rid,
rman_res_t start, rman_res_t end, rman_res_t count,
u_int flags);
-#ifdef NEW_PCIB
static int acpi_pcib_acpi_adjust_resource(device_t dev,
device_t child, struct resource *r,
rman_res_t start, rman_res_t end);
@@ -107,7 +104,6 @@
static int acpi_pcib_acpi_deactivate_resource(device_t dev,
device_t child, struct resource *r);
#endif
-#endif
static int acpi_pcib_request_feature(device_t pcib, device_t dev,
enum pci_feature feature);
static bus_dma_tag_t acpi_pcib_get_dma_tag(device_t bus, device_t child);
@@ -124,12 +120,8 @@
DEVMETHOD(bus_read_ivar, acpi_pcib_read_ivar),
DEVMETHOD(bus_write_ivar, acpi_pcib_write_ivar),
DEVMETHOD(bus_alloc_resource, acpi_pcib_acpi_alloc_resource),
-#ifdef NEW_PCIB
DEVMETHOD(bus_adjust_resource, acpi_pcib_acpi_adjust_resource),
-#else
- DEVMETHOD(bus_adjust_resource, bus_generic_adjust_resource),
-#endif
-#if defined(NEW_PCIB) && defined(PCI_RES_BUS)
+#if defined(PCI_RES_BUS)
DEVMETHOD(bus_release_resource, acpi_pcib_acpi_release_resource),
DEVMETHOD(bus_activate_resource, acpi_pcib_acpi_activate_resource),
DEVMETHOD(bus_deactivate_resource, acpi_pcib_acpi_deactivate_resource),
@@ -183,7 +175,6 @@
return (0);
}
-#ifdef NEW_PCIB
static ACPI_STATUS
acpi_pcib_producer_handler(ACPI_RESOURCE *res, void *context)
{
@@ -290,9 +281,8 @@
}
return (AE_OK);
}
-#endif
-#if defined(NEW_PCIB) && defined(PCI_RES_BUS)
+#if defined(PCI_RES_BUS)
static bool
get_decoded_bus_range(struct acpi_hpcib_softc *sc, rman_res_t *startp,
rman_res_t *endp)
@@ -371,7 +361,7 @@
ACPI_STATUS status;
static int bus0_seen = 0;
u_int slot, func, busok;
-#if defined(NEW_PCIB) && defined(PCI_RES_BUS)
+#if defined(PCI_RES_BUS)
struct resource *bus_res;
rman_res_t end, start;
int rid;
@@ -421,7 +411,6 @@
sc->ap_addr = -1;
}
-#ifdef NEW_PCIB
/*
* Determine which address ranges this bridge decodes and setup
* resource managers for those ranges.
@@ -435,7 +424,6 @@
device_printf(sc->ap_dev, "failed to parse resources: %s\n",
AcpiFormatException(status));
}
-#endif
/*
* Get our base bus number by evaluating _BBN.
@@ -491,7 +479,7 @@
}
}
-#if defined(NEW_PCIB) && defined(PCI_RES_BUS)
+#if defined(PCI_RES_BUS)
/*
* If nothing else worked, hope that ACPI at least lays out the
* Host-PCI bridges in order and that as a result the next free
@@ -578,7 +566,7 @@
errout:
device_printf(device_get_parent(dev), "couldn't attach pci bus\n");
-#if defined(NEW_PCIB) && defined(PCI_RES_BUS)
+#if defined(PCI_RES_BUS)
pcib_host_res_free(dev, &sc->ap_host_res);
#endif
return (error);
@@ -704,16 +692,13 @@
acpi_pcib_acpi_alloc_resource(device_t dev, device_t child, int type, int *rid,
rman_res_t start, rman_res_t end, rman_res_t count, u_int flags)
{
-#ifdef NEW_PCIB
struct acpi_hpcib_softc *sc;
struct resource *res;
-#endif
#if defined(__i386__) || defined(__amd64__)
start = hostb_alloc_start(type, start, end, count);
#endif
-#ifdef NEW_PCIB
sc = device_get_softc(dev);
#ifdef PCI_RES_BUS
if (type == PCI_RES_BUS)
@@ -734,13 +719,8 @@
res = bus_generic_alloc_resource(dev, child, type, rid, start, end,
count, flags);
return (res);
-#else
- return (bus_generic_alloc_resource(dev, child, type, rid, start, end,
- count, flags));
-#endif
}
-#ifdef NEW_PCIB
int
acpi_pcib_acpi_adjust_resource(device_t dev, device_t child,
struct resource *r, rman_res_t start, rman_res_t end)
@@ -793,7 +773,6 @@
return (bus_generic_deactivate_resource(dev, child, r));
}
#endif
-#endif
static int
acpi_pcib_request_feature(device_t pcib, device_t dev, enum pci_feature feature)
diff --git a/sys/dev/hyperv/pcib/vmbus_pcib.c b/sys/dev/hyperv/pcib/vmbus_pcib.c
--- a/sys/dev/hyperv/pcib/vmbus_pcib.c
+++ b/sys/dev/hyperv/pcib/vmbus_pcib.c
@@ -25,7 +25,6 @@
*/
#include <sys/cdefs.h>
-#ifdef NEW_PCIB
#include "opt_acpi.h"
#include <sys/param.h>
@@ -2042,5 +2041,3 @@
DRIVER_MODULE(vmbus_pcib, vmbus, vmbus_pcib_driver, 0, 0);
MODULE_DEPEND(vmbus_pcib, vmbus, 1, 1, 1);
MODULE_DEPEND(vmbus_pcib, pci, 1, 1, 1);
-
-#endif /* NEW_PCIB */
diff --git a/sys/dev/hyperv/vmbus/vmbus.c b/sys/dev/hyperv/vmbus/vmbus.c
--- a/sys/dev/hyperv/vmbus/vmbus.c
+++ b/sys/dev/hyperv/vmbus/vmbus.c
@@ -1069,15 +1069,12 @@
device_t parent = device_get_parent(dev);
struct resource *res;
-#ifdef NEW_PCIB
if (type == SYS_RES_MEMORY) {
struct vmbus_softc *sc = device_get_softc(dev);
res = pcib_host_res_alloc(&sc->vmbus_mmio_res, child, type,
rid, start, end, count, flags);
- } else
-#endif
- {
+ } else {
res = BUS_ALLOC_RESOURCE(parent, child, type, rid, start,
end, count, flags);
}
@@ -1158,7 +1155,6 @@
return (VMBUS_PCPU_GET(sc, event_tq, cpu));
}
-#ifdef NEW_PCIB
#define VTPM_BASE_ADDR 0xfed40000
#define FOUR_GB (1ULL << 32)
@@ -1375,7 +1371,6 @@
if (hv_fb_res)
hv_fb_res = NULL;
}
-#endif /* NEW_PCIB */
static void
vmbus_identify(driver_t *driver, device_t parent)
@@ -1460,10 +1455,8 @@
if (sc->vmbus_flags & VMBUS_FLAG_ATTACHED)
return (0);
-#ifdef NEW_PCIB
vmbus_get_mmio_res(sc->vmbus_dev);
vmbus_fb_mmio_res(sc->vmbus_dev);
-#endif
sc->vmbus_flags |= VMBUS_FLAG_ATTACHED;
@@ -1681,9 +1674,7 @@
mtx_destroy(&sc->vmbus_prichan_lock);
mtx_destroy(&sc->vmbus_chan_lock);
-#ifdef NEW_PCIB
vmbus_free_mmio_res(dev);
-#endif
#if defined(__aarch64__)
bus_release_resource(device_get_parent(dev), SYS_RES_IRQ, sc->vector,
diff --git a/sys/dev/hyperv/vmbus/vmbus_var.h b/sys/dev/hyperv/vmbus/vmbus_var.h
--- a/sys/dev/hyperv/vmbus/vmbus_var.h
+++ b/sys/dev/hyperv/vmbus/vmbus_var.h
@@ -127,10 +127,8 @@
struct intr_config_hook vmbus_intrhook;
-#ifdef NEW_PCIB
/* The list of usable MMIO ranges for PCIe pass-through */
struct pcib_host_resources vmbus_mmio_res;
-#endif
#if defined(__aarch64__)
struct resource *ires;
diff --git a/sys/dev/ofw/ofw_pcib.c b/sys/dev/ofw/ofw_pcib.c
--- a/sys/dev/ofw/ofw_pcib.c
+++ b/sys/dev/ofw/ofw_pcib.c
@@ -421,13 +421,13 @@
ofw_pcib_alloc_resource(device_t bus, device_t child, int type, int *rid,
rman_res_t start, rman_res_t end, rman_res_t count, u_int flags)
{
-#if defined(NEW_PCIB) && defined(PCI_RES_BUS)
+#if defined(PCI_RES_BUS)
struct ofw_pci_softc *sc;
sc = device_get_softc(bus);
#endif
switch (type) {
-#if defined(NEW_PCIB) && defined(PCI_RES_BUS)
+#if defined(PCI_RES_BUS)
case PCI_RES_BUS:
return (pci_domain_alloc_bus(sc->sc_pci_domain, child, rid,
start, end, count, flags));
@@ -445,13 +445,13 @@
static int
ofw_pcib_release_resource(device_t bus, device_t child, struct resource *res)
{
-#if defined(NEW_PCIB) && defined(PCI_RES_BUS)
+#if defined(PCI_RES_BUS)
struct ofw_pci_softc *sc;
sc = device_get_softc(bus);
#endif
switch (rman_get_type(res)) {
-#if defined(NEW_PCIB) && defined(PCI_RES_BUS)
+#if defined(PCI_RES_BUS)
case PCI_RES_BUS:
return (pci_domain_release_bus(sc->sc_pci_domain, child, res));
#endif
@@ -505,13 +505,13 @@
static int
ofw_pcib_activate_resource(device_t bus, device_t child, struct resource *res)
{
-#if defined(NEW_PCIB) && defined(PCI_RES_BUS)
+#if defined(PCI_RES_BUS)
struct ofw_pci_softc *sc;
sc = device_get_softc(bus);
#endif
switch (rman_get_type(res)) {
-#if defined(NEW_PCIB) && defined(PCI_RES_BUS)
+#if defined(PCI_RES_BUS)
case PCI_RES_BUS:
return (pci_domain_activate_bus(sc->sc_pci_domain, child, res));
#endif
@@ -621,13 +621,13 @@
static int
ofw_pcib_deactivate_resource(device_t bus, device_t child, struct resource *res)
{
-#if defined(NEW_PCIB) && defined(PCI_RES_BUS)
+#if defined(PCI_RES_BUS)
struct ofw_pci_softc *sc;
sc = device_get_softc(bus);
#endif
switch (rman_get_type(res)) {
-#if defined(NEW_PCIB) && defined(PCI_RES_BUS)
+#if defined(PCI_RES_BUS)
case PCI_RES_BUS:
return (pci_domain_deactivate_bus(sc->sc_pci_domain, child,
res));
@@ -644,13 +644,13 @@
ofw_pcib_adjust_resource(device_t bus, device_t child,
struct resource *res, rman_res_t start, rman_res_t end)
{
-#if defined(NEW_PCIB) && defined(PCI_RES_BUS)
+#if defined(PCI_RES_BUS)
struct ofw_pci_softc *sc;
sc = device_get_softc(bus);
#endif
switch (rman_get_type(res)) {
-#if defined(NEW_PCIB) && defined(PCI_RES_BUS)
+#if defined(PCI_RES_BUS)
case PCI_RES_BUS:
return (pci_domain_adjust_bus(sc->sc_pci_domain, child, res,
start, end));
diff --git a/sys/dev/pccbb/pccbb_pci.c b/sys/dev/pccbb/pccbb_pci.c
--- a/sys/dev/pccbb/pccbb_pci.c
+++ b/sys/dev/pccbb/pccbb_pci.c
@@ -276,7 +276,7 @@
static int
cbb_pci_attach(device_t brdev)
{
-#if !(defined(NEW_PCIB) && defined(PCI_RES_BUS))
+#if !defined(PCI_RES_BUS)
static int curr_bus_number = 2; /* XXX EVILE BAD (see below) */
uint32_t pribus;
#endif
@@ -293,7 +293,7 @@
sc->cbdev = NULL;
sc->domain = pci_get_domain(brdev);
sc->pribus = pcib_get_bus(parent);
-#if defined(NEW_PCIB) && defined(PCI_RES_BUS)
+#if defined(PCI_RES_BUS)
pci_write_config(brdev, PCIR_PRIBUS_2, sc->pribus, 1);
pcib_setup_secbus(brdev, &sc->bus, 1);
#else
@@ -351,7 +351,7 @@
CTLFLAG_RD, &sc->subbus, 0, "io range 2 open");
#endif
-#if !(defined(NEW_PCIB) && defined(PCI_RES_BUS))
+#if !defined(PCI_RES_BUS)
/*
* This is a gross hack. We should be scanning the entire pci
* tree, assigning bus numbers in a way such that we (1) can
@@ -429,13 +429,13 @@
static int
cbb_pci_detach(device_t brdev)
{
-#if defined(NEW_PCIB) && defined(PCI_RES_BUS)
+#if defined(PCI_RES_BUS)
struct cbb_softc *sc = device_get_softc(brdev);
#endif
int error;
error = cbb_detach(brdev);
-#if defined(NEW_PCIB) && defined(PCI_RES_BUS)
+#if defined(PCI_RES_BUS)
if (error == 0)
pcib_free_secbus(brdev, &sc->bus);
#endif
@@ -787,7 +787,7 @@
return retval;
}
-#if defined(NEW_PCIB) && defined(PCI_RES_BUS)
+#if defined(PCI_RES_BUS)
static struct resource *
cbb_pci_alloc_resource(device_t bus, device_t child, int type, int *rid,
rman_res_t start, rman_res_t end, rman_res_t count, u_int flags)
@@ -931,7 +931,7 @@
/* bus methods */
DEVMETHOD(bus_read_ivar, cbb_read_ivar),
DEVMETHOD(bus_write_ivar, cbb_write_ivar),
-#if defined(NEW_PCIB) && defined(PCI_RES_BUS)
+#if defined(PCI_RES_BUS)
DEVMETHOD(bus_alloc_resource, cbb_pci_alloc_resource),
DEVMETHOD(bus_adjust_resource, cbb_pci_adjust_resource),
DEVMETHOD(bus_release_resource, cbb_pci_release_resource),
diff --git a/sys/dev/pci/pci.c b/sys/dev/pci/pci.c
--- a/sys/dev/pci/pci.c
+++ b/sys/dev/pci/pci.c
@@ -405,7 +405,7 @@
SYSCTL_INT(_hw_pci, OID_AUTO, clear_bars, CTLFLAG_RDTUN, &pci_clear_bars, 0,
"Ignore firmware-assigned resources for BARs.");
-#if defined(NEW_PCIB) && defined(PCI_RES_BUS)
+#if defined(PCI_RES_BUS)
static int pci_clear_buses;
SYSCTL_INT(_hw_pci, OID_AUTO, clear_buses, CTLFLAG_RDTUN, &pci_clear_buses, 0,
"Ignore firmware-assigned bus numbers.");
@@ -3706,7 +3706,7 @@
bus_release_resource(self, SYS_RES_MEMORY, rid, res);
}
-#if defined(NEW_PCIB) && defined(PCI_RES_BUS)
+#if defined(PCI_RES_BUS)
static void
pci_reserve_secbus(device_t bus, device_t dev, pcicfgregs *cfg,
struct resource_list *rl)
@@ -4118,7 +4118,7 @@
uhci_early_takeover(dev);
}
-#if defined(NEW_PCIB) && defined(PCI_RES_BUS)
+#if defined(PCI_RES_BUS)
/*
* Reserve resources for secondary bus ranges behind bridge
* devices.
@@ -5551,7 +5551,7 @@
rl = &dinfo->resources;
cfg = &dinfo->cfg;
switch (type) {
-#if defined(NEW_PCIB) && defined(PCI_RES_BUS)
+#if defined(PCI_RES_BUS)
case PCI_RES_BUS:
return (pci_alloc_secbus(dev, child, rid, start, end, count,
flags));
@@ -5576,7 +5576,6 @@
break;
case SYS_RES_IOPORT:
case SYS_RES_MEMORY:
-#ifdef NEW_PCIB
/*
* PCI-PCI bridge I/O window resources are not BARs.
* For those allocations just pass the request up the
@@ -5595,7 +5594,6 @@
type, rid, start, end, count, flags));
}
}
-#endif
/* Reserve resources for this BAR if needed. */
rle = resource_list_find(rl, type, *rid);
if (rle == NULL) {
@@ -5668,7 +5666,6 @@
}
#endif
-#ifdef NEW_PCIB
/*
* PCI-PCI bridge I/O window resources are not BARs. For
* those allocations just pass the request up the tree.
@@ -5683,7 +5680,6 @@
return (bus_generic_release_resource(dev, child, r));
}
}
-#endif
rl = &dinfo->resources;
return (resource_list_release(rl, dev, child, r));
diff --git a/sys/dev/pci/pci_host_generic.c b/sys/dev/pci/pci_host_generic.c
--- a/sys/dev/pci/pci_host_generic.c
+++ b/sys/dev/pci/pci_host_generic.c
@@ -416,13 +416,13 @@
pci_host_generic_core_release_resource(device_t dev, device_t child,
struct resource *res)
{
-#if defined(NEW_PCIB) && defined(PCI_RES_BUS)
+#if defined(PCI_RES_BUS)
struct generic_pcie_core_softc *sc;
sc = device_get_softc(dev);
#endif
switch (rman_get_type(res)) {
-#if defined(NEW_PCIB) && defined(PCI_RES_BUS)
+#if defined(PCI_RES_BUS)
case PCI_RES_BUS:
return (pci_domain_release_bus(sc->ecam, child, res));
#endif
@@ -506,17 +506,17 @@
pci_host_generic_core_alloc_resource(device_t dev, device_t child, int type,
int *rid, rman_res_t start, rman_res_t end, rman_res_t count, u_int flags)
{
-#if defined(NEW_PCIB) && defined(PCI_RES_BUS)
+#if defined(PCI_RES_BUS)
struct generic_pcie_core_softc *sc;
#endif
struct resource *res;
-#if defined(NEW_PCIB) && defined(PCI_RES_BUS)
+#if defined(PCI_RES_BUS)
sc = device_get_softc(dev);
#endif
switch (type) {
-#if defined(NEW_PCIB) && defined(PCI_RES_BUS)
+#if defined(PCI_RES_BUS)
case PCI_RES_BUS:
res = pci_domain_alloc_bus(sc->ecam, child, rid, start, end,
count, flags);
@@ -543,13 +543,13 @@
static int
generic_pcie_activate_resource(device_t dev, device_t child, struct resource *r)
{
-#if defined(NEW_PCIB) && defined(PCI_RES_BUS)
+#if defined(PCI_RES_BUS)
struct generic_pcie_core_softc *sc;
sc = device_get_softc(dev);
#endif
switch (rman_get_type(r)) {
-#if defined(NEW_PCIB) && defined(PCI_RES_BUS)
+#if defined(PCI_RES_BUS)
case PCI_RES_BUS:
return (pci_domain_activate_bus(sc->ecam, child, r));
#endif
@@ -565,13 +565,13 @@
generic_pcie_deactivate_resource(device_t dev, device_t child,
struct resource *r)
{
-#if defined(NEW_PCIB) && defined(PCI_RES_BUS)
+#if defined(PCI_RES_BUS)
struct generic_pcie_core_softc *sc;
sc = device_get_softc(dev);
#endif
switch (rman_get_type(r)) {
-#if defined(NEW_PCIB) && defined(PCI_RES_BUS)
+#if defined(PCI_RES_BUS)
case PCI_RES_BUS:
return (pci_domain_deactivate_bus(sc->ecam, child, r));
#endif
@@ -587,13 +587,13 @@
generic_pcie_adjust_resource(device_t dev, device_t child,
struct resource *res, rman_res_t start, rman_res_t end)
{
-#if defined(NEW_PCIB) && defined(PCI_RES_BUS)
+#if defined(PCI_RES_BUS)
struct generic_pcie_core_softc *sc;
sc = device_get_softc(dev);
#endif
switch (rman_get_type(res)) {
-#if defined(NEW_PCIB) && defined(PCI_RES_BUS)
+#if defined(PCI_RES_BUS)
case PCI_RES_BUS:
return (pci_domain_adjust_bus(sc->ecam, child, res, start,
end));
@@ -619,7 +619,7 @@
type = rman_get_type(r);
switch (type) {
-#if defined(NEW_PCIB) && defined(PCI_RES_BUS)
+#if defined(PCI_RES_BUS)
case PCI_RES_BUS:
return (EINVAL);
#endif
@@ -658,7 +658,7 @@
type = rman_get_type(r);
switch (type) {
-#if defined(NEW_PCIB) && defined(PCI_RES_BUS)
+#if defined(PCI_RES_BUS)
case PCI_RES_BUS:
return (EINVAL);
#endif
diff --git a/sys/dev/pci/pci_pci.c b/sys/dev/pci/pci_pci.c
--- a/sys/dev/pci/pci_pci.c
+++ b/sys/dev/pci/pci_pci.c
@@ -58,19 +58,16 @@
#include "pcib_if.h"
static int pcib_probe(device_t dev);
-static int pcib_suspend(device_t dev);
static int pcib_resume(device_t dev);
static bus_child_present_t pcib_child_present;
static bus_alloc_resource_t pcib_alloc_resource;
-#ifdef NEW_PCIB
static bus_adjust_resource_t pcib_adjust_resource;
static bus_release_resource_t pcib_release_resource;
static bus_activate_resource_t pcib_activate_resource;
static bus_deactivate_resource_t pcib_deactivate_resource;
static bus_map_resource_t pcib_map_resource;
static bus_unmap_resource_t pcib_unmap_resource;
-#endif
static int pcib_reset_child(device_t dev, device_t child, int flags);
static int pcib_power_for_sleep(device_t pcib, device_t dev,
@@ -101,7 +98,7 @@
DEVMETHOD(device_attach, pcib_attach),
DEVMETHOD(device_detach, pcib_detach),
DEVMETHOD(device_shutdown, bus_generic_shutdown),
- DEVMETHOD(device_suspend, pcib_suspend),
+ DEVMETHOD(device_suspend, bus_generic_suspend),
DEVMETHOD(device_resume, pcib_resume),
/* Bus interface */
@@ -109,19 +106,12 @@
DEVMETHOD(bus_read_ivar, pcib_read_ivar),
DEVMETHOD(bus_write_ivar, pcib_write_ivar),
DEVMETHOD(bus_alloc_resource, pcib_alloc_resource),
-#ifdef NEW_PCIB
DEVMETHOD(bus_adjust_resource, pcib_adjust_resource),
DEVMETHOD(bus_release_resource, pcib_release_resource),
DEVMETHOD(bus_activate_resource, pcib_activate_resource),
DEVMETHOD(bus_deactivate_resource, pcib_deactivate_resource),
DEVMETHOD(bus_map_resource, pcib_map_resource),
DEVMETHOD(bus_unmap_resource, pcib_unmap_resource),
-#else
- DEVMETHOD(bus_adjust_resource, bus_generic_adjust_resource),
- DEVMETHOD(bus_release_resource, bus_generic_release_resource),
- DEVMETHOD(bus_activate_resource, bus_generic_activate_resource),
- DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource),
-#endif
DEVMETHOD(bus_setup_intr, bus_generic_setup_intr),
DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr),
DEVMETHOD(bus_reset_child, pcib_reset_child),
@@ -150,11 +140,8 @@
DEFINE_CLASS_0(pcib, pcib_driver, pcib_methods, sizeof(struct pcib_softc));
EARLY_DRIVER_MODULE(pcib, pci, pcib_driver, NULL, NULL, BUS_PASS_BUS);
-#if defined(NEW_PCIB) || defined(PCI_HP)
SYSCTL_DECL(_hw_pci);
-#endif
-#ifdef NEW_PCIB
static int pci_clear_pcib;
SYSCTL_INT(_hw_pci, OID_AUTO, clear_pcib, CTLFLAG_RDTUN, &pci_clear_pcib, 0,
"Clear firmware-assigned resources for PCI-PCI bridge I/O windows.");
@@ -808,140 +795,6 @@
}
#endif
-#else
-
-/*
- * Is the prefetch window open (eg, can we allocate memory in it?)
- */
-static int
-pcib_is_prefetch_open(struct pcib_softc *sc)
-{
- return (sc->pmembase > 0 && sc->pmembase < sc->pmemlimit);
-}
-
-/*
- * Is the nonprefetch window open (eg, can we allocate memory in it?)
- */
-static int
-pcib_is_nonprefetch_open(struct pcib_softc *sc)
-{
- return (sc->membase > 0 && sc->membase < sc->memlimit);
-}
-
-/*
- * Is the io window open (eg, can we allocate ports in it?)
- */
-static int
-pcib_is_io_open(struct pcib_softc *sc)
-{
- return (sc->iobase > 0 && sc->iobase < sc->iolimit);
-}
-
-/*
- * Get current I/O decode.
- */
-static void
-pcib_get_io_decode(struct pcib_softc *sc)
-{
- device_t dev;
- uint32_t iolow;
-
- dev = sc->dev;
-
- iolow = pci_read_config(dev, PCIR_IOBASEL_1, 1);
- if ((iolow & PCIM_BRIO_MASK) == PCIM_BRIO_32)
- sc->iobase = PCI_PPBIOBASE(
- pci_read_config(dev, PCIR_IOBASEH_1, 2), iolow);
- else
- sc->iobase = PCI_PPBIOBASE(0, iolow);
-
- iolow = pci_read_config(dev, PCIR_IOLIMITL_1, 1);
- if ((iolow & PCIM_BRIO_MASK) == PCIM_BRIO_32)
- sc->iolimit = PCI_PPBIOLIMIT(
- pci_read_config(dev, PCIR_IOLIMITH_1, 2), iolow);
- else
- sc->iolimit = PCI_PPBIOLIMIT(0, iolow);
-}
-
-/*
- * Get current memory decode.
- */
-static void
-pcib_get_mem_decode(struct pcib_softc *sc)
-{
- device_t dev;
- pci_addr_t pmemlow;
-
- dev = sc->dev;
-
- sc->membase = PCI_PPBMEMBASE(0,
- pci_read_config(dev, PCIR_MEMBASE_1, 2));
- sc->memlimit = PCI_PPBMEMLIMIT(0,
- pci_read_config(dev, PCIR_MEMLIMIT_1, 2));
-
- pmemlow = pci_read_config(dev, PCIR_PMBASEL_1, 2);
- if ((pmemlow & PCIM_BRPM_MASK) == PCIM_BRPM_64)
- sc->pmembase = PCI_PPBMEMBASE(
- pci_read_config(dev, PCIR_PMBASEH_1, 4), pmemlow);
- else
- sc->pmembase = PCI_PPBMEMBASE(0, pmemlow);
-
- pmemlow = pci_read_config(dev, PCIR_PMLIMITL_1, 2);
- if ((pmemlow & PCIM_BRPM_MASK) == PCIM_BRPM_64)
- sc->pmemlimit = PCI_PPBMEMLIMIT(
- pci_read_config(dev, PCIR_PMLIMITH_1, 4), pmemlow);
- else
- sc->pmemlimit = PCI_PPBMEMLIMIT(0, pmemlow);
-}
-
-/*
- * Restore previous I/O decode.
- */
-static void
-pcib_set_io_decode(struct pcib_softc *sc)
-{
- device_t dev;
- uint32_t iohi;
-
- dev = sc->dev;
-
- iohi = sc->iobase >> 16;
- if (iohi > 0)
- pci_write_config(dev, PCIR_IOBASEH_1, iohi, 2);
- pci_write_config(dev, PCIR_IOBASEL_1, sc->iobase >> 8, 1);
-
- iohi = sc->iolimit >> 16;
- if (iohi > 0)
- pci_write_config(dev, PCIR_IOLIMITH_1, iohi, 2);
- pci_write_config(dev, PCIR_IOLIMITL_1, sc->iolimit >> 8, 1);
-}
-
-/*
- * Restore previous memory decode.
- */
-static void
-pcib_set_mem_decode(struct pcib_softc *sc)
-{
- device_t dev;
- pci_addr_t pmemhi;
-
- dev = sc->dev;
-
- pci_write_config(dev, PCIR_MEMBASE_1, sc->membase >> 16, 2);
- pci_write_config(dev, PCIR_MEMLIMIT_1, sc->memlimit >> 16, 2);
-
- pmemhi = sc->pmembase >> 32;
- if (pmemhi > 0)
- pci_write_config(dev, PCIR_PMBASEH_1, pmemhi, 4);
- pci_write_config(dev, PCIR_PMBASEL_1, sc->pmembase >> 16, 2);
-
- pmemhi = sc->pmemlimit >> 32;
- if (pmemhi > 0)
- pci_write_config(dev, PCIR_PMLIMITH_1, pmemhi, 4);
- pci_write_config(dev, PCIR_PMLIMITL_1, sc->pmemlimit >> 16, 2);
-}
-#endif
-
#ifdef PCI_HP
/*
* PCI-express HotPlug support.
@@ -1509,45 +1362,13 @@
}
#endif
-/*
- * Get current bridge configuration.
- */
-static void
-pcib_cfg_save(struct pcib_softc *sc)
-{
-#ifndef NEW_PCIB
- device_t dev;
- uint16_t command;
-
- dev = sc->dev;
-
- command = pci_read_config(dev, PCIR_COMMAND, 2);
- if (command & PCIM_CMD_PORTEN)
- pcib_get_io_decode(sc);
- if (command & PCIM_CMD_MEMEN)
- pcib_get_mem_decode(sc);
-#endif
-}
-
/*
* Restore previous bridge configuration.
*/
static void
pcib_cfg_restore(struct pcib_softc *sc)
{
-#ifndef NEW_PCIB
- uint16_t command;
-#endif
-
-#ifdef NEW_PCIB
pcib_write_windows(sc, WIN_IO | WIN_MEM | WIN_PMEM);
-#else
- command = pci_read_config(sc->dev, PCIR_COMMAND, 2);
- if (command & PCIM_CMD_PORTEN)
- pcib_set_io_decode(sc);
- if (command & PCIM_CMD_MEMEN)
- pcib_set_mem_decode(sc);
-#endif
}
/*
@@ -1579,12 +1400,11 @@
* Get current bridge configuration.
*/
sc->domain = pci_get_domain(dev);
-#if !(defined(NEW_PCIB) && defined(PCI_RES_BUS))
+#if !defined(PCI_RES_BUS)
sc->bus.sec = pci_read_config(dev, PCIR_SECBUS_1, 1);
sc->bus.sub = pci_read_config(dev, PCIR_SUBBUS_1, 1);
#endif
sc->bridgectl = pci_read_config(dev, PCIR_BRIDGECTL_1, 2);
- pcib_cfg_save(sc);
/*
* The primary bus register should always be the bus of the
@@ -1611,7 +1431,7 @@
* Quirk handling.
*/
switch (pci_get_devid(dev)) {
-#if !(defined(NEW_PCIB) && defined(PCI_RES_BUS))
+#if !defined(PCI_RES_BUS)
case 0x12258086: /* Intel 82454KX/GX (Orion) */
{
uint8_t supbus;
@@ -1638,7 +1458,7 @@
sc->flags |= PCIB_SUBTRACTIVE;
break;
-#if !(defined(NEW_PCIB) && defined(PCI_RES_BUS))
+#if !defined(PCI_RES_BUS)
/* Compaq R3000 BIOS sets wrong subordinate bus number. */
case 0x00dd10de:
{
@@ -1688,12 +1508,10 @@
#ifdef PCI_HP
pcib_probe_hotplug(sc);
#endif
-#ifdef NEW_PCIB
#ifdef PCI_RES_BUS
pcib_setup_secbus(dev, &sc->bus, 1);
#endif
pcib_probe_windows(sc);
-#endif
#ifdef PCI_HP
if (sc->flags & PCIB_HOTPLUG)
pcib_setup_hotplug(sc);
@@ -1702,7 +1520,6 @@
device_printf(dev, " domain %d\n", sc->domain);
device_printf(dev, " secondary bus %d\n", sc->bus.sec);
device_printf(dev, " subordinate bus %d\n", sc->bus.sub);
-#ifdef NEW_PCIB
if (pcib_is_window_open(&sc->io))
device_printf(dev, " I/O decode 0x%jx-0x%jx\n",
(uintmax_t)sc->io.base, (uintmax_t)sc->io.limit);
@@ -1712,17 +1529,6 @@
if (pcib_is_window_open(&sc->pmem))
device_printf(dev, " prefetched decode 0x%jx-0x%jx\n",
(uintmax_t)sc->pmem.base, (uintmax_t)sc->pmem.limit);
-#else
- if (pcib_is_io_open(sc))
- device_printf(dev, " I/O decode 0x%x-0x%x\n",
- sc->iobase, sc->iolimit);
- if (pcib_is_nonprefetch_open(sc))
- device_printf(dev, " memory decode 0x%jx-0x%jx\n",
- (uintmax_t)sc->membase, (uintmax_t)sc->memlimit);
- if (pcib_is_prefetch_open(sc))
- device_printf(dev, " prefetched decode 0x%jx-0x%jx\n",
- (uintmax_t)sc->pmembase, (uintmax_t)sc->pmemlimit);
-#endif
if (sc->bridgectl & (PCIB_BCR_ISA_ENABLE | PCIB_BCR_VGA_ENABLE) ||
sc->flags & PCIB_SUBTRACTIVE) {
device_printf(dev, " special decode ");
@@ -1793,14 +1599,10 @@
int
pcib_detach(device_t dev)
{
-#if defined(PCI_HP) || defined(NEW_PCIB)
struct pcib_softc *sc;
-#endif
int error;
-#if defined(PCI_HP) || defined(NEW_PCIB)
sc = device_get_softc(dev);
-#endif
error = bus_generic_detach(dev);
if (error)
return (error);
@@ -1814,23 +1616,13 @@
error = device_delete_children(dev);
if (error)
return (error);
-#ifdef NEW_PCIB
pcib_free_windows(sc);
#ifdef PCI_RES_BUS
pcib_free_secbus(dev, &sc->bus);
-#endif
#endif
return (0);
}
-int
-pcib_suspend(device_t dev)
-{
-
- pcib_cfg_save(device_get_softc(dev));
- return (bus_generic_suspend(dev));
-}
-
int
pcib_resume(device_t dev)
{
@@ -1905,7 +1697,6 @@
return(ENOENT);
}
-#ifdef NEW_PCIB
/*
* Attempt to allocate a resource from the existing resources assigned
* to a window.
@@ -2569,163 +2360,6 @@
return (ENOENT);
return (bus_unmap_resource(dev, pres, map));
}
-#else
-/*
- * We have to trap resource allocation requests and ensure that the bridge
- * is set up to, or capable of handling them.
- */
-static struct resource *
-pcib_alloc_resource(device_t dev, device_t child, int type, int *rid,
- rman_res_t start, rman_res_t end, rman_res_t count, u_int flags)
-{
- struct pcib_softc *sc = device_get_softc(dev);
- const char *name, *suffix;
- int ok;
-
- /*
- * Fail the allocation for this range if it's not supported.
- */
- name = device_get_nameunit(child);
- if (name == NULL) {
- name = "";
- suffix = "";
- } else
- suffix = " ";
- switch (type) {
- case SYS_RES_IOPORT:
- ok = 0;
- if (!pcib_is_io_open(sc))
- break;
- ok = (start >= sc->iobase && end <= sc->iolimit);
-
- /*
- * Make sure we allow access to VGA I/O addresses when the
- * bridge has the "VGA Enable" bit set.
- */
- if (!ok && pci_is_vga_ioport_range(start, end))
- ok = (sc->bridgectl & PCIB_BCR_VGA_ENABLE) ? 1 : 0;
-
- if ((sc->flags & PCIB_SUBTRACTIVE) == 0) {
- if (!ok) {
- if (start < sc->iobase)
- start = sc->iobase;
- if (end > sc->iolimit)
- end = sc->iolimit;
- if (start < end)
- ok = 1;
- }
- } else {
- ok = 1;
-#if 0
- /*
- * If we overlap with the subtractive range, then
- * pick the upper range to use.
- */
- if (start < sc->iolimit && end > sc->iobase)
- start = sc->iolimit + 1;
-#endif
- }
- if (end < start) {
- device_printf(dev, "ioport: end (%jx) < start (%jx)\n",
- end, start);
- start = 0;
- end = 0;
- ok = 0;
- }
- if (!ok) {
- device_printf(dev, "%s%srequested unsupported I/O "
- "range 0x%jx-0x%jx (decoding 0x%x-0x%x)\n",
- name, suffix, start, end, sc->iobase, sc->iolimit);
- return (NULL);
- }
- if (bootverbose)
- device_printf(dev,
- "%s%srequested I/O range 0x%jx-0x%jx: in range\n",
- name, suffix, start, end);
- break;
-
- case SYS_RES_MEMORY:
- ok = 0;
- if (pcib_is_nonprefetch_open(sc))
- ok = ok || (start >= sc->membase && end <= sc->memlimit);
- if (pcib_is_prefetch_open(sc))
- ok = ok || (start >= sc->pmembase && end <= sc->pmemlimit);
-
- /*
- * Make sure we allow access to VGA memory addresses when the
- * bridge has the "VGA Enable" bit set.
- */
- if (!ok && pci_is_vga_memory_range(start, end))
- ok = (sc->bridgectl & PCIB_BCR_VGA_ENABLE) ? 1 : 0;
-
- if ((sc->flags & PCIB_SUBTRACTIVE) == 0) {
- if (!ok) {
- ok = 1;
- if (flags & RF_PREFETCHABLE) {
- if (pcib_is_prefetch_open(sc)) {
- if (start < sc->pmembase)
- start = sc->pmembase;
- if (end > sc->pmemlimit)
- end = sc->pmemlimit;
- } else {
- ok = 0;
- }
- } else { /* non-prefetchable */
- if (pcib_is_nonprefetch_open(sc)) {
- if (start < sc->membase)
- start = sc->membase;
- if (end > sc->memlimit)
- end = sc->memlimit;
- } else {
- ok = 0;
- }
- }
- }
- } else if (!ok) {
- ok = 1; /* subtractive bridge: always ok */
-#if 0
- if (pcib_is_nonprefetch_open(sc)) {
- if (start < sc->memlimit && end > sc->membase)
- start = sc->memlimit + 1;
- }
- if (pcib_is_prefetch_open(sc)) {
- if (start < sc->pmemlimit && end > sc->pmembase)
- start = sc->pmemlimit + 1;
- }
-#endif
- }
- if (end < start) {
- device_printf(dev, "memory: end (%jx) < start (%jx)\n",
- end, start);
- start = 0;
- end = 0;
- ok = 0;
- }
- if (!ok && bootverbose)
- device_printf(dev,
- "%s%srequested unsupported memory range %#jx-%#jx "
- "(decoding %#jx-%#jx, %#jx-%#jx)\n",
- name, suffix, start, end,
- (uintmax_t)sc->membase, (uintmax_t)sc->memlimit,
- (uintmax_t)sc->pmembase, (uintmax_t)sc->pmemlimit);
- if (!ok)
- return (NULL);
- if (bootverbose)
- device_printf(dev,"%s%srequested memory range "
- "0x%jx-0x%jx: good\n",
- name, suffix, start, end);
- break;
-
- default:
- break;
- }
- /*
- * Bridge is OK decoding this resource, so pass it up.
- */
- return (bus_generic_alloc_resource(dev, child, type, rid, start, end,
- count, flags));
-}
-#endif
/*
* If ARI is enabled on this downstream port, translate the function number
diff --git a/sys/dev/pci/pci_subr.c b/sys/dev/pci/pci_subr.c
--- a/sys/dev/pci/pci_subr.c
+++ b/sys/dev/pci/pci_subr.c
@@ -131,7 +131,6 @@
return 1;
}
-#ifdef NEW_PCIB
/*
* Return a pointer to a pretty name for a PCI device. If the device
* has a driver attached, the device's name is used, otherwise a name
@@ -413,5 +412,3 @@
return (rman_deactivate_resource(r));
}
#endif /* PCI_RES_BUS */
-
-#endif /* NEW_PCIB */
diff --git a/sys/dev/pci/pcib_private.h b/sys/dev/pci/pcib_private.h
--- a/sys/dev/pci/pcib_private.h
+++ b/sys/dev/pci/pcib_private.h
@@ -35,7 +35,6 @@
#include <sys/taskqueue.h>
-#ifdef NEW_PCIB
/*
* Data structure and routines that Host to PCI bridge drivers can use
* to restrict allocations for child devices to ranges decoded by the
@@ -58,7 +57,6 @@
int pcib_host_res_adjust(struct pcib_host_resources *hr,
device_t dev, struct resource *r, rman_res_t start,
rman_res_t end);
-#endif
/*
* Export portions of generic PCI:PCI bridge support so that it can be
@@ -66,7 +64,6 @@
*/
DECLARE_CLASS(pcib_driver);
-#ifdef NEW_PCIB
#define WIN_IO 0x1
#define WIN_MEM 0x2
#define WIN_PMEM 0x4
@@ -83,12 +80,11 @@
int step; /* log_2 of window granularity */
const char *name;
};
-#endif
struct pcib_secbus {
u_int sec;
u_int sub;
-#if defined(NEW_PCIB) && defined(PCI_RES_BUS)
+#if defined(PCI_RES_BUS)
device_t dev;
struct rman rman;
struct resource *res;
@@ -116,18 +112,9 @@
u_int domain; /* domain number */
u_int pribus; /* primary bus number */
struct pcib_secbus bus; /* secondary bus numbers */
-#ifdef NEW_PCIB
struct pcib_window io; /* I/O port window */
struct pcib_window mem; /* memory window */
struct pcib_window pmem; /* prefetchable memory window */
-#else
- pci_addr_t pmembase; /* base address of prefetchable memory */
- pci_addr_t pmemlimit; /* topmost address of prefetchable memory */
- pci_addr_t membase; /* base address of memory window */
- pci_addr_t memlimit; /* topmost address of memory window */
- uint32_t iobase; /* base address of port window */
- uint32_t iolimit; /* topmost address of port window */
-#endif
uint16_t bridgectl; /* bridge control register */
uint16_t pcie_link_sta;
uint16_t pcie_slot_sta;
@@ -153,7 +140,7 @@
int host_pcib_get_busno(pci_read_config_fn read_config, int bus,
int slot, int func, uint8_t *busnum);
-#if defined(NEW_PCIB) && defined(PCI_RES_BUS)
+#if defined(PCI_RES_BUS)
struct resource *pci_domain_alloc_bus(int domain, device_t dev, int *rid,
rman_res_t start, rman_res_t end, rman_res_t count, u_int flags);
int pci_domain_adjust_bus(int domain, device_t dev,
@@ -175,9 +162,7 @@
int pcib_attach_child(device_t dev);
void pcib_attach_common(device_t dev);
void pcib_bridge_init(device_t dev);
-#ifdef NEW_PCIB
const char *pcib_child_name(device_t child);
-#endif
int pcib_detach(device_t dev);
int pcib_read_ivar(device_t dev, device_t child, int which, uintptr_t *result);
int pcib_write_ivar(device_t dev, device_t child, int which, uintptr_t value);
diff --git a/sys/i386/conf/DEFAULTS b/sys/i386/conf/DEFAULTS
--- a/sys/i386/conf/DEFAULTS
+++ b/sys/i386/conf/DEFAULTS
@@ -29,6 +29,4 @@
# enable support for native hardware
device atpic
-options NEW_PCIB
-
options NETLINK # netlink(4) support
diff --git a/sys/i386/include/resource.h b/sys/i386/include/resource.h
--- a/sys/i386/include/resource.h
+++ b/sys/i386/include/resource.h
@@ -39,8 +39,6 @@
#define SYS_RES_DRQ 2 /* isa dma lines */
#define SYS_RES_MEMORY 3 /* i/o memory */
#define SYS_RES_IOPORT 4 /* i/o ports */
-#ifdef NEW_PCIB
#define PCI_RES_BUS 5 /* PCI bus numbers */
-#endif
#endif /* !_MACHINE_RESOURCE_H_ */
diff --git a/sys/modules/cardbus/Makefile b/sys/modules/cardbus/Makefile
--- a/sys/modules/cardbus/Makefile
+++ b/sys/modules/cardbus/Makefile
@@ -4,8 +4,4 @@
SRCS= cardbus.c cardbus_cis.c cardbus_device.c \
device_if.h bus_if.h card_if.h power_if.h pci_if.h pcib_if.h
-.if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "amd64"
-CFLAGS += -DNEW_PCIB
-.endif
-
.include <bsd.kmod.mk>
diff --git a/sys/modules/cbb/Makefile b/sys/modules/cbb/Makefile
--- a/sys/modules/cbb/Makefile
+++ b/sys/modules/cbb/Makefile
@@ -4,8 +4,4 @@
SRCS= pccbb.c pccbb_pci.c \
device_if.h bus_if.h power_if.h card_if.h pci_if.h pcib_if.h
-.if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "amd64"
-CFLAGS += -DNEW_PCIB
-.endif
-
.include <bsd.kmod.mk>
diff --git a/sys/powerpc/conf/DEFAULTS b/sys/powerpc/conf/DEFAULTS
--- a/sys/powerpc/conf/DEFAULTS
+++ b/sys/powerpc/conf/DEFAULTS
@@ -14,6 +14,4 @@
# Default congestion control algorithm
options CC_CUBIC # include CUBIC congestion control
-options NEW_PCIB
-
options NETLINK # netlink(4) support
diff --git a/sys/riscv/conf/DEFAULTS b/sys/riscv/conf/DEFAULTS
--- a/sys/riscv/conf/DEFAULTS
+++ b/sys/riscv/conf/DEFAULTS
@@ -15,7 +15,6 @@
# Default congestion control algorithm
options CC_CUBIC # include CUBIC congestion control
-options NEW_PCIB
options INTRNG
options NETLINK # netlink(4) support
diff --git a/sys/riscv/include/resource.h b/sys/riscv/include/resource.h
--- a/sys/riscv/include/resource.h
+++ b/sys/riscv/include/resource.h
@@ -40,8 +40,6 @@
#define SYS_RES_MEMORY 3 /* i/o memory */
#define SYS_RES_IOPORT 4 /* i/o ports */
#define SYS_RES_GPIO 5 /* general purpose i/o */
-#ifdef NEW_PCIB
#define PCI_RES_BUS 6 /* PCI bus numbers */
-#endif
#endif /* !_MACHINE_RESOURCE_H_ */
diff --git a/sys/x86/include/mptable.h b/sys/x86/include/mptable.h
--- a/sys/x86/include/mptable.h
+++ b/sys/x86/include/mptable.h
@@ -188,16 +188,12 @@
#ifdef _KERNEL
struct mptable_hostb_softc {
-#ifdef NEW_PCIB
struct pcib_host_resources sc_host_res;
int sc_decodes_vga_io;
int sc_decodes_isa_io;
-#endif
};
-#ifdef NEW_PCIB
void mptable_pci_host_res_init(device_t pcib);
-#endif
int mptable_pci_probe_table(int bus);
int mptable_pci_route_interrupt(device_t pcib, device_t dev, int pin);
#endif
diff --git a/sys/x86/pci/pci_bus.c b/sys/x86/pci/pci_bus.c
--- a/sys/x86/pci/pci_bus.c
+++ b/sys/x86/pci/pci_bus.c
@@ -595,7 +595,7 @@
rman_res_t start, rman_res_t end, rman_res_t count, u_int flags)
{
-#if defined(NEW_PCIB) && defined(PCI_RES_BUS)
+#if defined(PCI_RES_BUS)
if (type == PCI_RES_BUS)
return (pci_domain_alloc_bus(0, child, rid, start, end, count,
flags));
@@ -605,7 +605,7 @@
count, flags));
}
-#if defined(NEW_PCIB) && defined(PCI_RES_BUS)
+#if defined(PCI_RES_BUS)
int
legacy_pcib_adjust_resource(device_t dev, device_t child,
struct resource *r, rman_res_t start, rman_res_t end)
@@ -656,7 +656,7 @@
DEVMETHOD(bus_read_ivar, legacy_pcib_read_ivar),
DEVMETHOD(bus_write_ivar, legacy_pcib_write_ivar),
DEVMETHOD(bus_alloc_resource, legacy_pcib_alloc_resource),
-#if defined(NEW_PCIB) && defined(PCI_RES_BUS)
+#if defined(PCI_RES_BUS)
DEVMETHOD(bus_adjust_resource, legacy_pcib_adjust_resource),
DEVMETHOD(bus_release_resource, legacy_pcib_release_resource),
DEVMETHOD(bus_activate_resource, legacy_pcib_activate_resource),
diff --git a/sys/x86/pci/qpi.c b/sys/x86/pci/qpi.c
--- a/sys/x86/pci/qpi.c
+++ b/sys/x86/pci/qpi.c
@@ -246,7 +246,7 @@
}
}
-#if defined(NEW_PCIB) && defined(PCI_RES_BUS)
+#if defined(PCI_RES_BUS)
static struct resource *
qpi_pcib_alloc_resource(device_t dev, device_t child, int type, int *rid,
rman_res_t start, rman_res_t end, rman_res_t count, u_int flags)
@@ -280,7 +280,7 @@
/* Bus interface */
DEVMETHOD(bus_read_ivar, qpi_pcib_read_ivar),
-#if defined(NEW_PCIB) && defined(PCI_RES_BUS)
+#if defined(PCI_RES_BUS)
DEVMETHOD(bus_alloc_resource, qpi_pcib_alloc_resource),
DEVMETHOD(bus_adjust_resource, legacy_pcib_adjust_resource),
DEVMETHOD(bus_release_resource, legacy_pcib_release_resource),
diff --git a/sys/x86/x86/mptable.c b/sys/x86/x86/mptable.c
--- a/sys/x86/x86/mptable.c
+++ b/sys/x86/x86/mptable.c
@@ -36,18 +36,14 @@
#include <sys/limits.h>
#include <sys/malloc.h>
#include <sys/smp.h>
-#ifdef NEW_PCIB
#include <sys/rman.h>
-#endif
#include <vm/vm.h>
#include <vm/vm_param.h>
#include <vm/pmap.h>
#include <dev/pci/pcivar.h>
-#ifdef NEW_PCIB
#include <dev/pci/pcib_private.h>
-#endif
#include <x86/apicreg.h>
#include <x86/legacyvar.h>
#include <x86/mptable.h>
@@ -56,9 +52,7 @@
#include <x86/apicvar.h>
#include <machine/md_var.h>
#include <machine/pc/bios.h>
-#ifdef NEW_PCIB
#include <machine/resource.h>
-#endif
#include <machine/specialreg.h>
/* string defined by the Intel MP Spec as identifying the MP table */
@@ -199,10 +193,8 @@
static void mptable_register(void *dummy);
static int mptable_setup_local(void);
static int mptable_setup_io(void);
-#ifdef NEW_PCIB
static void mptable_walk_extended_table(
mptable_extended_entry_handler *handler, void *arg);
-#endif
static void mptable_walk_table(mptable_entry_handler *handler, void *arg);
static int search_for_sig(u_int32_t target, int count);
@@ -504,7 +496,6 @@
}
}
-#ifdef NEW_PCIB
/*
* Call the handler routine for each entry in the MP config extended
* table.
@@ -523,7 +514,6 @@
entry = (ext_entry_ptr)((char *)entry + entry->length);
}
}
-#endif
static void
mptable_probe_cpus_handler(u_char *entry, void *arg)
@@ -1178,7 +1168,6 @@
return (args.vector);
}
-#ifdef NEW_PCIB
struct host_res_args {
struct mptable_hostb_softc *sc;
device_t dev;
@@ -1306,4 +1295,3 @@
panic("failed to init hostb resources");
mptable_walk_extended_table(mptable_host_res_handler, &args);
}
-#endif
diff --git a/sys/x86/x86/mptable_pci.c b/sys/x86/x86/mptable_pci.c
--- a/sys/x86/x86/mptable_pci.c
+++ b/sys/x86/x86/mptable_pci.c
@@ -64,14 +64,11 @@
mptable_hostb_attach(device_t dev)
{
-#ifdef NEW_PCIB
mptable_pci_host_res_init(dev);
-#endif
device_add_child(dev, "pci", -1);
return (bus_generic_attach(dev));
}
-#ifdef NEW_PCIB
static int
mptable_is_isa_range(rman_res_t start, rman_res_t end)
{
@@ -151,7 +148,6 @@
sc = device_get_softc(dev);
return (pcib_host_res_adjust(&sc->sc_host_res, child, r, start, end));
}
-#endif
static device_method_t mptable_hostb_methods[] = {
/* Device interface */
@@ -164,14 +160,9 @@
/* Bus interface */
DEVMETHOD(bus_read_ivar, legacy_pcib_read_ivar),
DEVMETHOD(bus_write_ivar, legacy_pcib_write_ivar),
-#ifdef NEW_PCIB
DEVMETHOD(bus_alloc_resource, mptable_hostb_alloc_resource),
DEVMETHOD(bus_adjust_resource, mptable_hostb_adjust_resource),
-#else
- DEVMETHOD(bus_alloc_resource, legacy_pcib_alloc_resource),
- DEVMETHOD(bus_adjust_resource, bus_generic_adjust_resource),
-#endif
-#if defined(NEW_PCIB) && defined(PCI_RES_BUS)
+#if defined(PCI_RES_BUS)
DEVMETHOD(bus_release_resource, legacy_pcib_release_resource),
DEVMETHOD(bus_activate_resource, legacy_pcib_activate_resource),
DEVMETHOD(bus_deactivate_resource, legacy_pcib_deactivate_resource),
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Feb 22, 4:18 PM (4 h, 4 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
16774741
Default Alt Text
D32954.diff (45 KB)
Attached To
Mode
D32954: Retire non-NEW_PCIB code and remove config option
Attached
Detach File
Event Timeline
Log In to Comment