]> git.ipfire.org Git - people/ms/u-boot.git/commitdiff
x86: zImage: Propagate acpi_rsdp_addr to kernel via boot parameters
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Wed, 10 Jan 2018 17:40:15 +0000 (19:40 +0200)
committerBin Meng <bmeng.cn@gmail.com>
Tue, 30 Jan 2018 06:29:07 +0000 (14:29 +0800)
New field acpi_rsdp_addr, which has been introduced in boot protocol
v2.14 [1], in boot parameters tells kernel the exact address of RDSP
ACPI table. Knowing it increases robustness of the kernel by avoiding
in some cases traversal through a part of physical memory.
It will slightly reduce boot time by the same reason.

[1] See Linux kernel commit

  2f74cbf ("x86/boot: Add the ACPI RSDP address to struct setup_header::acpi_rdsp_addr")
  @ https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git/commit/?id=2f74cbf

for the details.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
[bmeng: updated the kernel commit git URL and fixed one style issue]
Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
arch/x86/include/asm/bootparam.h
arch/x86/lib/acpi_table.c
arch/x86/lib/acpi_table.h [new file with mode: 0644]
arch/x86/lib/zimage.c

index 48b138c6b0e9ed9d14c1d30ba445c42136ed6073..90768a99ceb829d82d77bc61db7a947fa6daa27f 100644 (file)
@@ -66,6 +66,7 @@ struct setup_header {
        __u64   pref_address;
        __u32   init_size;
        __u32   handover_offset;
+       __u64   acpi_rsdp_addr;
 } __attribute__((packed));
 
 struct sys_desc_table {
index 7b33cd371eb28f54a95479aa0428c1cfd6b5dd46..d3e5d2e104df54619be1362734689043ea74341f 100644 (file)
@@ -20,6 +20,7 @@
 #include <asm/mpspec.h>
 #include <asm/tables.h>
 #include <asm/arch/global_nvs.h>
+#include "acpi_table.h"
 
 /*
  * IASL compiles the dsdt entries and writes the hex values
@@ -27,6 +28,9 @@
  */
 extern const unsigned char AmlCode[];
 
+/* ACPI RSDP address to be used in boot parameters */
+unsigned long acpi_rsdp_addr;
+
 static void acpi_write_rsdp(struct acpi_rsdp *rsdp, struct acpi_rsdt *rsdt,
                            struct acpi_xsdt *xsdt)
 {
@@ -460,6 +464,7 @@ ulong write_acpi_tables(ulong start)
 
        debug("current = %x\n", current);
 
+       acpi_rsdp_addr = (unsigned long)rsdp;
        debug("ACPI: done\n");
 
        /* Don't touch ACPI hardware on HW reduced platforms */
diff --git a/arch/x86/lib/acpi_table.h b/arch/x86/lib/acpi_table.h
new file mode 100644 (file)
index 0000000..cece5d1
--- /dev/null
@@ -0,0 +1,10 @@
+/*
+ * SPDX-License-Identifier:    GPL-2.0
+ */
+
+#ifndef _X86_LIB_ACPI_TABLES_H
+#define _X86_LIB_ACPI_TABLES_H
+
+extern unsigned long acpi_rsdp_addr;
+
+#endif
index d224db4e07ec9fa08e1891634135d9479d0a148f..eae26635b1bc90ffb43ea8a8e650740948e57275 100644 (file)
@@ -24,6 +24,7 @@
 #include <asm/arch/timestamp.h>
 #endif
 #include <linux/compiler.h>
+#include "acpi_table.h"
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -255,6 +256,11 @@ int setup_zimage(struct boot_params *setup_base, char *cmd_line, int auto_boot,
                hdr->hardware_subarch = X86_SUBARCH_INTEL_MID;
 #endif
 
+#ifdef CONFIG_GENERATE_ACPI_TABLE
+       if (bootproto >= 0x020e)
+               hdr->acpi_rsdp_addr = acpi_rsdp_addr;
+#endif
+
        setup_video(&setup_base->screen_info);
 
        return 0;