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@chromium.org>

Change-Id: I1c899d8969b1f8d0fa4cff617099d222bc4b4f4b
Reviewed-on: https://chromium-review.googlesource.com/224772
Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
Commit-Queue: Daisuke Nojiri <dnojiri@chromium.org>
Tested-by: Daisuke Nojiri <dnojiri@chromium.org>
This commit is contained in:
Daisuke Nojiri 2014-10-21 11:18:20 -07:00 committed by chrome-internal-fetch
commit 34b838ebdc
4 changed files with 75 additions and 19 deletions

View file

@ -10,3 +10,9 @@ config ARCH_ROMSTAGE_ARM_V7
config ARCH_RAMSTAGE_ARM_V7
def_bool n
select ARCH_RAMSTAGE_ARM
config ARCH_BOOTBLOCK_ARM_V7_M
def_bool n
select ARCH_BOOTBLOCK_ARM
config ARCH_VERSTAGE_ARM_V7_M
def_bool n
select ARCH_VERSTAGE_ARM

View file

@ -19,15 +19,20 @@
##
################################################################################
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_ARM_V7),y)
bootblock-c-ccopts += $(armv7-a_flags)
bootblock-S-ccopts += $(armv7-a_asm_flags)
ifneq ($(CONFIG_ARM_BOOTBLOCK_CUSTOM),y)
bootblock-y += bootblock.S
@ -39,25 +44,37 @@ 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_ARM_V7_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
################################################################################
## Verification stage
################################################################################
ifeq ($(CONFIG_ARCH_VERSTAGE_ARM_V7),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
else ifeq ($(CONFIG_ARCH_VERSTAGE_ARM_V7_M),y)
verstage-c-ccopts += $(armv7-m_flags)
verstage-S-ccopts += $(armv7-m_asm_flags)
endif
################################################################################
## ROM stage
################################################################################
@ -69,11 +86,11 @@ romstage-y += exception.c
romstage-y += exception_asm.S
romstage-y += mmu.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
################################################################################
@ -87,10 +104,9 @@ ramstage-y += exception.c
ramstage-y += exception_asm.S
ramstage-y += mmu.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)
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

View file

@ -19,14 +19,12 @@
* MA 02110-1301 USA
*/
#include <arch/cache.h>
#include <arch/exception.h>
#include <arch/hlt.h>
#include <arch/stages.h>
#include <bootblock_common.h>
#include <cbfs.h>
#include <console/console.h>
#include <delay.h>
#include <vendorcode/google/chromeos/chromeos.h>
void main(void)

View file

@ -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");
}