diff --git a/src/arch/arm/armv4/bootblock_simple.c b/src/arch/arm/armv4/bootblock_simple.c index 9917dbb5aa..80401b3951 100644 --- a/src/arch/arm/armv4/bootblock_simple.c +++ b/src/arch/arm/armv4/bootblock_simple.c @@ -19,6 +19,7 @@ * MA 02110-1301 USA */ +#include #include #include #include @@ -33,8 +34,10 @@ void main(void) bootblock_cpu_init(); bootblock_mainboard_init(); - if (CONFIG_BOOTBLOCK_CONSOLE) + if (CONFIG_BOOTBLOCK_CONSOLE) { console_init(); + exception_init(); + } entry = cbfs_load_stage(CBFS_DEFAULT_MEDIA, stage_name); diff --git a/src/arch/arm/armv7/Makefile.inc b/src/arch/arm/armv7/Makefile.inc index 99560dd241..5bdd0e4418 100644 --- a/src/arch/arm/armv7/Makefile.inc +++ b/src/arch/arm/armv7/Makefile.inc @@ -33,6 +33,8 @@ endif bootblock-$(CONFIG_ARM_BOOTBLOCK_SIMPLE) += bootblock_simple.c bootblock-$(CONFIG_ARM_BOOTBLOCK_NORMAL) += bootblock_normal.c bootblock-y += cache.c +bootblock-$(CONFIG_BOOTBLOCK_CONSOLE) += exception.c +bootblock-$(CONFIG_BOOTBLOCK_CONSOLE) += exception_asm.S bootblock-y += mmu.c bootblock-c-ccopts += $(armv7_flags) diff --git a/src/arch/arm/armv7/bootblock_simple.c b/src/arch/arm/armv7/bootblock_simple.c index 809441bb57..bacff5a854 100644 --- a/src/arch/arm/armv7/bootblock_simple.c +++ b/src/arch/arm/armv7/bootblock_simple.c @@ -20,6 +20,7 @@ */ #include +#include #include #include #include @@ -51,8 +52,10 @@ void main(void) bootblock_cpu_init(); bootblock_mainboard_init(); - if (CONFIG_BOOTBLOCK_CONSOLE) + if (CONFIG_BOOTBLOCK_CONSOLE) { console_init(); + exception_init(); + } entry = cbfs_load_stage(CBFS_DEFAULT_MEDIA, stage_name); diff --git a/src/arch/arm/include/armv4/arch/exception.h b/src/arch/arm/include/armv4/arch/exception.h new file mode 100644 index 0000000000..a426c52aca --- /dev/null +++ b/src/arch/arm/include/armv4/arch/exception.h @@ -0,0 +1,35 @@ +/* + * This file is part of the coreboot 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. + */ + +#ifndef _ARCH_EXCEPTION_H +#define _ARCH_EXCEPTION_H + +static void exception_init(void) { /* not implemented */ } + +#endif diff --git a/src/arch/arm/include/arch/exception.h b/src/arch/arm/include/armv7/arch/exception.h similarity index 100% rename from src/arch/arm/include/arch/exception.h rename to src/arch/arm/include/armv7/arch/exception.h diff --git a/src/arch/x86/include/arch/exception.h b/src/arch/x86/include/arch/exception.h new file mode 100644 index 0000000000..a426c52aca --- /dev/null +++ b/src/arch/x86/include/arch/exception.h @@ -0,0 +1,35 @@ +/* + * This file is part of the coreboot 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. + */ + +#ifndef _ARCH_EXCEPTION_H +#define _ARCH_EXCEPTION_H + +static void exception_init(void) { /* not implemented */ } + +#endif diff --git a/src/lib/hardwaremain.c b/src/lib/hardwaremain.c index f72323cd81..30d6cf5456 100644 --- a/src/lib/hardwaremain.c +++ b/src/lib/hardwaremain.c @@ -22,6 +22,7 @@ * C Bootstrap code for the coreboot */ +#include #include #include #include @@ -462,6 +463,7 @@ void main(void) post_code(POST_CONSOLE_BOOT_MSG); + exception_init(); threads_initialize(); /* Schedule the static boot state entries. */ diff --git a/src/mainboard/google/nyan/romstage.c b/src/mainboard/google/nyan/romstage.c index e36d4c0a0e..ecfa20d898 100644 --- a/src/mainboard/google/nyan/romstage.c +++ b/src/mainboard/google/nyan/romstage.c @@ -95,6 +95,7 @@ void main(void) configure_l2actlr(); console_init(); + exception_init(); mmu_init(); mmu_config_range(0, DRAM_START, DCACHE_OFF); @@ -106,8 +107,6 @@ void main(void) dcache_invalidate_all(); dcache_mmu_enable(); - exception_init(); - /* for quality of the user interface, it's important to get * the video going ASAP. Because there are long delays in some * of the powerup steps, we do some very early setup here in diff --git a/src/mainboard/google/pit/mainboard.c b/src/mainboard/google/pit/mainboard.c index c0650d8542..c07db7b85f 100644 --- a/src/mainboard/google/pit/mainboard.c +++ b/src/mainboard/google/pit/mainboard.c @@ -27,7 +27,6 @@ #include #include #include -#include #include #include #include @@ -472,10 +471,6 @@ static void mainboard_enable(device_t dev) mmu_config_range(DMA_START >> 20, DMA_SIZE >> 20, DCACHE_OFF); tlb_invalidate_all(); - /* this is going to move, but we must have it now and we're - * not sure where */ - exception_init(); - const unsigned epll_hz = 192000000; const unsigned sample_rate = 48000; const unsigned lr_frame_size = 256; diff --git a/src/mainboard/google/pit/romstage.c b/src/mainboard/google/pit/romstage.c index a00ffad67c..8559163d0c 100644 --- a/src/mainboard/google/pit/romstage.c +++ b/src/mainboard/google/pit/romstage.c @@ -26,6 +26,7 @@ #include #include +#include #include #include #include @@ -250,6 +251,7 @@ void main(void) exynos_pinmux_uart3(); console_init(); + exception_init(); if (power_init_failed) die("Failed to intialize power.\n"); diff --git a/src/mainboard/google/snow/mainboard.c b/src/mainboard/google/snow/mainboard.c index 99a4e30a79..0b6cf4ae83 100644 --- a/src/mainboard/google/snow/mainboard.c +++ b/src/mainboard/google/snow/mainboard.c @@ -27,7 +27,6 @@ #include #include #include -#include #include #include #include @@ -338,10 +337,6 @@ static void mainboard_enable(device_t dev) dcache_invalidate_all(); dcache_mmu_enable(); - /* this is going to move, but we must have it now and we're - * not sure where */ - exception_init(); - const unsigned epll_hz = 192000000; const unsigned sample_rate = 48000; const unsigned lr_frame_size = 256; diff --git a/src/mainboard/google/snow/romstage.c b/src/mainboard/google/snow/romstage.c index 56907ed301..2fa5b298a8 100644 --- a/src/mainboard/google/snow/romstage.c +++ b/src/mainboard/google/snow/romstage.c @@ -25,6 +25,7 @@ #include #include +#include #include #include #include @@ -160,6 +161,7 @@ void main(void) mem = setup_clock(); console_init(); + exception_init(); setup_power(is_resume); #if CONFIG_COLLECT_TIMESTAMPS diff --git a/src/soc/nvidia/tegra124/bootblock.c b/src/soc/nvidia/tegra124/bootblock.c index 3355ce34c2..a85bad02a7 100644 --- a/src/soc/nvidia/tegra124/bootblock.c +++ b/src/soc/nvidia/tegra124/bootblock.c @@ -17,6 +17,7 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ +#include #include #include #include @@ -39,8 +40,10 @@ void main(void) PINMUX_TRISTATE | PINMUX_INPUT_ENABLE); - if (CONFIG_BOOTBLOCK_CONSOLE) + if (CONFIG_BOOTBLOCK_CONSOLE) { console_init(); + exception_init(); + } clock_init();