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 <gabeblack@google.com>
Reviewed-on: https://chromium-review.googlesource.com/171018
Reviewed-by: Ronald Minnich <rminnich@chromium.org>
Commit-Queue: Gabe Black <gabeblack@chromium.org>
Tested-by: Gabe Black <gabeblack@chromium.org>
diff --git a/src/arch/armv7/Kconfig b/src/arch/armv7/Kconfig
index c1a2c4c..99e857c 100644
--- a/src/arch/armv7/Kconfig
+++ b/src/arch/armv7/Kconfig
@@ -14,9 +14,16 @@
 	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 @@
 	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 f81243b..11a5e78 100644
--- a/src/arch/armv7/Makefile.inc
+++ b/src/arch/armv7/Makefile.inc
@@ -34,10 +34,13 @@
 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