diff options
author | Stefan Reinauer <stepan@openbios.org> | 2005-12-02 21:52:30 +0000 |
---|---|---|
committer | Stefan Reinauer <stepan@openbios.org> | 2005-12-02 21:52:30 +0000 |
commit | 7ce8c54e2ba89059d28790550a8f74907b54b916 (patch) | |
tree | e89df947fbe9e3f85d6082af6926038e9fe8e61a /src/cpu/amd/car | |
parent | c2455dc0ce210b3da2b14be8885803ff47a781eb (diff) | |
download | coreboot-7ce8c54e2ba89059d28790550a8f74907b54b916.tar.xz |
1201_ht_bus0_dev0_fidvid_core.diff
https://openbios.org/roundup/linuxbios/issue41
Lord have mercy upon us.
git-svn-id: svn://svn.coreboot.org/coreboot/trunk@2118 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Diffstat (limited to 'src/cpu/amd/car')
-rw-r--r-- | src/cpu/amd/car/clear_1m_ram.c | 3 | ||||
-rw-r--r-- | src/cpu/amd/car/copy_and_run.c | 33 | ||||
-rw-r--r-- | src/cpu/amd/car/disable_cache_as_ram.c | 5 |
3 files changed, 24 insertions, 17 deletions
diff --git a/src/cpu/amd/car/clear_1m_ram.c b/src/cpu/amd/car/clear_1m_ram.c index 85ba59cf73..80b215e502 100644 --- a/src/cpu/amd/car/clear_1m_ram.c +++ b/src/cpu/amd/car/clear_1m_ram.c @@ -1,5 +1,7 @@ /* by yhlu 6.2005 */ /* be warned, this file will be used core 0/node 0 only */ +static inline __attribute__((always_inline)) void clear_1m_ram(void) +{ __asm__ volatile ( /* disable cache */ @@ -51,3 +53,4 @@ "invd\n\t" ); +} diff --git a/src/cpu/amd/car/copy_and_run.c b/src/cpu/amd/car/copy_and_run.c index 89a864d4fc..9c6508b8d7 100644 --- a/src/cpu/amd/car/copy_and_run.c +++ b/src/cpu/amd/car/copy_and_run.c @@ -28,10 +28,18 @@ #define GETBIT(bb, src, ilen) GETBIT_LE32(bb, src, ilen) #endif +static inline void print_debug_cp_run(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 copy_and_run(unsigned cpu_reset) { uint8_t *src, *dst; - unsigned long dst_len; unsigned long ilen = 0, olen = 0, last_m_off = 1; uint32_t bb = 0; unsigned bc = 0; @@ -44,9 +52,9 @@ static void copy_and_run(unsigned cpu_reset) "leal _iseg, %1\n\t" "leal _eiseg, %2\n\t" "subl %1, %2\n\t" - : "=a" (src), "=b" (dst), "=c" (dst_len) + : "=a" (src), "=b" (dst), "=c" (olen) ); - memcpy(src, dst, dst_len); + memcpy(src, dst, olen); #else __asm__ volatile ( @@ -55,13 +63,10 @@ static void copy_and_run(unsigned cpu_reset) : "=a" (src) , "=b" (dst) ); -#if CONFIG_USE_INIT - printk_debug("src=%08x\r\n",src); - printk_debug("dst=%08x\r\n",dst); -#else - print_debug("src="); print_debug_hex32(src); print_debug("\r\n"); - print_debug("dst="); print_debug_hex32(dst); print_debug("\r\n"); -#endif + print_debug_cp_run("src=",(uint32_t)src); + print_debug_cp_run("dst=",(uint32_t)dst); + +// dump_mem(src, src+0x100); for(;;) { unsigned int m_off, m_len; @@ -105,11 +110,9 @@ static void copy_and_run(unsigned cpu_reset) } #endif // dump_mem(dst, dst+0x100); -#if CONFIG_USE_INIT - printk_debug("linxbios_ram.bin length = %08x\r\n", olen); -#else - print_debug("linxbios_ram.bin length = "); print_debug_hex32(olen); print_debug("\r\n"); -#endif + + print_debug_cp_run("linxbios_ram.bin length = ", olen); + print_debug("Jumping to LinuxBIOS.\r\n"); if(cpu_reset == 1 ) { diff --git a/src/cpu/amd/car/disable_cache_as_ram.c b/src/cpu/amd/car/disable_cache_as_ram.c index a699cae99b..06a558f413 100644 --- a/src/cpu/amd/car/disable_cache_as_ram.c +++ b/src/cpu/amd/car/disable_cache_as_ram.c @@ -1,11 +1,12 @@ /* by yhlu 6.2005 */ /* be warned, this file will be used other cores and core 0 / node 0 */ +static inline __attribute__((always_inline)) void disable_cache_as_ram(void) +{ __asm__ volatile ( /* FIXME : backup stack in CACHE_AS_RAM into mmx and sse and after we get STACK up, we restore that. It is only needed if we want to go back */ - /* We don't need cache as ram for now on */ /* disable cache */ "movl %cr0, %eax\n\t" @@ -42,5 +43,5 @@ "movl %cr0, %eax\n\t" "andl $0x9fffffff,%eax\n\t" "movl %eax, %cr0\n\t" - ); +} |