diff --git a/src/Kconfig b/src/Kconfig index f926f2e266..8d3d831df9 100644 --- a/src/Kconfig +++ b/src/Kconfig @@ -281,14 +281,6 @@ source src/soc/Kconfig endmenu -config CPU_HAS_BOOTBLOCK_INIT - bool - default n - -config MAINBOARD_HAS_BOOTBLOCK_INIT - bool - default n - source src/device/Kconfig menu "Generic Drivers" diff --git a/src/arch/arm/armv4/bootblock_simple.c b/src/arch/arm/armv4/bootblock_simple.c index 80401b3951..517e4d1bb0 100644 --- a/src/arch/arm/armv4/bootblock_simple.c +++ b/src/arch/arm/armv4/bootblock_simple.c @@ -26,12 +26,15 @@ #include #include +__attribute__((weak)) void bootblock_soc_init(void) { /* do nothing */ } +__attribute__((weak)) void bootblock_mainboard_init(void) { /* do nothing */ } + void main(void) { const char *stage_name = "fallback/romstage"; void *entry; - bootblock_cpu_init(); + bootblock_soc_init(); bootblock_mainboard_init(); if (CONFIG_BOOTBLOCK_CONSOLE) { diff --git a/src/arch/arm/armv7/bootblock_simple.c b/src/arch/arm/armv7/bootblock_simple.c index 27261df98d..5e7ba2035a 100644 --- a/src/arch/arm/armv7/bootblock_simple.c +++ b/src/arch/arm/armv7/bootblock_simple.c @@ -27,11 +27,14 @@ #include #include +__attribute__((weak)) void bootblock_soc_init(void) { /* do nothing */ } +__attribute__((weak)) void bootblock_mainboard_init(void) { /* do nothing */ } + void main(void) { void *entry = (void *)-1; - bootblock_cpu_init(); + bootblock_soc_init(); bootblock_mainboard_init(); if (CONFIG_BOOTBLOCK_CONSOLE) { diff --git a/src/arch/arm/include/bootblock_common.h b/src/arch/arm/include/bootblock_common.h index 72a4ba9fce..413a206177 100644 --- a/src/arch/arm/include/bootblock_common.h +++ b/src/arch/arm/include/bootblock_common.h @@ -1,17 +1,27 @@ -#if CONFIG_CPU_HAS_BOOTBLOCK_INIT -void bootblock_cpu_init(void); -#else -static void __attribute__((unused)) bootblock_cpu_init(void) -{ -} -#endif +/* + * This file is part of the coreboot project. + * + * Copyright 2014 Google Inc. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; version 2 of the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ -#if CONFIG_MAINBOARD_HAS_BOOTBLOCK_INIT +#ifndef __ARCH_BOOTBLOCK_COMMON_H +#define __ARCH_BOOTBLOCK_COMMON_H + +/* These are defined as weak no-ops that can be overridden by mainboard/SoC. */ void bootblock_mainboard_init(void); -#else -static void __attribute__((unused)) bootblock_mainboard_init(void) -{ -} -#endif - void bootblock_soc_init(void); + +#endif /* __ARCH_BOOTBLOCK_COMMON_H */ diff --git a/src/cpu/armltd/armv8/Kconfig b/src/cpu/armltd/armv8/Kconfig index 19575671d4..13a712c18f 100644 --- a/src/cpu/armltd/armv8/Kconfig +++ b/src/cpu/armltd/armv8/Kconfig @@ -6,10 +6,5 @@ config CPU_ARMLTD_ARMV8 if CPU_ARMLTD_ARMV8 -config BOOTBLOCK_CPU_INIT - string - default "cpu/armltd/armv8/bootblock.c" - help - CPU/SoC-specific bootblock code. endif diff --git a/src/cpu/armltd/armv8/bootblock.c b/src/cpu/armltd/armv8/bootblock.c deleted file mode 100644 index 8925439d2a..0000000000 --- a/src/cpu/armltd/armv8/bootblock.c +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright (C) 2013 Google, Inc. - * - * This software is licensed under the terms of the GNU General Public - * License version 2, as published by the Free Software Foundation, and - * may be copied, distributed, and modified under those terms. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - */ - -void bootblock_cpu_init(void); -void bootblock_cpu_init(void) -{ -} diff --git a/src/cpu/armltd/cortex-a9/Kconfig b/src/cpu/armltd/cortex-a9/Kconfig index 7b4231bfc7..91dbdb9211 100644 --- a/src/cpu/armltd/cortex-a9/Kconfig +++ b/src/cpu/armltd/cortex-a9/Kconfig @@ -8,10 +8,4 @@ config CPU_ARMLTD_CORTEX_A9 if CPU_ARMLTD_CORTEX_A9 -config BOOTBLOCK_CPU_INIT - string - default "cpu/armltd/cortex-a9/bootblock.c" - help - CPU/SoC-specific bootblock code. - endif diff --git a/src/cpu/armltd/cortex-a9/bootblock.c b/src/cpu/armltd/cortex-a9/bootblock.c deleted file mode 100644 index 8925439d2a..0000000000 --- a/src/cpu/armltd/cortex-a9/bootblock.c +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright (C) 2013 Google, Inc. - * - * This software is licensed under the terms of the GNU General Public - * License version 2, as published by the Free Software Foundation, and - * may be copied, distributed, and modified under those terms. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - */ - -void bootblock_cpu_init(void); -void bootblock_cpu_init(void) -{ -} diff --git a/src/mainboard/google/storm/Makefile.inc b/src/mainboard/google/storm/Makefile.inc index 80727b6adb..6ee0841dc3 100644 --- a/src/mainboard/google/storm/Makefile.inc +++ b/src/mainboard/google/storm/Makefile.inc @@ -17,7 +17,6 @@ ## Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA ## -bootblock-y += bootblock.c bootblock-y += cdp.c romstage-y += romstage.c diff --git a/src/mainboard/google/storm/bootblock.c b/src/mainboard/google/storm/bootblock.c deleted file mode 100644 index 03f214a5cb..0000000000 --- a/src/mainboard/google/storm/bootblock.c +++ /dev/null @@ -1,25 +0,0 @@ -/* - * This file is part of the coreboot project. - * - * Copyright 2014 Google Inc. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; version 2 of the License. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include - -void bootblock_mainboard_init(void) -{ - bootblock_soc_init(); -} diff --git a/src/soc/marvell/bg4cd/bootblock.c b/src/soc/marvell/bg4cd/bootblock.c index e7ce203d46..236a71810a 100644 --- a/src/soc/marvell/bg4cd/bootblock.c +++ b/src/soc/marvell/bg4cd/bootblock.c @@ -19,6 +19,7 @@ #include -void bootblock_cpu_init(void) +void bootblock_soc_init(void) { +/* TODO: I assume this is a placeholder. If it's not really needed delete it. */ } diff --git a/src/soc/rockchip/rk3288/bootblock.c b/src/soc/rockchip/rk3288/bootblock.c index 8f6c92d0dc..006af727d1 100644 --- a/src/soc/rockchip/rk3288/bootblock.c +++ b/src/soc/rockchip/rk3288/bootblock.c @@ -28,7 +28,7 @@ #include #include -void bootblock_cpu_init(void) +void bootblock_soc_init(void) { rk3288_init_timer(); diff --git a/src/soc/samsung/exynos5250/bootblock.c b/src/soc/samsung/exynos5250/bootblock.c index d4655e3557..dd0e01c87c 100644 --- a/src/soc/samsung/exynos5250/bootblock.c +++ b/src/soc/samsung/exynos5250/bootblock.c @@ -21,7 +21,7 @@ #include #include -void bootblock_cpu_init(void) +void bootblock_soc_init(void) { /* kick off the multi-core timer. * We want to do this as early as we can. diff --git a/src/soc/samsung/exynos5420/bootblock.c b/src/soc/samsung/exynos5420/bootblock.c index 26877dd36c..f347677b94 100644 --- a/src/soc/samsung/exynos5420/bootblock.c +++ b/src/soc/samsung/exynos5420/bootblock.c @@ -28,7 +28,7 @@ #define SRAM_SIZE 1 #define SRAM_END (SRAM_START + SRAM_SIZE) /* plus one... */ -void bootblock_cpu_init(void) +void bootblock_soc_init(void) { /* kick off the multi-core timer. * We want to do this as early as we can.