aboutsummaryrefslogtreecommitdiff
path: root/src/mainboard/google/snow/romstage.c
diff options
context:
space:
mode:
authorHung-Te Lin <hungte@chromium.org>2013-02-04 14:38:03 +0800
committerRonald G. Minnich <rminnich@gmail.com>2013-02-07 06:10:09 +0100
commit5f83f6cb7a3f179482db54aaff38f23795dc1acf (patch)
treebd94e259d2ae6fab8e4b993d04215b0964d8bf5f /src/mainboard/google/snow/romstage.c
parentc720d8d5d419d8e9128392cd7ab90e3a3fca1d4b (diff)
armv7: Clean up arm/snow bootblock build process.
Remove duplicated / testing code and share more driver for bootblock, romstage and ramstage. The __PRE_RAM__ is now also defined in bootblock build stage, since bootblock is executed before RAM is initialized. Change-Id: I4f5469b1545631eee1cf9f2f5df93cbe3a58268b Signed-off-by: Hung-Te Lin <hungte@chromium.org> Reviewed-on: http://review.coreboot.org/2282 Tested-by: build bot (Jenkins) Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
Diffstat (limited to 'src/mainboard/google/snow/romstage.c')
-rw-r--r--src/mainboard/google/snow/romstage.c59
1 files changed, 7 insertions, 52 deletions
diff --git a/src/mainboard/google/snow/romstage.c b/src/mainboard/google/snow/romstage.c
index 690d4aace8..b8e5116b22 100644
--- a/src/mainboard/google/snow/romstage.c
+++ b/src/mainboard/google/snow/romstage.c
@@ -47,15 +47,12 @@ static int board_wakeup_permitted(void)
void main(void)
{
- struct cbfs_media cbfs;
-// i2c_init(CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE);
-// power_init();
-// clock_init();
-// exynos_pinmux_config(PERIPH_ID_UART3, PINMUX_FLAG_NONE);
- console_init();
- printk(BIOS_INFO, "hello from romstage\n");
struct mem_timings *mem;
int ret;
+ void *entry;
+
+ console_init();
+ printk(BIOS_INFO, "hello from romstage\n");
mem = get_mem_timings();
if (!mem) {
@@ -76,51 +73,9 @@ void main(void)
}
printk(BIOS_INFO, "ddr3_init done\n");
- /* wow, did it work? */
- int i;
- u32 *c = (void *)CONFIG_RAMBASE;
-
-// mmu_setup(CONFIG_SYS_SDRAM_BASE, CONFIG_DRAM_SIZE_MB * 1024);
-// printk(BIOS_INFO, "mmu_setup done\n");
- for(i = 0; i < 16384; i++)
- c[i] = i+32768;
- for(i = 0; i < 16384; i++)
- if (c[i] != i+32768)
- printk(BIOS_SPEW, "BADc[%02x]: %02x,", i, c[i]);
- for(i = 0; i < 1048576; i++)
- c[i] = 0;
-
- ret = init_default_cbfs_media(&cbfs);
- if (ret){
- printk(BIOS_ERR, "init_default_cbfs_media returned %d: HALT\n",
- ret);
- while (1);
- }
-
- struct cbfs_stage *stage = (struct cbfs_stage *)
- cbfs_get_file_content(&cbfs, "fallback/coreboot_ram",
- CBFS_TYPE_STAGE);
- printk(BIOS_ERR, "Stage: %p\n", stage);
- printk(BIOS_ERR, "loading stage %s @ 0x%x (0x%x bytes),entry @ 0x%p\n",
- "ram stage",
- (uint32_t) stage->load, stage->memlen,
- (void *)(u32)stage->entry);
-
-#if 0
- /* for reference and testing ... we should be able to remove soon */
-// c = (void *)(u32)(stage->load + stage->len);
- c = (void *)(u32)(stage->load);
- printk(BIOS_ERR, "memzero 0x%x words starting at %p\n",
- (stage->memlen /*- stage->len*/)/4, c);
- for(i = 0; i < (stage->memlen /*- stage->len*/)/4; i++){
- printk(BIOS_INFO, "%p, ", &c[i]);
- c[i] = 0;
- }
-#endif
- void *entry = cbfs_load_stage(&cbfs, "fallback/coreboot_ram");
- printk(BIOS_INFO, "entry is %p\n", entry);
+ entry = cbfs_load_stage(CBFS_DEFAULT_MEDIA, "fallback/coreboot_ram");
+ printk(BIOS_INFO, "entry is 0x%p, leaving romstage.\n", entry);
- printk(BIOS_INFO, "sayonara, romstage!\n");
- stage_exit((unsigned long)entry);
+ stage_exit(entry);
}