summaryrefslogtreecommitdiff
path: root/src/arch/x86/assembly_entry.S
diff options
context:
space:
mode:
authorAaron Durbin <adurbin@chromium.org>2016-04-29 12:34:01 -0500
committerAaron Durbin <adurbin@chromium.org>2016-05-02 20:06:23 +0200
commitaef586548a2443f40a49f9f1f5d99c522a89480f (patch)
treed03b823af7322fe60386e026c0e573a855e2d3cb /src/arch/x86/assembly_entry.S
parent800b0173c98101ee6ad2c7eaf1951a435c819fd9 (diff)
downloadcoreboot-aef586548a2443f40a49f9f1f5d99c522a89480f.tar.xz
arch/x86/assembly_entry: allow early post CAR stages to use common code
The skylake-based Chromebooks use a separate verstage which runs just after bootblock and prior to romstage. The normal path for romstage would be to reload the gdt, however in the previously described scenario has verstage performing that work. Therefore, provide that path under those conditions. The only difference from the C_ENVIRONMENT_BOOTBLOCK scenario is that the stack should not be reloaded since there's no way to know the top of the stack. Change-Id: Ic39ab52a856233d3042ac02a15ae4816ddfe07c7 Signed-off-by: Aaron Durbin <adurbin@chromium.org> Reviewed-on: https://review.coreboot.org/14548 Reviewed-by: Furquan Shaikh <furquan@google.com> Tested-by: build bot (Jenkins) Reviewed-by: Andrey Petrov <andrey.petrov@intel.com> Reviewed-by: Leroy P Leahy <leroy.p.leahy@intel.com>
Diffstat (limited to 'src/arch/x86/assembly_entry.S')
-rw-r--r--src/arch/x86/assembly_entry.S26
1 files changed, 20 insertions, 6 deletions
diff --git a/src/arch/x86/assembly_entry.S b/src/arch/x86/assembly_entry.S
index ec3888fa43..86dbba4668 100644
--- a/src/arch/x86/assembly_entry.S
+++ b/src/arch/x86/assembly_entry.S
@@ -14,21 +14,35 @@
* GNU General Public License for more details.
*/
-#if IS_ENABLED(CONFIG_C_ENVIRONMENT_BOOTBLOCK)
+#include <rules.h>
/*
- * This path is for stages that post bootblock when employing
- * CONFIG_C_ENVIRONMENT_BOOTBLOCK. There's no need to re-load the gdt, etc
- * as all those settings are cached within the processor. In order to
- * continue with C code execution one needs to set stack pointer and clear
- * CAR_GLOBAL variables that are stage specific.
+ *Take the path where CAR_GLOBAL variables just need to be cleared when
+ * verstage runs directly after bootblock.
+ */
+#define ROMSTAGE_AFTER_VERSTAGE \
+ (IS_ENABLED(CONFIG_SEPARATE_VERSTAGE) && \
+ IS_ENABLED(CONFIG_VBOOT_STARTS_IN_BOOTBLOCK) && ENV_ROMSTAGE)
+
+#if IS_ENABLED(CONFIG_C_ENVIRONMENT_BOOTBLOCK) || ROMSTAGE_AFTER_VERSTAGE
+
+/*
+ * This path is for stages that are post bootblock when employing
+ * CONFIG_C_ENVIRONMENT_BOOTBLOCK or any intermediate stage succeeding
+ * the first stage to initialize protected mode. There's no need to re-load
+ * the gdt, etc as all those settings are cached within the processor. In
+ * order to continue with C code execution one needs to set stack pointer and
+ * clear CAR_GLOBAL variables that are stage specific.
*/
.section ".text._start", "ax", @progbits
.global _start
_start:
+/* _car_stack_end symbol is only valid when bootblock does CAR setup. */
+#if IS_ENABLED(CONFIG_C_ENVIRONMENT_BOOTBLOCK)
/* reset stack pointer to CAR stack */
mov $_car_stack_end, %esp
+#endif
/* clear CAR_GLOBAL area as it is not shared */
cld