Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/x86/isa If ACPI indicates that there are no user vi...



details:   https://anonhg.NetBSD.org/src/rev/e50d1641a769
branches:  trunk
changeset: 989510:e50d1641a769
user:      jmcneill <jmcneill%NetBSD.org@localhost>
date:      Fri Oct 15 18:44:53 2021 +0000

description:
If ACPI indicates that there are no user visible devices on the LPC or ISA
bus, set the "no-legacy-devices" property on isa to bypass indirect
configuration of ISA devices.

diffstat:

 sys/arch/x86/isa/isa_machdep.c |  17 ++++++++++++-----
 1 files changed, 12 insertions(+), 5 deletions(-)

diffs (42 lines):

diff -r 42c61b8c1db2 -r e50d1641a769 sys/arch/x86/isa/isa_machdep.c
--- a/sys/arch/x86/isa/isa_machdep.c    Fri Oct 15 18:12:48 2021 +0000
+++ b/sys/arch/x86/isa/isa_machdep.c    Fri Oct 15 18:44:53 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: isa_machdep.c,v 1.46 2020/05/02 16:44:35 bouyer Exp $  */
+/*     $NetBSD: isa_machdep.c,v 1.47 2021/10/15 18:44:53 jmcneill Exp $        */
 
 /*-
  * Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
@@ -65,7 +65,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: isa_machdep.c,v 1.46 2020/05/02 16:44:35 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: isa_machdep.c,v 1.47 2021/10/15 18:44:53 jmcneill Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -369,13 +369,20 @@
                prop_dictionary_set_bool(device_properties(dev),
                    "no-legacy-devices", true);
 #if NACPICA > 0
-#if notyet
        if (device_is_a(dev, "isa") && acpi_active) {
-               if (!(AcpiGbl_FADT.BootFlags & ACPI_FADT_LEGACY_DEVICES))
+               /*
+                * For FACP >= 2, the LEGACY_DEVICES flag indicates that
+                * the motherboard supports user-visible devices on the LPC
+                * or ISA bus. If clear, assume that no such devices are
+                * present and we can enumerate everything we need using
+                * ACPI tables.
+                */
+               if (AcpiGbl_FADT.Header.Revision >= 2 &&
+                   !(AcpiGbl_FADT.BootFlags & ACPI_FADT_LEGACY_DEVICES)) {
                        prop_dictionary_set_bool(device_properties(dev),
                            "no-legacy-devices", true);
+               }
        }
-#endif
 #endif /* NACPICA > 0 */
        return NULL;
 }



Home | Main Index | Thread Index | Old Index