2 * This file is part of the coreboot project.
4 * Copyright (C) 2007-2009 coresystems GmbH
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License as
8 * published by the Free Software Foundation; version 2 of
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
22 #include "cpu/x86/car/copy_and_run.c"
24 /* called from assembler code */
25 void stage1_main(unsigned long bist);
28 void real_main(unsigned long bist);
30 void stage1_main(unsigned long bist)
32 unsigned int cpu_reset = 0;
36 /* No servicable parts below this line .. */
38 /* Check value of esp to verify if we have enough rom for stack in Cache as RAM */
44 printk(BIOS_SPEW, "v_esp=%08x\n", v_esp);
47 printk(BIOS_SPEW, "cpu_reset = %08x\n", cpu_reset);
48 printk(BIOS_SPEW, "No cache as ram now - ");
50 /* store cpu_reset to ebx */
56 #undef CLEAR_FIRST_1M_RAM
57 #include "cache_as_ram_post.c"
59 /* For now: use rambase + 1MB - 64K (counting downwards) as stack. This
60 * makes sure that we stay completely within the 1M of memory we
61 * preserve with the memcpy above.
64 #ifndef HIGH_MEMORY_SAVE
65 #define HIGH_MEMORY_SAVE ( (1024 - 64) * 1024 )
71 :: "a" (CONFIG_RAMBASE + HIGH_MEMORY_SAVE)
75 unsigned new_cpu_reset;
77 /* get back cpu_reset from ebx */
83 /* Copy and execute coreboot_ram */
84 copy_and_run(new_cpu_reset);
87 /* We will not return */
88 printk(BIOS_DEBUG, "sorry. parachute did not open.\n");