Source-Changes-HG archive

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

[src/trunk]: src/sys/stand/efiboot Disable ACPI support when booting big endi...



details:   https://anonhg.NetBSD.org/src/rev/896af31425cf
branches:  trunk
changeset: 1021267:896af31425cf
user:      jmcneill <jmcneill%NetBSD.org@localhost>
date:      Fri May 21 21:53:15 2021 +0000

description:
Disable ACPI support when booting big endian kernels.

diffstat:

 sys/stand/efiboot/efiacpi.c |  15 ++++++++++++++-
 sys/stand/efiboot/efiacpi.h |   4 +++-
 sys/stand/efiboot/efifdt.c  |   4 ++--
 sys/stand/efiboot/exec.c    |   7 +++++--
 sys/stand/efiboot/version   |   3 ++-
 5 files changed, 26 insertions(+), 7 deletions(-)

diffs (105 lines):

diff -r 6b838b0ceb54 -r 896af31425cf sys/stand/efiboot/efiacpi.c
--- a/sys/stand/efiboot/efiacpi.c       Fri May 21 21:52:15 2021 +0000
+++ b/sys/stand/efiboot/efiacpi.c       Fri May 21 21:53:15 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: efiacpi.c,v 1.8 2020/10/10 19:17:39 jmcneill Exp $ */
+/* $NetBSD: efiacpi.c,v 1.9 2021/05/21 21:53:15 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -53,6 +53,7 @@
 static EFI_GUID Acpi20TableGuid = ACPI_20_TABLE_GUID;
 static EFI_GUID Smbios3TableGuid = SMBIOS3_TABLE_GUID;
 
+static int acpi_enable = 1;
 static void *acpi_root = NULL;
 static void *smbios3_table = NULL;
 
@@ -78,6 +79,18 @@
        return acpi_root != NULL;
 }
 
+int
+efi_acpi_enabled(void)
+{
+       return acpi_enable;
+}
+
+void
+efi_acpi_enable(int enable)
+{
+       acpi_enable = enable;
+}
+
 static char model_buf[128];
 
 static const char *
diff -r 6b838b0ceb54 -r 896af31425cf sys/stand/efiboot/efiacpi.h
--- a/sys/stand/efiboot/efiacpi.h       Fri May 21 21:52:15 2021 +0000
+++ b/sys/stand/efiboot/efiacpi.h       Fri May 21 21:53:15 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: efiacpi.h,v 1.1 2018/10/12 22:08:04 jmcneill Exp $ */
+/* $NetBSD: efiacpi.h,v 1.2 2021/05/21 21:53:15 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -32,4 +32,6 @@
 int efi_acpi_probe(void);
 void efi_acpi_show(void);
 int efi_acpi_available(void);
+int efi_acpi_enabled(void);
+void efi_acpi_enable(int);
 int efi_acpi_create_fdt(void);
diff -r 6b838b0ceb54 -r 896af31425cf sys/stand/efiboot/efifdt.c
--- a/sys/stand/efiboot/efifdt.c        Fri May 21 21:52:15 2021 +0000
+++ b/sys/stand/efiboot/efifdt.c        Fri May 21 21:53:15 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: efifdt.c,v 1.28 2020/12/19 08:09:31 skrll Exp $ */
+/* $NetBSD: efifdt.c,v 1.29 2021/05/21 21:53:15 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2019 Jason R. Thorpe
@@ -370,7 +370,7 @@
                /*
                 * In ACPI mode, use GOP as console.
                 */
-               if (efi_acpi_available()) {
+               if (efi_acpi_available() && efi_acpi_enabled()) {
                        snprintf(buf, sizeof(buf), "/chosen/framebuffer@%" PRIx64, mode->FrameBufferBase);
                        fdt_setprop_string(fdt_data, chosen, "stdout-path", buf);
                }
diff -r 6b838b0ceb54 -r 896af31425cf sys/stand/efiboot/exec.c
--- a/sys/stand/efiboot/exec.c  Fri May 21 21:52:15 2021 +0000
+++ b/sys/stand/efiboot/exec.c  Fri May 21 21:53:15 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: exec.c,v 1.20 2021/05/11 07:15:10 skrll Exp $ */
+/* $NetBSD: exec.c,v 1.21 2021/05/21 21:53:15 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2019 Jason R. Thorpe
@@ -289,7 +289,10 @@
        load_offset = 0;
 
 #ifdef EFIBOOT_ACPI
-       if (efi_acpi_available()) {
+       /* ACPI support only works for little endian kernels */
+       efi_acpi_enable(netbsd_elf_data == ELFDATA2LSB);
+
+       if (efi_acpi_available() && efi_acpi_enabled()) {
                efi_acpi_create_fdt();
        } else
 #endif
diff -r 6b838b0ceb54 -r 896af31425cf sys/stand/efiboot/version
--- a/sys/stand/efiboot/version Fri May 21 21:52:15 2021 +0000
+++ b/sys/stand/efiboot/version Fri May 21 21:53:15 2021 +0000
@@ -1,4 +1,4 @@
-$NetBSD: version,v 1.22 2020/10/18 18:09:32 tnn Exp $
+$NetBSD: version,v 1.23 2021/05/21 21:53:15 jmcneill Exp $
 
 NOTE ANY CHANGES YOU MAKE TO THE EFI BOOTLOADER HERE.  The format of this
 file is important - make sure the entries are appended on end, last item
@@ -26,3 +26,4 @@
 2.3:   EFI RT and GOP support for devicetree mode.
 2.4:   Add ISO9660 support.
 2.5:   Recognize the EFI system partion as fstype MSDOS.
+2.6:   Disable ACPI support when booting big endian kernels.



Home | Main Index | Thread Index | Old Index