summaryrefslogtreecommitdiffstats
path: root/sys/dev/acpica/acpi_pcib_acpi.c
diff options
context:
space:
mode:
authorimp <imp@FreeBSD.org>2004-04-09 15:44:34 +0000
committerimp <imp@FreeBSD.org>2004-04-09 15:44:34 +0000
commitca56ea20fc3b156a88a5caf374733a36948e1cbf (patch)
treeca7c96811517c5490a15746b5ab4f48b8ac626d7 /sys/dev/acpica/acpi_pcib_acpi.c
parentfd75a2f931626c978079f80dd1e0191255a38a7c (diff)
downloadFreeBSD-src-ca56ea20fc3b156a88a5caf374733a36948e1cbf.zip
FreeBSD-src-ca56ea20fc3b156a88a5caf374733a36948e1cbf.tar.gz
Omnibus PCI commit:
o Save and restore bars for suspend/resume as well as for D3->D0 transitions. o preallocate resources that the PCI devices use to avoid resource conflicts o lazy allocation of resources not allocated by the BIOS. o set unattached drivers to state D3. Set power state to D0 before probe/attach. Right now there's two special cases for this (display and memory devices) that need work in other areas of the tree. Please report any bugs to me.
Diffstat (limited to 'sys/dev/acpica/acpi_pcib_acpi.c')
-rw-r--r--sys/dev/acpica/acpi_pcib_acpi.c23
1 files changed, 22 insertions, 1 deletions
diff --git a/sys/dev/acpica/acpi_pcib_acpi.c b/sys/dev/acpica/acpi_pcib_acpi.c
index 640706a..65cc4a7 100644
--- a/sys/dev/acpica/acpi_pcib_acpi.c
+++ b/sys/dev/acpica/acpi_pcib_acpi.c
@@ -70,6 +70,10 @@ static void acpi_pcib_write_config(device_t dev, int bus, int slot, int func, i
u_int32_t data, int bytes);
static int acpi_pcib_acpi_route_interrupt(device_t pcib,
device_t dev, int pin);
+static 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);
static device_method_t acpi_pcib_acpi_methods[] = {
/* Device interface */
@@ -83,7 +87,7 @@ static device_method_t acpi_pcib_acpi_methods[] = {
DEVMETHOD(bus_print_child, bus_generic_print_child),
DEVMETHOD(bus_read_ivar, acpi_pcib_read_ivar),
DEVMETHOD(bus_write_ivar, acpi_pcib_write_ivar),
- DEVMETHOD(bus_alloc_resource, bus_generic_alloc_resource),
+ DEVMETHOD(bus_alloc_resource, acpi_pcib_acpi_alloc_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),
@@ -289,3 +293,20 @@ acpi_pcib_acpi_route_interrupt(device_t pcib, device_t dev, int pin)
sc = device_get_softc(pcib);
return (acpi_pcib_route_interrupt(pcib, dev, pin, &sc->ap_prt));
}
+
+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)
+{
+ /*
+ * If no memory preference is given, use upper 256MB slot most
+ * bioses use for their memory window. Typically other bridges
+ * before us get in the way to assert their preferences on memory.
+ * Hardcoding like this sucks, so a more MD/MI way needs to be
+ * found to do it.
+ */
+ if (type == SYS_RES_MEMORY && start == 0UL && end == ~0UL)
+ start = 0xf0000000;
+ return (bus_generic_alloc_resource(dev, child, type, rid, start, end,
+ count, flags));
+}
OpenPOWER on IntegriCloud