x86: Move acpi_s3.h to include/acpi/
authorSimon Glass <sjg@chromium.org>
Wed, 8 Apr 2020 22:57:35 +0000 (16:57 -0600)
committerBin Meng <bmeng.cn@gmail.com>
Thu, 16 Apr 2020 06:36:28 +0000 (14:36 +0800)
This header relates to ACPI and we are about to add some more ACPI
headers. Move this one into a new directory so they are together.

The header inclusion in pci_rom.c is not specific to x86 anymore, so drop
the #ifdef CONFIG_X86.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Wolfgang Wallner <wolfgang.wallner@br-automation.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
16 files changed:
arch/x86/cpu/apollolake/cpu_spl.c
arch/x86/cpu/apollolake/fsp_s.c
arch/x86/cpu/apollolake/pmc.c
arch/x86/cpu/baytrail/acpi.c
arch/x86/cpu/cpu.c
arch/x86/cpu/wakeup.S
arch/x86/lib/acpi_s3.c
arch/x86/lib/coreboot_table.c
arch/x86/lib/fsp/fsp_common.c
arch/x86/lib/fsp1/fsp_common.c
arch/x86/lib/fsp2/fsp_dram.c
drivers/pci/pci_rom.c
drivers/power/acpi_pmc/acpi-pmc-uclass.c
drivers/sysreset/sysreset_x86.c
include/acpi/acpi_s3.h [new file with mode: 0644]
include/acpi_s3.h [deleted file]

index 8a39c3128e0480f2c095bbcbb7f53bca504ecd3d..e2509e391faef9e41afa1c583eee07539275766d 100644 (file)
@@ -6,13 +6,13 @@
  */
 
 #include <common.h>
-#include <acpi_s3.h>
 #include <dm.h>
 #include <ec_commands.h>
 #include <log.h>
 #include <spi_flash.h>
 #include <spl.h>
 #include <syscon.h>
+#include <acpi/acpi_s3.h>
 #include <asm/cpu.h>
 #include <asm/cpu_common.h>
 #include <asm/cpu_x86.h>
index 1f22c1ea3c68f748280604058ccaae040fc05b5b..17cf1682ad03d089f3867da0bb01b984f956ad53 100644 (file)
@@ -5,11 +5,11 @@
  */
 
 #include <common.h>
-#include <acpi_s3.h>
 #include <binman.h>
 #include <dm.h>
 #include <irq.h>
 #include <malloc.h>
+#include <acpi/acpi_s3.h>
 #include <asm/intel_pinctrl.h>
 #include <asm/io.h>
 #include <asm/intel_regs.h>
index aec0c8394c2e5b708e1fdcd6d09b9d4ef2d4d486..4ea7c7447bc95425eeb7695dca06d518935776fd 100644 (file)
@@ -9,10 +9,10 @@
 #define LOG_CATEGORY UCLASS_ACPI_PMC
 
 #include <common.h>
-#include <acpi_s3.h>
 #include <dt-structs.h>
 #include <dm.h>
 #include <spl.h>
+#include <acpi/acpi_s3.h>
 #include <asm/io.h>
 #include <asm/pci.h>
 #include <power/acpi_pmc.h>
index f44228e693980080868f3646e2a6ca454934b60a..3c27391873c7de35b1f5435b3e60ea861fa5591d 100644 (file)
@@ -4,15 +4,15 @@
  */
 
 #include <common.h>
-#include <acpi_s3.h>
 #include <cpu.h>
 #include <dm.h>
-#include <dm/uclass-internal.h>
+#include <acpi/acpi_s3.h>
 #include <asm/acpi_table.h>
 #include <asm/io.h>
 #include <asm/tables.h>
 #include <asm/arch/global_nvs.h>
 #include <asm/arch/iomap.h>
+#include <dm/uclass-internal.h>
 
 void acpi_create_fadt(struct acpi_fadt *fadt, struct acpi_facs *facs,
                      void *dsdt)
index dae06949cc6e7899408e98d6ed59dae916caab66..246ee50948cd9d500c4e86efe443ed92190f6d99 100644 (file)
@@ -19,7 +19,6 @@
  */
 
 #include <common.h>
-#include <acpi_s3.h>
 #include <command.h>
 #include <cpu_func.h>
 #include <dm.h>
@@ -27,6 +26,7 @@
 #include <init.h>
 #include <malloc.h>
 #include <syscon.h>
+#include <acpi/acpi_s3.h>
 #include <asm/acpi.h>
 #include <asm/acpi_table.h>
 #include <asm/control_regs.h>
