[coreboot-gerrit] New patch to review for coreboot: 1d70c87 armv7-m: add armv7-m configuration

Patrick Georgi (pgeorgi@google.com) gerrit at coreboot.org
Wed Apr 8 11:45:40 CEST 2015


Patrick Georgi (pgeorgi at google.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/9379

-gerrit

commit 1d70c87101cd214e7bfd6e4a5b417f3d7490cb85
Author: Daisuke Nojiri <dnojiri at chromium.org>
Date:   Tue Oct 21 11:18:20 2014 -0700

    armv7-m: add armv7-m configuration
    
    this change adds armv7-m configuration for bootblock and verstage.
    
    BUG=none
    TEST=Built cosmos, daisy_spring, falco, lumpy, nyan, nyan_blaze,
    rush_ryu, storm, veyron_pinky
    BRANCH=none
    Signed-off-by: Daisuke Nojiri <dnojiri at chromium.org>
    
    Change-Id: Ib2496e33d5690c91c8fff0f101ec31837c8809bc
    Signed-off-by: Patrick Georgi <pgeorgi at chromium.org>
    Original-Commit-Id: 34b838ebdcb0506799d86b64204f54a171114304
    Original-Change-Id: I1c899d8969b1f8d0fa4cff617099d222bc4b4f4b
    Original-Reviewed-on: https://chromium-review.googlesource.com/224772
    Original-Reviewed-by: Vadim Bendebury <vbendeb at chromium.org>
    Original-Commit-Queue: Daisuke Nojiri <dnojiri at chromium.org>
    Original-Tested-by: Daisuke Nojiri <dnojiri at chromium.org>
---
 src/arch/arm/armv7/Kconfig            |  6 ++++
 src/arch/arm/armv7/Makefile.inc       | 57 ++++++++++++++++++++++-------------
 src/arch/arm/armv7/bootblock_simple.c |  1 -
 src/arch/arm/armv7/exception_m.c      | 36 ++++++++++++++++++++++
 util/xcompile/xcompile                |  2 +-
 5 files changed, 79 insertions(+), 23 deletions(-)

diff --git a/src/arch/arm/armv7/Kconfig b/src/arch/arm/armv7/Kconfig
index aa188e2..0ab3542 100644
--- a/src/arch/arm/armv7/Kconfig
+++ b/src/arch/arm/armv7/Kconfig
@@ -13,3 +13,9 @@ config ARCH_ROMSTAGE_ARMV7
 config ARCH_RAMSTAGE_ARMV7
 	def_bool n
 	select ARCH_RAMSTAGE_ARM
+config ARCH_BOOTBLOCK_ARMV7_M
+	def_bool n
+	select ARCH_BOOTBLOCK_ARM
+config ARCH_VERSTAGE_ARMV7_M
+	def_bool n
+	select ARCH_VERSTAGE_ARM
diff --git a/src/arch/arm/armv7/Makefile.inc b/src/arch/arm/armv7/Makefile.inc
index dac4276..951118a 100644
--- a/src/arch/arm/armv7/Makefile.inc
+++ b/src/arch/arm/armv7/Makefile.inc
@@ -19,16 +19,21 @@
 ##
 ###############################################################################
 
-armv7_flags = -march=armv7-a -mthumb \
-	-I$(src)/arch/arm/include/armv7/ -D__COREBOOT_ARM_ARCH__=7
-armv7_asm_flags = $(armv7_flags) -Wa,-mthumb -Wa,-mimplicit-it=always \
-	-Wa,-mno-warn-deprecated
+armv7_flags = -mthumb -I$(src)/arch/arm/include/armv7/ -D__COREBOOT_ARM_ARCH__=7
+armv7-a_flags = -march=armv7-a $(armv7_flags)
+armv7-m_flags = -march=armv7-m $(armv7_flags)
+
+armv7_asm_flags = -Wa,-mthumb -Wa,-mimplicit-it=always -Wa,-mno-warn-deprecated
+armv7-a_asm_flags = $(armv7-a_flags) $(armv7_asm_flags)
+armv7-m_asm_flags = $(armv7-m_flags) $(armv7_asm_flags)
 
 ###############################################################################
 # bootblock
 ###############################################################################
 
 ifeq ($(CONFIG_ARCH_BOOTBLOCK_ARMV7),y)
+bootblock-c-ccopts += $(armv7-a_flags)
+bootblock-S-ccopts += $(armv7-a_asm_flags)
 
 ifneq ($(CONFIG_ARM_BOOTBLOCK_CUSTOM),y)
 bootblock-y += bootblock.S
@@ -41,8 +46,14 @@ bootblock-$(CONFIG_BOOTBLOCK_CONSOLE) += exception.c
 bootblock-$(CONFIG_BOOTBLOCK_CONSOLE) += exception_asm.S
 bootblock-y += mmu.c
 
-bootblock-c-ccopts += $(armv7_flags)
-bootblock-S-ccopts += $(armv7_asm_flags)
+else ifeq ($(CONFIG_ARCH_BOOTBLOCK_ARMV7_M),y)
+bootblock-c-ccopts += $(armv7-m_flags)
+bootblock-S-ccopts += $(armv7-m_asm_flags)
+
+ifneq ($(CONFIG_ARM_BOOTBLOCK_CUSTOM),y)
+bootblock-y += bootblock_simple.c
+bootblock-y += exception_m.c
+endif
 
 endif # CONFIG_ARCH_BOOTBLOCK_ARMV7
 
@@ -50,23 +61,27 @@ endif # CONFIG_ARCH_BOOTBLOCK_ARMV7
 ## verification stage
 ################################################################################
 
-ifeq ($(CONFIG_ARCH_VERSTAGE_ARM_V7),y)
+ifeq ($(CONFIG_ARCH_VERSTAGE_ARMV7),y)
+verstage-c-ccopts += $(armv7-a_flags)
+verstage-S-ccopts += $(armv7-a_asm_flags)
 
-verstage-c-ccopts += $(armv7_flags)
-verstage-S-ccopts += $(armv7_asm_flags)
 verstage-y += cache.c
 verstage-y += cpu.S
 verstage-y += exception.c
 verstage-y += exception_asm.S
 verstage-y += mmu.c
 
-endif # CONFIG_ARCH_VERSTAGE_ARMV7
+else ifeq ($(CONFIG_ARCH_VERSTAGE_ARMV7_M),y)
+verstage-c-ccopts += $(armv7-m_flags)
+verstage-S-ccopts += $(armv7-m_asm_flags)
 
-###############################################################################
-# romstage
-###############################################################################
+endif # CONFIG_ARCH_VERSTAGE_ARMV7_M
 
+################################################################################
+## ROM stage
+################################################################################
 ifeq ($(CONFIG_ARCH_ROMSTAGE_ARMV7),y)
+>>>>>>> 34b838e... armv7-m: add armv7-m configuration
 
 romstage-y += cache.c
 romstage-y += cpu.S
@@ -75,11 +90,11 @@ romstage-y += exception_asm.S
 romstage-y += mmu.c
 romstage-$(CONFIG_COLLECT_TIMESTAMPS) += timestamp.c
 
-romstage-c-ccopts += $(armv7_flags)
-romstage-S-ccopts += $(armv7_asm_flags)
+romstage-c-ccopts += $(armv7-a_flags)
+romstage-S-ccopts += $(armv7-a_asm_flags)
 
-rmodules_arm-c-ccopts += $(armv7_flags)
-rmodules_arm-S-ccopts += $(armv7_asm_flags)
+rmodules_arm-c-ccopts += $(armv7-a_flags)
+rmodules_arm-S-ccopts += $(armv7-a_asm_flags)
 
 endif # CONFIG_ARCH_ROMSTAGE_ARMV7
 
@@ -96,10 +111,10 @@ ramstage-y += exception_asm.S
 ramstage-y += mmu.c
 ramstage-$(CONFIG_COLLECT_TIMESTAMPS) += timestamp.c
 
-ramstage-c-ccopts += $(armv7_flags)
-ramstage-S-ccopts += $(armv7_asm_flags)
+ramstage-c-ccopts += $(armv7-a_flags)
+ramstage-S-ccopts += $(armv7-a_asm_flags)
 
 # All rmodule code is armv7 if ramstage is armv7.
-rmodules_arm-c-ccopts += $(armv7_flags)
-rmodules_arm-S-ccopts += $(armv7_asm_flags)
+rmodules_arm-c-ccopts += $(armv7-a_flags)
+rmodules_arm-S-ccopts += $(armv7-a_asm_flags)
 endif # CONFIG_ARCH_RAMSTAGE_ARMV7
diff --git a/src/arch/arm/armv7/bootblock_simple.c b/src/arch/arm/armv7/bootblock_simple.c
index 96f2445..450e5b4 100644
--- a/src/arch/arm/armv7/bootblock_simple.c
+++ b/src/arch/arm/armv7/bootblock_simple.c
@@ -19,7 +19,6 @@
  * MA 02110-1301 USA
  */
 
-#include <arch/cache.h>
 #include <arch/exception.h>
 #include <arch/stages.h>
 #include <bootblock_common.h>
diff --git a/src/arch/arm/armv7/exception_m.c b/src/arch/arm/armv7/exception_m.c
new file mode 100644
index 0000000..d76cc6a
--- /dev/null
+++ b/src/arch/arm/armv7/exception_m.c
@@ -0,0 +1,36 @@
+/*
+ * This file is part of the libpayload project.
+ *
+ * Copyright 2013 Google Inc.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ *    derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include <arch/exception.h>
+#include <console/console.h>
+
+void exception_init(void)
+{
+	printk(BIOS_DEBUG, "Exception handlers not installed.\n");
+}
diff --git a/util/xcompile/xcompile b/util/xcompile/xcompile
index 5809ec0..c4bab81 100755
--- a/util/xcompile/xcompile
+++ b/util/xcompile/xcompile
@@ -179,7 +179,7 @@ arch_config_arm() {
 	TBFDARCHS="littlearm"
 	TCLIST="armv7a armv7-a"
 	TWIDTH="32"
-	TSUPP="arm armv4 armv7"
+	TSUPP="arm armv4 armv7 armv7_m"
 	TABI="eabi"
 }
 



More information about the coreboot-gerrit mailing list