diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2007-12-05 19:17:15 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2007-12-05 19:17:15 +0000 |
commit | 889140cc7443199609393b489e13d395e9e062a1 (patch) | |
tree | 9e57175bdada4e31c27b49ac718d0d24dd92e2d2 /sys/arch/amd64 | |
parent | 52e7566f48bd54f2a0a319139b4ca8625857a49c (diff) |
Hang acpi(4) below bios(4) instead of mainbus(4). This lets us move acpi(4)
before pcibios(4), and then.... if acpi(4) attaches, skip pcibios(4) since
it messes the machines up. Fixes claudio's HP dl320 G5, and almost assuredly
others.
ok kettenis
Diffstat (limited to 'sys/arch/amd64')
-rw-r--r-- | sys/arch/amd64/amd64/acpi_machdep.c | 7 | ||||
-rw-r--r-- | sys/arch/amd64/amd64/bios.c | 39 | ||||
-rw-r--r-- | sys/arch/amd64/amd64/mainbus.c | 27 | ||||
-rw-r--r-- | sys/arch/amd64/conf/GENERIC | 4 | ||||
-rw-r--r-- | sys/arch/amd64/conf/RAMDISK | 5 | ||||
-rw-r--r-- | sys/arch/amd64/conf/RAMDISK_CD | 5 | ||||
-rw-r--r-- | sys/arch/amd64/include/biosvar.h | 18 |
7 files changed, 63 insertions, 42 deletions
diff --git a/sys/arch/amd64/amd64/acpi_machdep.c b/sys/arch/amd64/amd64/acpi_machdep.c index ab7d11fa168..e5eb67b06b1 100644 --- a/sys/arch/amd64/amd64/acpi_machdep.c +++ b/sys/arch/amd64/amd64/acpi_machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: acpi_machdep.c,v 1.10 2007/11/25 09:11:12 jsg Exp $ */ +/* $OpenBSD: acpi_machdep.c,v 1.11 2007/12/05 19:17:13 deraadt Exp $ */ /* * Copyright (c) 2005 Thorsten Lockert <tholo@sigmasoft.com> * @@ -100,7 +100,7 @@ acpi_scan(struct acpi_mem_map *handle, paddr_t pa, size_t len) } int -acpi_probe(struct device *parent, struct cfdata *match, struct acpi_attach_args *aaa) +acpi_probe(struct device *parent, struct cfdata *match, struct bios_attach_args *ba) { struct acpi_mem_map handle; u_int8_t *ptr; @@ -143,7 +143,7 @@ acpi_probe(struct device *parent, struct cfdata *match, struct acpi_attach_args return (0); havebase: - aaa->aaa_pbase = ptr - handle.va + handle.pa; + ba->ba_acpipbase = ptr - handle.va + handle.pa; acpi_unmap(&handle); return (1); @@ -153,6 +153,7 @@ void acpi_attach_machdep(struct acpi_softc *sc) { extern void (*cpuresetfn)(void); + sc->sc_interrupt = isa_intr_establish(NULL, sc->sc_fadt->sci_int, IST_LEVEL, IPL_TTY, acpi_interrupt, sc, sc->sc_dev.dv_xname); cpuresetfn = acpi_reset; diff --git a/sys/arch/amd64/amd64/bios.c b/sys/arch/amd64/amd64/bios.c index 3a8684c4a67..d204e377687 100644 --- a/sys/arch/amd64/amd64/bios.c +++ b/sys/arch/amd64/amd64/bios.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bios.c,v 1.14 2007/11/25 16:40:04 jmc Exp $ */ +/* $OpenBSD: bios.c,v 1.15 2007/12/05 19:17:14 deraadt Exp $ */ /* * Copyright (c) 2006 Gordon Willem Klok <gklok@cogeco.ca> * @@ -31,6 +31,13 @@ #include <dev/isa/isareg.h> #include <amd64/include/isa_machdep.h> +#include <dev/pci/pcivar.h> + +#include <dev/acpi/acpireg.h> +#include <dev/acpi/acpivar.h> + +#include "acpi.h" +#include "pci.h" struct bios_softc { struct device sc_dev; @@ -39,6 +46,7 @@ struct bios_softc { void smbios_info(char *); int bios_match(struct device *, void *, void *); void bios_attach(struct device *, struct device *, void *); +int bios_print(void *, const char *); char *fixstring(char *); struct cfattach bios_ca = { @@ -68,7 +76,7 @@ bios_match(struct device *parent, void *match , void *aux) struct bios_attach_args *bia = aux; /* only one */ - if (bios_cd.cd_ndevs || strcmp(bia->bios_dev, bios_cd.cd_name)) + if (bios_cd.cd_ndevs || strcmp(bia->ba_name, bios_cd.cd_name)) return 0; return 1; } @@ -146,6 +154,22 @@ bios_attach(struct device *parent, struct device *self, void *aux) break; } printf("\n"); + +#if NACPI > 0 +#if NPCI > 0 + if (pci_mode != 0) +#endif + { + struct bios_attach_args ba; + + memset(&ba, 0, sizeof(ba)); + ba.ba_name = "acpi"; + ba.ba_iot = X86_BUS_SPACE_IO; + ba.ba_memt = X86_BUS_SPACE_MEM; + + config_found(self, &ba, bios_print); + } +#endif } /* @@ -383,3 +407,14 @@ smbios_info(char * str) } } } + +int +bios_print(void *aux, const char *pnp) +{ + struct bios_attach_args *ba = aux; + + if (pnp) + printf("%s at %s", + ba->ba_name, pnp); + return (UNCONF); +} diff --git a/sys/arch/amd64/amd64/mainbus.c b/sys/arch/amd64/amd64/mainbus.c index 3b5bc9743b8..a9627064289 100644 --- a/sys/arch/amd64/amd64/mainbus.c +++ b/sys/arch/amd64/amd64/mainbus.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mainbus.c,v 1.13 2007/11/16 16:16:07 deraadt Exp $ */ +/* $OpenBSD: mainbus.c,v 1.14 2007/12/05 19:17:14 deraadt Exp $ */ /* $NetBSD: mainbus.c,v 1.1 2003/04/26 18:39:29 fvdl Exp $ */ /* @@ -52,10 +52,8 @@ #include <machine/i82093var.h> #include <machine/mpbiosvar.h> -#if NACPI > 0 #include <dev/acpi/acpireg.h> #include <dev/acpi/acpivar.h> -#endif #if NIPMI > 0 #include <dev/ipmivar.h> @@ -84,9 +82,6 @@ union mainbus_attach_args { struct isabus_attach_args mba_iba; struct cpu_attach_args mba_caa; struct apic_attach_args aaa_caa; -#if NACPI > 0 - struct acpi_attach_args mba_aaa; -#endif #if NIPMI > 0 struct ipmi_attach_args mba_iaa; #endif @@ -160,27 +155,13 @@ mainbus_attach(struct device *parent, struct device *self, void *aux) #if NBIOS > 0 { - mba.mba_bios.bios_dev = "bios"; - mba.mba_bios.bios_iot = X86_BUS_SPACE_IO; - mba.mba_bios.bios_memt = X86_BUS_SPACE_MEM; + mba.mba_bios.ba_name = "bios"; + mba.mba_bios.ba_iot = X86_BUS_SPACE_IO; + mba.mba_bios.ba_memt = X86_BUS_SPACE_MEM; config_found(self, &mba.mba_bios, mainbus_print); } #endif -#if NACPI > 0 -#if NPCI > 0 - if (pci_mode != 0) -#endif - { - memset(&mba.mba_aaa, 0, sizeof(mba.mba_aaa)); - mba.mba_aaa.aaa_name = "acpi"; - mba.mba_aaa.aaa_iot = X86_BUS_SPACE_IO; - mba.mba_aaa.aaa_memt = X86_BUS_SPACE_MEM; - - config_found(self, &mba.mba_aaa, mainbus_print); - } -#endif - #if NIPMI > 0 { memset(&mba.mba_iaa, 0, sizeof(mba.mba_iaa)); diff --git a/sys/arch/amd64/conf/GENERIC b/sys/arch/amd64/conf/GENERIC index ae3264f79a0..ffe077d5b60 100644 --- a/sys/arch/amd64/conf/GENERIC +++ b/sys/arch/amd64/conf/GENERIC @@ -1,4 +1,4 @@ -# $OpenBSD: GENERIC,v 1.206 2007/11/25 17:11:12 oga Exp $ +# $OpenBSD: GENERIC,v 1.207 2007/12/05 19:17:14 deraadt Exp $ # # For further information on compiling OpenBSD kernels, see the config(8) # man page. @@ -40,7 +40,7 @@ pci* at mainbus0 #option ACPIVERBOSE -acpi0 at mainbus? +acpi0 at bios? acpitimer* at acpi? acpihpet* at acpi? acpiac* at acpi? diff --git a/sys/arch/amd64/conf/RAMDISK b/sys/arch/amd64/conf/RAMDISK index 3bb08fc5231..1f5285754fe 100644 --- a/sys/arch/amd64/conf/RAMDISK +++ b/sys/arch/amd64/conf/RAMDISK @@ -1,4 +1,4 @@ -# $OpenBSD: RAMDISK,v 1.42 2007/11/15 22:21:31 deraadt Exp $ +# $OpenBSD: RAMDISK,v 1.43 2007/12/05 19:17:14 deraadt Exp $ machine amd64 # architecture, used by config; REQUIRED @@ -32,8 +32,9 @@ option MINIROOTSIZE=4480 config bsd root on rd0a swap on rd0b and wd0b and sd0b mainbus0 at root +bios0 at mainbus? -acpi0 at mainbus? +acpi0 at bios? #acpitimer* at acpi? #acpihpet* at acpi? #acpiac* at acpi? diff --git a/sys/arch/amd64/conf/RAMDISK_CD b/sys/arch/amd64/conf/RAMDISK_CD index 09e4d38e5d4..68c27e0c93e 100644 --- a/sys/arch/amd64/conf/RAMDISK_CD +++ b/sys/arch/amd64/conf/RAMDISK_CD @@ -1,4 +1,4 @@ -# $OpenBSD: RAMDISK_CD,v 1.78 2007/11/15 22:21:31 deraadt Exp $ +# $OpenBSD: RAMDISK_CD,v 1.79 2007/12/05 19:17:14 deraadt Exp $ machine amd64 # architecture, used by config; REQUIRED @@ -33,8 +33,9 @@ option MINIROOTSIZE=4480 config bsd root on rd0a swap on rd0b and wd0b and sd0b mainbus0 at root +bios0 at mainbus? -acpi0 at mainbus? +acpi0 at bios? #acpitimer* at acpi? #acpihpet* at acpi? #acpiac* at acpi? diff --git a/sys/arch/amd64/include/biosvar.h b/sys/arch/amd64/include/biosvar.h index c881b648ad7..92e505a2532 100644 --- a/sys/arch/amd64/include/biosvar.h +++ b/sys/arch/amd64/include/biosvar.h @@ -1,5 +1,5 @@ /* XXX - DSR */ -/* $OpenBSD: biosvar.h,v 1.7 2006/05/20 22:36:33 deraadt Exp $ */ +/* $OpenBSD: biosvar.h,v 1.8 2007/12/05 19:17:14 deraadt Exp $ */ /* * Copyright (c) 1997-1999 Michael Shalayeff @@ -226,17 +226,19 @@ extern volatile struct BIOS_regs { #include <machine/bus.h> struct bios_attach_args { - char *bios_dev; - u_int bios_func; - bus_space_tag_t bios_iot; - bus_space_tag_t bios_memt; + char *ba_name; + u_int ba_biosfunc; + bus_space_tag_t ba_iot; + bus_space_tag_t ba_memt; union { - void *_p; - bios_apminfo_t *_bios_apmp; + void *_p; + bios_apminfo_t *_ba_apmp; + paddr_t _ba_acpipbase; } _; }; -#define bios_apmp _._bios_apmp +#define ba_apmp _._ba_apmp +#define ba_acpipbase _._ba_acpipbase struct consdev; struct proc; |