Jeremy Compostella has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/37681 )
Change subject: soc/intel/apollolake: add support for extracting LBP2 from IFWI
......................................................................
soc/intel/apollolake: add support for extracting LBP2 from IFWI
Add support for automatic extraction of the Logical Boot Partition 2
from the supplied IFWI binary.
Change-Id: Ia2a9ca233bddb8e9fb4e980f0ae5e6fcf3fc757c
Signed-off-by: Jeremy Compostella <jeremy.compostella(a)intel.com>
---
M src/soc/intel/apollolake/Kconfig
M src/soc/intel/apollolake/Makefile.inc
2 files changed, 19 insertions(+), 3 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/81/37681/1
diff --git a/src/soc/intel/apollolake/Kconfig b/src/soc/intel/apollolake/Kconfig
index 0b3b30a..32a1adc 100644
--- a/src/soc/intel/apollolake/Kconfig
+++ b/src/soc/intel/apollolake/Kconfig
@@ -211,9 +211,17 @@
help
Name of FMAP region to write logical boot partition 2 data.
+config LBP2_FROM_IFWI
+ bool "Extract the LBP2 from the IFWI binary"
+ depends on NEED_LBP2
+ default n
+ help
+ The Logical Boot Partition will be automatically extracted
+ from the supplied IFWI binary
+
config LBP2_FILE_NAME
string "Path of file to write to logical boot partition 2 region"
- depends on NEED_LBP2
+ depends on NEED_LBP2 && !LBP2_FROM_IFWI
default "3rdparty/blobs/mainboard/$(CONFIG_MAINBOARD_DIR)/lbp2.bin"
help
Name of file to store in the logical boot partition 2 region.
diff --git a/src/soc/intel/apollolake/Makefile.inc b/src/soc/intel/apollolake/Makefile.inc
index 24375b3..e2003fa 100644
--- a/src/soc/intel/apollolake/Makefile.inc
+++ b/src/soc/intel/apollolake/Makefile.inc
@@ -117,8 +117,16 @@
endif
ifeq ($(CONFIG_NEED_LBP2),y)
-files_added::
- $(CBFSTOOL) $(obj)/coreboot.rom write -r $(CONFIG_LBP2_FMAP_NAME) -f $(CONFIG_LBP2_FILE_NAME) --fill-upward
+$(objcbfs)/lbp2.bin: $(IFWITOOL)
+ifeq ($(CONFIG_LBP2_FROM_IFWI),y)
+ $(IFWITOOL) $(CONFIG_IFWI_FILE_NAME) create -f $@ -s 1
+ $(IFWITOOL) $@ delete -n OBBP
+else
+ cp $(CONFIG_LBP2_FILE_NAME) $@
+endif
+
+files_added:: $(objcbfs)/lbp2.bin
+ $(CBFSTOOL) $(obj)/coreboot.rom write -r $(CONFIG_LBP2_FMAP_NAME) -f $< --fill-upward
endif
# Bootblock on Apollolake platform lies in the IFWI region. In order to place
--
To view, visit https://review.coreboot.org/c/coreboot/+/37681
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: Ia2a9ca233bddb8e9fb4e980f0ae5e6fcf3fc757c
Gerrit-Change-Number: 37681
Gerrit-PatchSet: 1
Gerrit-Owner: Jeremy Compostella <jeremy.compostella(a)gmail.com>
Gerrit-MessageType: newchange
Jeremy Compostella has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/37660 )
Change subject: ifwitool: Introduce a skip BPDT parameter
......................................................................
ifwitool: Introduce a skip BPDT parameter
SoCs like apololake can require two Boot Partition Descriptor Table
entries. The second BPDT is usually in the ifwi binary which is
supplied but ifwitool can only create a BPDT binary with the first
BPDT of the supplied ifwi.
This patch introduces a skip BPDT parameter which is passed to the
ifwi_parse() function. It allows the caller script to extract any
BPDT separately. This is useful to extract the Logical Boot Partition
2 contains in some IFWI to inject it with fmaptool.
The same result could be achieve mixing up dd and ifwitool commands
but it would create dependencies on the dd command and more
importantly the script or Makefile would need to know the offset where
the second BPDT is. With this simple new ifwitool option, the second
BPDP (or third, ...) can be located and then extracted in one command
without know its offset.
Change-Id: If32ec11fc7291d52b821bf95c1e186690d06ba11
Signed-off-by: Jeremy Compostella <jeremy.compostella(a)intel.com>
---
M util/cbfstool/ifwitool.c
1 file changed, 36 insertions(+), 6 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/60/37660/1
diff --git a/util/cbfstool/ifwitool.c b/util/cbfstool/ifwitool.c
index 1fbb61b..c34e193 100644
--- a/util/cbfstool/ifwitool.c
+++ b/util/cbfstool/ifwitool.c
@@ -20,6 +20,8 @@
#include "common.h"
+#define max(a, b) (((a) > (b)) ? (a) : (b))
+
/*
* BPDT is Boot Partition Descriptor Table. It is located at the start of a
* logical boot partition(LBP). It stores information about the critical
@@ -851,8 +853,20 @@
print_subpart_dir(subpart_dir);
}
+/* Parse the bpdt entries to compute the size of the BPDT */
+static size_t bpdt_size(void *data)
+{
+ struct bpdt *b = (struct bpdt *)data;
+ size_t i, size = 0;
+
+ for (i = 0; i < b->h.descriptor_count; i++)
+ size = max(size, b->e[i].offset + b->e[i].size);
+
+ return size;
+}
+
/* Parse input image file to identify different sub-partitions. */
-static int ifwi_parse(void)
+static int ifwi_parse(size_t skip_bpdt_nb)
{
DEBUG("Parsing IFWI image...\n");
const char *image_name = param.image_name;
@@ -871,9 +885,13 @@
void *data = buffer_get(buff);
while (offset < buffer_size(buff)) {
- if (read_at_le32(data, offset) == BPDT_SIGNATURE)
- break;
- offset += 4 * KiB;
+ if (read_at_le32(data, offset) == BPDT_SIGNATURE) {
+ if (!skip_bpdt_nb)
+ break;
+ offset += bpdt_size(buffer_get(buff) + offset);
+ skip_bpdt_nb--;
+ } else
+ offset += 4 * KiB;
}
if (offset >= buffer_size(buff)) {
@@ -1851,7 +1869,7 @@
static const struct command commands[] = {
{"add", "f:n:e:dvh?", ifwi_add},
- {"create", "f:vh?", ifwi_create},
+ {"create", "f:s:vh?", ifwi_create},
{"delete", "f:n:vh?", ifwi_delete},
{"extract", "f:n:e:dvh?", ifwi_extract},
{"print", "dh?", ifwi_print},
@@ -1883,6 +1901,7 @@
" replace -f FILE -n NAME [-d -e ENTRY]\n"
"OPTIONs:\n"
" -f FILE : File to read/write/create/extract\n"
+ " -s NB : NB of BPDT to skip during IFWI parsing\n"
" -d : Perform directory operation\n"
" -e ENTRY: Name of directory entry to operate on\n"
" -v : Verbose level\n"
@@ -1915,6 +1934,7 @@
if (strcmp(cmd, commands[i].name) != 0)
continue;
+ size_t skip_bpdt_nb = 0;
int c;
while (1) {
@@ -1937,6 +1957,16 @@
case 'n':
param.subpart_name = optarg;
break;
+ case 's': {
+ char *endptr;
+ skip_bpdt_nb = strtoul(optarg, &endptr, 0);
+ if (*endptr != '\0') {
+ ERROR("%s: invalid offset\n", optarg);
+ return 1;
+ }
+ break;
+ }
+
case 'f':
param.file_name = optarg;
break;
@@ -1958,7 +1988,7 @@
}
}
- if (ifwi_parse()) {
+ if (ifwi_parse(skip_bpdt_nb)) {
ERROR("%s: ifwi parsing failed\n", argv[0]);
return 1;
}
--
To view, visit https://review.coreboot.org/c/coreboot/+/37660
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: If32ec11fc7291d52b821bf95c1e186690d06ba11
Gerrit-Change-Number: 37660
Gerrit-PatchSet: 1
Gerrit-Owner: Jeremy Compostella <jeremy.compostella(a)gmail.com>
Gerrit-MessageType: newchange
Wim Vervoorn has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/37694 )
Change subject: soc/intel{cannonlake,icelake}/northbridge.asl: Correct flash range
......................................................................
soc/intel{cannonlake,icelake}/northbridge.asl: Correct flash range
The base address of the 16 MB flash range was reported as 0xFFF00000
this causes the range to extend above the 4GB boundary.
Change the base to 0xFF000000 as is the case with e.g. Skylake.
BUG=N/A
TEST=build
Change-Id: Ia8de01769ced00c5ae13f255760401933230b88c
Signed-off-by: Wim Vervoorn <wvervoorn(a)eltan.com>
---
M src/soc/intel/cannonlake/acpi/northbridge.asl
M src/soc/intel/icelake/acpi/northbridge.asl
2 files changed, 2 insertions(+), 2 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/94/37694/1
diff --git a/src/soc/intel/cannonlake/acpi/northbridge.asl b/src/soc/intel/cannonlake/acpi/northbridge.asl
index 22ddad7..2529116 100644
--- a/src/soc/intel/cannonlake/acpi/northbridge.asl
+++ b/src/soc/intel/cannonlake/acpi/northbridge.asl
@@ -307,7 +307,7 @@
Memory32Fixed (ReadOnly, VTD_BASE_ADDRESS, VTD_BASE_SIZE)
/* FLASH range */
- Memory32Fixed (ReadOnly, 0xFFF00000, 0x1000000, FIOH)
+ Memory32Fixed (ReadOnly, 0xFF000000, 0x1000000, FIOH)
/* Local APIC range(0xFEE0_0000 to 0xFEEF_FFFF) */
Memory32Fixed (ReadOnly, 0xFEE00000, 0x100000, LIOH)
diff --git a/src/soc/intel/icelake/acpi/northbridge.asl b/src/soc/intel/icelake/acpi/northbridge.asl
index e99e7ed..68c7f9e 100644
--- a/src/soc/intel/icelake/acpi/northbridge.asl
+++ b/src/soc/intel/icelake/acpi/northbridge.asl
@@ -308,7 +308,7 @@
Memory32Fixed (ReadOnly, VTD_BASE_ADDRESS, VTD_BASE_SIZE)
/* FLASH range */
- Memory32Fixed (ReadOnly, 0xFFF00000, 0x1000000, FIOH)
+ Memory32Fixed (ReadOnly, 0xFF000000, 0x1000000, FIOH)
/* Local APIC range(0xFEE0_0000 to 0xFEEF_FFFF) */
Memory32Fixed (ReadOnly, 0xFEE00000, 0x100000, LIOH)
--
To view, visit https://review.coreboot.org/c/coreboot/+/37694
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: Ia8de01769ced00c5ae13f255760401933230b88c
Gerrit-Change-Number: 37694
Gerrit-PatchSet: 1
Gerrit-Owner: Wim Vervoorn <wvervoorn(a)eltan.com>
Gerrit-MessageType: newchange
Patrick Rudolph has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/37641 )
Change subject: superio/aspeed/ast2400: Add AST2500 support
......................................................................
superio/aspeed/ast2400: Add AST2500 support
The AST2500 is similar to the AST2400, but it also supports ESPI mode.
In ESPI mode the IRQ level must be 0 and UART3/UART4 aren't usable.
Change-Id: Iea45740427ad56656040e6342f5316ec9d38122f
Signed-off-by: Patrick Rudolph <patrick.rudolph(a)9elements.com>
---
A src/superio/aspeed/ast2400/chip.h
M src/superio/aspeed/ast2400/superio.c
2 files changed, 42 insertions(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/41/37641/1
diff --git a/src/superio/aspeed/ast2400/chip.h b/src/superio/aspeed/ast2400/chip.h
new file mode 100644
index 0000000..e17274e
--- /dev/null
+++ b/src/superio/aspeed/ast2400/chip.h
@@ -0,0 +1,22 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * 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; version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ */
+
+#ifndef __SUPERIO_ASPEED__AST2400_CHIP_H__
+#define __SUPERIO_ASPEED__AST2400_CHIP_H__
+
+struct superio_aspeed_ast2400_config {
+ /* On AST2500 1: ESPI, 0: LPC */
+ bool espi;
+};
+
+#endif /* __SUPERIO_ASPEED__AST2400_CHIP_H__ */
diff --git a/src/superio/aspeed/ast2400/superio.c b/src/superio/aspeed/ast2400/superio.c
index a41bba7..bf297af 100644
--- a/src/superio/aspeed/ast2400/superio.c
+++ b/src/superio/aspeed/ast2400/superio.c
@@ -22,12 +22,23 @@
#include <superio/common/ssdt.h>
#include <arch/acpi.h>
#include "ast2400.h"
+#include "chip.h"
static void ast2400_init(struct device *dev)
{
+ struct superio_aspeed_ast2400_config *conf = dev->chip_info;
+
if (!dev->enabled)
return;
+ if (conf && conf->espi) {
+ pnp_enter_conf_mode(dev);
+ pnp_set_logical_device(dev);
+ /* In ESPI mode must write 0 to IRQ level on every LDN */
+ pnp_write_config(dev, 0x70, 0);
+ pnp_exit_conf_mode(dev);
+ }
+
switch (dev->path.pnp.device) {
case AST2400_KBC:
pc_keyboard_init(NO_AUX_DEVICE);
@@ -94,11 +105,19 @@
static void enable_dev(struct device *dev)
{
+ struct superio_aspeed_ast2400_config *conf = dev->chip_info;
+
+ if (conf && conf->espi) {
+ /* UART3 and UART4 are not usable in ESPI mode */
+ pnp_dev_info[5].function = -1;
+ pnp_dev_info[6].function = -1;
+ }
+
pnp_enable_devices(dev, &ops, ARRAY_SIZE(pnp_dev_info),
pnp_dev_info);
}
struct chip_operations superio_aspeed_ast2400_ops = {
- CHIP_NAME("ASpeed AST2400 Super I/O")
+ CHIP_NAME("ASpeed AST2400/AST2500 Super I/O")
.enable_dev = enable_dev,
};
--
To view, visit https://review.coreboot.org/c/coreboot/+/37641
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: Iea45740427ad56656040e6342f5316ec9d38122f
Gerrit-Change-Number: 37641
Gerrit-PatchSet: 1
Gerrit-Owner: Patrick Rudolph <patrick.rudolph(a)9elements.com>
Gerrit-Reviewer: Felix Held <felix-coreboot(a)felixheld.de>
Gerrit-Reviewer: Patrick Rudolph <patrick.rudolph(a)9elements.com>
Gerrit-MessageType: newchange