From de4310af6f6dbeedd7432683d1d1fe12ce48f46e Mon Sep 17 00:00:00 2001 From: Aaron Durbin Date: Fri, 27 Jun 2014 16:43:59 -0500 Subject: [PATCH] t132: own main() for romstage There's no reason to duplicate code in the mainboards. Therefore, drive the flow of romstage boot in the SoC. This allows for easier scaling with multiple devices. BUG=None BRANCH=None TEST=Built and booted to same place as before. Change-Id: I0d4df84034b19353daad0da1f722b820596c4f55 Signed-off-by: Aaron Durbin Reviewed-on: https://chromium-review.googlesource.com/205992 Reviewed-by: Furquan Shaikh --- src/mainboard/google/rush/Makefile.inc | 3 +-- src/mainboard/google/rush/sdram_configs.c | 3 +-- src/soc/nvidia/tegra132/Makefile.inc | 1 + src/soc/nvidia/tegra132/bootblock.c | 3 ++- .../nvidia/tegra132/include/soc}/sdram_configs.h | 8 ++++---- .../google/rush => soc/nvidia/tegra132}/romstage.c | 7 ++++--- 6 files changed, 13 insertions(+), 12 deletions(-) rename src/{mainboard/google/rush => soc/nvidia/tegra132/include/soc}/sdram_configs.h (81%) rename src/{mainboard/google/rush => soc/nvidia/tegra132}/romstage.c (89%) diff --git a/src/mainboard/google/rush/Makefile.inc b/src/mainboard/google/rush/Makefile.inc index 746af11392..6f4a7748ed 100644 --- a/src/mainboard/google/rush/Makefile.inc +++ b/src/mainboard/google/rush/Makefile.inc @@ -32,8 +32,7 @@ bootblock-y += bootblock.c bootblock-y += pmic.c bootblock-y += reset.c -romstage-y += romstage.c romstage-y += reset.c romstage-y += sdram_configs.c -ramstage-y += mainboard.c \ No newline at end of file +ramstage-y += mainboard.c diff --git a/src/mainboard/google/rush/sdram_configs.c b/src/mainboard/google/rush/sdram_configs.c index f33e176e5b..462fec2afe 100644 --- a/src/mainboard/google/rush/sdram_configs.c +++ b/src/mainboard/google/rush/sdram_configs.c @@ -18,8 +18,7 @@ */ #include -#include -#include "sdram_configs.h" +#include static struct sdram_params sdram_configs[] = { #include "bct/sdram-hynix-2GB-924.inc" /* ram_code = 0000 */ diff --git a/src/soc/nvidia/tegra132/Makefile.inc b/src/soc/nvidia/tegra132/Makefile.inc index b2e04bd8a8..3bf4bf75d3 100644 --- a/src/soc/nvidia/tegra132/Makefile.inc +++ b/src/soc/nvidia/tegra132/Makefile.inc @@ -26,6 +26,7 @@ romstage-y += spi.c romstage-y += i2c.c romstage-y += dma.c romstage-y += monotonic_timer.c +romstage-y += romstage.c romstage-y += sdram.c romstage-y += sdram_lp0.c romstage-y += ../tegra/gpio.c diff --git a/src/soc/nvidia/tegra132/bootblock.c b/src/soc/nvidia/tegra132/bootblock.c index 62e5228829..ad78f51f16 100644 --- a/src/soc/nvidia/tegra132/bootblock.c +++ b/src/soc/nvidia/tegra132/bootblock.c @@ -68,7 +68,8 @@ void main(void) printk(BIOS_INFO, "T132 bootblock: Mainboard bootblock init done\n"); - entry = cbfs_load_stage(CBFS_DEFAULT_MEDIA, "fallback/romstage"); + entry = cbfs_load_stage(CBFS_DEFAULT_MEDIA, + CONFIG_CBFS_PREFIX "/romstage"); if (entry) { printk(BIOS_INFO, "T132 bootblock: jumping to romstage\n"); diff --git a/src/mainboard/google/rush/sdram_configs.h b/src/soc/nvidia/tegra132/include/soc/sdram_configs.h similarity index 81% rename from src/mainboard/google/rush/sdram_configs.h rename to src/soc/nvidia/tegra132/include/soc/sdram_configs.h index e00e9ca04c..300be1093c 100644 --- a/src/mainboard/google/rush/sdram_configs.h +++ b/src/soc/nvidia/tegra132/include/soc/sdram_configs.h @@ -17,12 +17,12 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#ifndef __MAINBOARD_GOOGLE_RUSH_SDRAM_CONFIG_H__ -#define __MAINBOARD_GOOGLE_RUSH_SDRAM_CONFIG_H__ +#ifndef __SOC_NVIDIA_TEGRA132_SDRAM_CONFIGS_H__ +#define __SOC_NVIDIA_TEGRA132_SDRAM_CONFIGS_H__ -#include +#include /* Loads SDRAM configurations for current system. */ const struct sdram_params *get_sdram_config(void); -#endif /* __MAINBOARD_GOOGLE_RUSH_SDRAM_CONFIG_H__ */ +#endif /* __SOC_NVIDIA_TEGRA132_SDRAM_CONFIGS_H__ */ diff --git a/src/mainboard/google/rush/romstage.c b/src/soc/nvidia/tegra132/romstage.c similarity index 89% rename from src/mainboard/google/rush/romstage.c rename to src/soc/nvidia/tegra132/romstage.c index 9db52989f7..20429a5e53 100644 --- a/src/mainboard/google/rush/romstage.c +++ b/src/soc/nvidia/tegra132/romstage.c @@ -22,7 +22,7 @@ #include #include -#include "sdram_configs.h" +#include #include void main(void) @@ -40,6 +40,7 @@ void main(void) while (1); - entry = cbfs_load_stage(CBFS_DEFAULT_MEDIA, "fallback/ramstage"); - stage_exit(entry); + entry = cbfs_load_stage(CBFS_DEFAULT_MEDIA, + CONFIG_CBFS_PREFIX "/ramstage"); + stage_exit(entry); }