index 244ca1276af70834879f9d29e21a6df3dcf3c386..093bf3bcc5cfdb932f67d9a1f7bca99adf8bd099 100644 (file)
@@ -5,7 +5,7 @@
  * From coreboot src/arch/x86/wakeup.S
  */
 
-#include <acpi_s3.h>
+#include <acpi/acpi_s3.h>
 #include <asm/processor.h>
 #include <asm/processor-flags.h>
 
index 197636c4b507eb3fd11eb09fae08a344b7d17a9a..c3759ec84924fab5804fe34cb22c75346bfa97d0 100644 (file)
@@ -4,7 +4,7 @@
  */
 
 #include <common.h>
-#include <acpi_s3.h>
+#include <acpi/acpi_s3.h>
 #include <asm/acpi.h>
 #include <asm/acpi_table.h>
 #include <asm/post.h>
index 2943e11d2a40a77b88920a5f8468d8d4dd01f2c9..c996fc588df702d71dd5e2a31ef1686cda0a9c8b 100644 (file)
@@ -4,9 +4,9 @@
  */
 
 #include <common.h>
-#include <acpi_s3.h>
 #include <malloc.h>
 #include <vbe.h>
+#include <acpi/acpi_s3.h>
 #include <asm/coreboot_tables.h>
 #include <asm/e820.h>
 
index 5eff0f99aad56c586493f352cdd171d9a9a33953..267527eb3448b28eeaba549de4c719150ab4a865 100644 (file)
@@ -4,11 +4,11 @@
  */
 
 #include <common.h>
-#include <acpi_s3.h>
 #include <cpu_func.h>
 #include <dm.h>
 #include <errno.h>
 #include <rtc.h>
+#include <acpi/acpi_s3.h>
 #include <asm/cmos_layout.h>
 #include <asm/early_cmos.h>
 #include <asm/io.h>
index aee2a05044f8ab0ccda947e27e2924e71b4b494a..0a726807c2b31eb7d21e4dac34864a9ed72b95e0 100644 (file)
@@ -4,11 +4,11 @@
  */
 
 #include <common.h>
-#include <acpi_s3.h>
 #include <dm.h>
 #include <errno.h>
 #include <malloc.h>
 #include <rtc.h>
+#include <acpi/acpi_s3.h>
 #include <asm/cmos_layout.h>
 #include <asm/early_cmos.h>
 #include <asm/io.h>
index 90a238a224548cfa3dbed1d191f8567c8fc125d5..c8f2c09b6a77142e795145ee8702db1de91a2169 100644 (file)
@@ -5,9 +5,9 @@
  */
 
 #include <common.h>
-#include <acpi_s3.h>
 #include <handoff.h>
 #include <spl.h>
+#include <acpi/acpi_s3.h>
 #include <asm/arch/cpu.h>
 #include <asm/fsp/fsp_support.h>
 #include <asm/fsp2/fsp_api.h>
index 90f224b045234ef5b4117da0562b3481e608999b..6b17f18bc075a45826a5638f8fcd79d2303257a5 100644 (file)
 #include <vbe.h>
 #include <video.h>
 #include <video_fb.h>
+#include <acpi/acpi_s3.h>
 #include <linux/screen_info.h>
 
-#ifdef CONFIG_X86
-#include <acpi_s3.h>
 DECLARE_GLOBAL_DATA_PTR;
