Rizwan Qureshi (rizwan.qureshi(a)intel.com) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/16332
-gerrit
commit b45967119e2201c08a206e1baaf040ae05b9d52b
Author: Rizwan Qureshi <rizwan.qureshi(a)intel.com>
Date: Fri Aug 26 21:16:01 2016 +0530
soc/intel/skylake: Use postcar functions for setting up new stack
Setup stack and MTRRs using the postcar funtions provided
in postcar_loader.c.
Change-Id: Ia5771e70386dbae9fa181e3635021dd187345123
Signed-off-by: Rizwan Qureshi <rizwan.qureshi(a)intel.com>
---
src/soc/intel/skylake/romstage/romstage_fsp20.c | 50 +++++++++++++++++++++++--
1 file changed, 47 insertions(+), 3 deletions(-)
diff --git a/src/soc/intel/skylake/romstage/romstage_fsp20.c b/src/soc/intel/skylake/romstage/romstage_fsp20.c
index 57b2a52..0d827ab 100644
--- a/src/soc/intel/skylake/romstage/romstage_fsp20.c
+++ b/src/soc/intel/skylake/romstage/romstage_fsp20.c
@@ -24,16 +24,24 @@
#include <console/console.h>
#include <device/pci_def.h>
#include <fsp/util.h>
+#include <fsp/memmap.h>
#include <soc/pci_devs.h>
#include <soc/pm.h>
#include <soc/romstage.h>
#include <timestamp.h>
#include <vboot/vboot_common.h>
+/*
+ * Romstage needs some stack for decompressing ramstage images, since the lzma
+ * lib keeps its state on the stack during romstage.
+ */
+#define ROMSTAGE_RAM_STACK_SIZE 0x5000
+
asmlinkage void *car_stage_c_entry(void)
{
bool s3wake;
- void *top_of_stack;
+ struct postcar_frame pcf;
+ uintptr_t top_of_ram;
struct chipset_power_state *ps;
console_init();
@@ -46,8 +54,44 @@ asmlinkage void *car_stage_c_entry(void)
s3wake = ps->prev_sleep_state == ACPI_S3;
fsp_memory_init(s3wake);
- top_of_stack = setup_stack_and_mtrrs();
- return top_of_stack;
+ if (postcar_frame_init(&pcf, ROMSTAGE_RAM_STACK_SIZE))
+ die("Unable to initialize postcar frame.\n");
+
+ /*
+ * We need to make sure ramstage will be run cached. At this
+ * point exact location of ramstage in cbmem is not known.
+ * Instruct postcar to cache 16 megs under cbmem top which is
+ * a safe bet to cover ramstage.
+ */
+ top_of_ram = (uintptr_t) cbmem_top();
+ printk(BIOS_DEBUG, "top_of_ram = 0x%lx\n", top_of_ram);
+ assert(ALIGN_DOWN(top_of_ram, 1*MiB) == top_of_ram);
+ top_of_ram -= 16*MiB;
+ postcar_frame_add_mtrr(&pcf, top_of_ram, 16*MiB, MTRR_TYPE_WRBACK);
+
+ if (IS_ENABLED(CONFIG_HAVE_SMI_HANDLER)) {
+ void *smm_base;
+ size_t smm_size;
+ uintptr_t tseg_base;
+
+ /*
+ * Cache the TSEG region at the top of ram. This region is
+ * not restricted to SMM mode until SMM has been relocated.
+ * By setting the region to cacheable it provides faster access
+ * when relocating the SMM handler as well as using the TSEG
+ * region for other purposes.
+ */
+ smm_region(&smm_base, &smm_size);
+ tseg_base = (uintptr_t)smm_base;
+ postcar_frame_add_mtrr(&pcf, tseg_base, smm_size,
+ MTRR_TYPE_WRBACK);
+ }
+
+ /* Cache the ROM as WP just below 4GiB. */
+ postcar_frame_add_mtrr(&pcf, 0xFFFFFFFF - CONFIG_ROM_SIZE + 1,
+ CONFIG_ROM_SIZE, MTRR_TYPE_WRPROT);
+
+ return postcar_commit_mtrrs(&pcf);
}
static void soc_memory_init_params(struct FSP_M_CONFIG *m_cfg)
Rizwan Qureshi (rizwan.qureshi(a)intel.com) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/16301
-gerrit
commit a779af6035ef798569b9091b4fe79c494ca09471
Author: Rizwan Qureshi <rizwan.qureshi(a)intel.com>
Date: Tue Aug 23 13:38:19 2016 +0530
kunimitsu: Add initial FSP2.0 support
Add placeholders for functions required when skylake
uses FSP2.0 driver, keeping the fsp1.1 flow intact.
Change-Id: I5446f8cd093af289e0f6022b53a985fa29e32471
Signed-off-by: Rizwan Qureshi <rizwan.qureshi(a)intel.com>
---
src/mainboard/intel/kunimitsu/Makefile.inc | 4 ++++
src/mainboard/intel/kunimitsu/ramstage.c | 2 +-
src/mainboard/intel/kunimitsu/romstage_fsp20.c | 21 +++++++++++++++++++++
src/mainboard/intel/kunimitsu/spd/Makefile.inc | 2 +-
4 files changed, 27 insertions(+), 2 deletions(-)
diff --git a/src/mainboard/intel/kunimitsu/Makefile.inc b/src/mainboard/intel/kunimitsu/Makefile.inc
index cafa12c..86be420 100644
--- a/src/mainboard/intel/kunimitsu/Makefile.inc
+++ b/src/mainboard/intel/kunimitsu/Makefile.inc
@@ -34,3 +34,7 @@ ramstage-y += pei_data.c
ramstage-y += ramstage.c
smm-$(CONFIG_HAVE_SMI_HANDLER) += smihandler.c
+
+ifeq ($(CONFIG_PLATFORM_USES_FSP2_0),y)
+romstage-srcs := $(subst $(MAINBOARDDIR)/romstage.c,$(MAINBOARDDIR)/romstage_fsp20.c,$(romstage-srcs))
+endif
diff --git a/src/mainboard/intel/kunimitsu/ramstage.c b/src/mainboard/intel/kunimitsu/ramstage.c
index 563c715..44fb9cd 100644
--- a/src/mainboard/intel/kunimitsu/ramstage.c
+++ b/src/mainboard/intel/kunimitsu/ramstage.c
@@ -16,7 +16,7 @@
#include <soc/ramstage.h>
#include "gpio.h"
-void mainboard_silicon_init_params(SILICON_INIT_UPD *params)
+void mainboard_silicon_init_params(FSP_SIL_UPD *params)
{
/* Configure pads prior to SiliconInit() in case there's any
* dependencies during hardware initialization. */
diff --git a/src/mainboard/intel/kunimitsu/romstage_fsp20.c b/src/mainboard/intel/kunimitsu/romstage_fsp20.c
new file mode 100644
index 0000000..10bdd21
--- /dev/null
+++ b/src/mainboard/intel/kunimitsu/romstage_fsp20.c
@@ -0,0 +1,21 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright (C) 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.
+ */
+
+#include <soc/romstage.h>
+
+void mainboard_memory_init_params(struct FSPM_UPD *mupd)
+{
+ /* TODO: Read and copy SPD and fill up Rcomp and DQ param */
+}
diff --git a/src/mainboard/intel/kunimitsu/spd/Makefile.inc b/src/mainboard/intel/kunimitsu/spd/Makefile.inc
index 62d6fd4..0a9cb0f 100644
--- a/src/mainboard/intel/kunimitsu/spd/Makefile.inc
+++ b/src/mainboard/intel/kunimitsu/spd/Makefile.inc
@@ -14,7 +14,7 @@
## GNU General Public License for more details.
##
-romstage-y += spd.c
+romstage-$(CONFIG_PLATFORM_USES_FSP1_1) += spd.c
SPD_BIN = $(obj)/spd.bin
Rizwan Qureshi (rizwan.qureshi(a)intel.com) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/16331
-gerrit
commit 2c8da704edbcc97c1ee3c76f70e1e249369d5f2f
Author: Rizwan Qureshi <rizwan.qureshi(a)intel.com>
Date: Fri Aug 26 21:08:50 2016 +0530
arch/x86: Make postcar library available irrespective of CONFIG_POSTCAR_STAGE
postcar_loader.c has a useful library of funtions for
setting up stack and MTRRs. Make it available in romstage
irrespective of CONFIG_POSTCAR_STAGE for use in stack setup
after Dram init.
The final step of moving the used and max MTRRs on to stack
is moved to a new function, that can be used outside of
postcar phase.
Change-Id: I322b12577d74268d03fe42a9744648763693cddd
Signed-off-by: Rizwan Qureshi <rizwan.qureshi(a)intel.com>
---
src/arch/x86/Makefile.inc | 2 +-
src/arch/x86/include/arch/cpu.h | 6 ++++++
src/arch/x86/postcar_loader.c | 18 ++++++++++++------
3 files changed, 19 insertions(+), 7 deletions(-)
diff --git a/src/arch/x86/Makefile.inc b/src/arch/x86/Makefile.inc
index 9b16add..38a2a8c 100644
--- a/src/arch/x86/Makefile.inc
+++ b/src/arch/x86/Makefile.inc
@@ -213,7 +213,7 @@ romstage-y += memcpy.c
romstage-y += memmove.c
romstage-y += memset.c
romstage-$(CONFIG_X86_TOP4G_BOOTMEDIA_MAP) += mmap_boot.c
-romstage-$(CONFIG_POSTCAR_STAGE) += postcar_loader.c
+romstage-y += postcar_loader.c
romstage-$(CONFIG_COLLECT_TIMESTAMPS) += timestamp.c
ifneq ($(CONFIG_ROMCC),y)
diff --git a/src/arch/x86/include/arch/cpu.h b/src/arch/x86/include/arch/cpu.h
index 5c26bcf..faa2375 100644
--- a/src/arch/x86/include/arch/cpu.h
+++ b/src/arch/x86/include/arch/cpu.h
@@ -274,6 +274,12 @@ void postcar_frame_add_mtrr(struct postcar_frame *pcf,
uintptr_t addr, size_t size, int type);
/*
+ * Push used MTRR and Max MTRRs on to the stack
+ * and return pointer to stack top.
+ */
+void *postcar_commit_mtrrs(struct postcar_frame *pcf);
+
+/*
* Load and run a program that takes control of execution that
* tears down CAR and loads ramstage. The postcar_frame object
* indicates how to set up the frame. If caching is enabled at
diff --git a/src/arch/x86/postcar_loader.c b/src/arch/x86/postcar_loader.c
index cc1d460..b5d8db0 100644
--- a/src/arch/x86/postcar_loader.c
+++ b/src/arch/x86/postcar_loader.c
@@ -84,6 +84,17 @@ void postcar_frame_add_mtrr(struct postcar_frame *pcf,
pcf->num_var_mttrs++;
}
+void *postcar_commit_mtrrs(struct postcar_frame *pcf)
+{
+ /*
+ * Place the number of used variable MTRRs on stack then max number
+ * of variable MTRRs supported in the system.
+ */
+ stack_push(pcf, pcf->num_var_mttrs);
+ stack_push(pcf, pcf->max_var_mttrs);
+ return (void *) pcf->stack;
+}
+
void run_postcar_phase(struct postcar_frame *pcf)
{
struct prog prog =
@@ -93,12 +104,7 @@ void run_postcar_phase(struct postcar_frame *pcf)
.prog = &prog,
};
- /*
- * Place the number of used variable MTRRs on stack then max number
- * of variable MTRRs supported in the system.
- */
- stack_push(pcf, pcf->num_var_mttrs);
- stack_push(pcf, pcf->max_var_mttrs);
+ postcar_commit_mtrrs(pcf);
if (prog_locate(&prog))
die("Failed to locate after CAR program.\n");
Martin Roth (martinroth(a)google.com) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/16362
-gerrit
commit b4b642558dc24fa3a0ae57db9091f691ef21d445
Author: Martin Roth <martinroth(a)google.com>
Date: Tue Aug 30 09:39:48 2016 -0600
Makefile.inc: lint: Update to run lint-server scripts
- Add junit-amend command so that junit.xml doesn't get overwritten
- Add lint-server as a valid option
- Call lint with lint-server --junit-amend from what-jenkins-does
- Add final newlines check as lint-server script
Change-Id: I7e4156844b8c60790e03a0e43564610bb0c8f386
Signed-off-by: Martin Roth <martinroth(a)google.com>
---
Makefile.inc | 1 +
util/lint/lint | 8 ++++++--
util/lint/lint-server-015-final-newlines | 17 +++++++++++++++++
3 files changed, 24 insertions(+), 2 deletions(-)
diff --git a/Makefile.inc b/Makefile.inc
index 6225152..084ba56 100644
--- a/Makefile.inc
+++ b/Makefile.inc
@@ -997,6 +997,7 @@ JENKINS_PAYLOAD?=none
CPUS?=4
what-jenkins-does:
util/lint/lint lint-stable --junit
+ util/lint/lint lint-server --junit-amend
util/abuild/abuild -B -J $(if $(JENKINS_NOCCACHE),,-y) -c $(CPUS) -z -p $(JENKINS_PAYLOAD) -x -X $(top)/abuild-chromeos.xml
util/abuild/abuild -B -J $(if $(JENKINS_NOCCACHE),,-y) -c $(CPUS) -z -p $(JENKINS_PAYLOAD)
(cd payloads/libpayload; unset COREBOOT_BUILD_DIR; $(MAKE) $(if $(JENKINS_NOCCACHE),,CONFIG_LP_CCACHE=y) V=$(V) Q=$(Q) junit.xml)
diff --git a/util/lint/lint b/util/lint/lint
index 826685d..db24c7d 100755
--- a/util/lint/lint
+++ b/util/lint/lint
@@ -14,7 +14,7 @@
#set -x # uncomment for debug
usage () {
- printf "Usage: %s <lint|lint-stable> [--junit]\n" "$0"
+ printf "Usage: %s <lint|lint-stable|lint-server> [--junit]\n" "$0"
}
#write to the junit xml file if --junit was specified
@@ -25,7 +25,8 @@ junit_write () {
}
#verify the first command line parameter
-if [ -z "$1" ] || [ "$1" != "lint" ] && [ "$1" != "lint-stable" ]; then
+if [ -z "$1" ] || [ "$1" != "lint" ] && [ "$1" != "lint-stable" ] && \
+ [ "$1" != "lint-server" ]; then
usage
exit 1
fi
@@ -40,6 +41,9 @@ if [ "$2" = "--junit" ]; then
JUNIT=1
echo '<?xml version="1.0" encoding="utf-8"?>' > "$XMLFILE"
junit_write '<testsuite>'
+elif [ "$2" = "--junit-amend" ]; then
+ JUNIT=1
+ junit_write '<testsuite>'
else
JUNIT=0
fi
diff --git a/util/lint/lint-server-015-final-newlines b/util/lint/lint-server-015-final-newlines
new file mode 100755
index 0000000..c3f66c0
--- /dev/null
+++ b/util/lint/lint-server-015-final-newlines
@@ -0,0 +1,17 @@
+#!/bin/sh
+# This file is part of the coreboot project.
+#
+# Copyright (C) 2016 Google Inc.
+#
+# 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.
+#
+# DESCR: Check that files end with a single newline
+
+lint-015-final-newlines
Martin Roth (martinroth(a)google.com) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/16360
-gerrit
commit 60091f62cc9ec4ebe992fbffd27b16e106da8f30
Author: Martin Roth <martinroth(a)google.com>
Date: Mon Aug 29 15:49:02 2016 -0600
util/lint: add stable checkpatch for jenkins
The checkpatch script takes a while to run, so don't add it to the
lint-stable checks which run pre-commit.
Change-Id: I907176c21c057564495b75133ba10b0761c9fe7b
Signed-off-by: Martin Roth <martinroth(a)google.com>
---
util/lint/lint-server-007-checkpatch | 44 ++++++++++++++++++++++++++++++++++++
1 file changed, 44 insertions(+)
diff --git a/util/lint/lint-server-007-checkpatch b/util/lint/lint-server-007-checkpatch
new file mode 100755
index 0000000..5fbed01
--- /dev/null
+++ b/util/lint/lint-server-007-checkpatch
@@ -0,0 +1,44 @@
+#!/bin/sh
+# This file is part of the coreboot project.
+#
+# Copyright (C) 2016 Google Inc.
+#
+# 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.
+#
+#
+# DESCR: Run checkpatch on directories that are known good
+
+# Top level
+util/lint/lint-007-checkpatch "src/acpi"
+
+#src/cpu
+util/lint/lint-007-checkpatch "src/cpu/armltd src/cpu/qemu-power8 \
+src/cpu/qemu-x86"
+
+#src/drivers
+util/lint/lint-007-checkpatch "src/drivers/dec src/drivers/gic \
+src/drivers/ti"
+
+#src/ec
+util/lint/lint-007-checkpatch "src/ec/purism"
+
+#src/include
+util/lint/lint-007-checkpatch "src/include/boot src/include/superio \
+src/include/sys"
+
+#src/mainboard
+util/lint/lint-007-checkpatch "src/mainboard/adlink src/mainboard/linutop \
+src/mainboard/purism src/mainboard/ti"
+
+# src/soc
+util/lint/lint-007-checkpatch "src/soc/rdc"
+
+# src/superio
+util/lint/lint-007-checkpatch "src/superio/acpi src/superio/common"
Martin Roth (martinroth(a)google.com) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/16359
-gerrit
commit 0a60c2cf162186bbc7fcce903ee0ed5fbbe925f7
Author: Martin Roth <martinroth(a)google.com>
Date: Mon Aug 29 15:40:57 2016 -0600
lint/lint-007-checkpatch: Update lint script
- Check Kconfig files as well.
- Accept a list of directories to check as a command line argument.
- Only look at src & util directories by default.
- Skip src/vendorcode.
- Remove bypass of payloads/coreinfo/util/kconfig directory, it no
longer exists.
Change-Id: Ia522d3ddc29914220bdaae36ea23ded7338c48fd
Signed-off-by: Martin Roth <martinroth(a)google.com>
---
util/lint/lint-007-checkpatch | 33 ++++++++++++++++++++++++++-------
1 file changed, 26 insertions(+), 7 deletions(-)
diff --git a/util/lint/lint-007-checkpatch b/util/lint/lint-007-checkpatch
index 9d9d96e..ef4feab 100755
--- a/util/lint/lint-007-checkpatch
+++ b/util/lint/lint-007-checkpatch
@@ -12,12 +12,31 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
-# DESCR: Checkpatch on all .c and .h files in the tree
+# DESCR: Checkpatch on .c, .h, & Kconfig files in the tree
LC_ALL=C export LC_ALL
-util/lint/checkpatch.pl --show-types --file $( git ls-files \*.[ch] | \
- grep -v ^payloads/libpayload/util/kconfig | \
- grep -v ^payloads/libpayload/curses/PDCurses-3.4 | \
- grep -v ^payloads/coreinfo/util/kconfig | \
- grep -v ^util/kconfig \
- )
+
+# GNU BRE syntax list of files to examine
+INCLUDED_FILES='.*\.[ch]\|Kconfig.*$'
+
+EXCLUDED_DIRS="^payloads/libpayload/util/kconfig\|\
+^payloads/libpayload/curses/PDCurses\|\
+^util/kconfig\|\
+^src/vendorcode"
+
+#space separated list of directories to test
+if [ "$1" = "" ]; then
+ INCLUDED_DIRS="src util"
+else
+ INCLUDED_DIRS="$1"
+fi
+
+# We want word splitting here, so disable the shellcheck warnings
+# shellcheck disable=SC2046,SC2086
+FILELIST=$( git ls-files $INCLUDED_DIRS | \
+ grep $INCLUDED_FILES | \
+ grep -v $EXCLUDED_DIRS )
+
+for FILE in $FILELIST; do
+ util/lint/checkpatch.pl --show-types --file --quiet "$FILE"
+done