[coreboot-gerrit] Patch set updated for coreboot: FSP2.0: Add SiliconInit API

Andrey Petrov (andrey.petrov@intel.com) gerrit at coreboot.org
Mon Feb 29 21:48:29 CET 2016


Andrey Petrov (andrey.petrov at intel.com) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/13799

-gerrit

commit 037622270e02af1164273a500065ad4acade381d
Author: Andrey Petrov <andrey.petrov at intel.com>
Date:   Thu Feb 25 14:17:45 2016 -0800

    FSP2.0: Add SiliconInit API
    
    This adds SiliconInit API that is needed to be called after memory
    has been trained. This call is needed to let the blob do various
    initialisations of IP blocks.
    
    Change-Id: I35e02f22174c8392e55ac869265a19c4309932e5
    Signed-off-by: Andrey Petrov <andrey.petrov at intel.com>
---
 src/drivers/intel/fsp2_0/silicon_init.c | 56 +++++++++++++++++++++++++++++++++
 1 file changed, 56 insertions(+)

diff --git a/src/drivers/intel/fsp2_0/silicon_init.c b/src/drivers/intel/fsp2_0/silicon_init.c
new file mode 100644
index 0000000..ef2f229
--- /dev/null
+++ b/src/drivers/intel/fsp2_0/silicon_init.c
@@ -0,0 +1,56 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright (C) 2015 Intel Corp.
+ * (Written by Andrey Petrov <andrey.petrov at 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/cpu.h>
+#include <cbfs.h>
+#include <console/console.h>
+#include <fsp/api.h>
+#include <fsp/util.h>
+#include <memrange.h>
+#include <string.h>
+
+typedef asmlinkage enum fsp_status (*fsp_silicon_init_fn)
+				   (struct FSP_S_CONFIG *upd);
+
+extern struct fsp_header *fsps_hdr;
+
+static enum fsp_status do_silicon_init(struct fsp_header *hdr)
+{
+	struct FSP_S_CONFIG *s_config;
+	fsp_silicon_init_fn silicon_init;
+	enum fsp_status status;
+
+	/* UPD region is in RW memory, so it can be modified directly */
+	s_config = (void *) (hdr->cfg_region_offset + hdr->image_base);
+	silicon_init = (void *)
+			(hdr->image_base + hdr->silicon_init_entry_offset);
+
+	/* give a chance to populate entries */
+	platform_fsp_silicon_init_params_cb(s_config);
+
+	status = silicon_init(s_config);
+	printk(BIOS_DEBUG, "FspSiliconInit returned 0x%08x\n", status);
+	return status;
+}
+
+enum fsp_status fsp_silicon_init(struct range_entry *range)
+{
+	static struct fsp_header hdr;
+
+	if (fsp_load_binary(&hdr, CONFIG_FSP_S_FILE, range) != CB_SUCCESS)
+		return FSP_NOT_FOUND;
+
+	/* save the FSPS header, it will come in handy during notify */
+	fsps_hdr = &hdr;
+
+	return do_silicon_init(&hdr);
+}



More information about the coreboot-gerrit mailing list