diff --git a/sys/dev/acpica/acpi_pcib_acpi.c b/sys/dev/acpica/acpi_pcib_acpi.c index 30777643e7d..8ec60e76ae4 100644 --- a/sys/dev/acpica/acpi_pcib_acpi.c +++ b/sys/dev/acpica/acpi_pcib_acpi.c @@ -32,6 +32,7 @@ #include #include #include +#include #include "acpi.h" #include @@ -300,6 +301,9 @@ acpi_pcib_acpi_route_interrupt(device_t pcib, device_t dev, int pin) return (acpi_pcib_route_interrupt(pcib, dev, pin)); } +static int acpi_host_mem_start = 0x80000000; +TUNABLE_INT("hw.acpi.host_mem_start", &acpi_host_mem_start); + struct resource * acpi_pcib_acpi_alloc_resource(device_t dev, device_t child, int type, int *rid, u_long start, u_long end, u_long count, u_int flags) @@ -314,7 +318,7 @@ acpi_pcib_acpi_alloc_resource(device_t dev, device_t child, int type, int *rid, * is liekly OK. */ if (type == SYS_RES_MEMORY && start == 0UL && end == ~0UL) - start = 0xfe000000; + start = acpi_host_mem_start; return (bus_generic_alloc_resource(dev, child, type, rid, start, end, count, flags)); } diff --git a/sys/i386/pci/pci_bus.c b/sys/i386/pci/pci_bus.c index dbf10376596..378075a7750 100644 --- a/sys/i386/pci/pci_bus.c +++ b/sys/i386/pci/pci_bus.c @@ -35,6 +35,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -469,6 +470,16 @@ legacy_pcib_write_ivar(device_t dev, device_t child, int which, return ENOENT; } +SYSCTL_DECL(_hw_pci); + +static int legacy_host_mem_start = 0x80000000; +/* No TUNABLE_ULONG :-( */ +TUNABLE_INT("hw.pci.host_mem_start", &legacy_host_mem_start); +SYSCTL_INT(_hw_pci, OID_AUTO, host_mem_start, CTLFLAG_RDTUN, + &legacy_host_mem_start, 0x80000000, + "Limit the host bridge memory to being above this address. Must be\n\ +set at boot via a tunable."); + static struct resource * legacy_pcib_alloc_resource(device_t dev, device_t child, int type, int *rid, u_long start, u_long end, u_long count, u_int flags) @@ -481,9 +492,12 @@ legacy_pcib_alloc_resource(device_t dev, device_t child, int type, int *rid, * found to do it. This is typically only used on older laptops * that don't have pci busses behind pci bridge, so assuming > 32MB * is liekly OK. + * + * However, this can cause problems for other chipsets, so we make + * this tunable by hw.pci.host_mem_start. */ if (type == SYS_RES_MEMORY && start == 0UL && end == ~0UL) - start = 0xfe000000; + start = legacy_host_mem_start; return (bus_generic_alloc_resource(dev, child, type, rid, start, end, count, flags)); }