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/13336
-gerrit
commit f692aecc92c94a6ec34aa65d68a73eac6a816279
Author: Alexandru Gagniuc <alexandrux.gagniuc(a)intel.com>
Date: Tue Nov 3 16:54:43 2015 -0800
driver/intel/fsp2_0: Add utility to load an FSP binary to memory
Since FSP 2.0 is split into several binaries, implement a common
function to load such binaries into memory.
Change-Id: Id4a9024163034d8f53eff6fa2f28a7078d690bdc
Signed-off-by: Alexandru Gagniuc <alexandrux.gagniuc(a)intel.com>
---
src/drivers/intel/fsp2_0/include/fsp/util.h | 21 ++++++++++++++++++
src/drivers/intel/fsp2_0/util.c | 34 ++++++++++++++++++++++++++++-
2 files changed, 54 insertions(+), 1 deletion(-)
diff --git a/src/drivers/intel/fsp2_0/include/fsp/util.h b/src/drivers/intel/fsp2_0/include/fsp/util.h
new file mode 100644
index 0000000..abdbcf0
--- /dev/null
+++ b/src/drivers/intel/fsp2_0/include/fsp/util.h
@@ -0,0 +1,21 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright (C) 2015 Intel Corp.
+ * (Written by Alexandru Gagniuc <alexandrux.gagniuc(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.
+ */
+
+#ifndef _FSP2_0_UTIL_H_
+#define _FSP2_0_UTIL_H_
+
+#include <fsp/info_header.h>
+
+/* Load an FSP binary into CBFS, and fill the associated fsp_header struct */
+enum cb_err fsp_load_binary(struct fsp_header *hdr, const char *name);
+
+#endif /* _FSP2_0_UTIL_H_ */
diff --git a/src/drivers/intel/fsp2_0/util.c b/src/drivers/intel/fsp2_0/util.c
index e1b77a8..405021b 100644
--- a/src/drivers/intel/fsp2_0/util.c
+++ b/src/drivers/intel/fsp2_0/util.c
@@ -3,6 +3,7 @@
*
* Copyright (C) 2015 Intel Corp.
* (Written by Alexandru Gagniuc <alexandrux.gagniuc(a)intel.com> for Intel Corp.)
+ * (Written by Andrey Petrov <andrey.petrov(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
@@ -11,8 +12,9 @@
*/
#include <arch/io.h>
+#include <cbfs.h>
#include <console/console.h>
-#include <fsp/info_header.h>
+#include <fsp/util.h>
#include <lib.h>
#include <string.h>
@@ -68,3 +70,33 @@ void fsp_print_header_info(const struct fsp_header *hdr)
hdr->silicon_init_entry_offset,
hdr->notify_phase_entry_offset);
}
+
+enum cb_err fsp_load_binary(struct fsp_header *hdr, const char *name)
+{
+ struct cbfsf file_desc;
+ struct region_device file_data;
+ size_t fsp_load_size;
+ void *membase;
+
+ if (cbfs_boot_locate(&file_desc, name, NULL)) {
+ printk(BIOS_ERR, "Could not locate %s in CBFS\n", name);
+ return CB_ERR;
+ }
+
+ cbfs_file_data(&file_data, &file_desc);
+
+ /* Map just enough of the file to be able to parse the header. */
+ membase = rdev_mmap(&file_data, 0, FSP_HDR_OFFSET + FSP_HDR_LEN);
+ if (fsp_identify(hdr, membase) != CB_SUCCESS) {
+ printk(BIOS_ERR, "%s did not have a valid FSP header\n", name);
+ return CB_ERR;
+ }
+
+ fsp_print_header_info(hdr);
+
+ /* Load binary into memory. */
+ fsp_load_size = MIN(hdr->image_size, file_data.region.size);
+ rdev_readat(&file_data, (void *)hdr->image_base, 0, fsp_load_size);
+
+ return CB_SUCCESS;
+}
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/13338
-gerrit
commit cba02167b4673845d53505ea186fc196bb2964b9
Author: Alexandru Gagniuc <alexandrux.gagniuc(a)intel.com>
Date: Wed Nov 4 12:00:24 2015 -0800
drivers/intel/fsp2_0: Include stddef.h before FspUpdVpd.h
The semantically patched FspUpdVpd.h requires the definition of
wchar_t, which is provided by stddef.h.
Change-Id: I1093a6ac48e0a616ca86b8109da929dabe9554c5
Signed-off-by: Alexandru Gagniuc <alexandrux.gagniuc(a)intel.com>
---
src/drivers/intel/fsp2_0/include/fsp/api.h | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/drivers/intel/fsp2_0/include/fsp/api.h b/src/drivers/intel/fsp2_0/include/fsp/api.h
index 75dcffe..e51b854 100644
--- a/src/drivers/intel/fsp2_0/include/fsp/api.h
+++ b/src/drivers/intel/fsp2_0/include/fsp/api.h
@@ -13,6 +13,7 @@
#ifndef _FSP2_0_API_H_
#define _FSP2_0_API_H_
+#include <stddef.h>
#include "FspUpdVpd.h"
enum fsp_status {
the following patch was just integrated into master:
commit d6577e1cb89ba3b04eab2804627343bbad175a72
Author: Patrick Georgi <pgeorgi(a)chromium.org>
Date: Mon Jan 25 18:16:14 2016 +0100
xcompile: fill in power8 64bit LE
Change-Id: Id0316042f665ec9c095887cf6a37a7949ed8e861
Signed-off-by: Patrick Georgi <pgeorgi(a)chromium.org>
Reviewed-on: https://review.coreboot.org/13421
Reviewed-by: Ronald G. Minnich <rminnich(a)gmail.com>
Tested-by: build bot (Jenkins)
See https://review.coreboot.org/13421 for details.
-gerrit
the following patch was just integrated into master:
commit a1a6f7535b004de71e894946321b9c1b1d34e57d
Author: Patrick Georgi <pgeorgi(a)chromium.org>
Date: Mon Jan 25 18:15:45 2016 +0100
xcompile: also look for *-linux compiler triplet
Not just *-linux-gnu.
Change-Id: Ib817c6d207d3b69ce7595505f2b45f3be35b7d2f
Signed-off-by: Patrick Georgi <pgeorgi(a)chromium.org>
Reviewed-on: https://review.coreboot.org/13420
Reviewed-by: Ronald G. Minnich <rminnich(a)gmail.com>
Tested-by: build bot (Jenkins)
See https://review.coreboot.org/13420 for details.
-gerrit
the following patch was just integrated into master:
commit 74c86456af23171457464766e3f1072bf5dca490
Author: Patrick Georgi <pgeorgi(a)chromium.org>
Date: Mon Jan 25 18:15:08 2016 +0100
xcompile: document all the variables!
What's the exact difference between TARCH, TSUPP and TBFDARCHS? Fear no
more, it's documented.
Change-Id: I18717eb1e20b1c0a82a485d391de2794a77c59ae
Signed-off-by: Patrick Georgi <pgeorgi(a)chromium.org>
Reviewed-on: https://review.coreboot.org/13419
Reviewed-by: Ronald G. Minnich <rminnich(a)gmail.com>
Tested-by: build bot (Jenkins)
See https://review.coreboot.org/13419 for details.
-gerrit