-#endif
 
 __weak bool board_should_run_oprom(struct udevice *dev)
 {
index d43de87126c1d9630d9a1ab1c42e52014200327b..1c79f835c667e3c1418be42aaa3b506e23d7d9ff 100644 (file)
@@ -6,9 +6,9 @@
 #define LOG_CATEGORY UCLASS_ACPI_PMC
 
 #include <common.h>
-#include <acpi_s3.h>
 #include <dm.h>
 #include <log.h>
+#include <acpi/acpi_s3.h>
 #ifdef CONFIG_X86
 #include <asm/intel_pinctrl.h>
 #endif
index 8e2d1eaa7a1312e10cc56711d5f2737cdcb31b5e..bc911435602a2f56dd105829cd640a5b2a672a68 100644 (file)
@@ -6,11 +6,11 @@
  */
 
 #include <common.h>
-#include <acpi_s3.h>
 #include <dm.h>
 #include <efi_loader.h>
 #include <pch.h>
 #include <sysreset.h>
+#include <acpi/acpi_s3.h>
 #include <asm/io.h>
 #include <asm/processor.h>
 
diff --git a/include/acpi/acpi_s3.h b/include/acpi/acpi_s3.h
new file mode 100644 (file)
index 0000000..baa848d
--- /dev/null
@@ -0,0 +1,130 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * Copyright (C) 2017, Bin Meng <bmeng.cn@gmail.com>
+ */
+
+#ifndef __ASM_ACPI_S3_H__
+#define __ASM_ACPI_S3_H__
+
+#define WAKEUP_BASE    0x600
+
+/* PM1_STATUS register */
+#define WAK_STS                (1 << 15)
+#define PCIEXPWAK_STS  (1 << 14)
+#define RTC_STS                (1 << 10)
+#define SLPBTN_STS     (1 << 9)
+#define PWRBTN_STS     (1 << 8)
+#define GBL_STS                (1 << 5)
+#define BM_STS         (1 << 4)
+#define TMR_STS                (1 << 0)
+
+/* PM1_CNT register */
+#define SLP_EN         (1 << 13)
+#define SLP_TYP_SHIFT  10
+#define SLP_TYP                (7 << SLP_TYP_SHIFT)
+#define SLP_TYP_S0     0
+#define SLP_TYP_S1     1
+#define SLP_TYP_S3     5
+#define SLP_TYP_S4     6
+#define SLP_TYP_S5     7
+
+/* Memory size reserved for S3 resume */
+#define S3_RESERVE_SIZE        0x1000
+
+#ifndef __ASSEMBLY__
+
+extern char __wakeup[];
+extern int __wakeup_size;
+
+enum acpi_sleep_state {
+       ACPI_S0,
+       ACPI_S1,
+       ACPI_S2,
+       ACPI_S3,
+       ACPI_S4,
+       ACPI_S5,
+};
+
+/**
+ * acpi_ss_string() - get ACPI-defined sleep state string
+ *
+ * @pm1_cnt:   ACPI-defined sleep state
+ * @return:    a pointer to the sleep state string.
+ */
+static inline char *acpi_ss_string(enum acpi_sleep_state state)
+{
+       char *ss_string[] = { "S0", "S1", "S2", "S3", "S4", "S5"};
+
+       return ss_string[state];
+}
+
+/**
+ * acpi_sleep_from_pm1() - get ACPI-defined sleep state from PM1_CNT register
+ *
+ * @pm1_cnt:   PM1_CNT register value
+ * @return:    ACPI-defined sleep state if given valid PM1_CNT register value,
+ *             -EINVAL otherwise.
+ */
+static inline enum acpi_sleep_state acpi_sleep_from_pm1(u32 pm1_cnt)
+{
+       switch ((pm1_cnt & SLP_TYP) >> SLP_TYP_SHIFT) {
+       case SLP_TYP_S0:
+               return ACPI_S0;
+       case SLP_TYP_S1:
+               return ACPI_S1;
+       case SLP_TYP_S3:
+               return ACPI_S3;
+       case SLP_TYP_S4:
+               return ACPI_S4;
+       case SLP_TYP_S5:
+               return ACPI_S5;
+       }
+
+       return -EINVAL;
+}
+
+/**
+ * chipset_prev_sleep_state() - Get chipset previous sleep state
+ *
+ * This returns chipset previous sleep state from ACPI registers.
+ * Platform codes must supply this routine in order to support ACPI S3.
+ *
+ * @return ACPI_S0/S1/S2/S3/S4/S5.
+ */
+enum acpi_sleep_state chipset_prev_sleep_state(void);
+
+/**
+ * chipset_clear_sleep_state() - Clear chipset sleep state
+ *
+ * This clears chipset sleep state in ACPI registers.
+ * Platform codes must supply this routine in order to support ACPI S3.
+ */
+void chipset_clear_sleep_state(void);
+
+struct acpi_fadt;
+/**
+ * acpi_resume() - Do ACPI S3 resume
+ *
+ * This calls U-Boot wake up assembly stub and jumps to OS's wake up vector.
+ *
+ * @fadt:      FADT table pointer in the ACPI table
+ * @return:    Never returns
+ */
+void acpi_resume(struct acpi_fadt *fadt);
+
+/**
+ * acpi_s3_reserve() - Reserve memory for ACPI S3 resume
+ *
+ * This copies memory where real mode interrupt handler stubs reside to the
+ * reserved place on the stack.
+ *
+ * This routine should be called by reserve_arch() before U-Boot is relocated
+ * when ACPI S3 resume is enabled.
+ *
+ * @return:    0 always
+ */
+int acpi_s3_reserve(void);
+
+#endif /* __ASSEMBLY__ */
+
+#endif /* __ASM_ACPI_S3_H__ */
diff --git a/include/acpi_s3.h b/include/acpi_s3.h
deleted file mode 100644 (file)
index baa848d..0000000
+++ /dev/null
@@ -1,130 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0+ */
-/*
- * Copyright (C) 2017, Bin Meng <bmeng.cn@gmail.com>
- */
-
-#ifndef __ASM_ACPI_S3_H__
-#define __ASM_ACPI_S3_H__
-
-#define WAKEUP_BASE    0x600
-
-/* PM1_STATUS register */
-#define WAK_STS                (1 << 15)
-#define PCIEXPWAK_STS  (1 << 14)
-#define RTC_STS                (1 << 10)
-#define SLPBTN_STS     (1 << 9)
-#define PWRBTN_STS     (1 << 8)
-#define GBL_STS                (1 << 5)
-#define BM_STS         (1 << 4)
-#define TMR_STS                (1 << 0)
-
-/* PM1_CNT register */
-#define SLP_EN         (1 << 13)
-#define SLP_TYP_SHIFT  10
-#define SLP_TYP                (7 << SLP_TYP_SHIFT)
-#define SLP_TYP_S0     0
-#define SLP_TYP_S1     1
-#define SLP_TYP_S3     5
-#define SLP_TYP_S4     6
-#define SLP_TYP_S5     7
-
-/* Memory size reserved for S3 resume */
-#define S3_RESERVE_SIZE        0x1000
-
-#ifndef __ASSEMBLY__
-
-extern char __wakeup[];
-extern int __wakeup_size;
-
-enum acpi_sleep_state {
-       ACPI_S0,
-       ACPI_S1,
-       ACPI_S2,
-       ACPI_S3,
-       ACPI_S4,
-       ACPI_S5,
-};
-
-/**
- * acpi_ss_string() - get ACPI-defined sleep state string
- *
- * @pm1_cnt:   ACPI-defined sleep state
- * @return:    a pointer to the sleep state string.
- */
-static inline char *acpi_ss_string(enum acpi_sleep_state state)
-{
-       char *ss_string[] = { "S0", "S1", "S2", "S3", "S4", "S5"};
-
-       return ss_string[state];
-}
-
-/**
- * acpi_sleep_from_pm1() - get ACPI-defined sleep state from PM1_CNT register
- *
- * @pm1_cnt:   PM1_CNT register value
- * @return:    ACPI-defined sleep state if given valid PM1_CNT register value,
- *             -EINVAL otherwise.
- */
-static inline enum acpi_sleep_state acpi_sleep_from_pm1(u32 pm1_cnt)
-{
-       switch ((pm1_cnt & SLP_TYP) >> SLP_TYP_SHIFT) {
-       case SLP_TYP_S0:
-               return ACPI_S0;
-       case SLP_TYP_S1:
-               return ACPI_S1;
-       case SLP_TYP_S3:
-               return ACPI_S3;
-       case SLP_TYP_S4:
-               return ACPI_S4;
-       case SLP_TYP_S5:
-               return ACPI_S5;
-       }
-
-       return -EINVAL;
-}
-
-/**
- * chipset_prev_sleep_state() - Get chipset previous sleep state
- *
- * This returns chipset previous sleep state from ACPI registers.
- * Platform codes must supply this routine in order to support ACPI S3.
- *
- * @return ACPI_S0/S1/S2/S3/S4/S5.
- */
-enum acpi_sleep_state chipset_prev_sleep_state(void);
-
-/**
- * chipset_clear_sleep_state() - Clear chipset sleep state
- *
- * This clears chipset sleep state in ACPI registers.
- * Platform codes must supply this routine in order to support ACPI S3.
- */
-void chipset_clear_sleep_state(void);
-
-struct acpi_fadt;
-/**
- * acpi_resume() - Do ACPI S3 resume
- *
- * This calls U-Boot wake up assembly stub and jumps to OS's wake up vector.
- *
- * @fadt:      FADT table pointer in the ACPI table
- * @return:    Never returns
- */
-void acpi_resume(struct acpi_fadt *fadt);
-
-/**
- * acpi_s3_reserve() - Reserve memory for ACPI S3 resume
- *
- * This copies memory where real mode interrupt handler stubs reside to the
- * reserved place on the stack.
- *
- * This routine should be called by reserve_arch() before U-Boot is relocated
- * when ACPI S3 resume is enabled.
- *
- * @return:    0 always
- */
-int acpi_s3_reserve(void);
-
-#endif /* __ASSEMBLY__ */
-
-#endif /* __ASM_ACPI_S3_H__ */