x86: acpi: Support installation of Ubuntu/Windows and boot Windows
v2 cover x86: acpi: Support installation of Ubuntu/Windows and boot Windows
SeaBIOS can be loaded by U-Boot to aid the installation of Ubuntu and Windows to a SATA drive and boot from there. But till now this is broken. The installation either hangs forever or just crashes.
This series fixed a bunch of issues that affect the installation of Ubuntu and Windows, and booting Windows.
Testing was performed on MinnowMax by:
- Install Ubuntu 14.04 and boot
- Install Windows 8.1 and boot
- Install Windows 10 and boot
This series is available at u-boot-x86/acpi2-working.
Changes in v2:
- New patch to remove the unnecessary checksum calculation of DSDT
- New patch to remove header length check when writing tables
- New patch to enable SeaBIOS on all boards
- New patch to add GPIO ASL description
Bin Meng (18):
x86: minnowmax: Adjust U-Boot environment address in SPI flash
x86: Call board_final_cleanup() in last_stage_init()
x86: Fix up PIRQ routing table checksum earlier
x86: Compile coreboot_table.c only for SeaBIOS
x86: Prepare configuration tables in dedicated high memory region
x86: Unify reserve_arch() for all x86 boards
x86: Reserve configuration tables in high memory
x86: Use high_table_malloc() for tables passing to SeaBIOS
x86: acpi: Switch to ACPI mode by ourselves instead of requested by
OSPM
x86: acpi: Remove the unnecessary checksum calculation of DSDT
x86: acpi: Remove header length check when writing tables
x86: doc: Update information about IGD with SeaBIOS
x86: baytrail: Enable SeaBIOS on all boards
x86: doc: Mention Ubuntu/Windows installation and boot support
acpi: Quieten IASL output when 'make -s' is used
x86: baytrail: Add internal UART ASL description
x86: baytrail: Add GPIO ASL description
x86: doc: Add porting hints for ACPI with Windows
arch/x86/Kconfig | 14 ++++ arch/x86/cpu/baytrail/valleyview.c | 8 -- arch/x86/cpu/broadwell/sdram.c | 5 -- arch/x86/cpu/coreboot/coreboot.c | 20 +++-- arch/x86/cpu/cpu.c | 27 ++++++ arch/x86/cpu/irq.c | 4 + arch/x86/cpu/ivybridge/sdram.c | 5 -- arch/x86/cpu/quark/quark.c | 9 -- arch/x86/include/asm/acpi_table.h | 3 + arch/x86/include/asm/arch-baytrail/acpi/gpio.asl | 95 ++++++++++++++++++++++ .../include/asm/arch-baytrail/acpi/irqlinks.asl | 4 + arch/x86/include/asm/arch-baytrail/acpi/lpc.asl | 60 ++++++++++++++ .../include/asm/arch-baytrail/acpi/platform.asl | 3 + arch/x86/include/asm/coreboot_tables.h | 19 +++++ arch/x86/include/asm/global_data.h | 4 + arch/x86/lib/Makefile | 2 +- arch/x86/lib/acpi_table.c | 58 ++++++++----- arch/x86/lib/bootm.c | 9 -- arch/x86/lib/coreboot_table.c | 31 +++++++ arch/x86/lib/pirq_routing.c | 4 - arch/x86/lib/tables.c | 4 +- configs/bayleybay_defconfig | 1 + configs/conga-qeval20-qa3-e3845_defconfig | 1 + configs/minnowmax_defconfig | 1 + doc/README.x86 | 44 ++++++++-- include/configs/minnowmax.h | 2 +- scripts/Makefile.lib | 2 +- 27 files changed, 357 insertions(+), 82 deletions(-) create mode 100644 arch/x86/include/asm/arch-baytrail/acpi/gpio.asl
Signature · 1 line
1.8.2.1
PATCH v2 1/18 x86: minnowmax: Adjust U-Boot environment address in SPI flash
Currently U-Boot environment address is at offset 0x7fe00 of a 8MB SPI flash. When creating a partial u-boot.rom image without flash descriptor and ME firmware, U-Boot actually occupies the last 1MB of the flash, and reprograming U-Boot causes previous environment settings get lost which is not convenient during testing.
Adjust the environment address to 0x6ef000 instead (before the MRC cache data region in the flash).
---
Changes in v2: None
doc/README.x86 | 2 +- include/configs/minnowmax.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
doc/README.x86 +1 -1
@@ -304,12 +304,12 @@ Offset Description Controlling config 000000 descriptor.bin Hard-coded to 0 in ifdtool 001000 me.bin Set by the descriptor 500000 <spare> +6ef000 Environment CONFIG_ENV_OFFSET 6f0000 MRC cache CONFIG_ENABLE_MRC_CACHE 700000 u-boot-dtb.bin CONFIG_SYS_TEXT_BASE 790000 vga.bin CONFIG_VGA_BIOS_ADDR 7c0000 fsp.bin CONFIG_FSP_ADDR 7f8000 <spare> (depends on size of fsp.bin) -7fe000 Environment CONFIG_ENV_OFFSET 7ff800 U-Boot 16-bit boot CONFIG_SYS_X86_START16 Overall ROM image size is controlled by CONFIG_ROM_SIZE.
include/configs/minnowmax.h +1 -1
@@ -40,6 +40,6 @@#define CONFIG_X86EMU_RAW_IO #define CONFIG_ENV_SECT_SIZE 0x1000 -#define CONFIG_ENV_OFFSET 0x007fe000 +#define CONFIG_ENV_OFFSET 0x006ef000#endif /* __CONFIG_H */
Signature · 1 line
1.8.2.1
PATCH v2 2/18 x86: Call board_final_cleanup() in last_stage_init()
In reply to Bin MengAt present board_final_cleanup() is called before booting a Linux kernel. This actually needs to be done before booting anything, like SeaBIOS, VxWorks or Windows.
Move the call to last_stage_init() instead.
---
Changes in v2: None
arch/x86/cpu/coreboot/coreboot.c | 20 +++++++++++--------- arch/x86/cpu/cpu.c | 10 ++++++++++ arch/x86/lib/bootm.c | 9 --------- 3 files changed, 21 insertions(+), 18 deletions(-)
arch/x86/cpu/coreboot/coreboot.c +11 -9
@@ -39,15 +39,7 @@ int print_cpuinfo(void)return default_print_cpuinfo (); } -int last_stage_init (void ) -{ -if (gd->flags &GD_FLG_COLD_BOOT ) -timestamp_add_to_bootstage (); - -return 0 ; -} - -void board_final_cleanup (void ) +static void board_final_cleanup (void ) {/* * Un-cache the ROM so the kernel has one
@@ -79,6 +71,16 @@ void board_final_cleanup(void) } } +int last_stage_init (void ) +{ +if (gd->flags &GD_FLG_COLD_BOOT ) +timestamp_add_to_bootstage (); + +board_final_cleanup (); + +return 0 ; +} +int misc_init_r (void ) {return 0 ;
arch/x86/cpu/cpu.c +10 -0
@@ -661,10 +661,20 @@ void show_boot_progress(int val) }#ifndef CONFIG_SYS_COREBOOT +/* +* Implement a weak default function for boards that optionally +* need to clean up the system before jumping to the kernel. +*/ +__weak void board_final_cleanup (void ) +{ +} +int last_stage_init (void ) {write_tables (); +board_final_cleanup (); +return 0 ; }#endif
arch/x86/lib/bootm.c +0 -9
@@ -26,14 +26,6 @@ DECLARE_GLOBAL_DATA_PTR;#define COMMAND_LINE_OFFSET 0x9000 -/* -* Implement a weak default function for boards that optionally -* need to clean up the system before jumping to the kernel. -*/ -__weak void board_final_cleanup (void ) -{ -} -void bootm_announce_and_cleanup (void ) {printf ("\nStarting kernel ...\n\n" );
@@ -45,7 +37,6 @@ void bootm_announce_and_cleanup(void)#ifdef CONFIG_BOOTSTAGE_REPORT bootstage_report ();#endif -board_final_cleanup (); }#if defined(CONFIG_OF_LIBFDT ) && !defined(CONFIG_OF_NO_KERNEL )
Signature · 1 line
1.8.2.1
PATCH v2 3/18 x86: Fix up PIRQ routing table checksum earlier
In reply to Bin MengPIRQ routing table checksum is fixed up in copy_pirq_routing_table(), which is fine if we only write the configuration table once. But with the SeaBIOS case, when we write the table for the second time, the checksum will be fixed up to zero per the checksum algorithm, which is caused by the checksum field not being zero before fix up, since the checksum has already been calculated in the first run.
To fix this, move the checksum fixup to create_pirq_routing_table(), so that copy_pirq_routing_table() only does what its function name
suggests: copy the table to somewhere else.
---
Changes in v2: None
arch/x86/cpu/irq.c | 4 ++++ arch/x86/lib/pirq_routing.c | 4 ---- 2 files changed, 4 insertions(+), 4 deletions(-)
arch/x86/cpu/irq.c +4 -0
@@ -13,6 +13,7 @@#include <asm/irq.h> #include <asm/pci.h> #include <asm/pirq_routing.h> +#include <asm/tables.h> DECLARE_GLOBAL_DATA_PTR ;
@@ -214,6 +215,9 @@ static int create_pirq_routing_table(struct udevice *dev) rt->size = irq_entries *sizeof (struct irq_info ) +32 ; +/* Fix up the table checksum */ + rt->checksum =table_compute_checksum (rt, rt->size); + pirq_routing_table = rt;return 0 ;
arch/x86/lib/pirq_routing.c +0 -4
@@ -10,7 +10,6 @@#include <pci.h> #include <asm/pci.h> #include <asm/pirq_routing.h> -#include <asm/tables.h> static bool irq_already_routed[16 ];
@@ -111,9 +110,6 @@ u32 copy_pirq_routing_table(u32 addr, struct irq_routing_table *rt) {struct irq_routing_table *rom_rt; -/* Fix up the table checksum */ - rt->checksum =table_compute_checksum (rt, rt->size); -/* Align the table to be 16 byte aligned */ addr =ALIGN (addr,16 );
Signature · 1 line
1.8.2.1
PATCH v2 4/18 x86: Compile coreboot_table.c only for SeaBIOS
In reply to Bin Mengcoreboot_table.c only needs to be built when SeaBIOS is used.
---
Changes in v2: None
arch/x86/lib/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/lib/Makefile +1 -1
@@ -10,7 +10,7 @@ obj-y += bios_asm.o obj-y += bios_interrupts.o obj-$(CONFIG_CMD_BOOTM) += bootm.o obj-y += cmd_boot.o -obj-y += coreboot_table.o +obj-$(CONFIG_SEABIOS) += coreboot_table.o obj-$(CONFIG_EFI) += efi/ obj-y += e820.o obj-y += gcc.o
Signature · 1 line
1.8.2.1
PATCH v2 5/18 x86: Prepare configuration tables in dedicated high memory region
In reply to Bin MengCurrently when CONFIG_SEABIOS is on, U-Boot allocates configuration tables via normal malloc(). To simplify, use a dedicated memory region which is reserved on the stack before relocation for this purpose. Add functions for reserve and malloc.
---
Changes in v2: None
arch/x86/Kconfig | 14 ++++++++++++++ arch/x86/include/asm/coreboot_tables.h | 19 +++++++++++++++++++ arch/x86/include/asm/global_data.h | 4 ++++ arch/x86/lib/coreboot_table.c | 31 +++++++++++++++++++++++++++++++ 4 files changed, 68 insertions(+)
arch/x86/Kconfig +14 -0
@@ -536,6 +536,20 @@ config SEABIOS Check http://www.seabios.org/SeaBIOS for details. +config HIGH_TABLE_SIZE + hex "Size of configuration tables which reside in high memory" + default 0x10000 + depends on SEABIOS + help + SeaBIOS itself resides in E seg and F seg, where U-Boot puts all + configuration tables like PIRQ/MP/ACPI. To avoid conflicts, U-Boot + puts a copy of configuration tables in high memory region which + is reserved on the stack before relocation. The region size is + determined by this option. + + Increse it if the default size does not fit the board's needs. + This is most likely due to a large ACPI DSDT table is used. + source "arch/x86/lib/efi/Kconfig" endmenu
arch/x86/include/asm/coreboot_tables.h +19 -0
@@ -295,6 +295,25 @@ struct cbmem_entry {#define CBMEM_ID_NONE 0x00000000/** +* high_table_reserve() - reserve configuration table in high memory +* +* This reserves configuration table in high memory. +* +* @return: always 0 +*/ +int high_table_reserve (void ); + +/** +* high_table_malloc() - allocate configuration table in high memory +* +* This allocates configuration table in high memory. +* +* @bytes: size of configuration table to be allocated +* @return: pointer to configuration table in high memory +*/ +void *high_table_malloc (size_t bytes); + +/** * write_coreboot_table() - write coreboot table * * This writes coreboot table at a given address.
arch/x86/include/asm/global_data.h +4 -0
@@ -93,6 +93,10 @@ struct arch_global_data {char *mrc_output;unsigned int mrc_output_len;ulong table;/* Table pointer from previous loader */ +#ifdef CONFIG_SEABIOS +u32 high_table_ptr; +u32 high_table_limit; +#endif };#endif
arch/x86/lib/coreboot_table.c +31 -0
@@ -9,6 +9,37 @@#include <asm/coreboot_tables.h> #include <asm/e820.h> +DECLARE_GLOBAL_DATA_PTR ; + +int high_table_reserve (void ) +{ +/* adjust stack pointer to reserve space for configuration tables */ + gd->arch.high_table_limit = gd->start_addr_sp; + gd->start_addr_sp -=CONFIG_HIGH_TABLE_SIZE ; + gd->arch.high_table_ptr = gd->start_addr_sp; + +/* clear the memory */ +memset ((void *)gd->arch.high_table_ptr,0 ,CONFIG_HIGH_TABLE_SIZE ); + + gd->start_addr_sp &= ~0xf ; + +return 0 ; +} + +void *high_table_malloc (size_t bytes) +{ +u32 new_ptr; +void *ptr; + + new_ptr = gd->arch.high_table_ptr + bytes; +if (new_ptr >= gd->arch.high_table_limit) +return NULL ; + ptr = (void *)gd->arch.high_table_ptr; + gd->arch.high_table_ptr = new_ptr; + +return ptr; +} +/** * cb_table_init() - initialize a coreboot table header *
Signature · 1 line
1.8.2.1
PATCH v2 6/18 x86: Unify reserve_arch() for all x86 boards
In reply to Bin MengInstead of asking each platform to provide reserve_arch(), supply it in arch/x86/cpu/cpu.c in a unified way.
---
Changes in v2: None
arch/x86/cpu/baytrail/valleyview.c | 8 -------- arch/x86/cpu/broadwell/sdram.c | 5 ----- arch/x86/cpu/cpu.c | 12 ++++++++++++ arch/x86/cpu/ivybridge/sdram.c | 5 ----- arch/x86/cpu/quark/quark.c | 9 --------- 5 files changed, 12 insertions(+), 27 deletions(-)
arch/x86/cpu/baytrail/valleyview.c +0 -8
@@ -53,14 +53,6 @@ int arch_misc_init(void) return 0; } -int reserve_arch (void ) -{ -#ifdef CONFIG_ENABLE_MRC_CACHE -return mrccache_reserve (); -#else -return 0 ; -#endif -}#endif void reset_cpu (ulong addr)
arch/x86/cpu/broadwell/sdram.c +0 -5
@@ -190,11 +190,6 @@ static int prepare_mrc_cache(struct pei_data *pei_data)return 0 ; } -int reserve_arch (void ) -{ -return mrccache_reserve (); -} -int dram_init (void ) {struct pei_data _pei_data__aligned(8) ;
arch/x86/cpu/cpu.c +12 -0
@@ -29,6 +29,7 @@#include <asm/lapic.h> #include <asm/microcode.h> #include <asm/mp.h> +#include <asm/mrccache.h> #include <asm/msr.h> #include <asm/mtrr.h> #include <asm/post.h>
@@ -751,3 +752,14 @@ int cpu_init_r(void)return 0 ; } + +#ifndef CONFIG_EFI_STUB +int reserve_arch (void ) +{ +#ifdef CONFIG_ENABLE_MRC_CACHE +return mrccache_reserve (); +#else +return 0 ; +#endif +} +#endif
arch/x86/cpu/ivybridge/sdram.c +0 -5
@@ -201,11 +201,6 @@ static int recovery_mode_enabled(void)return false; } -int reserve_arch (void ) -{ -return mrccache_reserve (); -} -static int copy_spd (struct udevice *dev,struct pei_data *peid) {const void *data;
arch/x86/cpu/quark/quark.c +0 -9
@@ -360,12 +360,3 @@ void board_final_cleanup(void)return ; } - -int reserve_arch (void ) -{ -#ifdef CONFIG_ENABLE_MRC_CACHE -return mrccache_reserve (); -#else -return 0 ; -#endif -}
Signature · 1 line
1.8.2.1
PATCH v2 7/18 x86: Reserve configuration tables in high memory
In reply to Bin MengWhen SeaBIOS is on, reserve configuration tables in reserve_arch().
---
Changes in v2: None
arch/x86/cpu/cpu.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-)
arch/x86/cpu/cpu.c +8 -3
@@ -25,6 +25,7 @@#include <errno.h> #include <malloc.h> #include <asm/control_regs.h> +#include <asm/coreboot_tables.h> #include <asm/cpu.h> #include <asm/lapic.h> #include <asm/microcode.h>
@@ -757,9 +758,13 @@ int cpu_init_r(void)int reserve_arch (void ) {#ifdef CONFIG_ENABLE_MRC_CACHE -return mrccache_reserve (); -#else -return 0 ; +mrccache_reserve (); +#endif + +#ifdef CONFIG_SEABIOS +high_table_reserve ();#endif + +return 0 ; }#endif
Signature · 1 line
1.8.2.1
PATCH v2 8/18 x86: Use high_table_malloc() for tables passing to SeaBIOS
In reply to Bin MengNow that we already reserved high memory for configuration tables, call high_table_malloc() to allocate tables from the region.
---
Changes in v2: None
arch/x86/lib/tables.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
arch/x86/lib/tables.c +1 -3
@@ -5,7 +5,6 @@*/ #include <common.h> -#include <malloc.h> #include <asm/sfi.h> #include <asm/mpspec.h> #include <asm/smbios.h>
@@ -81,9 +80,8 @@ void write_tables(void)#ifdef CONFIG_SEABIOS table_size = rom_table_end - rom_table_start; - high_table = (u32 )memalign (ROM_TABLE_ALIGN , table_size); + high_table = (u32 )high_table_malloc (table_size);if (high_table) { -memset ((void *)high_table,0 , table_size); table_write_funcs[i](high_table); cfg_tables[i].start = high_table;
Signature · 1 line
1.8.2.1
PATCH v2 9/18 x86: acpi: Switch to ACPI mode by ourselves instead of requested by OSPM
In reply to Bin MengPer ACPI spec, during ACPI OS initialization, OSPM can determine that the ACPI hardware registers are owned by SMI (by way of the SCI_EN bit in the PM1_CNT register), in which case the ACPI OS issues the ACPI_ENABLE command to the SMI_CMD port. The SCI_EN bit effectively tracks the ownership of the ACPI hardware registers.
However since U-Boot does not support SMI, we report all 3 fields in FADT (SMI_CMD, ACPI_ENABLE, ACPI_DISABLE) as zero, by following the spec who says: these fields are reserved and must be zero on system that does not support System Management mode.
U-Boot seems to behave in a correct way that the ACPI spec allows, at least Linux does not complain, but apparently Windows does not think so. During Windows bring up debugging, it is observed that even these 3 fields are zero, Windows are still trying to issue SMI with hardcoded SMI port address and commands, and expecting SCI_EN to be changed by the firmware. Eventually Windows gives us a BSOD (Blue Screen of Death) saying ACPI_BIOS_ERROR and refuses to start.
To fix this, turn on the SCI_EN bit by ourselves. With this patch, now U-Boot can install and boot Windows 8.1/10 successfully with the help of SeaBIOS using legacy interface (non-UEFI mode).
---
Changes in v2: None
arch/x86/include/asm/acpi_table.h | 3 +++ arch/x86/lib/acpi_table.c | 26 ++++++++++++++++++++++++++ 2 files changed, 29 insertions(+)
arch/x86/include/asm/acpi_table.h +3 -0
@@ -296,6 +296,9 @@ struct acpi_mcfg_mmconfig {u8 reserved[4 ]; }; +/* PM1_CNT bit defines */ +#define PM1_CNT_SCI_EN (1 << 0) +/* These can be used by the target port */ void acpi_fill_header (struct acpi_table_header *header,char *signature);
arch/x86/lib/acpi_table.c +26 -0
@@ -12,6 +12,7 @@#include <dm.h> #include <dm/uclass-internal.h> #include <asm/acpi_table.h> +#include <asm/io.h> #include <asm/lapic.h> #include <asm/tables.h>
@@ -301,6 +302,25 @@ static void acpi_create_mcfg(struct acpi_mcfg *mcfg) header->checksum =table_compute_checksum ((void *)mcfg, header->length); } +static void enter_acpi_mode (int pm1_cnt) +{ +/* +* PM1_CNT register bit0 selects the power management event to be +* either an SCI or SMI interrupt. When this bit is set, then power +* management events will generate an SCI interrupt. When this bit +* is reset power management events will generate an SMI interrupt. +* +* Per ACPI spec, it is the responsibility of the hardware to set +* or reset this bit. OSPM always preserves this bit position. +* +* U-Boot does not support SMI. And we don't have plan to support +* anything running in SMM within U-Boot. To create a legacy-free +* system, and expose ourselves to OSPM as working under ACPI mode +* already, turn this bit on. +*/ +outw (PM1_CNT_SCI_EN , pm1_cnt); +} +/* * QEMU's version of write_acpi_tables is defined in * arch/x86/cpu/qemu/fw_cfg.c
@@ -400,5 +420,11 @@ u32 write_acpi_tables(u32 start)debug ("ACPI: done\n" ); +/* +* Other than waiting for OSPM to request us to switch to ACPI mode, +* do it by ourselves, since SMI will not be triggered. +*/ +enter_acpi_mode (fadt->pm1a_cnt_blk); +return current; }
Signature · 1 line
1.8.2.1
PATCH v2 10/18 x86: acpi: Remove the unnecessary checksum calculation of DSDT
In reply to Bin MengThe generated AmlCode[] from IASL already has the calculated DSDT table checksum in place. No need for us to calculate it again.
---
Changes in v2:
- New patch to remove the unnecessary checksum calculation of DSDT
arch/x86/lib/acpi_table.c | 6 ------ 1 file changed, 6 deletions(-)
arch/x86/lib/acpi_table.c +0 -6
@@ -382,12 +382,6 @@ u32 write_acpi_tables(u32 start) (char *)&AmlCode +sizeof (struct acpi_table_header ), dsdt->length - sizeof(struct acpi_table_header)); current += dsdt->length -sizeof (struct acpi_table_header ); - -/* (Re)calculate length and checksum */ - dsdt->length = current - (u32 )dsdt; - dsdt->checksum =0 ; - dsdt->checksum =table_compute_checksum ((void *)dsdt, - dsdt->length); } current =ALIGN (current,16 );
Signature · 1 line
1.8.2.1
PATCH v2 11/18 x86: acpi: Remove header length check when writing tables
In reply to Bin MengBefore moving 'current' pointer during ACPI table writing, we always check the table length to see if it is larger than the table header. Since our purpose is to generate valid tables, the check logic is always true, which can be avoided.
---
Changes in v2:
- New patch to remove header length check when writing tables
arch/x86/lib/acpi_table.c | 26 ++++++++++---------------- 1 file changed, 10 insertions(+), 16 deletions(-)
arch/x86/lib/acpi_table.c +10 -16
@@ -376,13 +376,11 @@ u32 write_acpi_tables(u32 start)debug ("ACPI: * DSDT\n" ); dsdt = (struct acpi_table_header *)current;memcpy (dsdt, &AmlCode,sizeof (struct acpi_table_header )); -if (dsdt->length >=sizeof (struct acpi_table_header )) { - current +=sizeof (struct acpi_table_header ); -memcpy ((char *)current, - (char *)&AmlCode +sizeof (struct acpi_table_header ), - dsdt->length -sizeof (struct acpi_table_header )); - current += dsdt->length -sizeof (struct acpi_table_header ); - } + current +=sizeof (struct acpi_table_header ); +memcpy ((char *)current, + (char *)&AmlCode +sizeof (struct acpi_table_header ), + dsdt->length -sizeof (struct acpi_table_header )); + current += dsdt->length -sizeof (struct acpi_table_header ); current =ALIGN (current,16 );debug ("ACPI: * FADT\n" );
@@ -395,20 +393,16 @@ u32 write_acpi_tables(u32 start)debug ("ACPI: * MADT\n" ); madt = (struct acpi_madt *)current;acpi_create_madt (madt); -if (madt->header.length >sizeof (struct acpi_madt )) { - current += madt->header.length; -acpi_add_table (rsdp, madt); - } + current += madt->header.length; +acpi_add_table (rsdp, madt); current =ALIGN (current,16 );debug ("ACPI: * MCFG\n" ); mcfg = (struct acpi_mcfg *)current;acpi_create_mcfg (mcfg); -if (mcfg->header.length >sizeof (struct acpi_mcfg )) { - current += mcfg->header.length; - current =ALIGN (current,16 ); -acpi_add_table (rsdp, mcfg); - } + current += mcfg->header.length; +acpi_add_table (rsdp, mcfg); + current =ALIGN (current,16 );debug ("current = %x\n" , current);
Signature · 1 line
1.8.2.1
PATCH v2 12/18 x86: doc: Update information about IGD with SeaBIOS
In reply to Bin MengDocument how to make SeaBIOS load and run the VGA ROM of Intel IGD device when loaded by U-Boot.
---
Changes in v2: None
doc/README.x86 | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+)
doc/README.x86 +24 -0
@@ -807,6 +807,30 @@ to install/boot a Windows XP OS (below for example command to install Windows). This is also tested on Intel Crown Bay board with a PCIe graphics card, booting SeaBIOS then chain-loading a GRUB on a USB drive, then Linux kernel finally. +If you are using Intel Integrated Graphics Device (IGD) as the primary display +device on your board, SeaBIOS needs to be patched manually to get its VGA ROM +loaded and run by SeaBIOS. SeaBIOS locates VGA ROM via the PCI expansion ROM +register, but IGD device does not have its VGA ROM mapped by this register. +Its VGA ROM is packaged as part of u-boot.rom at a configurable flash address +which is unknown to SeaBIOS. An example patch is needed for SeaBIOS below: + +diff --git a/src/optionroms.c b/src/optionroms.c +index 65f7fe0..c7b6f5e 100644 +--- a/src/optionroms.c ++++ b/src/optionroms.c +@@ -324,6 +324,8 @@ init_pcirom(struct pci_device *pci, int isvga, u64 *sources) + rom = deploy_romfile(file); + else if (RunPCIroms > 1 || (RunPCIroms == 1 && isvga)) + rom = map_pcirom(pci); ++ if (pci->bdf == pci_to_bdf(0, 2, 0)) ++ rom = (struct rom_header *)0xfff90000; + if (! rom) + // No ROM present. + return; + +Note: the patch above expects IGD device is at PCI b.d.f 0.2.0 and its VGA ROM +is at 0xfff90000 which corresponds to CONFIG_VGA_BIOS_ADDR on Minnowboard MAX. +Change these two accordingly if this is not the case on your board. Development Flow ----------------
Signature · 1 line
1.8.2.1
PATCH v2 13/18 x86: baytrail: Enable SeaBIOS on all boards
In reply to Bin MengSeaBIOS can be loaded by U-Boot to aid the installation of Ubuntu and Windows to a SATA drive and boot from there. Enable it on all BayTrail boards.
---
Changes in v2:
- New patch to enable SeaBIOS on all boards
configs/bayleybay_defconfig | 1 + configs/conga-qeval20-qa3-e3845_defconfig | 1 + configs/minnowmax_defconfig | 1 + 3 files changed, 3 insertions(+)
configs/bayleybay_defconfig +1 -0
@@ -10,6 +10,7 @@ CONFIG_VGA_BIOS_ADDR=0xfffa0000 CONFIG_GENERATE_PIRQ_TABLE=y CONFIG_GENERATE_MP_TABLE=y CONFIG_GENERATE_ACPI_TABLE=y +CONFIG_SEABIOS=y CONFIG_FIT=y CONFIG_BOOTSTAGE=y CONFIG_BOOTSTAGE_REPORT=y
configs/conga-qeval20-qa3-e3845_defconfig +1 -0
@@ -9,6 +9,7 @@ CONFIG_HAVE_VGA_BIOS=y CONFIG_GENERATE_PIRQ_TABLE=y CONFIG_GENERATE_MP_TABLE=y CONFIG_GENERATE_ACPI_TABLE=y +CONFIG_SEABIOS=y CONFIG_FIT=y CONFIG_FIT_SIGNATURE=y CONFIG_BOOTSTAGE=y
configs/minnowmax_defconfig +1 -0
@@ -9,6 +9,7 @@ CONFIG_HAVE_VGA_BIOS=y CONFIG_GENERATE_PIRQ_TABLE=y CONFIG_GENERATE_MP_TABLE=y CONFIG_GENERATE_ACPI_TABLE=y +CONFIG_SEABIOS=y CONFIG_FIT=y CONFIG_FIT_SIGNATURE=y CONFIG_BOOTSTAGE=y
Signature · 1 line
1.8.2.1
PATCH v2 14/18 x86: doc: Mention Ubuntu/Windows installation and boot support
In reply to Bin MengAs of now, U-Boot can support installing and booting Ubuntu/Windows with the help of SeaBIOS. Update the documentation.
---
Changes in v2: None
doc/README.x86 | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-)
doc/README.x86 +8 -4
@@ -1004,12 +1004,14 @@ in the future. The status as of today is: * Support one static DSDT table only, compiled by Intel ACPI compiler. * Support S0/S5, reboot and shutdown from OS. * Support booting a pre-installed Ubuntu distribution via 'zboot' command. + * Support installing and booting Ubuntu 14.04 (or above) from U-Boot with + the help of SeaBIOS using legacy interface (non-UEFI mode). + * Support installing and booting Windows 8.1/10 from U-Boot with the help + of SeaBIOS using legacy interface (non-UEFI mode). * Support ACPI interrupts with SCI only. Features not supported so far (to make it a complete ACPI solution): * S3 (Suspend to RAM), S4 (Suspend to Disk). - * Install and boot Ubuntu 14.04 (or above) from U-Boot with legacy interface. - * Install and boot Windows 8.1/10 from U-Boot with legacy interface. Features that are optional: * ACPI global NVS support. We may need it to simplify ASL code logic if
@@ -1021,8 +1023,10 @@ Features that are optional: support SMI (a legacy-free system). So far ACPI is enabled on BayTrail based boards. Testing was done by booting -a pre-installed Ubuntu 14.04 from a SATA drive. Most devices seem to work -correctly and the board can respond a reboot/shutdown command from Ubuntu. +a pre-installed Ubuntu 14.04 from a SATA drive. Installing Ubuntu 14.04 and +Windows 8.1/10 to a SATA drive and booting from there is also tested. Most +devices seem to work correctly and the board can respond a reboot/shutdown +command from the OS. TODO List ---------
Signature · 1 line
1.8.2.1
PATCH v2 15/18 acpi: Quieten IASL output when 'make -s' is used
In reply to Bin MengIASL compiler does not provide a command line option to turn off its non-warning message. To quieten the output when 'make -s', redirect its output to /dev/null.
---
Changes in v2: None
scripts/Makefile.lib | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
scripts/Makefile.lib +1 -1
@@ -326,7 +326,7 @@ $(obj)/%.S: $(src)/%.ttf quiet_cmd_acpi_c_asl= ASL $< cmd_acpi_c_asl= \ $(CPP) -x assembler-with-cpp -P $(UBOOTINCLUDE) -o $<.tmp $<; \ - iasl -p $< -tc $<.tmp; \ + iasl -p $< -tc $<.tmp $(if $(KBUILD_VERBOSE:1=), >/dev/null); \ mv $(patsubst %.asl,%.hex,$<) $@ $(obj)/dsdt.c: $(src)/dsdt.asl
Signature · 1 line
1.8.2.1
PATCH v2 16/18 x86: baytrail: Add internal UART ASL description
In reply to Bin MengBayTrail integrates an internal ns15550 compatible UART (PNP0501). Its IRQ is hardwired to IRQ3 in old revision chipset, but in newer revision one IRQ4 is being used for ISA compatibility. Handle this correctly in the ASL file.
Linux does not need this ASL, but Windows need this to correctly discover a COM port existing in the system so that Windows can show it in the 'Device Manager' window, and expose this COM port to any terminal emulation application.
---
Changes in v2: None
.../include/asm/arch-baytrail/acpi/irqlinks.asl | 4 ++ arch/x86/include/asm/arch-baytrail/acpi/lpc.asl | 60 ++++++++++++++++++++++ 2 files changed, 64 insertions(+)
arch/x86/include/asm/arch-baytrail/acpi/irqlinks.asl +4 -0
@@ -21,6 +21,10 @@ Scope (\) PRTF, 8, PRTG, 8, PRTH, 8, + Offset (0x88), + , 3, + UI3E, 1, + UI4E, 1 } }
arch/x86/include/asm/arch-baytrail/acpi/lpc.asl +60 -0
72 lines not on this page · raw message
Signature · 1 line
1.8.2.1
PATCH v2 17/18 x86: baytrail: Add GPIO ASL description
In reply to Bin MengSince BayTrail, Intel starts to use new GPIO IPs in their chipset. This adds the GPIO ASL, so that OS can load corresponding drivers for it. On Linux, this is BayTrail pinctrl driver.
---
Changes in v2:
- New patch to add GPIO ASL description
arch/x86/include/asm/arch-baytrail/acpi/gpio.asl | 95 ++++++++++++++++++++++ .../include/asm/arch-baytrail/acpi/platform.asl | 3 + 2 files changed, 98 insertions(+) create mode 100644 arch/x86/include/asm/arch-baytrail/acpi/gpio.asl
arch/x86/include/asm/arch-baytrail/acpi/gpio.asl new file +95 -0
@@ -0,0 +1,95 @@ +/* + * Copyright (C) 2013 Google Inc. + * Copyright (C) 2016 Bin Meng <[email protected]> + * + * Modified from coreboot src/soc/intel/baytrail/acpi/gpio.asl + * + * SPDX-License-Identifier: GPL-2.0+ + */ + +/* SouthCluster GPIO */ +Device (GPSC) +{ + Name(_HID, "INT33FC") + Name(_CID, "INT33FC") + Name(_UID, 1) + + Name(RBUF, ResourceTemplate() + { + Memory32Fixed(ReadWrite, 0, 0x1000, RMEM) + Interrupt(ResourceConsumer, Level, ActiveLow, Shared, , ,) + { + GPIO_SC_IRQ + } + }) + + Method(_CRS) + { + CreateDwordField(^RBUF, ^RMEM._BAS, RBAS) + Add(IO_BASE_ADDRESS, IO_BASE_OFFSET_GPSCORE, RBAS) + Return (^RBUF) + } + + Method(_STA) + { + Return (STA_VISIBLE) + } +} + +/* NorthCluster GPIO */ +Device (GPNC) +{ + Name(_HID, "INT33FC") + Name(_CID, "INT33FC") + Name(_UID, 2) + + Name(RBUF, ResourceTemplate() + { + Memory32Fixed(ReadWrite, 0, 0x1000, RMEM) + Interrupt(ResourceConsumer, Level, ActiveLow, Shared, , ,) + { + GPIO_NC_IRQ + } + }) + + Method(_CRS) + { + CreateDwordField(^RBUF, ^RMEM._BAS, RBAS) + Add(IO_BASE_ADDRESS, IO_BASE_OFFSET_GPNCORE, RBAS) + Return (^RBUF) + } + + Method(_STA) + { + Return (STA_VISIBLE) + } +} + +/* SUS GPIO */ +Device (GPSS) +{ + Name(_HID, "INT33FC") + Name(_CID, "INT33FC") + Name(_UID, 3) + + Name(RBUF, ResourceTemplate() + { + Memory32Fixed(ReadWrite, 0, 0x1000, RMEM) + Interrupt(ResourceConsumer, Level, ActiveLow, Shared, , ,) + { + GPIO_SUS_IRQ + } + }) + + Method(_CRS) + { + CreateDwordField(^RBUF, ^RMEM._BAS, RBAS) + Add(IO_BASE_ADDRESS, IO_BASE_OFFSET_GPSSUS, RBAS) + Return (^RBUF) + } + + Method(_STA) + { + Return (STA_VISIBLE) + } +}
arch/x86/include/asm/arch-baytrail/acpi/platform.asl +3 -0
@@ -27,6 +27,9 @@ Method(_WAK, 1) Scope (\_SB) { #include "southcluster.asl" + + /* ACPI devices */ + #include "gpio.asl" } /* Chipset specific sleep states */
Signature · 1 line
1.8.2.1
PATCH v2 18/18 x86: doc: Add porting hints for ACPI with Windows
In reply to Bin MengWindows might cache system information and only detect ACPI changes if you modify the ACPI table versions.
---
Changes in v2: None
doc/README.x86 | 6 ++++++ 1 file changed, 6 insertions(+)
doc/README.x86 +6 -0
@@ -982,6 +982,12 @@ transformations. Remember to add attribution to coreboot for new files added to U-Boot. This should go at the top of each file and list the coreboot filename where the code originated. +Debugging ACPI issues with Windows: + +Windows might cache system information and only detect ACPI changes if you +modify the ACPI table versions. So tweak them liberally when debugging ACPI +issues with Windows. + ACPI Support Status ------------------- Advanced Configuration and Power Interface (ACPI) [16] aims to establish
Signature · 1 line
1.8.2.1
v2 cover x86: acpi: Support installation of Ubuntu/Windows and boot Windows
In reply to Bin MengHi Simon,
Quoted 12 lines · Bin Meng
SeaBIOS can be loaded by U-Boot to aid the installation of Ubuntu and Windows to a SATA drive and boot from there. But till now this is broken. The installation either hangs forever or just crashes.
This series fixed a bunch of issues that affect the installation of Ubuntu and Windows, and booting Windows.
Testing was performed on MinnowMax by:
- Install Ubuntu 14.04 and boot
- Install Windows 8.1 and boot
- Install Windows 10 and boot
Quoted 8 lines
This series is available at u-boot-x86/acpi2-working.
Changes in v2:
- New patch to remove the unnecessary checksum calculation of DSDT
- New patch to remove header length check when writing tables
- New patch to enable SeaBIOS on all boards
- New patch to add GPIO ASL description
Do you want to review and test this series, before I apply?
Regards,
Bin
PATCH v2 1/18 x86: minnowmax: Adjust U-Boot environment address in SPI flash
In reply to Bin MengQuoted 11 lines · Bin Meng
Currently U-Boot environment address is at offset
0x7fe00of a 8MB SPI flash. When creating a partial u-boot.rom image without flash descriptor and ME firmware, U-Boot actually occupies the last 1MB of the flash, and reprograming U-Boot causes previous environment settings get lost which is not convenient during testing.Adjust the environment address to
0x6ef000instead (before the MRC cache data region in the flash).Signed-off-by Bin Meng <[email protected]>Reviewed-by Stefan Roese <[email protected]>
Quoted 7 lines
---
Changes in v2: None
doc/README.x86 | 2 +- include/configs/minnowmax.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
PATCH v2 2/18 x86: Call board_final_cleanup() in last_stage_init()
In reply to Bin MengQuoted 7 lines · Bin Meng
At present
board_final_cleanup()is called before booting a Linux kernel. This actually needs to be done before booting anything, like SeaBIOS, VxWorks or Windows.Move the call to
last_stage_init()instead.Signed-off-by Bin Meng <[email protected]>
Quoted 8 lines
---
Changes in v2: None
arch/x86/cpu/coreboot/coreboot.c | 20 +++++++++++--------- arch/x86/cpu/cpu.c | 10 ++++++++++ arch/x86/lib/bootm.c | 9 --------- 3 files changed, 21 insertions(+), 18 deletions(-)
PATCH v2 3/18 x86: Fix up PIRQ routing table checksum earlier
In reply to Bin MengQuoted 11 lines · Bin Meng
PIRQ routing table checksum is fixed up in
copy_pirq_routing_table(), which is fine if we only write the configuration table once. But with the SeaBIOS case, when we write the table for the second time, the checksum will be fixed up to zero per the checksum algorithm, which is caused by the checksum field not being zero before fix up, since the checksum has already been calculated in the first run.To fix this, move the checksum fixup to
create_pirq_routing_table(), so thatcopy_pirq_routing_table()only does what its function name
suggests: copy the table to somewhere else.
Quoted 8 lines
Signed-off-by Bin Meng <[email protected]>---
Changes in v2: None
arch/x86/cpu/irq.c | 4 ++++ arch/x86/lib/pirq_routing.c | 4 ---- 2 files changed, 4 insertions(+), 4 deletions(-)
PATCH v2 4/18 x86: Compile coreboot_table.c only for SeaBIOS
In reply to Bin MengQuoted 9 lines · Bin Meng
coreboot_table.conly needs to be built when SeaBIOS is used.Signed-off-by Bin Meng <[email protected]>---
Changes in v2: None
arch/x86/lib/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
PATCH v2 5/18 x86: Prepare configuration tables in dedicated high memory region
In reply to Bin MengQuoted 8 lines · Bin Meng
Currently when
CONFIG_SEABIOSis on, U-Boot allocates configuration tables via normalmalloc(). To simplify, use a dedicated memory region which is reserved on the stack before relocation for this purpose. Add functions for reserve and malloc.Signed-off-by Bin Meng <[email protected]>---
Quoted 7 lines
Changes in v2: None
arch/x86/Kconfig | 14 ++++++++++++++ arch/x86/include/asm/coreboot_tables.h | 19 +++++++++++++++++++ arch/x86/include/asm/global_data.h | 4 ++++ arch/x86/lib/coreboot_table.c | 31 +++++++++++++++++++++++++++++++ 4 files changed, 68 insertions(+)
PATCH v2 6/18 x86: Unify reserve_arch() for all x86 boards
In reply to Bin MengQuoted 6 lines · Bin Meng
Instead of asking each platform to provide
reserve_arch(), supply it inarch/x86/cpu/cpu.cin a unified way.Signed-off-by Bin Meng <[email protected]>---
Quoted 8 lines
Changes in v2: None
arch/x86/cpu/baytrail/valleyview.c | 8 -------- arch/x86/cpu/broadwell/sdram.c | 5 ----- arch/x86/cpu/cpu.c | 12 ++++++++++++ arch/x86/cpu/ivybridge/sdram.c | 5 ----- arch/x86/cpu/quark/quark.c | 9 --------- 5 files changed, 12 insertions(+), 27 deletions(-)
PATCH v2 7/18 x86: Reserve configuration tables in high memory
In reply to Bin MengQuoted 9 lines · Bin Meng
When SeaBIOS is on, reserve configuration tables in
reserve_arch().Signed-off-by Bin Meng <[email protected]>---
Changes in v2: None
arch/x86/cpu/cpu.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-)
PATCH v2 8/18 x86: Use high_table_malloc() for tables passing to SeaBIOS
In reply to Bin MengQuoted 10 lines · Bin Meng
Now that we already reserved high memory for configuration tables, call
high_table_malloc()to allocate tables from the region.Signed-off-by Bin Meng <[email protected]>---
Changes in v2: None
arch/x86/lib/tables.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
PATCH v2 9/18 x86: acpi: Switch to ACPI mode by ourselves instead of requested by OSPM
In reply to Bin MengQuoted 23 lines · Bin Meng
Per ACPI spec, during ACPI OS initialization, OSPM can determine that the ACPI hardware registers are owned by SMI (by way of the
SCI_ENbit in thePM1_CNTregister), in which case the ACPI OS issues theACPI_ENABLEcommand to theSMI_CMDport. TheSCI_ENbit effectively tracks the ownership of the ACPI hardware registers.However since U-Boot does not support SMI, we report all 3 fields in FADT (
SMI_CMD,ACPI_ENABLE,ACPI_DISABLE) as zero, by following the spec who says: these fields are reserved and must be zero on system that does not support System Management mode.U-Boot seems to behave in a correct way that the ACPI spec allows, at least Linux does not complain, but apparently Windows does not think so. During Windows bring up debugging, it is observed that even these 3 fields are zero, Windows are still trying to issue SMI with hardcoded SMI port address and commands, and expecting
SCI_ENto be changed by the firmware. Eventually Windows gives us a BSOD (Blue Screen of Death) sayingACPI_BIOS_ERRORand refuses to start.To fix this, turn on the
SCI_ENbit by ourselves. With this patch, now U-Boot can install and boot Windows 8.1/10 successfully with the help of SeaBIOS using legacy interface (non-UEFI mode).
Quoted 8 lines
Signed-off-by Bin Meng <[email protected]>---
Changes in v2: None
arch/x86/include/asm/acpi_table.h | 3 +++ arch/x86/lib/acpi_table.c | 26 ++++++++++++++++++++++++++ 2 files changed, 29 insertions(+)
PATCH v2 10/18 x86: acpi: Remove the unnecessary checksum calculation of DSDT
In reply to Bin MengQuoted 5 lines · Bin Meng
The generated AmlCode[] from IASL already has the calculated DSDT table checksum in place. No need for us to calculate it again.
Signed-off-by Bin Meng <[email protected]>
Quoted 7 lines
---
Changes in v2:
- New patch to remove the unnecessary checksum calculation of DSDTarch/x86/lib/acpi_table.c | 6 ------ 1 file changed, 6 deletions(-)
PATCH v2 11/18 x86: acpi: Remove header length check when writing tables
In reply to Bin MengQuoted 7 lines · Bin Meng
Before moving 'current' pointer during ACPI table writing, we always check the table length to see if it is larger than the table header. Since our purpose is to generate valid tables, the check logic is always true, which can be avoided.
Signed-off-by Bin Meng <[email protected]>
Quoted 7 lines
---
Changes in v2:
- New patch to remove header length check when writing tablesarch/x86/lib/acpi_table.c | 26 ++++++++++---------------- 1 file changed, 10 insertions(+), 16 deletions(-)
PATCH v2 12/18 x86: doc: Update information about IGD with SeaBIOS
In reply to Bin MengQuoted 10 lines · Bin Meng
Document how to make SeaBIOS load and run the VGA ROM of Intel IGD device when loaded by U-Boot.
Signed-off-by Bin Meng <[email protected]>---
Changes in v2: None
doc/README.x86 | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+)
PATCH v2 13/18 x86: baytrail: Enable SeaBIOS on all boards
In reply to Bin MengQuoted 8 lines · Bin Meng
SeaBIOS can be loaded by U-Boot to aid the installation of Ubuntu and Windows to a SATA drive and boot from there. Enable it on all BayTrail boards.
Signed-off-by Bin Meng <[email protected]>---
Quoted 7 lines
Changes in v2:
- New patch to enable SeaBIOS on all boardsconfigs/bayleybay_defconfig | 1 + configs/conga-qeval20-qa3-e3845_defconfig | 1 + configs/minnowmax_defconfig | 1 + 3 files changed, 3 insertions(+)
PATCH v2 14/18 x86: doc: Mention Ubuntu/Windows installation and boot support
In reply to Bin MengQuoted 10 lines · Bin Meng
As of now, U-Boot can support installing and booting Ubuntu/Windows with the help of SeaBIOS. Update the documentation.
Signed-off-by Bin Meng <[email protected]>---
Changes in v2: None
doc/README.x86 | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-)
PATCH v2 15/18 acpi: Quieten IASL output when 'make -s' is used
In reply to Bin MengQuoted 11 lines · Bin Meng
IASL compiler does not provide a command line option to turn off its non-warning message. To quieten the output when 'make -s', redirect its output to
/dev/null.Signed-off-by Bin Meng <[email protected]>---
Changes in v2: None
scripts/Makefile.lib | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
PATCH v2 16/18 x86: baytrail: Add internal UART ASL description
In reply to Bin MengQuoted 10 lines · Bin Meng
BayTrail integrates an internal ns15550 compatible UART (PNP0501). Its IRQ is hardwired to IRQ3 in old revision chipset, but in newer revision one IRQ4 is being used for ISA compatibility. Handle this correctly in the ASL file.
Linux does not need this ASL, but Windows need this to correctly discover a COM port existing in the system so that Windows can show it in the 'Device Manager' window, and expose this COM port to any terminal emulation application.
Quoted 8 lines
Signed-off-by Bin Meng <[email protected]>---
Changes in v2: None
.../include/asm/arch-baytrail/acpi/irqlinks.asl | 4 ++ arch/x86/include/asm/arch-baytrail/acpi/lpc.asl | 60 ++++++++++++++++++++++ 2 files changed, 64 insertions(+)
PATCH v2 17/18 x86: baytrail: Add GPIO ASL description
In reply to Bin MengQuoted 8 lines · Bin Meng
Since BayTrail, Intel starts to use new GPIO IPs in their chipset. This adds the GPIO ASL, so that OS can load corresponding drivers for it. On Linux, this is BayTrail pinctrl driver.
Signed-off-by Bin Meng <[email protected]>---
Quoted 7 lines
Changes in v2:
- New patch to add GPIO ASL descriptionarch/x86/include/asm/arch-baytrail/acpi/gpio.asl | 95 ++++++++++++++++++++++ .../include/asm/arch-baytrail/acpi/platform.asl | 3 + 2 files changed, 98 insertions(+) create mode 100644 arch/x86/include/asm/arch-baytrail/acpi/gpio.asl
PATCH v2 18/18 x86: doc: Add porting hints for ACPI with Windows
In reply to Bin MengQuoted 11 lines · Bin Meng
Windows might cache system information and only detect ACPI changes if you modify the ACPI table versions.
Signed-off-by Bin Meng <[email protected]>---
Changes in v2: None
doc/README.x86 | 6 ++++++ 1 file changed, 6 insertions(+)
v2 cover x86: acpi: Support installation of Ubuntu/Windows and boot Windows
In reply to Bin MengHi Bin,
Quoted 17 lines · Bin Meng
Hi Simon,
Quoted 14 lines · Bin Meng
SeaBIOS can be loaded by U-Boot to aid the installation of Ubuntu and Windows to a SATA drive and boot from there. But till now this is broken. The installation either hangs forever or just crashes.
This series fixed a bunch of issues that affect the installation of Ubuntu and Windows, and booting Windows.
Testing was performed on MinnowMax by:
- Install Ubuntu 14.04 and boot
- Install Windows 8.1 and boot
- Install Windows 10 and bootThis series is available at u-boot-x86/acpi2-working.
Quoted 8 lines
Quoted 6 lines
Changes in v2:
- New patch to remove the unnecessary checksum calculation of DSDT
- New patch to remove header length check when writing tables
- New patch to enable SeaBIOS on all boards
- New patch to add GPIO ASL descriptionDo you want to review and test this series, before I apply?
It looks good, please go ahead. I will test it at some point but not soon unfortunately. Looks like what I have been waiting for to get the Ubuntu installer running properly.
Regards,
Simon
PATCH v2 1/18 x86: minnowmax: Adjust U-Boot environment address in SPI flash
In reply to Simon GlassQuoted 14 lines · Simon Glass
Quoted 13 lines · Bin Meng
Currently U-Boot environment address is at offset
0x7fe00of a 8MB SPI flash. When creating a partial u-boot.rom image without flash descriptor and ME firmware, U-Boot actually occupies the last 1MB of the flash, and reprograming U-Boot causes previous environment settings get lost which is not convenient during testing.Adjust the environment address to
0x6ef000instead (before the MRC cache data region in the flash).Signed-off-by Bin Meng <[email protected]>Reviewed-by Stefan Roese <[email protected]>---
Quoted 7 lines
Quoted 5 lines
Changes in v2: None
doc/README.x86 | 2 +- include/configs/minnowmax.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)Reviewed-by Simon Glass <[email protected]>
applied to u-boot-x86, thanks!
PATCH v2 2/18 x86: Call board_final_cleanup() in last_stage_init()
In reply to Simon GlassQuoted 10 lines · Simon Glass
Quoted 9 lines · Bin Meng
At present
board_final_cleanup()is called before booting a Linux kernel. This actually needs to be done before booting anything, like SeaBIOS, VxWorks or Windows.Move the call to
last_stage_init()instead.Signed-off-by Bin Meng <[email protected]>---
Quoted 8 lines
Quoted 6 lines
Changes in v2: None
arch/x86/cpu/coreboot/coreboot.c | 20 +++++++++++--------- arch/x86/cpu/cpu.c | 10 ++++++++++ arch/x86/lib/bootm.c | 9 --------- 3 files changed, 21 insertions(+), 18 deletions(-)Reviewed-by Simon Glass <[email protected]>
applied to u-boot-x86, thanks!
PATCH v2 3/18 x86: Fix up PIRQ routing table checksum earlier
In reply to Simon GlassQuoted 15 lines · Simon Glass
Quoted 14 lines · Bin Meng
PIRQ routing table checksum is fixed up in
copy_pirq_routing_table(), which is fine if we only write the configuration table once. But with the SeaBIOS case, when we write the table for the second time, the checksum will be fixed up to zero per the checksum algorithm, which is caused by the checksum field not being zero before fix up, since the checksum has already been calculated in the first run.To fix this, move the checksum fixup to
create_pirq_routing_table(), so thatcopy_pirq_routing_table()only does what its function name
suggests: copy the table to somewhere else.Signed-off-by Bin Meng <[email protected]>---
Quoted 7 lines
Quoted 5 lines
Changes in v2: None
arch/x86/cpu/irq.c | 4 ++++ arch/x86/lib/pirq_routing.c | 4 ---- 2 files changed, 4 insertions(+), 4 deletions(-)Reviewed-by Simon Glass <[email protected]>
applied to u-boot-x86, thanks!
PATCH v2 4/18 x86: Compile coreboot_table.c only for SeaBIOS
In reply to Simon GlassQuoted 6 lines · Simon Glass
Quoted 5 lines · Bin Meng
coreboot_table.conly needs to be built when SeaBIOS is used.Signed-off-by Bin Meng <[email protected]>---
Quoted 6 lines
Quoted 4 lines
Changes in v2: None
arch/x86/lib/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)Reviewed-by Simon Glass <[email protected]>
applied to u-boot-x86, thanks!
PATCH v2 5/18 x86: Prepare configuration tables in dedicated high memory region
In reply to Simon GlassQuoted 11 lines · Simon Glass
Quoted 10 lines · Bin Meng
Currently when
CONFIG_SEABIOSis on, U-Boot allocates configuration tables via normalmalloc(). To simplify, use a dedicated memory region which is reserved on the stack before relocation for this purpose. Add functions for reserve and malloc.Signed-off-by Bin Meng <[email protected]>---
Changes in v2: None
Quoted 7 lines
Quoted 5 lines
arch/x86/Kconfig | 14 ++++++++++++++ arch/x86/include/asm/coreboot_tables.h | 19 +++++++++++++++++++ arch/x86/include/asm/global_data.h | 4 ++++ arch/x86/lib/coreboot_table.c | 31 +++++++++++++++++++++++++++++++ 4 files changed, 68 insertions(+)Reviewed-by Simon Glass <[email protected]>
applied to u-boot-x86, thanks!
PATCH v2 6/18 x86: Unify reserve_arch() for all x86 boards
In reply to Simon GlassQuoted 9 lines · Simon Glass
Quoted 8 lines · Bin Meng
Instead of asking each platform to provide
reserve_arch(), supply it inarch/x86/cpu/cpu.cin a unified way.Signed-off-by Bin Meng <[email protected]>---
Changes in v2: None
Quoted 8 lines
Quoted 6 lines
arch/x86/cpu/baytrail/valleyview.c | 8 -------- arch/x86/cpu/broadwell/sdram.c | 5 ----- arch/x86/cpu/cpu.c | 12 ++++++++++++ arch/x86/cpu/ivybridge/sdram.c | 5 ----- arch/x86/cpu/quark/quark.c | 9 --------- 5 files changed, 12 insertions(+), 27 deletions(-)Reviewed-by Simon Glass <[email protected]>
applied to u-boot-x86, thanks!
PATCH v2 7/18 x86: Reserve configuration tables in high memory
In reply to Simon GlassQuoted 6 lines · Simon Glass
Quoted 5 lines · Bin Meng
When SeaBIOS is on, reserve configuration tables in
reserve_arch().Signed-off-by Bin Meng <[email protected]>---
Quoted 6 lines
Quoted 4 lines
Changes in v2: None
arch/x86/cpu/cpu.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-)Reviewed-by Simon Glass <[email protected]>
applied to u-boot-x86, thanks!
PATCH v2 8/18 x86: Use high_table_malloc() for tables passing to SeaBIOS
In reply to Simon GlassQuoted 7 lines · Simon Glass
Quoted 6 lines · Bin Meng
Now that we already reserved high memory for configuration tables, call
high_table_malloc()to allocate tables from the region.Signed-off-by Bin Meng <[email protected]>---
Quoted 6 lines
Quoted 4 lines
Changes in v2: None
arch/x86/lib/tables.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)Reviewed-by Simon Glass <[email protected]>
applied to u-boot-x86, thanks!
PATCH v2 9/18 x86: acpi: Switch to ACPI mode by ourselves instead of requested by OSPM
In reply to Simon GlassQuoted 27 lines · Simon Glass
Quoted 26 lines · Bin Meng
Per ACPI spec, during ACPI OS initialization, OSPM can determine that the ACPI hardware registers are owned by SMI (by way of the
SCI_ENbit in thePM1_CNTregister), in which case the ACPI OS issues theACPI_ENABLEcommand to theSMI_CMDport. TheSCI_ENbit effectively tracks the ownership of the ACPI hardware registers.However since U-Boot does not support SMI, we report all 3 fields in FADT (
SMI_CMD,ACPI_ENABLE,ACPI_DISABLE) as zero, by following the spec who says: these fields are reserved and must be zero on system that does not support System Management mode.U-Boot seems to behave in a correct way that the ACPI spec allows, at least Linux does not complain, but apparently Windows does not think so. During Windows bring up debugging, it is observed that even these 3 fields are zero, Windows are still trying to issue SMI with hardcoded SMI port address and commands, and expecting
SCI_ENto be changed by the firmware. Eventually Windows gives us a BSOD (Blue Screen of Death) sayingACPI_BIOS_ERRORand refuses to start.To fix this, turn on the
SCI_ENbit by ourselves. With this patch, now U-Boot can install and boot Windows 8.1/10 successfully with the help of SeaBIOS using legacy interface (non-UEFI mode).Signed-off-by Bin Meng <[email protected]>---
Quoted 7 lines
Quoted 5 lines
Changes in v2: None
arch/x86/include/asm/acpi_table.h | 3 +++ arch/x86/lib/acpi_table.c | 26 ++++++++++++++++++++++++++ 2 files changed, 29 insertions(+)Reviewed-by Simon Glass <[email protected]>
applied to u-boot-x86, thanks!
PATCH v2 10/18 x86: acpi: Remove the unnecessary checksum calculation of DSDT
In reply to Simon GlassQuoted 8 lines · Simon Glass
Quoted 7 lines · Bin Meng
The generated AmlCode[] from IASL already has the calculated DSDT table checksum in place. No need for us to calculate it again.
Signed-off-by Bin Meng <[email protected]>---
Quoted 7 lines
Quoted 5 lines
Changes in v2:
- New patch to remove the unnecessary checksum calculation of DSDTarch/x86/lib/acpi_table.c | 6 ------ 1 file changed, 6 deletions(-)Reviewed-by Simon Glass <[email protected]>
applied to u-boot-x86, thanks!
PATCH v2 11/18 x86: acpi: Remove header length check when writing tables
In reply to Simon GlassQuoted 10 lines · Simon Glass
Quoted 9 lines · Bin Meng
Before moving 'current' pointer during ACPI table writing, we always check the table length to see if it is larger than the table header. Since our purpose is to generate valid tables, the check logic is always true, which can be avoided.
Signed-off-by Bin Meng <[email protected]>---
Quoted 7 lines
Quoted 5 lines
Changes in v2:
- New patch to remove header length check when writing tablesarch/x86/lib/acpi_table.c | 26 ++++++++++---------------- 1 file changed, 10 insertions(+), 16 deletions(-)Reviewed-by Simon Glass <[email protected]>
applied to u-boot-x86, thanks!
PATCH v2 12/18 x86: doc: Update information about IGD with SeaBIOS
In reply to Simon GlassQuoted 7 lines · Simon Glass
Quoted 6 lines · Bin Meng
Document how to make SeaBIOS load and run the VGA ROM of Intel IGD device when loaded by U-Boot.
Signed-off-by Bin Meng <[email protected]>---
Quoted 6 lines
Quoted 4 lines
Changes in v2: None
doc/README.x86 | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+)Reviewed-by Simon Glass <[email protected]>
applied to u-boot-x86, thanks!
PATCH v2 13/18 x86: baytrail: Enable SeaBIOS on all boards
In reply to Simon GlassQuoted 12 lines · Simon Glass
Quoted 11 lines · Bin Meng
SeaBIOS can be loaded by U-Boot to aid the installation of Ubuntu and Windows to a SATA drive and boot from there. Enable it on all BayTrail boards.
Signed-off-by Bin Meng <[email protected]>---
Changes in v2:
- New patch to enable SeaBIOS on all boards
Quoted 6 lines
Quoted 4 lines
configs/bayleybay_defconfig | 1 + configs/conga-qeval20-qa3-e3845_defconfig | 1 + configs/minnowmax_defconfig | 1 + 3 files changed, 3 insertions(+)Reviewed-by Simon Glass <[email protected]>
applied to u-boot-x86, thanks!
PATCH v2 14/18 x86: doc: Mention Ubuntu/Windows installation and boot support
In reply to Simon GlassQuoted 7 lines · Simon Glass
Quoted 6 lines · Bin Meng
As of now, U-Boot can support installing and booting Ubuntu/Windows with the help of SeaBIOS. Update the documentation.
Signed-off-by Bin Meng <[email protected]>---
Quoted 6 lines
Quoted 4 lines
Changes in v2: None
doc/README.x86 | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-)Reviewed-by Simon Glass <[email protected]>
applied to u-boot-x86, thanks!
PATCH v2 15/18 acpi: Quieten IASL output when 'make -s' is used
In reply to Simon GlassQuoted 8 lines · Simon Glass
Quoted 7 lines · Bin Meng
IASL compiler does not provide a command line option to turn off its non-warning message. To quieten the output when 'make -s', redirect its output to
/dev/null.Signed-off-by Bin Meng <[email protected]>---
Quoted 6 lines
Quoted 4 lines
Changes in v2: None
scripts/Makefile.lib | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)Reviewed-by Simon Glass <[email protected]>
applied to u-boot-x86, thanks!
PATCH v2 16/18 x86: baytrail: Add internal UART ASL description
In reply to Simon GlassQuoted 14 lines · Simon Glass
Quoted 13 lines · Bin Meng
BayTrail integrates an internal ns15550 compatible UART (PNP0501). Its IRQ is hardwired to IRQ3 in old revision chipset, but in newer revision one IRQ4 is being used for ISA compatibility. Handle this correctly in the ASL file.
Linux does not need this ASL, but Windows need this to correctly discover a COM port existing in the system so that Windows can show it in the 'Device Manager' window, and expose this COM port to any terminal emulation application.
Signed-off-by Bin Meng <[email protected]>---
Quoted 7 lines
Quoted 5 lines
Changes in v2: None
.../include/asm/arch-baytrail/acpi/irqlinks.asl | 4 ++ arch/x86/include/asm/arch-baytrail/acpi/lpc.asl | 60 ++++++++++++++++++++++ 2 files changed, 64 insertions(+)Reviewed-by Simon Glass <[email protected]>
applied to u-boot-x86, thanks!
PATCH v2 17/18 x86: baytrail: Add GPIO ASL description
In reply to Simon GlassQuoted 12 lines · Simon Glass
Quoted 11 lines · Bin Meng
Since BayTrail, Intel starts to use new GPIO IPs in their chipset. This adds the GPIO ASL, so that OS can load corresponding drivers for it. On Linux, this is BayTrail pinctrl driver.
Signed-off-by Bin Meng <[email protected]>---
Changes in v2:
- New patch to add GPIO ASL description
Quoted 6 lines
Quoted 4 lines
arch/x86/include/asm/arch-baytrail/acpi/gpio.asl | 95 ++++++++++++++++++++++ .../include/asm/arch-baytrail/acpi/platform.asl | 3 + 2 files changed, 98 insertions(+) create mode 100644 arch/x86/include/asm/arch-baytrail/acpi/gpio.aslReviewed-by Simon Glass <[email protected]>
applied to u-boot-x86, thanks!
PATCH v2 18/18 x86: doc: Add porting hints for ACPI with Windows
In reply to Simon GlassQuoted 6 lines · Simon Glass
Quoted 5 lines · Bin Meng
Windows might cache system information and only detect ACPI changes if you modify the ACPI table versions.
Signed-off-by Bin Meng <[email protected]>
Quoted 8 lines
Quoted 6 lines
---
Changes in v2: None
doc/README.x86 | 6 ++++++ 1 file changed, 6 insertions(+)Reviewed-by Simon Glass <[email protected]>
applied to u-boot-x86, thanks!