u-boot-brain/arch/x86/lib
Bin Meng 5ae5aa9310 x86: acpi: Fix Windows S3 resume failure
U-Boot sets up the real mode interrupt handler stubs starting from
address 0x1000. In most cases, the first 640K (0x00000 - 0x9ffff)
system memory is reported as system RAM in E820 table to the OS.
(see install_e820_map() implementation for each platform). So OS
can use these memories whatever it wants.

If U-Boot is in an S3 resume path, care must be taken not to corrupt
these memorie otherwise OS data gets lost. Testing shows that, on
Microsoft Windows 10 on Intel Baytrail its wake up vector happens to
be installed at the same address 0x1000. While on Linux its wake up
vector does not overlap this memory range, but after resume kernel
checks low memory range per config option CONFIG_X86_RESERVE_LOW
which is 64K by default to see whether a memory corruption occurs
during the suspend/resume (it's harmless, but warnings are shown
in the kernel dmesg logs).

We cannot simply mark the these memory as reserved in E820 table
because such configuration makes GRUB complain: unable to allocate
real mode page. Hence we choose to back up these memories to the
place where we reserved on our stack for our S3 resume work.
Before jumping to OS wake up vector, we need restore the original
content there.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Tested-by: Stefan Roese <sr@denx.de>
2017-05-17 17:11:46 +08:00
..
efi board_f: Drop setup_dram_config() wrapper 2017-04-05 16:36:51 -04:00
fsp x86: fsp: Save stack address to CMOS for next S3 boot 2017-05-17 17:11:46 +08:00
acpi_s3.c x86: acpi: Fix Windows S3 resume failure 2017-05-17 17:11:46 +08:00
acpi_table.c x86: acpi: Refactor acpi_resume() 2017-05-17 17:11:46 +08:00
asm-offsets.c x86: Add support for passing tables into U-Boot 2015-08-05 08:44:07 -06:00
bios_asm.S x86: bios: Synchronize stack between real and protected mode 2015-07-14 18:03:18 -06:00
bios_interrupts.c dm: Convert bios_interrupts to use DM PCI API 2016-01-12 10:19:09 -07:00
bios.c x86: lib: Fix types and casts for 64-bit compilation 2017-02-06 11:38:46 +08:00
bios.h x86: move arch-specific asmlinkage to <asm/linkage.h> 2014-12-15 07:22:53 -07:00
bootm.c x86: bootm: Fix FIT image booting on x86 2017-04-10 10:02:03 +08:00
cmd_boot.c Add GPL-2.0+ SPDX-License-Identifier to source files 2013-07-24 09:44:38 -04:00
cmd_mtrr.c x86: cmd_mtrr: Improve MTRR list information 2015-07-14 18:03:18 -06:00
coreboot_table.c x86: Do not clear high table area for S3 2017-05-17 17:11:46 +08:00
crt0_ia32_efi.S x86: Move efi .S files into the 'lib' directory 2016-11-14 23:24:04 +01:00
crt0_x86_64_efi.S x86: Move efi .S files into the 'lib' directory 2016-11-14 23:24:04 +01:00
e820.c x86: Move install_e820_map() out of zimage.c 2015-10-21 07:46:25 -06:00
early_cmos.c x86: Add an early CMOS access library 2017-05-17 17:11:46 +08:00
elf_ia32_efi.lds efi: x86: Adjust EFI files support efi_loader 2016-11-14 23:24:04 +01:00
elf_x86_64_efi.lds efi: x86: Adjust EFI files support efi_loader 2016-11-14 23:24:04 +01:00
gcc.c Add more SPDX-License-Identifier tags 2016-01-19 08:31:21 -05:00
i8254.c x86: Rename pcat_ to i8254 and i8259 accordingly 2015-11-13 06:46:18 -08:00
i8259.c x86: Rename pcat_ to i8254 and i8259 accordingly 2015-11-13 06:46:18 -08:00
init_helpers.c x86: Use X86_32BIT_INIT instead of X86_RESET_VECTOR 2017-02-06 11:38:46 +08:00
interrupts.c x86: Drop interrupt support in 64-bit mode 2017-02-06 11:38:46 +08:00
lpc-uclass.c dm: Use dm_scan_fdt_dev() directly where possible 2016-07-27 14:15:54 -06:00
Makefile x86: Add an early CMOS access library 2017-05-17 17:11:46 +08:00
mpspec.c dm: core: Replace of_offset with accessor 2017-02-08 06:12:14 -07:00
mrccache.c x86: mrccache: Fix error handling in mrccache_get_region() 2016-10-11 11:55:33 +08:00
northbridge-uclass.c dm: x86: Add a northbridge uclass 2016-01-24 12:08:16 +08:00
physmem.c x86: Move paging functions into cpu.c 2014-10-28 20:42:51 -06:00
pinctrl_ich6.c dm: core: Replace of_offset with accessor 2017-02-08 06:12:14 -07:00
pirq_routing.c x86: Change irq_already_routed to a local variable 2017-02-07 13:07:30 +08:00
pmu.c x86: Introduce minimal PMU driver for Intel MID platforms 2017-04-10 10:02:03 +08:00
ramtest.c x86: ivybridge: Implement SDRAM init 2014-11-21 07:34:15 +01:00
reloc_ia32_efi.c x86: Move efi .S files into the 'lib' directory 2016-11-14 23:24:04 +01:00
reloc_x86_64_efi.c x86: Move efi .S files into the 'lib' directory 2016-11-14 23:24:04 +01:00
relocate.c board_f: Make relocation functions generic 2017-04-05 16:36:57 -04:00
scu.c x86: Add SCU IPC driver for Intel MID platforms 2017-04-10 10:02:03 +08:00
sections.c x86: efi: Add EFI loader support for x86 2016-10-19 09:01:53 +02:00
sfi.c x86: Use unsigned long for address in table generation 2017-02-06 11:38:46 +08:00
spl.c x86: Display the SPL banner only once 2017-04-18 15:51:21 +08:00
string.c x86: Add an accelerated memmove() function 2016-10-11 11:55:33 +08:00
tables.c x86: Use unsigned long for address in table generation 2017-02-06 11:38:46 +08:00
zimage.c x86: zImage: add Intel MID platforms support 2017-02-21 15:10:50 +08:00