From a66393fdd6fe68757e394b8a611e610f1938771d Mon Sep 17 00:00:00 2001 From: Gabe Black Date: Sun, 29 Sep 2013 05:40:13 -0700 Subject: [PATCH] ARM: Make it possible to use a custom bootblock implementation. Tegra needs to use a custom bootblock implementation because it starts on a coprocessor which uses ARMv4. It doesn't have the same control registers, caches, etc., and the regular bootblock gets exceptions and dies. BUG=None TEST=Built for pit. With this and other changes, built and booted on nyan and verified that it got into the bootblock. BRANCH=None Change-Id: Id197db2939bc840ad64244d6e2017fc5c89e0cbd Signed-off-by: Gabe Black Reviewed-on: https://chromium-review.googlesource.com/171018 Reviewed-by: Ronald Minnich Commit-Queue: Gabe Black Tested-by: Gabe Black --- src/arch/armv7/Kconfig | 12 +++++++----- src/arch/armv7/Makefile.inc | 5 ++++- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/src/arch/armv7/Kconfig b/src/arch/armv7/Kconfig index c1a2c4c469..99e857c72d 100644 --- a/src/arch/armv7/Kconfig +++ b/src/arch/armv7/Kconfig @@ -14,9 +14,16 @@ config MAX_REBOOT_CNT int default 3 +# If a custom bootblock is necessary, this option should be "select"-ed by +# the thing that needs it, probably the CPU. +config ARM_BOOTBLOCK_CUSTOM + bool + default n + choice prompt "Bootblock behaviour" default ARM_BOOTBLOCK_SIMPLE + depends on !ARM_BOOTBLOCK_CUSTOM config ARM_BOOTBLOCK_SIMPLE bool "Always load fallback" @@ -34,11 +41,6 @@ config MAINBOARD_HAS_BOOTBLOCK_INIT bool default n -config BOOTBLOCK_SOURCE - string - default "bootblock_simple.c" if ARM_BOOTBLOCK_SIMPLE - default "bootblock_normal.c" if ARM_BOOTBLOCK_NORMAL - config UPDATE_IMAGE bool "Update existing coreboot.rom image" default n diff --git a/src/arch/armv7/Makefile.inc b/src/arch/armv7/Makefile.inc index f81243bf94..11a5e78cd8 100644 --- a/src/arch/armv7/Makefile.inc +++ b/src/arch/armv7/Makefile.inc @@ -34,10 +34,13 @@ bootblock-$(CONFIG_BOOTBLOCK_CONSOLE) += early_console.c bootblock-y += cache.c bootblock-y += mmu.c +ifneq ($(CONFIG_ARM_BOOTBLOCK_CUSTOM),y) bootblock-y += bootblock.S +endif bootblock-y += id.S $(obj)/arch/armv7/id.bootblock.o: $(obj)/build.h -bootblock-y += $(call strip_quotes,$(CONFIG_BOOTBLOCK_SOURCE)) +bootblock-$(CONFIG_ARM_BOOTBLOCK_SIMPLE) += bootblock_simple.c +bootblock-$(CONFIG_ARM_BOOTBLOCK_NORMAL) += bootblock_normal.c bootblock-y += stages.c romstage-y += stages.c