]> git.ipfire.org Git - people/ms/u-boot.git/commitdiff
x86: acpi: Use an API to get the ACPI RSDP table address
authorBin Meng <bmeng.cn@gmail.com>
Tue, 30 Jan 2018 13:01:16 +0000 (05:01 -0800)
committerBin Meng <bmeng.cn@gmail.com>
Tue, 30 Jan 2018 14:34:37 +0000 (22:34 +0800)
At present the acpi_rsdp_addr variable is directly referenced in
setup_zimage(). This changes to use an API for better encapsulation
and extension.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
arch/x86/include/asm/acpi_table.h
arch/x86/lib/acpi_table.c
arch/x86/lib/acpi_table.h [deleted file]
arch/x86/lib/zimage.c

index 80038504ddb8a2388995f6a5a7883ccb50e3b9cd..d5d77cc01172b323b113fca38f52e951ce9e8f54 100644 (file)
@@ -329,6 +329,15 @@ void acpi_create_gnvs(struct acpi_global_nvs *gnvs);
 void enter_acpi_mode(int pm1_cnt);
 ulong write_acpi_tables(ulong start);
 
+/**
+ * acpi_get_rsdp_addr() - get ACPI RSDP table address
+ *
+ * This routine returns the ACPI RSDP table address in the system memory.
+ *
+ * @return:    ACPI RSDP table address
+ */
+ulong acpi_get_rsdp_addr(void);
+
 /**
  * acpi_find_fadt() - find ACPI FADT table in the sytem memory
  *
index d3e5d2e104df54619be1362734689043ea74341f..0d448cffc949981698c0d5a3e9bf2d7b4639efc3 100644 (file)
@@ -20,7 +20,6 @@
 #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
@@ -29,7 +28,7 @@
 extern const unsigned char AmlCode[];
 
 /* ACPI RSDP address to be used in boot parameters */
-unsigned long acpi_rsdp_addr;
+static ulong acpi_rsdp_addr;
 
 static void acpi_write_rsdp(struct acpi_rsdp *rsdp, struct acpi_rsdt *rsdt,
                            struct acpi_xsdt *xsdt)
@@ -480,6 +479,11 @@ ulong write_acpi_tables(ulong start)
        return current;
 }
 
+ulong acpi_get_rsdp_addr(void)
+{
+       return acpi_rsdp_addr;
+}
+
 static struct acpi_rsdp *acpi_valid_rsdp(struct acpi_rsdp *rsdp)
 {
        if (strncmp((char *)rsdp, RSDP_SIG, sizeof(RSDP_SIG) - 1) != 0)
diff --git a/arch/x86/lib/acpi_table.h b/arch/x86/lib/acpi_table.h
deleted file mode 100644 (file)
index cece5d1..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-/*
- * 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 eae26635b1bc90ffb43ea8a8e650740948e57275..2a82bc83d6cfcb19bc3b2513ae2bdc6920cca123 100644 (file)
@@ -14,6 +14,7 @@
  */
 
 #include <common.h>
+#include <asm/acpi_table.h>
 #include <asm/io.h>
 #include <asm/ptrace.h>
 #include <asm/zimage.h>
@@ -24,7 +25,6 @@
 #include <asm/arch/timestamp.h>
 #endif
 #include <linux/compiler.h>
-#include "acpi_table.h"
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -258,7 +258,7 @@ int setup_zimage(struct boot_params *setup_base, char *cmd_line, int auto_boot,
 
 #ifdef CONFIG_GENERATE_ACPI_TABLE
        if (bootproto >= 0x020e)
-               hdr->acpi_rsdp_addr = acpi_rsdp_addr;
+               hdr->acpi_rsdp_addr = acpi_get_rsdp_addr();
 #endif
 
        setup_video(&setup_base->screen_info);