diff mbox

[U-Boot,v2,13/22] x86: Do not clear high table area for S3

Message ID 1492784689-15701-14-git-send-email-bmeng.cn@gmail.com
State Accepted
Commit 95e50dd197cb86641a4ad06a18d5a4c57ea0a6f4
Delegated to: Bin Meng
Headers show

Commit Message

Bin Meng April 21, 2017, 2:24 p.m. UTC
When SeaBIOS is being used, U-Boot reserves a memory area to be
used for configuration tables like ACPI. But it should not be
cleared otherwise ACPI table will be missing.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>

---

Changes in v2:
- new patch "Do not clear high table area for S3"
- drop patch "x86: fsp: Mark the first 64K low memory as reserved"
  as it causes boot failure on GRUB

 arch/x86/lib/coreboot_table.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

Comments

Simon Glass April 24, 2017, 3:38 a.m. UTC | #1
On 21 April 2017 at 08:24, Bin Meng <bmeng.cn@gmail.com> wrote:
> When SeaBIOS is being used, U-Boot reserves a memory area to be
> used for configuration tables like ACPI. But it should not be
> cleared otherwise ACPI table will be missing.
>
> Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
>
> ---
>
> Changes in v2:
> - new patch "Do not clear high table area for S3"
> - drop patch "x86: fsp: Mark the first 64K low memory as reserved"
>   as it causes boot failure on GRUB
>
>  arch/x86/lib/coreboot_table.c | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)

Reviewed-by: Simon Glass <sjg@chromium.org>
Bin Meng April 26, 2017, 7:35 a.m. UTC | #2
On Mon, Apr 24, 2017 at 11:38 AM, Simon Glass <sjg@chromium.org> wrote:
> On 21 April 2017 at 08:24, Bin Meng <bmeng.cn@gmail.com> wrote:
>> When SeaBIOS is being used, U-Boot reserves a memory area to be
>> used for configuration tables like ACPI. But it should not be
>> cleared otherwise ACPI table will be missing.
>>
>> Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
>>
>> ---
>>
>> Changes in v2:
>> - new patch "Do not clear high table area for S3"
>> - drop patch "x86: fsp: Mark the first 64K low memory as reserved"
>>   as it causes boot failure on GRUB
>>
>>  arch/x86/lib/coreboot_table.c | 7 ++++++-
>>  1 file changed, 6 insertions(+), 1 deletion(-)
>
> Reviewed-by: Simon Glass <sjg@chromium.org>

applied to u-boot-x86/next, thanks!
diff mbox

Patch

diff --git a/arch/x86/lib/coreboot_table.c b/arch/x86/lib/coreboot_table.c
index ceab3cf..b1b4cd9 100644
--- a/arch/x86/lib/coreboot_table.c
+++ b/arch/x86/lib/coreboot_table.c
@@ -6,6 +6,7 @@ 
 
 #include <common.h>
 #include <vbe.h>
+#include <asm/acpi_s3.h>
 #include <asm/coreboot_tables.h>
 #include <asm/e820.h>
 
@@ -19,7 +20,11 @@  int high_table_reserve(void)
 	gd->arch.high_table_ptr = gd->start_addr_sp;
 
 	/* clear the memory */
-	memset((void *)gd->arch.high_table_ptr, 0, CONFIG_HIGH_TABLE_SIZE);
+#ifdef CONFIG_HAVE_ACPI_RESUME
+	if (gd->arch.prev_sleep_state != ACPI_S3)
+#endif
+		memset((void *)gd->arch.high_table_ptr, 0,
+		       CONFIG_HIGH_TABLE_SIZE);
 
 	gd->start_addr_sp &= ~0xf;