Alexandru Gagniuc (mr.nuke.me(a)gmail.com) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/13356
-gerrit
commit a3b2746cea54650850c13bb73b328df46edc7b01
Author: Lance Zhao <lijian.zhao(a)intel.com>
Date: Thu Nov 12 18:19:41 2015 -0800
soc/apollolake: Add lpc device driver
A dedicated pci device driver required for LPC devices as the legacy IO range
need to be included to avoid IO resource confilict. Blindly set to 0~0x1000 to
also avoid the IO resource of COMA/COMB/LPT/FDD and LPC.Without this driver
system will have assertion on load RTC DXE driver in UEFI payloads.
Change-Id: Icc462c159c2cf39cc1030d55acee79e73a6bfb35
Signed-off-by: Lance Zhao <lijian.zhao(a)intel.com>
---
src/soc/intel/apollolake/Makefile.inc | 1 +
src/soc/intel/apollolake/lpc.c | 52 +++++++++++++++++++++++++++++++++++
2 files changed, 53 insertions(+)
diff --git a/src/soc/intel/apollolake/Makefile.inc b/src/soc/intel/apollolake/Makefile.inc
index 7efb3ba..e9f1079 100644
--- a/src/soc/intel/apollolake/Makefile.inc
+++ b/src/soc/intel/apollolake/Makefile.inc
@@ -27,6 +27,7 @@ ramstage-$(CONFIG_HAVE_ACPI_TABLES) += acpi.c
ramstage-y += chip.c
ramstage-y += cpu.c
ramstage-y += gpio.c
+ramstage-y += lpc.c
ramstage-y += memmap.c
ramstage-y += mmap_boot.c
ramstage-y += tsc_freq.c
diff --git a/src/soc/intel/apollolake/lpc.c b/src/soc/intel/apollolake/lpc.c
new file mode 100644
index 0000000..8f0d2ad
--- /dev/null
+++ b/src/soc/intel/apollolake/lpc.c
@@ -0,0 +1,52 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright (C) 2015 Intel Corp.
+ * (Written by Lance Zhao <lijian.zhao(a)intel.com> for Intel Corp.)
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ */
+
+#include <device/device.h>
+#include <device/pci.h>
+#include <device/pci_ids.h>
+
+static void soc_lpc_add_io_resources(device_t dev)
+{
+ struct resource *res;
+
+ /* Add the default claimed legacy IO range for the LPC device. */
+ res = new_resource(dev, 0);
+ res->base = 0;
+ res->size = 0x1000;
+ res->flags = IORESOURCE_IO | IORESOURCE_ASSIGNED | IORESOURCE_FIXED;
+}
+
+static void soc_lpc_read_resources(device_t dev)
+{
+ /* Get the PCI resources of this device. */
+ pci_dev_read_resources(dev);
+
+ /* Add IO resources to LPC. */
+ soc_lpc_add_io_resources(dev);
+}
+
+static struct device_operations device_ops = {
+ .read_resources = &soc_lpc_read_resources,
+ .set_resources = &pci_dev_set_resources,
+ .enable_resources = &pci_dev_enable_resources,
+};
+
+static const unsigned short pci_device_ids[] = {
+ 0x5AE8,
+ 0
+};
+
+static const struct pci_driver soc_lpc __pci_driver = {
+ .ops = &device_ops,
+ .vendor = PCI_VENDOR_ID_INTEL,
+ .devices = pci_device_ids,
+};
Alexandru Gagniuc (mr.nuke.me(a)gmail.com) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/13357
-gerrit
commit adb2482a9ffbbd84700a1d30655a251079f8c5c0
Author: Alexandru Gagniuc <alexandrux.gagniuc(a)intel.com>
Date: Fri Nov 13 17:15:03 2015 -0800
soc/apollolake: Place new romstage stack in CAR instead of RAM
We can allocate a new romstage stack in CAR because we don't tear down
CAR in romstage. This simple change improves ramstage loading time by
about 30%.
Change-Id: I5762c74cdc0ea8cb0aade3fdf8071cb86ec3fe0e
Signed-off-by: Alexandru Gagniuc <alexandrux.gagniuc(a)intel.com>
---
src/soc/intel/apollolake/Kconfig | 13 +------------
src/soc/intel/apollolake/romstage/entry.inc | 6 +++---
src/soc/intel/apollolake/romstage/romstage.c | 29 ++++++++++++----------------
3 files changed, 16 insertions(+), 32 deletions(-)
diff --git a/src/soc/intel/apollolake/Kconfig b/src/soc/intel/apollolake/Kconfig
index eb9bd79..1b60bcf 100644
--- a/src/soc/intel/apollolake/Kconfig
+++ b/src/soc/intel/apollolake/Kconfig
@@ -12,7 +12,6 @@ config CPU_SPECIFIC_OPTIONS
select ARCH_ROMSTAGE_X86_32
select ARCH_VERSTAGE_X86_32
# CPU specific options
- select CPU_INTEL_FIRMWARE_INTERFACE_TABLE
select IOAPIC
select SMP
select SSE2
@@ -70,17 +69,7 @@ config DCACHE_RAM_BOOTBLOCK_STACK_SIZE
default 0x800
help
The amount of anticipated stack usage from the bootblock during
- pre-romstage initialization.
-
-config ROMSTAGE_RAM_STACK_SIZE
- hex
- default 0x5000
- help
- The size of the romstage stack after memory is available. Because CAR
- space is very crowded, only a very limited part of CAR is available
- for stack. More than that is needed to decompress ramstage. This
- variable indicates how much RAM to reserve for the stack after
- raminit. The stack is automatically switched after romstage_main().
+ pre-romstage initialization..
config IFD_BIOS_START
hex
diff --git a/src/soc/intel/apollolake/romstage/entry.inc b/src/soc/intel/apollolake/romstage/entry.inc
index 8c0670c..2c6dfd6 100644
--- a/src/soc/intel/apollolake/romstage/entry.inc
+++ b/src/soc/intel/apollolake/romstage/entry.inc
@@ -21,9 +21,9 @@ apollolake_entry:
call romstage_entry
/*
- * eax contains pointer to a region in RAM that we've been given the go
- * ahead to use as stack. The old stack is empty at this point, so we
- * don't have to relocate anything.
+ * eax contains pointer to a region that we've been given the go ahead
+ * to use as stack. The old stack is empty at this point, so we don't
+ * have to relocate anything.
*/
mov esp, eax
diff --git a/src/soc/intel/apollolake/romstage/romstage.c b/src/soc/intel/apollolake/romstage/romstage.c
index b7ffd3a..24fad92 100644
--- a/src/soc/intel/apollolake/romstage/romstage.c
+++ b/src/soc/intel/apollolake/romstage/romstage.c
@@ -54,23 +54,18 @@ static void soc_early_romstage_init(void)
pci_write_config32(PCI_DEV(0, 13, 0), 0x60, 1<<7);
}
-static void *alloc_stack_in_ram(void)
+/*
+ * Now that FSP is done consuming large amounts of CAR, we can use a much
+ * larger portion of CAR for the stack. The larger stack is needed for
+ * decompressing ramstage. It turns out that setting the stack pointer to top
+ * of CAR gives us the largest uninterrupted stack.
+ */
+static void *realloc_stack(void)
{
- uint8_t *ram_stack = cbmem_add(CBMEM_ID_ROMSTAGE_RAM_STACK,
- CONFIG_ROMSTAGE_RAM_STACK_SIZE);
-
- /*
- * If cbmem fails to give us a memory window, try to get a stack at
- * 2 MiB, and hope we can go forward. The 2 MiB address is arbitrary.
- */
- if (ram_stack == NULL) {
- printk(BIOS_ALERT, "Could not find place for stack\n");
- return (void *)(2 * MiB);
- }
-
- /* The initial stack pointer should point at the top of the region */
- ram_stack += CONFIG_ROMSTAGE_RAM_STACK_SIZE - sizeof(size_t);
- return ram_stack;
+ uintptr_t new_stack = CONFIG_DCACHE_RAM_BASE + CONFIG_DCACHE_RAM_SIZE;
+ new_stack -= sizeof(size_t);
+ printk(BIOS_DEBUG, "Placing new stack at 0x%lx\n", new_stack);
+ return (void *)new_stack;
}
asmlinkage void* romstage_entry(void)
@@ -100,7 +95,7 @@ asmlinkage void* romstage_entry(void)
if (fsp_mem.base != (uintptr_t)cbmem_find(CBMEM_ID_FSP_RESERVED_MEMORY))
die("Failed to accommodate FSP reserved memory request");
- return alloc_stack_in_ram();
+ return realloc_stack();
}
asmlinkage void romstage_after_raminit(void)
Alexandru Gagniuc (mr.nuke.me(a)gmail.com) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/13348
-gerrit
commit 3eb7e0acb59c9ce779ee9e5ff2466d7e23efb0f9
Author: Lance Zhao <lijian.zhao(a)intel.com>
Date: Mon Nov 9 17:06:34 2015 -0800
soc/apollolake: Add skelton ACPI entry
Change-Id: Ib127af5392ca2b349480f5b21fad2186b444d7e6
Signed-off-by: Lance Zhao <lijian.zhao(a)intel.com>
---
src/mainboard/intel/apollolake_rvp/Kconfig | 1 +
src/mainboard/intel/apollolake_rvp/acpi_tables.c | 18 +++++++++++++++
src/mainboard/intel/apollolake_rvp/dsdt.asl | 29 ++++++++++++++++++++++++
src/soc/intel/apollolake/Makefile.inc | 1 +
src/soc/intel/apollolake/acpi.c | 22 ++++++++++++++++++
5 files changed, 71 insertions(+)
diff --git a/src/mainboard/intel/apollolake_rvp/Kconfig b/src/mainboard/intel/apollolake_rvp/Kconfig
index 5e6c4f0..ec71e96 100755
--- a/src/mainboard/intel/apollolake_rvp/Kconfig
+++ b/src/mainboard/intel/apollolake_rvp/Kconfig
@@ -4,6 +4,7 @@ config BOARD_SPECIFIC_OPTIONS
def_bool y
select SOC_INTEL_APOLLOLAKE
select BOARD_ROMSIZE_KB_8192
+ select HAVE_ACPI_TABLES
config MAINBOARD_DIR
string
diff --git a/src/mainboard/intel/apollolake_rvp/acpi_tables.c b/src/mainboard/intel/apollolake_rvp/acpi_tables.c
new file mode 100644
index 0000000..d21b743
--- /dev/null
+++ b/src/mainboard/intel/apollolake_rvp/acpi_tables.c
@@ -0,0 +1,18 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright (C) 2015 Intel Corp.
+ * (Written by Lance Zhao <lijian.zhao(a)intel.com> for Intel Corp.)
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ */
+
+#include <arch/acpi.h>
+
+void acpi_create_fadt(acpi_fadt_t *fadt, acpi_facs_t *facs, void *dsdt)
+{
+}
+
diff --git a/src/mainboard/intel/apollolake_rvp/dsdt.asl b/src/mainboard/intel/apollolake_rvp/dsdt.asl
new file mode 100644
index 0000000..1736cea
--- /dev/null
+++ b/src/mainboard/intel/apollolake_rvp/dsdt.asl
@@ -0,0 +1,29 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright (C) 2015 Intel Corp.
+ * (Written by Lance Zhao <lijian.zhao(a)intel.com> for Intel Corp.)
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ */
+
+DefinitionBlock(
+ "dsdt.aml",
+ "DSDT",
+ 0x02, /* DSDT revision: ACPI v2.0 */
+ "COREv4", /* OEM id */
+ "COREBOOT", /* OEM table id */
+ 0x20110725 /* OEM revision */
+)
+{
+ Scope (\_SB) {
+ Device (PCI0)
+ {
+ Name (_HID, EISAID ("PNP0A08")) /* PCIe */
+ }
+ }
+
+}
diff --git a/src/soc/intel/apollolake/Makefile.inc b/src/soc/intel/apollolake/Makefile.inc
index 59d13e3..7efb3ba 100644
--- a/src/soc/intel/apollolake/Makefile.inc
+++ b/src/soc/intel/apollolake/Makefile.inc
@@ -23,6 +23,7 @@ romstage-y += romstage/romstage.c
romstage-y += tsc_freq.c
romstage-y += uart_early.c
+ramstage-$(CONFIG_HAVE_ACPI_TABLES) += acpi.c
ramstage-y += chip.c
ramstage-y += cpu.c
ramstage-y += gpio.c
diff --git a/src/soc/intel/apollolake/acpi.c b/src/soc/intel/apollolake/acpi.c
new file mode 100644
index 0000000..4246f40
--- /dev/null
+++ b/src/soc/intel/apollolake/acpi.c
@@ -0,0 +1,22 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright (C) 2015 Intel Corp.
+ * (Written by Lance Zhao <lijian.zhao(a)intel.com> for Intel Corp.)
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ */
+
+#include <arch/acpi.h>
+unsigned long acpi_fill_mcfg(unsigned long current)
+{
+ return 0;
+}
+unsigned long acpi_fill_madt(unsigned long current)
+{
+ return 0;
+}
+