Brenton Dong (brenton.m.dong(a)intel.com) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/17063
-gerrit
commit 9ba70ac4807284c797dbf7ed4599cff7e39deca9
Author: Brenton Dong <brenton.m.dong(a)intel.com>
Date: Tue Oct 18 13:57:54 2016 -0700
soc/intel/apollolake: allow ApolloLake SoC to use FSP CAR Init
FSP v2.0 Driver supports TempRamInit & TempRamExit APIs to initialize
& tear down Cache-As-Ram. Add TempRamInit & TempRamExit usage to
ApolloLake SoC when CONFIG_FSP_CAR is enabled.
Verified on Intel Leaf Hill CRB and confirmed that Cache-As-Ram
is correctly set up and torn down using the FSP v2.0 APIs
without coreboot implementation of CAR init/teardown.
Change-Id: Ifd6fe8398ea147a5fb8c60076b93205bb94b1f25
Signed-off-by: Brenton Dong <brenton.m.dong(a)intel.com>
---
src/arch/x86/exit_car.S | 1 +
src/arch/x86/postcar.c | 8 +-
src/soc/intel/apollolake/Makefile.inc | 14 +++-
.../intel/apollolake/bootblock/cache_as_ram_fsp.S | 98 ++++++++++++++++++++++
src/soc/intel/apollolake/exit_car_fsp.S | 47 +++++++++++
5 files changed, 162 insertions(+), 6 deletions(-)
diff --git a/src/arch/x86/exit_car.S b/src/arch/x86/exit_car.S
index 5c62c92..09d5cd7 100644
--- a/src/arch/x86/exit_car.S
+++ b/src/arch/x86/exit_car.S
@@ -19,6 +19,7 @@
.section ".module_parameters", "aw", @progbits
/* stack_top indicates the stack to pull MTRR information from. */
+.global stack_top
stack_top:
.long 0
.long 0
diff --git a/src/arch/x86/postcar.c b/src/arch/x86/postcar.c
index c4c9cda..34a4335 100644
--- a/src/arch/x86/postcar.c
+++ b/src/arch/x86/postcar.c
@@ -22,15 +22,15 @@
void main(void)
{
+ /* Call TempRamExit FSP API if enabled. */
+ if (IS_ENABLED(CONFIG_FSP_CAR))
+ fsp_temp_ram_exit();
+
console_init();
/* Recover cbmem so infrastruture using it is functional. */
cbmem_initialize();
- /* Call TempRamExit FSP API if enabled. */
- if (IS_ENABLED(CONFIG_FSP_CAR))
- fsp_temp_ram_exit();
-
/* Display the MTRRs */
if (IS_ENABLED(CONFIG_DISPLAY_MTRRS))
soc_display_mtrrs();
diff --git a/src/soc/intel/apollolake/Makefile.inc b/src/soc/intel/apollolake/Makefile.inc
index 4f867e1..9ae5569 100644
--- a/src/soc/intel/apollolake/Makefile.inc
+++ b/src/soc/intel/apollolake/Makefile.inc
@@ -9,7 +9,6 @@ subdirs-y += ../../../cpu/x86/tsc
subdirs-y += ../../../cpu/x86/cache
bootblock-y += bootblock/bootblock.c
-bootblock-y += bootblock/cache_as_ram.S
bootblock-y += bootblock/bootblock.c
bootblock-y += car.c
bootblock-y += gpio.c
@@ -22,6 +21,12 @@ bootblock-y += spi.c
bootblock-y += tsc_freq.c
bootblock-$(CONFIG_SOC_UART_DEBUG) += uart_early.c
+ifeq ($(CONFIG_FSP_CAR),y)
+bootblock-y += bootblock/cache_as_ram_fsp.S
+else
+bootblock-y += bootblock/cache_as_ram.S
+endif
+
romstage-y += car.c
romstage-$(CONFIG_PLATFORM_USES_FSP2_0) += romstage.c
romstage-y += gpio.c
@@ -75,13 +80,18 @@ ramstage-y += sram.c
ramstage-y += spi.c
ramstage-y += xhci.c
-postcar-y += exit_car.S
postcar-y += memmap.c
postcar-y += mmap_boot.c
postcar-y += spi.c
postcar-$(CONFIG_SOC_UART_DEBUG) += uart_early.c
postcar-y += tsc_freq.c
+ifeq ($(CONFIG_FSP_CAR),y)
+postcar-y += exit_car_fsp.S
+else
+postcar-y += exit_car.S
+endif
+
verstage-y += car.c
verstage-y += i2c_early.c
verstage-y += heci.c
diff --git a/src/soc/intel/apollolake/bootblock/cache_as_ram_fsp.S b/src/soc/intel/apollolake/bootblock/cache_as_ram_fsp.S
new file mode 100644
index 0000000..31cdb35
--- /dev/null
+++ b/src/soc/intel/apollolake/bootblock/cache_as_ram_fsp.S
@@ -0,0 +1,98 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * 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; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * 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 <device/pci_def.h>
+#include <cpu/x86/mtrr.h>
+#include <cpu/x86/cache.h>
+#include <cpu/x86/cr.h>
+#include <cpu/x86/post_code.h>
+#include <soc/cpu.h>
+
+#include <../../../arch/x86/walkcbfs.S>
+
+#define FSP_HDR_OFFSET 0x94
+
+.global bootblock_pre_c_entry
+bootblock_pre_c_entry:
+
+.global cache_as_ram
+cache_as_ram:
+ post_code(0x21)
+
+ /* find fsp in cbfs */
+ lea fsp_name, %esi
+ mov $1f, %esp
+ jmp walkcbfs_asm
+1:
+ cmp $0, %eax
+ jz .halt_forever
+ mov CBFS_FILE_OFFSET(%eax), %ebx
+ bswap %ebx
+ add %eax, %ebx
+ add FSP_HDR_OFFSET, %ebx
+
+ /*
+ * ebx = FSP INFO HEADER
+ * Calculate entry into FSP
+ */
+ mov 0x30(%ebx), %eax /* Load TempRamInitEntryOffset */
+ add 0x1c(%ebx), %eax /* add the FSP ImageBase */
+
+ /*
+ * Pass early init variables on a fake stack (no memory yet)
+ * as well as the return location
+ */
+ lea CAR_init_stack, %esp
+
+ /* call FSP binary to setup temporary stack */
+ jmp *%eax
+
+CAR_init_done:
+
+ /* Setup bootblock stack */
+ mov %edx, %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
+ nop
+
+ /* We can call into C functions now */
+ call bootblock_c_entry
+
+ /* Never reached */
+
+.halt_forever:
+ post_code(POST_DEAD_CODE)
+ hlt
+ jmp .halt_forever
+
+CAR_init_params:
+ .long 0 /* Microcode Location */
+ .long 0 /* Microcode Length */
+ .long 0xFFFFFFFF - CONFIG_CBFS_SIZE + 1 /* Firmware Location */
+ .long CONFIG_CBFS_SIZE /* Total Firmware Length */
+
+CAR_init_stack:
+ .long CAR_init_done
+ .long CAR_init_params
+
+fsp_name:
+ .ascii "blobs/fspt.bin\x00"
diff --git a/src/soc/intel/apollolake/exit_car_fsp.S b/src/soc/intel/apollolake/exit_car_fsp.S
new file mode 100644
index 0000000..fb476f1
--- /dev/null
+++ b/src/soc/intel/apollolake/exit_car_fsp.S
@@ -0,0 +1,47 @@
+/*
+ * 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.
+ */
+
+#include <cpu/x86/mtrr.h>
+#include <cpu/x86/cr.h>
+#include <soc/cpu.h>
+
+/*
+ * This path for CAR teardown is taken when CONFIG_FSP_CAR is employed.
+ * This version of chipset_teardown_car sets up the stack, then bypasses
+ * the rest of arch/x86/exit_car.S and calls main() itself instead of
+ * returning to _start. In main(), the TempRamExit FSP API is called
+ * to tear down the CAR and set up caching which can be overwritten
+ * after the API call. More info can be found in the Apollo Lake FSP
+ * Integration Guide included with the FSP binary. The below
+ * caching settings are based on an 8MiB Flash Size given as a
+ * parameter to TempRamInit.
+ *
+ * TempRamExit MTRR Settings:
+ * 0x00000000 - 0x0009FFFF | Write Back
+ * 0x000C0000 - Top of Low Memory | Write Back
+ * 0xFF800000 - 0xFFFFFFFF Flash Reg | Write Protect
+ * 0x100000000 - Top of High Memory | Write Back
+ */
+
+.text
+.global chipset_teardown_car
+chipset_teardown_car:
+
+ /* Set up new stack. */
+ mov stack_top, %esp
+
+ /* Call C code */
+ call main
Matt DeVillier (matt.devillier(a)gmail.com) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/17620
-gerrit
commit 8633ba44029f220fcc701c8f9a15c142b03d565f
Author: Prabal Saha <coolstarorganization(a)gmail.com>
Date: Thu Jul 14 12:34:33 2016 -0700
sb/intel/lynxpoint: add missing I2C ACPI SSCN/FMCN methods
The SSCN and FMCN methods provide the optimal HCNT/LCNT timing values to
the driver, and are necessary when using I2C devices (eg, trackpad and
touchscreen) in ACPI (vs PCI) mode. Add these methods using the
timing values from Broadwell, which work for Haswell/Lynxpoint as well.
TEST: build google/peppy with trackpad/touchscreen devices in ACPI mode,
observe proper operation under Windows and Linux
Change-Id: I25f07ac474b041358315530e5f391bb33d9c4d04
Signed-off-by: Matt DeVillier <matt.devillier(a)gmail.com>
---
src/southbridge/intel/lynxpoint/acpi/serialio.asl | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/src/southbridge/intel/lynxpoint/acpi/serialio.asl b/src/southbridge/intel/lynxpoint/acpi/serialio.asl
index 930a8ee..e8e81c3 100644
--- a/src/southbridge/intel/lynxpoint/acpi/serialio.asl
+++ b/src/southbridge/intel/lynxpoint/acpi/serialio.asl
@@ -165,6 +165,9 @@ Device (I2C0)
Name (_UID, 1)
Name (_ADR, 0x00150001)
+ Name (SSCN, Package () { 432, 507, 30 })
+ Name (FMCN, Package () { 72, 160, 30 })
+
// BAR0 is assigned during PCI enumeration and saved into NVS
Name (RBUF, ResourceTemplate ()
{
@@ -244,6 +247,9 @@ Device (I2C1)
Name (_UID, 1)
Name (_ADR, 0x00150002)
+ Name (SSCN, Package () { 432, 507, 30 })
+ Name (FMCN, Package () { 72, 160, 30 })
+
// BAR0 is assigned during PCI enumeration and saved into NVS
Name (RBUF, ResourceTemplate ()
{
Martin Roth (martinroth(a)google.com) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/17633
-gerrit
commit 09a50b06c5cbf4710eee6bc9fc5fbf0d9ce1a815
Author: Martin Roth <martinroth(a)google.com>
Date: Mon Nov 28 13:16:24 2016 -0700
util/lint: Add check for symbolic links in the coreboot tree
Because of the varied environments that coreboot is built under, we
don't want to have symbolic links in the tree.
Change-Id: I4cf9d95a437626cb52e3032a5e6cba83320a334b
Signed-off-by: Martin Roth <martinroth(a)google.com>
---
util/lint/lint-stable-018-symlinks | 35 +++++++++++++++++++++++++++++++++++
1 file changed, 35 insertions(+)
diff --git a/util/lint/lint-stable-018-symlinks b/util/lint/lint-stable-018-symlinks
new file mode 100755
index 0000000..d271961
--- /dev/null
+++ b/util/lint/lint-stable-018-symlinks
@@ -0,0 +1,35 @@
+#!/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: Report any symbolic links
+
+LC_ALL=C export LC_ALL
+
+EXCLUDED_DIRS='^3rdparty\|^site-local'
+
+# Find symbolic links in the tree
+LINKLIST=$(find . -type l | sed 's|\.\/||' | grep -v "$EXCLUDED_DIRS")
+
+# If the code is in a git repo, only print files that are checked in
+if [ -n "$(command -v git)" ] && [ -d .git ]; then
+ for FILENAME in $LINKLIST; do
+ if [ -n "$(git ls-files "$FILENAME")" ]; then
+ echo "$FILENAME"
+ fi
+ done
+else
+ # If the code isn't in a git repo, print everything found.
+ echo "$LINKLIST"
+fi
+
Matt DeVillier (matt.devillier(a)gmail.com) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/17620
-gerrit
commit 72729d4ef37364e8e5b1b96e9343834b0ad81f8b
Author: Prabal Saha <coolstarorganization(a)gmail.com>
Date: Thu Jul 14 12:34:33 2016 -0700
sb/intel/lynxpoint: add missing I2C ACPI SSCN/FMCN methods
The SSCN and FMCN methods provide the optimal HCNT/LCNT timing values to
the driver, and are necessary when using I2C devices (eg, trackpad and
touchscreen) in ACPI (vs PCI) mode. Add these methods using the
timing values from Broadwell, which work for Haswell/Lynxpoint as well.
TEST: build google/peppy with trackpad/touchscreen devices in ACPI mode,
observe proper operation under Windows and Linux
Change-Id: I25f07ac474b041358315530e5f391bb33d9c4d04
Signed-off-by: Matt DeVillier <matt.devillier(a)gmail.com>
---
src/southbridge/intel/lynxpoint/acpi/serialio.asl | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/src/southbridge/intel/lynxpoint/acpi/serialio.asl b/src/southbridge/intel/lynxpoint/acpi/serialio.asl
index 930a8ee..e4d8659 100644
--- a/src/southbridge/intel/lynxpoint/acpi/serialio.asl
+++ b/src/southbridge/intel/lynxpoint/acpi/serialio.asl
@@ -127,6 +127,9 @@ Device (SDMA)
Name (_UID, 1)
Name (_ADR, 0x00150000)
+ Name (SSCN, Package () { 432, 507, 30 })
+ Name (FMCN, Package () { 72, 160, 30 })
+
// BAR0 is assigned during PCI enumeration and saved into NVS
Name (RBUF, ResourceTemplate ()
{
@@ -165,6 +168,9 @@ Device (I2C0)
Name (_UID, 1)
Name (_ADR, 0x00150001)
+ Name (SSCN, Package () { 432, 507, 30 })
+ Name (FMCN, Package () { 72, 160, 30 })
+
// BAR0 is assigned during PCI enumeration and saved into NVS
Name (RBUF, ResourceTemplate ()
{
the following patch was just integrated into master:
commit bef4d263ae092f8e4b25924f45c4f526fee4615c
Author: Teo Boon Tiong <boon.tiong.teo(a)intel.com>
Date: Fri Nov 11 05:28:53 2016 +0800
sio/nuvoton: Include generic nuvoton driver in bootblock stage
The purpose of this change is to enable serial output in
bootblock stage
Change-Id: I8e075f1e70d1a6598dfdc34931218f5af9637178
Signed-off-by: Teo Boon Tiong <boon.tiong.teo(a)intel.com>
Reviewed-on: https://review.coreboot.org/17359
Tested-by: build bot (Jenkins)
Reviewed-by: Nico Huber <nico.h(a)gmx.de>
Reviewed-by: Martin Roth <martinroth(a)google.com>
See https://review.coreboot.org/17359 for details.
-gerrit
Martin Roth (martinroth(a)google.com) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/17360
-gerrit
commit deb7350da3ddb0704ca63db669f5fecf421abf17
Author: Teo Boon Tiong <boon.tiong.teo(a)intel.com>
Date: Fri Nov 11 05:41:56 2016 +0800
mb/intel/saddlebrook: Enable nuvoton serial in bootblock
Change-Id: I56e7feddd7a582ad0cd898b7b0b45630d32c6300
Signed-off-by: Teo Boon Tiong <boon.tiong.teo(a)intel.com>
---
src/mainboard/intel/saddlebrook/Makefile.inc | 16 ++++++++++
.../intel/saddlebrook/bootblock_mainboard.c | 37 ++++++++++++++++++++++
2 files changed, 53 insertions(+)
diff --git a/src/mainboard/intel/saddlebrook/Makefile.inc b/src/mainboard/intel/saddlebrook/Makefile.inc
new file mode 100644
index 0000000..8b5378a
--- /dev/null
+++ b/src/mainboard/intel/saddlebrook/Makefile.inc
@@ -0,0 +1,16 @@
+##
+## This file is part of the coreboot project.
+##
+## Copyright (C) 2013 Google Inc.
+## 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.
+##
+bootblock-y += bootblock_mainboard.c
diff --git a/src/mainboard/intel/saddlebrook/bootblock_mainboard.c b/src/mainboard/intel/saddlebrook/bootblock_mainboard.c
new file mode 100644
index 0000000..3c85792
--- /dev/null
+++ b/src/mainboard/intel/saddlebrook/bootblock_mainboard.c
@@ -0,0 +1,37 @@
+/*
+ * 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 <bootblock_common.h>
+
+#include "superio/nuvoton/common/nuvoton.h"
+#include <superio/nuvoton/nct6776/nct6776.h>
+
+#define SERIAL_DEV PNP_DEV(0x2e, NCT6776_SP1)
+
+static void early_config_gpio(void)
+{
+ /* do nothing for now */
+}
+
+void bootblock_mainboard_init(void)
+{
+ early_config_gpio();
+}
+
+void bootblock_mainboard_early_init(void)
+{
+ if (IS_ENABLED(CONFIG_SUPERIO_NUVOTON_NCT6776))
+ nuvoton_enable_serial(SERIAL_DEV, CONFIG_TTYS0_BASE);
+}