Skip to contentSkip to conversation

x86: acpi: Support installation of Ubuntu/Windows and boot Windows

PATCH New Bin Meng 2 participants 19 messages May 9, 2016 – May 11, 2016

Subsystems (2)
lore
Share & tools
lore

Bin Meng

author
#0 lore raw

cover x86: acpi: Support installation of Ubuntu/Windows and boot Windows

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.

Bin Meng (14):
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: doc: Update information about IGD with SeaBIOS
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: 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 ++
 .../include/asm/arch-baytrail/acpi/irqlinks.asl    |  4 ++
 arch/x86/include/asm/arch-baytrail/acpi/lpc.asl    | 60 ++++++++++++++++++++++
 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                          | 26 ++++++++++
 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 +-
 doc/README.x86                                     | 44 ++++++++++++++--
 include/configs/minnowmax.h                        |  2 +-
 scripts/Makefile.lib                               |  2 +-
 22 files changed, 246 insertions(+), 60 deletions(-)
Signature · 1 line
1.8.2.1
author
#1 lore raw

PATCH 1/14 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).

---

 doc/README.x86              | 2 +-
 include/configs/minnowmax.h | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
doc/README.x86 +1 -1
index ce806ee..25cb218 100644
@@ -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
index 674d1f6..95ad128 100644
@@ -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
#2 lore raw

PATCH 1/14 x86: minnowmax: Adjust U-Boot environment address in SPI flash

Quoted 10 lines · Bin Meng

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).

Thanks,
Stefan

author
#3 lore raw

PATCH 2/14 x86: Call board_final_cleanup() in last_stage_init()

In reply to 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.

---

 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
index 845f86a..1b04203 100644
@@ -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
index 233a6c8..1482153 100644
@@ -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
index 783be69..7cf9de4 100644
@@ -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
author
#4 lore raw

PATCH 3/14 x86: Fix up PIRQ routing table checksum earlier

In reply to 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 that copy_pirq_routing_table() only does what its function name
suggests: copy the table to somewhere else.

---

 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
index 86183b0..df3cd0a 100644
@@ -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
index 3cc6adb..a93d355 100644
@@ -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
author
#5 lore raw

PATCH 4/14 x86: Compile coreboot_table.c only for SeaBIOS

In reply to Bin Meng

coreboot_table.c only needs to be built when SeaBIOS is used.

---

 arch/x86/lib/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/lib/Makefile +1 -1
index dc90df2..73e3e52 100644
@@ -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
author
#6 lore raw

PATCH 5/14 x86: Prepare configuration tables in dedicated high memory region

In reply to Bin Meng

Currently 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.

---

 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
index 4ef27dc..d304e29 100644
@@ -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
index 15ccf9b..e036f74 100644
@@ -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
index 3bc2ac2..7434f77 100644
@@ -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
index cb45a79..ceab3cf 100644
@@ -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
author
#7 lore raw

PATCH 6/14 x86: Unify reserve_arch() for all x86 boards

In reply to Bin Meng

Instead of asking each platform to provide reserve_arch(), supply it in arch/x86/cpu/cpu.c in a unified way.

---

 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
index 25382f9..b31f24e 100644
@@ -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
index 4bf5d15..e7befde 100644
@@ -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
index 1482153..2e27d78 100644
@@ -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
index e35e543..9d9f63d 100644
@@ -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
index afb3463..cf3fe7f 100644
@@ -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
author
#8 lore raw

PATCH 7/14 x86: Reserve configuration tables in high memory

In reply to Bin Meng

When SeaBIOS is on, reserve configuration tables in reserve_arch().

---

 arch/x86/cpu/cpu.c | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)
arch/x86/cpu/cpu.c +8 -3
index 2e27d78..e522ff3 100644
@@ -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
author
#9 lore raw

PATCH 8/14 x86: Use high_table_malloc() for tables passing to SeaBIOS

In reply to Bin Meng

Now that we already reserved high memory for configuration tables, call high_table_malloc() to allocate tables from the region.

---

 arch/x86/lib/tables.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
