Leroy P Leahy (leroy.p.leahy(a)intel.com) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/13443
-gerrit
commit 381972b67c97dea16a9a910eb651913394a17f0e
Author: Lee Leahy <leroy.p.leahy(a)intel.com>
Date: Sun Jan 24 15:12:50 2016 -0800
Quark: Add TempRamInit support
Successfully invoke TempRamInit from the FSP binary:
* Don't relocate the FSP binary image
* Move the FSP binary into ESRAM
* Test by setting the following Kconfig values one at a time:
* CONFIG_ENABLE_DEBUG_LED_FINDFSP
* CONFIG_ENABLE_DEBUG_LED_TEMPRAMINIT
BRANCH=none
BUG=None
TEST=Build and run on Galileo Gen2
Change-Id: I1e2e413a8573f750c611b0f9df101b2c869a789e
Signed-off-by: Lee Leahy <leroy.p.leahy(a)intel.com>
---
src/mainboard/intel/galileo/Kconfig | 37 ++++++
src/mainboard/intel/galileo/Makefile.inc | 27 +++++
src/soc/intel/quark/Kconfig | 33 ++++++
src/soc/intel/quark/memmap.c | 7 ++
src/soc/intel/quark/romstage/Makefile.inc | 1 +
src/soc/intel/quark/romstage/cache_as_ram.inc | 165 ++++++++++++++++++++++++++
src/soc/intel/quark/romstage/esram_init.inc | 20 +++-
7 files changed, 288 insertions(+), 2 deletions(-)
diff --git a/src/mainboard/intel/galileo/Kconfig b/src/mainboard/intel/galileo/Kconfig
index 8cf0cf7..eeb7ab4 100755
--- a/src/mainboard/intel/galileo/Kconfig
+++ b/src/mainboard/intel/galileo/Kconfig
@@ -3,9 +3,46 @@ if BOARD_INTEL_GALILEO
config BOARD_SPECIFIC_OPTIONS
def_bool y
select BOARD_ROMSIZE_KB_8192
+ select HAVE_FSP_RAW_BIN
select PLATFORM_USES_FSP1_1
select SOC_INTEL_QUARK
+config HAVE_FSP_RAW_BIN
+ bool "Should the Intel FSP binary be added to the flash image"
+ help
+ Select this option to add an Intel FSP binary to
+ the resulting coreboot image.
+
+ Note: Without this binary, coreboot builds relying on the FSP
+ will not boot
+
+config FSP_FILE
+ string
+ default "3rdparty/blobs/mainboard/$(MAINBOARDDIR)/fsp.bin"
+ help
+ The path and filename of the Intel FSP binary for this platform.
+
+config FSP_LOC
+ hex
+ default 0xfff80000
+ help
+ The location in CBFS that the FSP is located. This must match the
+ value that is set in the FSP binary. If the FSP needs to be moved,
+ rebase the FSP with Intel's BCT (tool).
+
+config FSP_SRAM_LOC
+ hex
+ default 0x80000000
+ help
+ The location in SRAM where a copy of the FSP binary is placed.
+
+config FSP_IMAGE_ID_STRING
+ string "8 byte platform string identifying the FSP platform"
+ default "QUK-FSP0"
+ help
+ 8 ASCII character byte signature string that will help match the FSP
+ binary to a supported hardware configuration.
+
config MAINBOARD_DIR
string
default intel/galileo
diff --git a/src/mainboard/intel/galileo/Makefile.inc b/src/mainboard/intel/galileo/Makefile.inc
new file mode 100755
index 0000000..7a1603e
--- /dev/null
+++ b/src/mainboard/intel/galileo/Makefile.inc
@@ -0,0 +1,27 @@
+##
+## This file is part of the coreboot project.
+##
+## Copyright (C) 2013 Google Inc.
+## Copyright (C) 2015-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.
+##
+## You should have received a copy of the GNU General Public License
+## along with this program; if not, write to the Free Software
+## Foundation, Inc.
+##
+
+# Add the FSP binary to the cbfs image
+ifeq ($(CONFIG_HAVE_FSP_RAW_BIN),y)
+cbfs-files-y += fsp.bin
+fsp.bin-file := $(call strip_quotes,$(CONFIG_FSP_FILE))
+fsp.bin-position := $(CONFIG_FSP_LOC)
+fsp.bin-type := raw
+endif
diff --git a/src/soc/intel/quark/Kconfig b/src/soc/intel/quark/Kconfig
index 9c29627..197eb59 100644
--- a/src/soc/intel/quark/Kconfig
+++ b/src/soc/intel/quark/Kconfig
@@ -23,6 +23,39 @@ config CBFS_SIZE
This option specifies the maximum size of the CBFS portion in the
firmware image.
+config ENABLE_DEBUG_LED
+ bool
+ default n
+ help
+ Enable the use of the SD LED for early debugging before serial output is
+ available. Setting this LED indicates that control has reached the desired
+ check point. The assembly code below may be inserted into cache_as_ram.inc:
+ movl $SD_HOST_CTRL, %ebx
+ movb 0(%ebx), %al
+ orb $1, %al
+ movb %al, 0(%ebx)
+
+config ENABLE_DEBUG_LED_ESRAM
+ bool "SD LED indicates ESRAM initialized"
+ default n
+ select ENABLE_DEBUG_LED
+ help
+ Indicate that ESRAM has been successfully initialized.
+
+config ENABLE_DEBUG_LED_FINDFSP
+ bool "SD LED indicates fsp.bin file was found"
+ default n
+ select ENABLE_DEBUG_LED
+ help
+ Indicate that fsp.bin was found.
+
+config ENABLE_DEBUG_LED_TEMPRAMINIT
+ bool "SD LED indicates TempRamInit was successful"
+ default n
+ select ENABLE_DEBUG_LED
+ help
+ Indicate that TempRamInit was successful.
+
config RMU_FILE
string
default "3rdparty/blobs/mainboard/$(MAINBOARDDIR)/rmu.bin"
diff --git a/src/soc/intel/quark/memmap.c b/src/soc/intel/quark/memmap.c
index 975128c..4f47afa 100644
--- a/src/soc/intel/quark/memmap.c
+++ b/src/soc/intel/quark/memmap.c
@@ -15,6 +15,13 @@
*/
#include <cbmem.h>
+#include <fsp/memmap.h>
+
+size_t mmap_region_granluarity(void)
+{
+ /* Align to 8 MiB by default */
+ return 8 << 20;
+}
void *cbmem_top(void)
{
diff --git a/src/soc/intel/quark/romstage/Makefile.inc b/src/soc/intel/quark/romstage/Makefile.inc
index 3a891b4..f664b38 100644
--- a/src/soc/intel/quark/romstage/Makefile.inc
+++ b/src/soc/intel/quark/romstage/Makefile.inc
@@ -15,3 +15,4 @@
# GNU General Public License for more details.
#
cpu_incs-y += $(src)/soc/intel/quark/romstage/esram_init.inc
+cpu_incs-y += $(src)/soc/intel/quark/romstage/cache_as_ram.inc
diff --git a/src/soc/intel/quark/romstage/cache_as_ram.inc b/src/soc/intel/quark/romstage/cache_as_ram.inc
new file mode 100644
index 0000000..80ac64d
--- /dev/null
+++ b/src/soc/intel/quark/romstage/cache_as_ram.inc
@@ -0,0 +1,165 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright (C) 2000,2007 Ronald G. Minnich <rminnich(a)gmail.com>
+ * Copyright (C) 2007-2008 coresystems GmbH
+ * Copyright (C) 2013-2014 Sage Electronic Engineering, LLC.
+ * Copyright (C) 2015-2016 Intel Corporation
+ *
+ * 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.
+ */
+
+/*
+ * Replacement for cache_as_ram.inc when using the FSP binary. This code
+ * locates the FSP binary, initializes the cache as RAM and performs the
+ * first stage of initialization. Next this code switches the stack from
+ * the cache to RAM and then disables the cache as RAM. Finally this code
+ * performs the final stage of initialization.
+ */
+
+#include <rules.h>
+
+ /*
+ * eax: BIST value
+ */
+
+ mov %eax, %edi
+
+cache_as_ram:
+ post_code(0x20)
+
+ /*
+ * edi: BIST value
+ */
+
+ /*
+ * Find the FSP binary in cbfs.
+ * Make a fake stack that has the return value back to this code.
+ */
+ lea fake_fsp_stack, %esp
+ jmp find_fsp
+
+find_fsp_ret:
+ /* Save the FSP location */
+ mov %eax, %ebp
+
+ /*
+ * Only when a valid FSP binary is found at CONFIG_FSP_LOC is
+ * the returned FSP_INFO_HEADER structure address above the base
+ * address of FSP binary specified by the CONFIG_FSP_LOC value.
+ * All of the error values are in the 0x8xxxxxxx range which are
+ * below the CONFIG_FSP_LOC value.
+ */
+ cmp $CONFIG_FSP_SRAM_LOC, %eax
+ jbe halt1
+
+ post_code(POST_FSP_TEMP_RAM_INIT)
+
+#if IS_ENABLED(CONFIG_ENABLE_DEBUG_LED_FINDFSP)
+ movl $SD_HOST_CTRL, %ebx
+ movb 0(%ebx), %al
+ orb $1, %al
+ movb %al, 0(%ebx)
+#endif /* CONFIG_ENABLE_DEBUG_LED_FINDFSP */
+
+ /* Calculate entry into FSP */
+ mov 0x30(%ebp), %eax /* Load TempRamInitEntry */
+ add 0x1c(%ebp), %eax /* add in the offset for FSP */
+
+ /*
+ * Pass early init variables on a fake stack (no memory yet)
+ * as well as the return location
+ */
+ lea CAR_init_stack, %esp
+
+ /*
+ * BIST value is zero
+ * eax: TempRamInitApi address
+ * ebp: FSP_INFO_HEADER address
+ * edi: BIST value
+ * esi: Not used
+ */
+
+ /* call FSP binary to setup temporary stack */
+ jmp *%eax
+
+CAR_init_done:
+ addl $4, %esp
+
+ /*
+ * ebp: FSP_INFO_HEADER address
+ * ecx: Temp RAM base
+ * edx: Temp RAM top
+ * edi: BIST value
+ */
+
+ cmp $0, %eax
+ jne halt2
+
+#if IS_ENABLED(CONFIG_ENABLE_DEBUG_LED_TEMPRAMINIT)
+ movl %edx, %esi
+ movl $SD_HOST_CTRL, %ebx
+ movb 0(%ebx), %al
+ orb $1, %al
+ movb %al, 0(%ebx)
+ movl %esi, %edx
+#endif /* CONFIG_ENABLE_DEBUG_LED_TEMPRAMINIT */
+
+ clrl %eax
+ jmp halt2
+
+halt1:
+ /*
+ * Failures for postcode 0xBA - failed in fsp_fih_early_find()
+ *
+ * Values are:
+ * 0x01 - FV signature, "_FVH" not present
+ * 0x02 - FFS GUID not present
+ * 0x03 - FSP INFO Header not found
+ * 0x04 - ImageBase does not equal CONFIG_FSP_LOC - Is the FSP rebased to
+ * a different location, or does it need to be?
+ * 0x05 - FSP INFO Header signature "FSPH" not found
+ * 0x06 - FSP Image ID is not the expected ID.
+ */
+ movb $0xBA, %ah
+ jmp .Lhlt
+
+halt2:
+ /*
+ * Failures for postcode 0xBB - failed in the FSP:
+ *
+ * 0x00 - FSP_SUCCESS: Temp RAM was initialized successfully.
+ * 0x02 - FSP_INVALID_PARAMETER: Input parameters are invalid.
+ * 0x03 - FSP_UNSUPPORTED: The FSP calling conditions were not met.
+ * 0x07 - FSP_DEVICE_ERROR: Temp RAM initialization failed
+ * 0x0E - FSP_NOT_FOUND: No valid microcode was found in the microcode region.
+ * 0x14 - FSP_ALREADY_STARTED: Temp RAM initialization has been invoked
+ */
+ movb $0xBB, %ah
+ jmp .Lhlt
+
+/*
+ * esp is set to this location so that the call into and return from the FSP
+ * in find_fsp will work.
+ */
+ .align 4
+fake_fsp_stack:
+ .long find_fsp_ret
+ .long CONFIG_FSP_SRAM_LOC /* FSP base address */
+
+CAR_init_params:
+ .long CONFIG_CPU_MICROCODE_CBFS_LOC /* Microcode Location */
+ .long CONFIG_CPU_MICROCODE_CBFS_LEN /* Microcode Length */
+ .long 0xFFFFFFFF - CONFIG_ROM_SIZE + 1 /* Firmware Location */
+ .long CONFIG_ROM_SIZE /* Total Firmware Length */
+
+CAR_init_stack:
+ .long CAR_init_done
+ .long CAR_init_params
diff --git a/src/soc/intel/quark/romstage/esram_init.inc b/src/soc/intel/quark/romstage/esram_init.inc
index e81e23c..38e2b54 100644
--- a/src/soc/intel/quark/romstage/esram_init.inc
+++ b/src/soc/intel/quark/romstage/esram_init.inc
@@ -514,6 +514,20 @@ stackless_PCIConfig_Read:
#----------------------------------------------------------------------------
esram_init_done:
+ #
+ # Copy FSP image to SRAM and call it.
+ #
+ #TODO - FSP location/size could be got in a routine.
+ cld
+ movl $(0x00040000), %ecx # 256K DWORDs = 64K
+ shrl $2, %ecx
+ movl $CONFIG_FSP_LOC, %esi # The source address.
+ movl $CONFIG_FSP_SRAM_LOC, %edi # The destination address in QUARK_ESRAM_MEM_BASE_ADDRESS.
+ rep movsl
+
+#if IS_ENABLED(CONFIG_ENABLE_DEBUG_LED)
+sd_led:
+ movl %eax, %ecx
.equ SD_PFA, (0x14 << 11) # B0:D20:F0 - SDIO controller
.equ SD_CFG_BASE, (PCI_CFG | SD_PFA) # SD controller base in PCI config space
@@ -555,10 +569,12 @@ L43:
jmp stackless_PCIConfig_Read
L44:
+#if IS_ENABLED(CONFIG_ENABLE_DEBUG_LED_ESRAM)
movl $SD_HOST_CTRL, %ebx
movb 0(%ebx), %al
orb $1, %al
movb %al, 0(%ebx)
+#endif /* CONFIG_ENABLE_DEBUG_LED_ESRAM */
- movl $0, %eax
- jmp .Lhlt
+ movl %ecx, %eax
+#endif /* CONFIG_ENABLE_DEBUG_LED */
Leroy P Leahy (leroy.p.leahy(a)intel.com) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/13446
-gerrit
commit 6779025f7d2404448ce3f114c13800245b1d72c3
Author: Lee Leahy <leroy.p.leahy(a)intel.com>
Date: Mon Jan 11 14:03:24 2016 -0800
x86 Docs: Add sleep state and minimal memory setup
Document how to add the sleep state and minimal memory setup.
BRANCH=none
BUG=None
TEST=None
Change-Id: Ibebeef34269dbf2366f1bea6d734f6bade4e4028
Signed-off-by: Lee Leahy <leroy.p.leahy(a)intel.com>
---
Documentation/x86Board.html | 79 +++++++++++++++++++++++++++++++++++++++
Documentation/x86Development.html | 14 +++++++
Documentation/x86SoC.html | 53 ++++++++++++++++++++++++++
3 files changed, 146 insertions(+)
diff --git a/Documentation/x86Board.html b/Documentation/x86Board.html
index 76282a6..acf2bc6 100644
--- a/Documentation/x86Board.html
+++ b/Documentation/x86Board.html
@@ -15,6 +15,7 @@
<ol>
<li><a href="#RequiredFiles">Required Files</a></li>
<li>Enable <a href="#SerialOutput">Serial Output</a></li>
+ <li>Load the <a href="#SpdData">Memory Timing Data</a></li>
</ol>
@@ -101,6 +102,84 @@
</ol>
+<hr>
+<h1><a name="SpdData">Memory Timing Data</a></h1>
+<p>
+ Memory timing data is located in the flash. This data is in the format of
+ <a target="_blank" href="https://en.wikipedia.org/wiki/Serial_presence_detect">serial presence detect</a>
+ (SPD) data.
+ Use the following steps to load the SPD data:
+</p>
+<ol>
+ <li>Edit Kconfig to add the DISPLAY_SPD_DATA" value which enables the
+ display of the SPD data being passed to MemoryInit
+ </li>
+ <li>Create an "spd" subdirectory</li>
+ <li>Create an spd/spd.c file for the SPD implementation
+ <ol type="A">
+ <li>Implement the mainboard_fill_spd_data routine
+ <ol type="i">
+ <li>Read the SPD data either from the spd.bin file or using I2C or SMBUS</li>
+ <li>Fill in the pei_data structure with SPD data for each of the DIMMs</li>
+ <li>Set the DIMM channel configuration</li>
+ </ol>
+ </li>
+ </ol>
+ </li>
+ <li>Add an .spd.hex file containing the memory timing data to the spd subdirectory</li>
+ <li>Create spd/Makefile.inc
+ <ol type="A">
+ <li>Add spd.c to romstage</li>
+ <li>Add the .spd.hex file to SPD_SOURCES</li>
+ </ol>
+ </li>
+ <li>Edit Makefile.inc to add the spd subdirectory</li>
+ <li>Edit romstage.c
+ <ol type="A">
+ <li>Call mainboard_fill_spd_data</li>
+ <li>Add mainboard_memory_init_params to copy the SPD and DRAM
+ configuration data from the pei_data structure into the UPDs
+ for MemoryInit
+ </li>
+ </ol>
+ </li>
+ <li>Edit devicetree.cb
+ <ol type="A">
+ <li>Include the UPD parameters for MemoryInit except for:
+ <ul>
+ <li>Address of SPD data</li>
+ <li>DRAM configuration set above</li>
+ </ul>
+ </li>
+ </ol>
+ </li>
+ <li>A working FSP
+ <a target="_blank" href="x86FSP1_1.html#MemoryInit">MemoryInit</a>
+ routine is required to complete debugging</li>
+ <li>Debug the result until port 0x80 outputs
+ <ol type="A">
+ <li>0x34:
+ - Just after entering
+ <a target="_blank" href="https://chromium.googlesource.com/chromiumos/third_party/coreboot/+/chromeo…">raminit</a>
+ </li>
+ <li>0x36:
+ - Just before displaying the
+ <a target="_blank" href="https://chromium.googlesource.com/chromiumos/third_party/coreboot/+/chromeo…">UPD parameters</a>
+ for FSP MemoryInit
+ </li>
+ <li>0x92: <a target="_blank" href="https://chromium.googlesource.com/chromiumos/third_party/coreboot/+/chromeo…">POST_FSP_MEMORY_INIT</a>
+ - Just before calling FSP
+ <a target="_blank" href="https://chromium.googlesource.com/chromiumos/third_party/coreboot/+/chromeo…">MemoryInit</a>
+ </li>
+ <li>0x37:
+ - Just after returning from FSP
+ <a target="_blank" href="https://chromium.googlesource.com/chromiumos/third_party/coreboot/+/chromeo…">MemoryInit</a>
+ </li>
+ </ol>
+ </li>
+ <li>Continue debugging with CONFIG_DISPLAY_HOBS enabled until TempRamExit is called</li>
+</ol>
+
<hr>
<p>Modified: 24 January 2016</p>
diff --git a/Documentation/x86Development.html b/Documentation/x86Development.html
index ab797cb..818da30 100644
--- a/Documentation/x86Development.html
+++ b/Documentation/x86Development.html
@@ -56,6 +56,20 @@
</ol>
</li>
<li>Enable <a target="_blank" href="x86FSP1_1.html#CorebootFspDebugging">coreboot/FSP</a> debugging</li>
+ <li>Determine the <a target="_blank" href="x86SoC.html#PreviousSleepState">Previous Sleep State</a></li>
+ <li>Enable DRAM:
+ <ol type="A">
+ <li>Implement the SoC
+ <a target="_blank" href="x86SoC.html#MemoryInit">MemoryInit</a>
+ Support
+ </li>
+ <li>Implement the board support to read the
+ <a target="_blank" href="x86Board.html#SpdData">Memory Timing Data</a>
+ </li>
+ </ol>
+ </li>
+ <li>Enable CONFIG_DISPLAY_MTRRS to verify the MTRR configuration</li>
+ <li>Coreboot should now attempt to load the payload</li>
</ol>
diff --git a/Documentation/x86SoC.html b/Documentation/x86SoC.html
index 00b78b1..23f7f64 100644
--- a/Documentation/x86SoC.html
+++ b/Documentation/x86SoC.html
@@ -22,6 +22,8 @@
<li><a href="#Romstage">Romstage</a>
<ol type="A">
<li>Enable <a href="#SerialOutput">Serial Output"</a></li>
+ <li>Get the <a href="#PreviousSleepState">Previous Sleep State</a></li>
+ <li>Add the <a href="#MemoryInit">MemoryInit</a> Support</li>
</ol>
</li>
</ol>
@@ -295,6 +297,57 @@ mv build/coreboot.rom.new build/coreboot.rom
</ol>
+<h2><a name="PreviousSleepState">Determine Previous Sleep State</a></h2>
+<p>
+ The following steps implement the code to get the previous sleep state:
+</p>
+<ol>
+ <li>Implement the fill_power_state routine which determines the previous sleep state</li>
+ <li>Debug the result until port 0x80 outputs
+ <ol type="A">
+ <li>0x32:
+ - Just after entering
+ <a target="_blank" href="https://chromium.googlesource.com/chromiumos/third_party/coreboot/+/chromeo…">romstage_common</a>
+ </li>
+ <li>0x33 - Just after calling
+ <a target="_blank" href="https://chromium.googlesource.com/chromiumos/third_party/coreboot/+/chromeo…">soc_pre_ram_init</a>
+ </li>
+ <li>0x34:
+ - Just after entering
+ <a target="_blank" href="https://chromium.googlesource.com/chromiumos/third_party/coreboot/+/chromeo…">raminit</a>
+ </li>
+ </ol>
+</ol>
+
+
+<h2><a name="MemoryInit">MemoryInit Support</a></h2>
+<p>
+ The following steps implement the code to support the FSP MemoryInit call:
+</p>
+<ol>
+ <li>Add the chip.h header file to define the UPD values which get passed
+ to MemoryInit. Skip the values containing SPD addresses and DRAM
+ configuration data which is determined by the board.
+ <p>
+ <b>Build Note</b>: The src/mainboard/<Vendor>/<Board>/devicetree.cb
+ file specifies the default values for these parameters. The build
+ process creates the static.c module which contains the config data
+ structure containing these values.
+ </p>
+ </li>
+ <li>Edit romstage/romstage.c
+ <ol type="A">
+ <li>Implement the romstage/romstage.c/soc_memory_init_params routine to
+ copy the values from the config structure into the UPD structure
+ </li>
+ <li>Implement the soc_display_memory_init_params routine to display
+ the updated UPD parameters by calling fsp_display_upd_value
+ </li>
+ </ol>
+ </li>
+</ol>
+
+
<hr>
<p>Modified: 24 January 2016</p>
</body>
Leroy P Leahy (leroy.p.leahy(a)intel.com) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/13438
-gerrit
commit 3c6c28471d368c320acd293c3ed4fbc22f6faa20
Author: Lee Leahy <leroy.p.leahy(a)intel.com>
Date: Thu Jan 7 11:24:24 2016 -0800
x86 Docs: Add required files
Document the required files to perform a minimal coreboot/FSP build for
x86.
BRANCH=none
BUG=None
TEST=None
Change-Id: I65b2947114634fce982ce82fb7c577fd5f47ed10
Signed-off-by: Lee Leahy <leroy.p.leahy(a)intel.com>
---
Documentation/x86Board.html | 83 ++++++++++++++++++++++++++++++
Documentation/x86Development.html | 52 +++++++++++++++++++
Documentation/x86FSP1_1.html | 44 ++++++++++++++++
Documentation/x86SoC.html | 103 ++++++++++++++++++++++++++++++++++++++
4 files changed, 282 insertions(+)
diff --git a/Documentation/x86Board.html b/Documentation/x86Board.html
new file mode 100644
index 0000000..a974bed
--- /dev/null
+++ b/Documentation/x86Board.html
@@ -0,0 +1,83 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Board</title>
+ </head>
+ <body>
+
+<h1>x86 Board Development</h1>
+<p>
+ Board development requires System-on-a-Chip (SoC) support.
+ The combined steps are listed
+ <a target="_blank" href="x86Development.html">here</a>.
+ The development steps for the board are listed below:
+</p>
+<ol>
+ <li><a href="#RequiredFiles">Required Files</a></li>
+</ol>
+
+
+<hr>
+<h1><a name="RequiredFiles">Required Files</a></h1>
+<p>
+ Create the board directory as src/mainboard/<Vendor>/<Board>.
+</p>
+
+<p>
+ The following files are required to build a new board:
+</p>
+<ol>
+ <li>Kconfig.name - Defines the Kconfig value for the board</li>
+ <li>Kconfig
+ <ol type="A">
+ <li>Selects the SoC for the board and specifies the SPI flash size
+ <ol type="I">
+ <li>BOARD_ROMSIZE_KB_<Size></li>
+ <li>SOC_<Vendor>_<Chip Family></li>
+ </ol>
+ </li>
+ <li>Declare the Kconfig values for:
+ <ol type="I">
+ <li>MAINBOARD_DIR</li>
+ <li>MAINBOARD_PART_NUMBER</li>
+ <li>MAINBOARD_VENDOR</li>
+ </ol>
+ </li>
+ </ol>
+ </li>
+ <li>devicetree.cb - Enable root bridge and serial port
+ <ol type="A">
+ <li>The first line must be "chip soc/Intel/<soc family>";
+ this path is used by the generated static.c to include the chip.h
+ header file
+ </li>
+ </ol>
+ </li>
+ <li>romstage.c
+ <ol type="A">
+ <li>Add routine mainboard_romstage_entry which calls romstage_common</li>
+ </ol>
+ </li>
+ <li>Configure coreboot build:
+ <ol type="A">
+ <li>Set LOCALVERSION</li>
+ <li>FLASHMAP_OFFSET = 0x00700000</li>
+ <li>Select vendor for the board</li>
+ <li>Select the board</li>
+ <LI>CBFS_SIZE = 0x00100000</li>
+ <li>Set the CPU_MICROCODE_CBFS_LEN</li>
+ <li>Set the CPU_MICROCODE_CBFS_LOC</li>
+ <li>Set the FSP_IMAGE_ID_STRING</li>
+ <li>Set the FSP_LOC</li>
+ <li>Disable GOP_SUPPORT</li>
+ <li>No payload</li>
+ <li>Choose the default value for all other options</li>
+ </ol>
+ </li>
+</ol>
+
+
+<hr>
+<p>Modified: 24 January 2016</p>
+ </body>
+</html>
\ No newline at end of file
diff --git a/Documentation/x86Development.html b/Documentation/x86Development.html
new file mode 100644
index 0000000..3bd18f0
--- /dev/null
+++ b/Documentation/x86Development.html
@@ -0,0 +1,52 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Development</title>
+ </head>
+ <body>
+
+<h1>Coreboot/FSP Development Process for Intel x86</h1>
+<p>
+ The x86 development process for coreboot is broken into the following components:
+</p>
+<ul>
+ <li>Coreboot <a target="_blank" href="x86SoC.html">SoC</a> development</li>
+ <li>Coreboot <a target="_blank" href="x86Board.html">mainboard</a> development</li>
+ <li><a target="_blank" href="x86FSP1_1.html">FSP 1.1</a> integration</li>
+</ul>
+<p>
+ The combined steps below describe how to bring up coreboot for a
+ system-on-a-chip (SoC) and a development board:
+</p>
+<table>
+ <tr bgcolor="#ffffc0">
+ <td>The initial coreboot steps are single threaded!
+ The initial minimal FSP development is also single threaded.
+ Progress can speed up by adding more developers after the minimal coreboot/FSP
+ implementation reaches the payload.
+ </td>
+ </tr>
+</table>
+<ol>
+ <li>Get and build the necessary tools:
+ <ol type="A">
+ <li>sudo apt-get install m4 bison flex ncurses-dev</li>
+ <li>make crossgcc</li>
+ </ol>
+ </li>
+ <li>Get something to build:
+ <ol type="A">
+ <li><a target="_blank" href="x86FSP1_1.html#RequiredFiles">FSP 1.1</a> required files</li>
+ <li><a target="_blank" href="x86SoC.html#RequiredFiles">SoC</a> required files</li>
+ <li><a target="_blank" href="x86Board.html#RequiredFiles">Board</a> required files</li>
+ </ol>
+ </li>
+ <li>Get result to start <a target="_blank" href="x86SoC.html#Descriptor">booting</a></li>
+ <li><a target="_blank" href="x86SoC.html#EarlyDebug">Early Debug</a></li>
+</ol>
+
+
+<hr>
+<p>Modified: 24 January 2016</p>
+ </body>
+</html>
\ No newline at end of file
diff --git a/Documentation/x86FSP1_1.html b/Documentation/x86FSP1_1.html
new file mode 100644
index 0000000..52ff374
--- /dev/null
+++ b/Documentation/x86FSP1_1.html
@@ -0,0 +1,44 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>FSP 1.1</title>
+ </head>
+ <body>
+
+<h1>x86 FSP 1.1 Development</h1>
+<p>
+ Firmware Support Package (FSP) development requires System-on-a-Chip (SoC)
+ and board support. The combined steps are listed
+ <a target="_blank" href="x86Development.html">here</a>.
+ The development steps for FSP are listed below:
+</p>
+<ol>
+ <li><a href="#RequiredFiles">Required Files</a></li>
+</ol>
+
+
+<hr>
+<h1><a name="RequiredFiles">Required Files</a></h1>
+<h2><a name="CorebootRequiredFiles">Coreboot Required Files</a></h2>
+<ol>
+ <li>Create the directories:
+ <ul>
+ <li>src/vendorcode/intel/fsp/fsp1_1/<Chip Family></li>
+ <li>3rdparty/blobs/mainboard/<Board Vendor>/<Board Name></li>
+ </ul>
+ </li>
+ <li>
+ The following files need to be copied from the FSP build or release into the
+ directories above:
+ <ul>
+ <li>FspUpdVpd.h: src/vendorcode/intel/fsp/fsp1_1/<Chip Family>/FspUpdVpd.h</li>
+ <li>FSP.bin: 3rdparty/blobs/mainboard/<Board Vendor>/<Board Name>/fsp.bin</li>
+ </ul>
+ </li>
+</ol>
+
+
+<hr>
+<p>Modified: 25 January 2016</p>
+ </body>
+</html>
\ No newline at end of file
diff --git a/Documentation/x86SoC.html b/Documentation/x86SoC.html
new file mode 100644
index 0000000..758f913
--- /dev/null
+++ b/Documentation/x86SoC.html
@@ -0,0 +1,103 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>SoC</title>
+ </head>
+ <body>
+
+<h1>x86 System on a Chip (SoC) Development</h1>
+<p>
+ SoC development is best done in parallel with development for a specific
+ board. The combined steps are listed
+ <a target="_blank" href="x86Development.html">here</a>.
+ The development steps for the SoC are listed below:
+</p>
+<ol>
+ <li><a target="_blank" href="x86FSP1_1.html#RequiredFiles">FSP 1.1</a> required files</li>
+ <li>SoC <a href="#RequiredFiles">Required Files</a></li>
+ <li><a href="#Descriptor">Start Booting</a></li>
+ <li><a href="#EarlyDebug">Early Debug</a></li>
+</ol>
+
+
+<hr>
+<h1><a name="RequiredFiles">Required Files</a></h1>
+<p>
+ Create the directory as src/soc/<Vendor>/<Chip Family>.
+</p>
+
+<p>
+ The following files are required to build a new SoC:
+</p>
+<ul>
+ <li>Include files
+ <ul>
+ <li>include/soc/pei_data.h</li>
+ <li>include/soc/pm.h</li>
+ </ul>
+ </li>
+ <li>Kconfig - Defines the Kconfig value for the SoC and selects the tool
+ chains for the various stages:
+ <ul>
+ <li>select ARCH_BOOTBLOCK_<Tool Chain></li>
+ <li>select ARCH_RAMSTAGE_<Tool Chain></li>
+ <li>select ARCH_ROMSTAGE_<Tool Chain></li>
+ <li>select ARCH_VERSTAGE_<Tool Chain></li>
+ </ul>
+ </li>
+ <li>Makefile.inc - Specify the include paths</li>
+ <li>memmap.c - Top of usable RAM</li>
+</ul>
+
+
+<hr>
+<h1><a name="Descriptor">Start Booting</a></h1>
+<p>
+ Some SoC parts require additional firmware components in the flash.
+ This section describes how to add those pieces.
+</p>
+
+<h2>Intel Firmware Descriptor</h2>
+<p>
+ The Intel Firmware Descriptor (IFD) is located at the base of the flash part.
+ The following command overwrites the base of the flash image with the Intel
+ Firmware Descriptor:
+</p>
+<pre><code>dd if=descriptor.bin of=build/coreboot.rom conv=notrunc >/dev/null 2>&1</code></pre>
+
+
+<h2><a name="MEB">Management Engine Binary</a></h2>
+<p>
+ Some SoC parts contain and require that the Management Engine (ME) be running
+ before it is possible to bring the x86 processor out of reset. A binary file
+ containing the management engine code must be added to the firmware using the
+ ifdtool. The following commands add this binary blob:
+</p>
+<pre><code>util/ifdtool/ifdtool -i ME:me.bin build/coreboot.rom
+mv build/coreboot.rom.new build/coreboot.rom
+</code></pre>
+
+
+<h2><a name="EarlyDebug">Early Debug</a></h2>
+<p>
+ Early debugging between the reset vector and the time the serial port is enabled
+ is most easily done by writing values to port 0x80.
+</p>
+
+
+<h2>Success</h2>
+<p>
+ When the reset vector is successfully invoked, port 0x80 will output the following value:
+</p>
+<ul>
+ <li>0x01: <a target="_blank" href="https://chromium.googlesource.com/chromiumos/third_party/coreboot/+/chromeo…">POST_RESET_VECTOR_CORRECT</a>
+ - Bootblock reached the
+ <a target="_blank" href="https://chromium.googlesource.com/chromiumos/third_party/coreboot/+/chromeo…">reset vector</a>
+ </li>
+</ul>
+
+
+<hr>
+<p>Modified: 24 January 2016</p>
+ </body>
+</html>
\ No newline at end of file
Leroy P Leahy (leroy.p.leahy(a)intel.com) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/13442
-gerrit
commit 761e516d0c039c651bfbb664eaa3fbe24377650b
Author: Lee Leahy <leroy.p.leahy(a)intel.com>
Date: Mon Jan 25 11:10:41 2016 -0800
x86 Docs: Add the FSP Binary
Document how to add the FSP binary to the SPI flash image.
BRANCH=none
BUG=None
TEST=None
Change-Id: I51b16600ea69853240282ac2eb0d84935b8e2a71
Signed-off-by: Lee Leahy <leroy.p.leahy(a)intel.com>
---
Documentation/x86Development.html | 1 +
Documentation/x86FSP1_1.html | 13 +++++++
Documentation/x86SoC.html | 71 +++++++++++++++++++++++++++++++++++++++
3 files changed, 85 insertions(+)
diff --git a/Documentation/x86Development.html b/Documentation/x86Development.html
index 8cd697f..852e1f3 100644
--- a/Documentation/x86Development.html
+++ b/Documentation/x86Development.html
@@ -44,6 +44,7 @@
<li>Get result to start <a target="_blank" href="x86SoC.html#Descriptor">booting</a></li>
<li><a target="_blank" href="x86SoC.html#EarlyDebug">Early Debug</a></li>
<li>Implement and debug the <a target="_blank" href="x86SoC.html#Bootblock">bootblock</a> code</li>
+ <li>Implement and debug the call to <a target="_blank" href="x86SoC.html#TempRamInit">TempRamInit</a></li>
</ol>
diff --git a/Documentation/x86FSP1_1.html b/Documentation/x86FSP1_1.html
index 52ff374..7a200b0 100644
--- a/Documentation/x86FSP1_1.html
+++ b/Documentation/x86FSP1_1.html
@@ -14,6 +14,7 @@
</p>
<ol>
<li><a href="#RequiredFiles">Required Files</a></li>
+ <li>Add the <a href="#FspBinary">FSP Binary File</a> to the Coreboot File System</li>
</ol>
@@ -39,6 +40,18 @@
<hr>
+<h1><a name="FspBinary">Add the FSP Binary File to Coreboot File System</a></h1>
+<p>
+ Add the FSP binary to the coreboot flash image using the following command:
+</p>
+<pre><code>util/cbfstool/cbfstool build/coreboot.rom add -t fsp -n fsp.bin -b <base address> -f fsp.bin</code></pre>
+<p>
+ This command relocates the FSP binary to the 4K byte aligned location in CBFS so that the
+ FSP code for TempRamInit may be executed in place.
+</p>
+
+
+<hr>
<p>Modified: 25 January 2016</p>
</body>
</html>
\ No newline at end of file
diff --git a/Documentation/x86SoC.html b/Documentation/x86SoC.html
index 5eab50d..ebd1ca7 100644
--- a/Documentation/x86SoC.html
+++ b/Documentation/x86SoC.html
@@ -18,6 +18,7 @@
<li><a href="#Descriptor">Start Booting</a></li>
<li><a href="#EarlyDebug">Early Debug</a></li>
<li><a href="#BootBlock">Bootblock</a></li>
+ <li><a href="#TempRamInit">TempRamInit</a></li>
</ol>
@@ -181,6 +182,76 @@ mv build/coreboot.rom.new build/coreboot.rom
<hr>
+<h1><a name="TempRamInit">TempRamInit</a></h1>
+<p>
+ Enable the call to TempRamInit using the following steps:
+</p>
+<ol>
+ <li>Edit the src/soc/<Vendor>/<Chip Family>/Kconfig file
+ <ol type="A">
+ <li>Add "select USE_GENERIC_FSP_CAR_INC" to enable the use of
+ <a target="_blank" href="https://chromium.googlesource.com/chromiumos/third_party/coreboot/+/chromeo…">src/drivers/intel/fsp1_1/cache_as_ram.inc</a>
+ </li>
+ <li>Add "select SOC_INTEL_COMMON" to enable the use of the files from
+ <a target="_blank" href="https://chromium.googlesource.com/chromiumos/third_party/coreboot/+/chromeo…">src/soc/intel/common</a>
+ specifically building util.c
+ </li>
+ </ol>
+ </li>
+ <li>Debug the result until port 0x80 outputs
+ <ol type="A">
+ <li>0x90: <a target="_blank" href="https://chromium.googlesource.com/chromiumos/third_party/coreboot/+/chromeo…">POST_FSP_TEMP_RAM_INIT</a>
+ - Just before calling
+ <a target="_blank" href="https://chromium.googlesource.com/chromiumos/third_party/coreboot/+/chromeo…">TempRamInit</a>
+ </li>
+ <li>Alternating 0xba and 0x01 - The FSP image was not found</li>
+ </ol>
+ </li>
+ <li>Add the <a target="_blank" href="x86FSP1_1.html#FspBinary">FSP binary file</a> to the flash image</li>
+ <li>Set the following Kconfig values:
+ <ul>
+ <li>CONFIG_FSP_LOC to the FSP base address specified in the previous step</li>
+ <li>CONFIG_FSP_IMAGE_ID_STRING</li>
+ </ul>
+ </li>
+ <li>Debug the result until port 0x80 outputs
+ <ol type="A">
+ <li>0x90: <a target="_blank" href="https://chromium.googlesource.com/chromiumos/third_party/coreboot/+/chromeo…">POST_FSP_TEMP_RAM_INIT</a>
+ - Just before calling
+ <a target="_blank" href="https://chromium.googlesource.com/chromiumos/third_party/coreboot/+/chromeo…">TempRamInit</a>
+ </li>
+ <li>Alternating 0xbb and 0x02 - TempRamInit executed, no CPU microcode update found</li>
+ </ol>
+ </li>
+ <li>Add the CPU microcode update file
+ <ol type="A">
+ <li>Add the microcode file with the following command
+<pre><code>util/cbfstool/cbfstool build/coreboot.rom add -t microcode -n cpu_microcode_blob.bin -b <base address> -f cpu_microcode_blob.bin</code></pre>
+ </li>
+ <li>Set the Kconfig values
+ <ul>
+ <li>CONFIG_CPU_MICROCODE_CBFS_LOC set to the value from the previous step</li>
+ <li>CONFIG_CPU_MICROCODE_CBFS_LEN</li>
+ </ul>
+ </li>
+ </ol>
+ </li>
+ <li>Debug the result until port 0x80 outputs
+ <ol type="A">
+ <li>0x90: <a target="_blank" href="https://chromium.googlesource.com/chromiumos/third_party/coreboot/+/chromeo…">POST_FSP_TEMP_RAM_INIT</a>
+ - Just before calling
+ <a target="_blank" href="https://chromium.googlesource.com/chromiumos/third_party/coreboot/+/chromeo…">TempRamInit</a>
+ </li>
+ <li>0x23 - Just before calling
+ <a target="_blank" href="https://chromium.googlesource.com/chromiumos/third_party/coreboot/+/chromeo…">cache_as_ram_main</a>
+ which is the start of the verstage code which may be part of romstage
+ </li>
+ </ol>
+ </li>
+</ol>
+
+
+<hr>
<p>Modified: 24 January 2016</p>
</body>
</html>
\ No newline at end of file
Hannah Williams (hannah.williams(a)intel.com) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/13186
-gerrit
commit d06d5677852d13356a576910dd6172fd16214935
Author: Hannah Williams <hannah.williams(a)intel.com>
Date: Fri Jan 22 23:04:05 2016 -0800
intel/strago: Get Boot Flash Write Protect status
Read GPIO to get the status
Change-Id: Id2d56ce4b47c4cccba2de3f113afaee6c49885c9
Signed-off-by: Hannah Williams <hannah.williams(a)intel.com>
---
src/mainboard/intel/strago/chromeos.c | 16 +++++++---------
1 file changed, 7 insertions(+), 9 deletions(-)
diff --git a/src/mainboard/intel/strago/chromeos.c b/src/mainboard/intel/strago/chromeos.c
index 969021c..741933f 100755
--- a/src/mainboard/intel/strago/chromeos.c
+++ b/src/mainboard/intel/strago/chromeos.c
@@ -23,12 +23,11 @@
#include <ec/google/chromeec/ec.h>
#endif
#include <rules.h>
-#include <soc/gpio.h>
+#include <gpio.h>
#include <string.h>
#include <vendorcode/google/chromeos/chromeos.h>
-/* The WP status pin lives on GPIO_SSUS_6 which is pad 36 in the SUS well. */
-#define WP_STATUS_PAD 36
+#define WP_GPIO GP_E_22
#if ENV_RAMSTAGE
#include <boot/coreboot_tables.h>
@@ -115,15 +114,14 @@ int get_write_protect_state(void)
{
/*
* The vboot loader queries this function in romstage. The GPIOs have
- * not been set up yet as that configuration is done in ramstage. The
- * hardware defaults to an input but there is a 20K pulldown. Externally
- * there is a 10K pullup. Disable the internal pull in romstage so that
- * there isn't any ambiguity in the reading.
+ * not been set up yet as that configuration is done in ramstage.
+ * Configuring this GPIO as input so that there isn't any ambiguity
+ * in the reading.
*/
#if ENV_ROMSTAGE
- ssus_disable_internal_pull(WP_STATUS_PAD);
+ gpio_input_pullup(WP_GPIO);
#endif
/* WP is enabled when the pin is reading high. */
- return ssus_get_gpio(WP_STATUS_PAD);
+ return !!gpio_get(WP_GPIO);
}