From 3ea7307b531b1a78c692e4f71a0d81b32108ebf0 Mon Sep 17 00:00:00 2001 From: Vadim Bendebury Date: Thu, 1 May 2014 12:15:46 -0700 Subject: [PATCH] ipq8064: storm: re-arrange bootblock initialization The recent addition of the storm bootblock initialization broke compilation of Exynos platforms. The SOC specific code needs to be kept in the respective source files, not in the common CPU code. As of now coreboot does not provide a separate SOC initialization API. In general it makes sense to invoke SOC initialization from the board initialization code, as the board knows what SOC it is running on. Presently all what's need initialization on 8064 is the timer. This patch adds the SOC initialization framework for 8064 and moves there the related code. BUG=chrome-os-partner:27784 TEST=manual . nyan_big, peach_pit, and storm targets build fine now. Change-Id: Iae9a021f8cbf7d009770b02d798147a3e08420e8 Signed-off-by: Vadim Bendebury Reviewed-on: https://chromium-review.googlesource.com/197835 --- src/arch/arm/armv7/bootblock_simple.c | 5 ----- src/arch/arm/include/bootblock_common.h | 2 ++ src/mainboard/google/storm/Makefile.inc | 1 + src/mainboard/google/storm/bootblock.c | 25 ++++++++++++++++++++++++ src/mainboard/google/storm/mainboard.c | 5 ++--- src/soc/qualcomm/ipq806x/Makefile.inc | 20 +++++++++++++++++++ src/soc/qualcomm/ipq806x/bootblock.c | 26 +++++++++++++++++++++++++ 7 files changed, 76 insertions(+), 8 deletions(-) create mode 100644 src/mainboard/google/storm/bootblock.c create mode 100644 src/soc/qualcomm/ipq806x/bootblock.c diff --git a/src/arch/arm/armv7/bootblock_simple.c b/src/arch/arm/armv7/bootblock_simple.c index 24020e6c5c..2ea441336c 100644 --- a/src/arch/arm/armv7/bootblock_simple.c +++ b/src/arch/arm/armv7/bootblock_simple.c @@ -46,8 +46,3 @@ void main(void) if (entry) stage_exit(entry); hlt(); } - -void bootblock_mainboard_init(void) -{ - init_timer(); -} diff --git a/src/arch/arm/include/bootblock_common.h b/src/arch/arm/include/bootblock_common.h index 034a12bc36..72a4ba9fce 100644 --- a/src/arch/arm/include/bootblock_common.h +++ b/src/arch/arm/include/bootblock_common.h @@ -13,3 +13,5 @@ static void __attribute__((unused)) bootblock_mainboard_init(void) { } #endif + +void bootblock_soc_init(void); diff --git a/src/mainboard/google/storm/Makefile.inc b/src/mainboard/google/storm/Makefile.inc index ababd2dc27..e55646adb3 100644 --- a/src/mainboard/google/storm/Makefile.inc +++ b/src/mainboard/google/storm/Makefile.inc @@ -17,6 +17,7 @@ ## 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 new file mode 100644 index 0000000000..03f214a5cb --- /dev/null +++ b/src/mainboard/google/storm/bootblock.c @@ -0,0 +1,25 @@ +/* + * 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/mainboard/google/storm/mainboard.c b/src/mainboard/google/storm/mainboard.c index a781e30b50..89ed8dae45 100644 --- a/src/mainboard/google/storm/mainboard.c +++ b/src/mainboard/google/storm/mainboard.c @@ -1,7 +1,7 @@ /* * This file is part of the coreboot project. * - * Copyright 2013 Google Inc. + * 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 @@ -18,12 +18,11 @@ */ #include -#include #include static void mainboard_init(device_t dev) { - init_timer(); + /* Not sure if this is needed at all */ } static void mainboard_enable(device_t dev) diff --git a/src/soc/qualcomm/ipq806x/Makefile.inc b/src/soc/qualcomm/ipq806x/Makefile.inc index ec83dad2c0..73bdb6ead8 100644 --- a/src/soc/qualcomm/ipq806x/Makefile.inc +++ b/src/soc/qualcomm/ipq806x/Makefile.inc @@ -1,3 +1,23 @@ +## +## 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 +## + +bootblock-y += bootblock.c bootblock-y += cbfs.c bootblock-y += clock.c bootblock-y += gpio.c diff --git a/src/soc/qualcomm/ipq806x/bootblock.c b/src/soc/qualcomm/ipq806x/bootblock.c new file mode 100644 index 0000000000..a079d42922 --- /dev/null +++ b/src/soc/qualcomm/ipq806x/bootblock.c @@ -0,0 +1,26 @@ +/* + * 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 +#include + +void bootblock_soc_init(void) +{ + init_timer(); +}