arch/x86/lib/tables.c +1 -3
index 1213a9c..f92111e 100644
@@ -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
author
#10 lore raw

PATCH 9/14 x86: acpi: Switch to ACPI mode by ourselves instead of requested by OSPM

In reply to 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_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).

---

 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
index ff4802a..56aa282 100644
@@ -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
index 989cf7d..a9fe243 100644
@@ -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
author
#11 lore raw

PATCH 10/14 x86: doc: Update information about IGD with SeaBIOS

In reply to Bin Meng

Document how to make SeaBIOS load and run the VGA ROM of Intel IGD device when loaded by U-Boot.

---

 doc/README.x86 | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)
doc/README.x86 +24 -0
index 25cb218..250d5a3 100644
@@ -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
author
#12 lore raw

PATCH 11/14 x86: doc: Mention Ubuntu/Windows installation and boot support

In reply to Bin Meng

As of now, U-Boot can support installing and booting Ubuntu/Windows with the help of SeaBIOS. Update the documentation.

---

 doc/README.x86 | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)
doc/README.x86 +8 -4
index 250d5a3..75762de 100644
@@ -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
author
#13 lore raw

PATCH 12/14 acpi: Quieten IASL output when 'make -s' is used

In reply to 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.

---

 scripts/Makefile.lib | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
scripts/Makefile.lib +1 -1
index 44534e1..97a09a2 100644
@@ -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
author
#14 lore raw

PATCH 13/14 x86: baytrail: Add internal UART ASL description

In reply to 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.

---

 .../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
index aa72085..0affa23 100644
@@ -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
author
#15 lore raw

PATCH 14/14 x86: doc: Add porting hints for ACPI with Windows

In reply to Bin Meng

Windows might cache system information and only detect ACPI changes if you modify the ACPI table versions.

---

 doc/README.x86 | 6 ++++++
 1 file changed, 6 insertions(+)
doc/README.x86 +6 -0
index 75762de..4d50feb 100644
@@ -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
#16 lore raw

cover x86: acpi: Support installation of Ubuntu/Windows and boot Windows

In reply to Bin Meng

Hi Bin,

Quoted 9 lines · Bin Meng

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.

This is really great news. Thanks for working on this. I do have some questions though:

AFAICT, SeaBIOS is required for this installation, correct? Perhaps you should mention this here in this patch summary as well. And if this is the case, its would be nice to enable the SeaBIOS support at least for MinnowMAX as well in the defconfig?

Thanks,
Stefan

author
#17 lore raw

cover x86: acpi: Support installation of Ubuntu/Windows and boot Windows

Hi Stefan,

Quoted 12 lines · Stefan Roese

Hi Bin,

Quoted 9 lines · Bin Meng

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 7 lines
Quoted 1 line

This series is available at u-boot-x86/acpi2-working.

This is really great news. Thanks for working on this. I do have some questions though:

AFAICT, SeaBIOS is required for this installation, correct?

Correct.

Quoted 4 lines

Perhaps you should mention this here in this patch summary as well. And if this is the case, its would be nice to enable the SeaBIOS support at least for MinnowMAX as well in the defconfig?

Makes sense. Maybe enable this on all BayTrail boards.

Regards,
Bin

#18 lore raw

cover x86: acpi: Support installation of Ubuntu/Windows and boot Windows

Hi Bin,

Quoted 21 lines · Bin Meng
Quoted 12 lines · Stefan Roese

Hi Bin,

Quoted 9 lines · Bin Meng

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 7 lines
Quoted 1 line

This series is available at u-boot-x86/acpi2-working.

This is really great news. Thanks for working on this. I do have some questions though:

AFAICT, SeaBIOS is required for this installation, correct?

Quoted 8 lines

Correct.

Quoted 4 lines

Perhaps you should mention this here in this patch summary as well. And if this is the case, its would be nice to enable the SeaBIOS support at least for MinnowMAX as well in the defconfig?

Makes sense. Maybe enable this on all BayTrail boards.

Yes, please do this for v2.

Thanks,
Stefan