diff options
author | Stefan Reinauer <stepan@openbios.org> | 2005-12-01 10:54:44 +0000 |
---|---|---|
committer | Stefan Reinauer <stepan@openbios.org> | 2005-12-01 10:54:44 +0000 |
commit | 806e146e754a44f96c693cde707065b14f80d8a2 (patch) | |
tree | e8e174faffc6f7674b93b5b34d17ef3fa716c32f /src/cpu/amd/car/post_cache_as_ram.c | |
parent | 70597f96c45e225a42f395cdf16b4ad62459dc3b (diff) |
Applying 11_26_car_tyan.diff from Yinghai Lu.
NOTE: This will break the tree so it can be fixed up later
git-svn-id: svn://svn.coreboot.org/coreboot/trunk@2115 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Diffstat (limited to 'src/cpu/amd/car/post_cache_as_ram.c')
-rw-r--r-- | src/cpu/amd/car/post_cache_as_ram.c | 48 |
1 files changed, 31 insertions, 17 deletions
diff --git a/src/cpu/amd/car/post_cache_as_ram.c b/src/cpu/amd/car/post_cache_as_ram.c index b78ce77211..fec5905822 100644 --- a/src/cpu/amd/car/post_cache_as_ram.c +++ b/src/cpu/amd/car/post_cache_as_ram.c @@ -1,3 +1,19 @@ + +#include "cpu/amd/car/disable_cache_as_ram.c" + +#include "cpu/amd/car/clear_1m_ram.c" + +static inline void print_debug_pcar(const char *strval, uint32_t val) +{ +#if CONFIG_USE_INIT + printk_debug("%s%08x\r\n", strval, val); +#else + print_debug(strval); print_debug_hex32(val); print_debug("\r\n"); +#endif +} + + + static void post_cache_as_ram(unsigned cpu_reset) { @@ -10,19 +26,11 @@ static void post_cache_as_ram(unsigned cpu_reset) "movl %%esp, %0\n\t" : "=a" (v_esp) ); -#if CONFIG_USE_INIT - printk_debug("v_esp=%08x\r\n", v_esp); -#else - print_debug("v_esp="); print_debug_hex32(v_esp); print_debug("\r\n"); -#endif + print_debug_pcar("v_esp=", v_esp); } #endif -#if CONFIG_USE_INIT - printk_debug("cpu_reset = %08x\r\n",cpu_reset); -#else - print_debug("cpu_reset = "); print_debug_hex32(cpu_reset); print_debug("\r\n"); -#endif + print_debug_pcar("cpu_reset = ",cpu_reset); if(cpu_reset == 0) { print_debug("Clearing initial memory region: "); @@ -35,12 +43,19 @@ static void post_cache_as_ram(unsigned cpu_reset) ::"a" (cpu_reset) ); -#include "cpu/amd/car/disable_cache_as_ram.c" + disable_cache_as_ram(); if(cpu_reset==0) { // cpu_reset don't need to clear it -#include "cpu/amd/car/clear_1m_ram.c" + clear_1m_ram(); } +#if 0 + int i; + for(i=0;i<0x800000;i++) { + outb(0x66, 0x80); + } +#endif + __asm__ volatile ( /* set new esp */ /* before _RAMBASE */ "subl %0, %%ebp\n\t" @@ -58,6 +73,7 @@ static void post_cache_as_ram(unsigned cpu_reset) ); print_debug("Use Ram as Stack now - "); /* but We can not go back any more, we lost old stack data in cache as ram*/ + if(new_cpu_reset==0) { print_debug("done\r\n"); } else @@ -65,11 +81,9 @@ static void post_cache_as_ram(unsigned cpu_reset) print_debug("\r\n"); } -#if CONFIG_USE_INIT - printk_debug("new_cpu_reset = %08x\r\n", new_cpu_reset); -#else - print_debug("new_cpu_reset = "); print_debug_hex32(new_cpu_reset); print_debug("\r\n"); -#endif + print_debug_pcar("new_cpu_reset = ", new_cpu_reset); + + /*copy and execute linuxbios_ram */ copy_and_run(new_cpu_reset); /* We will not return */ |