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/15133
-gerrit
commit 4b745f6564bb61023fb02813fbcdfc446949c923
Author: Lee Leahy <leroy.p.leahy(a)intel.com>
Date: Wed Jun 8 14:01:05 2016 -0700
mainboard/intel/galileo: Support bootblock in C
Initialize the GPIOs during the boot block to properly route the SOC
UART pins.
TEST=Build and run on Galileo Gen2
Change-Id: I22c24f8c83f04566a0bbd598a141a5209569a924
Signed-off-by: Lee Leahy <Leroy.P.Leahy(a)intel.com>
---
src/mainboard/intel/galileo/Makefile.inc | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/src/mainboard/intel/galileo/Makefile.inc b/src/mainboard/intel/galileo/Makefile.inc
index 83fb0db..cbcbf81 100644
--- a/src/mainboard/intel/galileo/Makefile.inc
+++ b/src/mainboard/intel/galileo/Makefile.inc
@@ -17,6 +17,11 @@ ifeq ($(CONFIG_PLATFORM_USES_FSP1_1),y)
CPPFLAGS_common += -I$(src)/vendorcode/intel/fsp/fsp1_1/quark
endif
+ifeq ($(CONFIG_C_ENVIRONMENT_BOOTBLOCK),y)
+bootblock-y += gpio.c
+bootblock-y += reg_access.c
+endif
+
romstage-y += gpio.c
romstage-y += reg_access.c
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/15131
-gerrit
commit f623cac38c633987bf64a0208b77cba1c67ff60f
Author: Lee Leahy <leroy.p.leahy(a)intel.com>
Date: Sun Jun 5 18:49:55 2016 -0700
lib: Build reg_script for bootblock
Allow reg_script to be used during the bootblock.
TEST=Build and run on Galileo Gen2
Change-Id: I55fe0be3f50116927b801ce67a3f23bb1931f6e7
Signed-off-by: Lee Leahy <leroy.p.leahy(a)intel.com>
---
src/lib/Makefile.inc | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/lib/Makefile.inc b/src/lib/Makefile.inc
index b446e10..49720a7 100644
--- a/src/lib/Makefile.inc
+++ b/src/lib/Makefile.inc
@@ -146,6 +146,7 @@ bootblock-y += hexdump.c
ramstage-y += hexdump.c
romstage-y += hexdump.c
+bootblock-$(CONFIG_REG_SCRIPT) += reg_script.c
verstage-$(CONFIG_REG_SCRIPT) += reg_script.c
romstage-$(CONFIG_REG_SCRIPT) += reg_script.c
ramstage-$(CONFIG_REG_SCRIPT) += reg_script.c
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/15127
-gerrit
commit 152d830442ff958c0b41f15f950b3d96a5dd1a8c
Author: Lee Leahy <leroy.p.leahy(a)intel.com>
Date: Tue Jun 7 08:45:17 2016 -0700
arch/x86: Add debug spinloop
Conditionally add a debug spinloop to enable easy connection of JTAG
debuggers.
TEST=Build and run on Galileo Gen2 with a JTAG debugger.
Change-Id: I7a21f9e6bfb10912d06ce48447c61202553630d0
Signed-off-by: Lee Leahy <leroy.p.leahy(a)intel.com>
---
src/arch/x86/Kconfig | 7 +++++++
src/arch/x86/bootblock_crt0.S | 9 +++++++++
2 files changed, 16 insertions(+)
diff --git a/src/arch/x86/Kconfig b/src/arch/x86/Kconfig
index cdeb02d..8be7ac1 100644
--- a/src/arch/x86/Kconfig
+++ b/src/arch/x86/Kconfig
@@ -117,6 +117,13 @@ config PC80_SYSTEM
bool
default y if ARCH_X86
+config BOOTBLOCK_DEBUG_SPINLOOP
+ bool
+ default n
+ help
+ Add a spin (JMP .) in bootblock_crt0.S during early bootblock to wait
+ for a JTAG debugger to break into the execution sequence.
+
config BOOTBLOCK_MAINBOARD_INIT
string
diff --git a/src/arch/x86/bootblock_crt0.S b/src/arch/x86/bootblock_crt0.S
index 4e49bce..1d66bdc 100644
--- a/src/arch/x86/bootblock_crt0.S
+++ b/src/arch/x86/bootblock_crt0.S
@@ -32,6 +32,15 @@
#include <cpu/x86/16bit/reset16.inc>
#include <cpu/x86/32bit/entry32.inc>
+#if IS_ENABLED(CONFIG_BOOTBLOCK_DEBUG_SPINLOOP)
+
+ /* Wait for a JTAG debugger to break in and set EBX non-zero */
+ xor %ebx, %ebx
+
+debug_spinloop:
+ cmp $0, %ebx
+ jz debug_spinloop
+#endif
bootblock_protected_mode_entry:
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/15126
-gerrit
commit 88fe4193a543aa662c46b19047dc59a453f07840
Author: Lee Leahy <leroy.p.leahy(a)intel.com>
Date: Sun Jun 5 18:41:00 2016 -0700
arch/x86: Support "weak" BIST and TSC save routines
Not all x86 architectures support the mm register set. Provide a "weak"
routine that saves BIST in mm0 and a "weak" routine that saves the TSC
value in mm2:mm1. Use the Kconfig value BOOTBLOCK_SAVE_BIST to specify
the "weak" routine to save the BIST value. Use the Kconfig value
BOOTBLOCK_SAVE_TIMESTAMP to specify the "weak" routine to get and save
the TSC value as the early timestamp.
TEST=Build and run on Amenia and Galileo Gen2.
Change-Id: I8119e74664ac3522c011767d424d441cd62545ce
Signed-off-by: Lee Leahy <leroy.p.leahy(a)intel.com>
---
src/arch/x86/Kconfig | 16 +++++++++++++++
src/arch/x86/bootblock_crt0.S | 19 ++++++++++++------
src/arch/x86/bootblock_save_bist.inc | 27 +++++++++++++++++++++++++
src/arch/x86/bootblock_save_timestamp.inc | 33 +++++++++++++++++++++++++++++++
4 files changed, 89 insertions(+), 6 deletions(-)
diff --git a/src/arch/x86/Kconfig b/src/arch/x86/Kconfig
index 724c4db..cdeb02d 100644
--- a/src/arch/x86/Kconfig
+++ b/src/arch/x86/Kconfig
@@ -126,6 +126,22 @@ config BOOTBLOCK_NORTHBRIDGE_INIT
config BOOTBLOCK_RESETS
string
+config BOOTBLOCK_SAVE_BIST
+ string
+ default src/arch/x86/bootblock_save_bist.inc
+ help
+ Specify the file to use to save the BIST value. The default file
+ uses register MM0. Another file is necessary when the CPU does not
+ support the MMx register set.
+
+config BOOTBLOCK_SAVE_TIMESTAMP
+ string
+ default src/arch/x86/bootblock_save_timestamp.inc
+ help
+ Specify the file to use to save the timestamp value. The default
+ file uses registers MM1 and MM2. Another file is necessary when
+ the CPU does not support the MMx register set.
+
config HAVE_CMOS_DEFAULT
def_bool n
diff --git a/src/arch/x86/bootblock_crt0.S b/src/arch/x86/bootblock_crt0.S
index 7292b8b..4e49bce 100644
--- a/src/arch/x86/bootblock_crt0.S
+++ b/src/arch/x86/bootblock_crt0.S
@@ -34,12 +34,18 @@
bootblock_protected_mode_entry:
- /* Save BIST result */
- movd %eax, %mm0
- /* Save an early timestamp */
- rdtsc
- movd %eax, %mm1
- movd %edx, %mm2
+
+ /* Save BIST result:
+ * eax: BIST result
+ */
+#ifdef CONFIG_BOOTBLOCK_SAVE_BIST
+#include CONFIG_BOOTBLOCK_SAVE_BIST
+#endif
+
+ /* Save the timestamp value */
+#ifdef CONFIG_BOOTBLOCK_SAVE_TIMESTAMP
+#include CONFIG_BOOTBLOCK_SAVE_TIMESTAMP
+#endif
#if !IS_ENABLED(CONFIG_SSE)
enable_sse:
@@ -53,4 +59,5 @@ enable_sse:
#endif /* IS_ENABLED(CONFIG_SSE) */
/* We're done. Now it's up to platform-specific code */
+jump_to_soc_code:
jmp bootblock_pre_c_entry
diff --git a/src/arch/x86/bootblock_save_bist.inc b/src/arch/x86/bootblock_save_bist.inc
new file mode 100644
index 0000000..6474a8c
--- /dev/null
+++ b/src/arch/x86/bootblock_save_bist.inc
@@ -0,0 +1,27 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright (C) 2015 Alexandru Gagniuc <mr.nuke.me(a)gmail.com>
+ * 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; 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.
+ *
+ * Default BIST save routine.
+ */
+
+.global save_bist
+
+ /* Save BIST result:
+ * eax: BIST result
+ */
+
+save_bist:
+ movd %eax, %mm0
diff --git a/src/arch/x86/bootblock_save_timestamp.inc b/src/arch/x86/bootblock_save_timestamp.inc
new file mode 100644
index 0000000..d1cbe8a
--- /dev/null
+++ b/src/arch/x86/bootblock_save_timestamp.inc
@@ -0,0 +1,33 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright (C) 2015 Alexandru Gagniuc <mr.nuke.me(a)gmail.com>
+ * 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; 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.
+ *
+ * Default timestamp save routine.
+ */
+
+.global save_timestamp
+
+ /* Get an early timestamp */
+ rdtsc
+
+ /* Save the timestamp value:
+ * eax: Low 32-bits of timestamp
+ * edx: High 32-bits of timestamp
+ */
+
+save_timestamp:
+ movd %eax, %mm1
+ movd %edx, %mm2
+
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/15125
-gerrit
commit 84e8952d9326c7d809f9ab1ef3636f8a48e2f3fb
Author: Lee Leahy <leroy.p.leahy(a)intel.com>
Date: Sun Jun 5 17:20:17 2016 -0700
lib: Add asmlinkage attribute to bootblock_main_with_timestamp
Add asmlinkage to bootblock_main_with_timestamp so that it may be called
directly from the assembly code.
TEST=Build for Amenia and Galileo Gen2
Change-Id: Iefb8e5c1ddce2ec495b9272966b595d5adcebc1c
Signed-off-by: Lee Leahy <leroy.p.leahy(a)intel.com>
---
src/include/bootblock_common.h | 2 +-
src/lib/bootblock.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/include/bootblock_common.h b/src/include/bootblock_common.h
index 8bef60a..9a321b4 100644
--- a/src/include/bootblock_common.h
+++ b/src/include/bootblock_common.h
@@ -43,6 +43,6 @@ void asmlinkage bootblock_c_entry(uint64_t base_timestamp);
* This function assumes that the timer has already been initialized, so it
* does not call init_timer().
*/
-void bootblock_main_with_timestamp(uint64_t base_timestamp);
+void asmlinkage bootblock_main_with_timestamp(uint64_t base_timestamp);
#endif /* __BOOTBLOCK_COMMON_H */
diff --git a/src/lib/bootblock.c b/src/lib/bootblock.c
index f16cb44..9dece0c 100644
--- a/src/lib/bootblock.c
+++ b/src/lib/bootblock.c
@@ -29,7 +29,7 @@ __attribute__((weak)) void bootblock_soc_early_init(void) { /* do nothing */ }
__attribute__((weak)) void bootblock_soc_init(void) { /* do nothing */ }
__attribute__((weak)) void bootblock_mainboard_init(void) { /* do nothing */ }
-void bootblock_main_with_timestamp(uint64_t base_timestamp)
+void asmlinkage bootblock_main_with_timestamp(uint64_t base_timestamp)
{
/* Initialize timestamps if we have TIMESTAMP region in memlayout.ld. */
if (IS_ENABLED(CONFIG_COLLECT_TIMESTAMPS) && _timestamp_size > 0)