fix caching problem

git-svn-id: svn://svn.coreboot.org/coreboot/trunk@1382 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
This commit is contained in:
Greg Watson 2004-03-07 17:38:43 +00:00
parent 7780fc6404
commit c762e55fc9
2 changed files with 12 additions and 8 deletions

View File

@ -72,6 +72,13 @@ void jmp_to_elf_entry(void *entry, unsigned long buffer)
void (*kernel_entry)(void); void (*kernel_entry)(void);
kernel_entry = entry; kernel_entry = entry;
/*
* Kernel will invalidate and disable dcache immediately on
* entry. This is bad if we've been using it, which we
* have. Make sure it is flushed to memory.
*/
flush_dcache();
/* On ppc we don't currently support loading over LinuxBIOS. /* On ppc we don't currently support loading over LinuxBIOS.
* So ignore the buffer. * So ignore the buffer.
*/ */
@ -79,5 +86,3 @@ void jmp_to_elf_entry(void *entry, unsigned long buffer)
/* Jump to kernel */ /* Jump to kernel */
kernel_entry(); kernel_entry();
} }

View File

@ -32,6 +32,11 @@ void ppc_main(void)
sdram_init(); sdram_init();
/*
* Flush cache now that memory is enabled.
*/
flush_dcache();
/* /*
* Relocate payload (text & data) if necessary * Relocate payload (text & data) if necessary
*/ */
@ -42,12 +47,6 @@ void ppc_main(void)
*to++ = *from++; *to++ = *from++;
} }
/*
* Flush cache to memory because linux will try and
* invalidate it.
*/
flush_dcache();
payload(); payload();
/* NOT REACHED */ /* NOT REACHED */