Andrey Petrov (andrey.petrov(a)intel.com) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/13799
-gerrit
commit 6ce83c447babbea331bab1d6094f864813abd31f
Author: Andrey Petrov <andrey.petrov(a)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(a)intel.com>
---
src/drivers/intel/fsp2_0/silicon_init.c | 52 +++++++++++++++++++++++++++++++++
1 file changed, 52 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..ca6ba9d
--- /dev/null
+++ b/src/drivers/intel/fsp2_0/silicon_init.c
@@ -0,0 +1,52 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright (C) 2015 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
+ * 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>
+
+struct fsp_header fsps_hdr;
+
+typedef asmlinkage enum fsp_status (*fsp_silicon_init_fn)
+ (struct FSP_S_CONFIG *upd);
+
+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)
+{
+ /* Load FSP-S and save FSP header. We will need it for Notify */
+ if (fsp_load_binary(&fsps_hdr, CONFIG_FSP_S_FILE, range) != CB_SUCCESS)
+ return FSP_NOT_FOUND;
+
+ return do_silicon_init(&fsps_hdr);
+}
Andrey Petrov (andrey.petrov(a)intel.com) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/13860
-gerrit
commit 1d13029d025a0e1b788cab33d6cbc4074c2b4e92
Author: Andrey Petrov <andrey.petrov(a)intel.com>
Date: Sun Feb 28 22:04:51 2016 -0800
arch/x86: Allow soc/chipset to set linking address
Until recently x86 romstage used to be linked at some default
address. The address itself is not meaningful because the code
was normally relocated at address calculated during insertion
in CBFS. Since some newer SoC run romstage at CAR it became
useful to link romstage code at some address in CAR and avoid
relocation during build/run time altogether.
Change-Id: I11bec142ab204633da0000a63792de7057e2eeaf
Signed-off-by: Andrey Petrov <andrey.petrov(a)intel.com>
---
src/arch/x86/Kconfig | 10 ++++++++++
src/arch/x86/memlayout.ld | 4 ++--
2 files changed, 12 insertions(+), 2 deletions(-)
diff --git a/src/arch/x86/Kconfig b/src/arch/x86/Kconfig
index 89e142a..2257cb6 100644
--- a/src/arch/x86/Kconfig
+++ b/src/arch/x86/Kconfig
@@ -161,3 +161,13 @@ config COMPILE_IN_DSDT
config C_ENV_BOOTBLOCK_SIZE
hex
default 0x10000
+
+# Default address romstage is to be linked at
+config ROMSTAGE_ADDR
+ hex
+ default 0x2000000
+
+# Default address verstage is to be linked at
+config VERSTAGE_ADDR
+ hex
+ default 0x2000000
diff --git a/src/arch/x86/memlayout.ld b/src/arch/x86/memlayout.ld
index fb67575..56611041 100644
--- a/src/arch/x86/memlayout.ld
+++ b/src/arch/x86/memlayout.ld
@@ -31,14 +31,14 @@ SECTIONS
#elif ENV_ROMSTAGE
/* The 1M size is not allocated. It's just for basic size checking.
* Link at 32MiB address and rely on cbfstool to relocate to XIP. */
- ROMSTAGE(32M, 1M)
+ ROMSTAGE(CONFIG_ROMSTAGE_ADDR, 1M)
/* Pull in the cache-as-ram rules. */
#include "car.ld"
#elif ENV_VERSTAGE
/* The 1M size is not allocated. It's just for basic size checking.
* Link at 32MiB address and rely on cbfstool to relocate to XIP. */
- VERSTAGE(32M, 1M)
+ VERSTAGE(CONFIG_VERSTAGE_ADDR, 1M)
/* Pull in the cache-as-ram rules. */
#include "car.ld"
Andrey Petrov (andrey.petrov(a)intel.com) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/13861
-gerrit
commit 399e200da1cdbceec6b7c76577a241c8f109117e
Author: Andrey Petrov <andrey.petrov(a)intel.com>
Date: Sun Feb 28 22:37:15 2016 -0800
arch/x86: Add common assembly code for stages that run in CAR
This adds a few assembly lines that are generic enought to be shared
between romstage and verstage that are ran in CAR.
Change-Id: Ie7ef6a02f62627f29a109126d08c68176075bd67
Signed-off-by: Andrey Petrov <andrey.petrov(a)intel.com>
---
src/arch/x86/carstage_entry.S | 50 +++++++++++++++++++++++++++++++++++++++++++
1 file changed, 50 insertions(+)
diff --git a/src/arch/x86/carstage_entry.S b/src/arch/x86/carstage_entry.S
new file mode 100644
index 0000000..4d86302
--- /dev/null
+++ b/src/arch/x86/carstage_entry.S
@@ -0,0 +1,50 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright (C) 2016 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; 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.
+ */
+
+#define LHLT_DELAY 0x50000 /* I/O delay between post codes on failure */
+ /*
+ * This code is meant to be used for stages that are ran in CAR.
+ * The assumption is that gdt is already loaded. So in order to
+ * continue with C code execution we needed to set stack pointer
+ * and clear CAR_GLOBAL variables that are stage-specific.
+ */
+
+ /* reset stack pointer to CAR stack */
+ mov $_car_stack_end, %esp
+
+ /* clear CAR_GLOBAL area as it is not shared */
+ cld
+ xor %eax, %eax
+ movl $(_car_global_end), %ecx
+ movl $(_car_global_start), %edi
+ sub %edi, %ecx
+ rep stosl
+
+ jmp romstage_car_entry
+ movb $0x69, %ah
+ jmp .Lhlt
+
+.Lhlt:
+ xchg %al, %ah
+#if IS_ENABLED(CONFIG_POST_IO)
+ outb %al, $CONFIG_POST_IO_PORT
+#else
+ post_code(POST_DEAD_CODE)
+#endif
+ movl $LHLT_DELAY, %ecx
+.Lhlt_Delay:
+ outb %al, $0xED
+ loop .Lhlt_Delay
+ jmp .Lhlt
Andrey Petrov (andrey.petrov(a)intel.com) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/13800
-gerrit
commit 5394f58d349279879fbf3803c6fbd3c84cd26047
Author: Andrey Petrov <andrey.petrov(a)intel.com>
Date: Thu Feb 25 14:19:07 2016 -0800
FSP2.0: Add Notify Phase API
This adds Notify Phase API. This is an important call that is used
to inform FSP runtimes of different stages of SoC initializations
by the coreboot.
Change-Id: Icec770d0c1c4d239adb2ef342bf6cc9c35666e4d
Signed-off-by: Andrey Petrov <andrey.petrov(a)intel.com>
---
src/drivers/intel/fsp2_0/notify.c | 41 +++++++++++++++++++++++++++++++++++++++
1 file changed, 41 insertions(+)
diff --git a/src/drivers/intel/fsp2_0/notify.c b/src/drivers/intel/fsp2_0/notify.c
new file mode 100644
index 0000000..c5f06db
--- /dev/null
+++ b/src/drivers/intel/fsp2_0/notify.c
@@ -0,0 +1,41 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright (C) 2015 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
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ */
+
+#include <arch/cpu.h>
+#include <console/console.h>
+#include <fsp/api.h>
+#include <fsp/util.h>
+#include <string.h>
+
+typedef struct fsp_notify_params {
+ enum fsp_notify_phase phase;
+} NOTIFY_PHASE_PARAMS;
+
+typedef asmlinkage enum fsp_status (*fsp_notify_fn)
+ (struct fsp_notify_params *);
+
+struct fsp_header *fsps_hdr = NULL;
+
+enum fsp_status fsp_notify(enum fsp_notify_phase phase)
+{
+ fsp_notify_fn fspnotify = NULL;
+
+ if (!fsps_hdr)
+ return FSP_NOT_FOUND;
+
+ fspnotify = (void*) (fsps_hdr->image_base +
+ fsps_hdr->notify_phase_entry_offset);
+
+ printk(BIOS_DEBUG, "FspNotify %x\n", (uint32_t) phase);
+
+ return fspnotify((struct fsp_notify_params *) &phase);
+}
Andrey Petrov (andrey.petrov(a)intel.com) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/13803
-gerrit
commit d5b59db011c85197c95bac11c4520c5255ed5507
Author: Andrey Petrov <andrey.petrov(a)intel.com>
Date: Thu Feb 25 17:14:29 2016 -0800
cpu/intel: Compile FIT table for romstage as well
On Apollolake FIT needs to be accessed during romstage, so the
fit_pointer symbol can be used as well.
Change-Id: Id910ec8e2729ccd2f1e5caa0a847c8790638175a
Signed-off-by: Andrey Petrov <andrey.petrov(a)intel.com>
---
src/cpu/intel/fit/Makefile.inc | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/cpu/intel/fit/Makefile.inc b/src/cpu/intel/fit/Makefile.inc
index 4b540ba..7f92806 100644
--- a/src/cpu/intel/fit/Makefile.inc
+++ b/src/cpu/intel/fit/Makefile.inc
@@ -1 +1,2 @@
bootblock-y += fit.S
+romstage-y += fit.S