On Sat, Nov 1, 2008 at 1:06 AM, Corey Osgood corey.osgood@gmail.com wrote:
Debug log attached, I'm using COM2 so I modified the patch to use $760 instead of $1016, I hope that's right. I'm honestly not sure if the output is what you were expecting or not, I don't think it is though. One thing I noticed in the build log, with or without the patch, dunno if it matters or not:
/home/corey/coreboot/coreboot-v3/arch/x86/via/stage1.c: In function 'disable_car': /home/corey/coreboot/coreboot-v3/arch/x86/via/stage1.c:49: warning: passing argument 1 of 'memcpy' discards qualifiers from pointer target type
Thanks, Corey
I should have also mentioned that I didn't trim anything, the serial console hangs at the end of the log file, but the post code keeps changing, so I'm assuming something is going on but nothing's going to the console.
-Corey
On Fri, Oct 31, 2008 at 9:59 PM, Carl-Daniel Hailfinger < c-d.hailfinger.devel.2006@gmx.net> wrote:
On 01.11.2008 02:50, Carl-Daniel Hailfinger wrote:
On 31.10.2008 01:36, Corey Osgood wrote:
debug log attached.
Thanks, the log was really informative. Can you apply the following patch and report back? Yes, the patch is evil, but it may help track down the issue.
And the patch had minor garbage in it. New patch follows:
Index: arch/x86/via/stage1.c
--- arch/x86/via/stage1.c (Revision 976) +++ arch/x86/via/stage1.c (Arbeitskopie) @@ -29,12 +29,14 @@ #include <string.h> #include <mtrr.h> #include <via_c7.h> +#include <uart8250.h>
/**
- Disable Cache As RAM (CAR) after memory is setup.
*/ void disable_car(void) {
printk(BIOS_DEBUG, "disable_car entry\n"); /* Determine new global variable location. Stack organization from
top * Top 4 bytes are reserved * Pointer to global variables @@ -45,9 +47,19 @@ const struct global_vars *newlocation = (struct global_vars *)((RAM_STACK_BASE - sizeof(struct global_vars *) - sizeof(struct global_vars)) & ~0x7); /* Copy global variables to new location. */ memcpy(newlocation, global_vars(), sizeof(struct global_vars));
printk(BIOS_DEBUG, "disable_car global_vars copy done\n"); /* Set the new global variable pointer. */ *(struct global_vars **)(RAM_STACK_BASE - sizeof(struct global_vars
*)) = newlocation;
printk(BIOS_DEBUG, "disable_car global_vars pointer adjusted,
entering asm code...");
printk(BIOS_DEBUG,
"now..........................................................................\n");
uart8250_tx_byte(TTYSx_BASE, 'F');
uart8250_tx_byte(TTYSx_BASE, 'O');
uart8250_tx_byte(TTYSx_BASE, 'O');
uart8250_tx_byte(TTYSx_BASE, 'B');
uart8250_tx_byte(TTYSx_BASE, 'A');
uart8250_tx_byte(TTYSx_BASE, 'R');
uart8250_tx_byte(TTYSx_BASE, '\n'); __asm__ __volatile__( /* We don't need cache as ram for now on */ /* disable cache */
@@ -55,6 +67,52 @@ " orl $(0x1<<30),%%eax \n" " movl %%eax, %%cr0 \n"
" movl $99, %%edx\n"
" movl $1016, %%eax\n"
" call uart8250_tx_byte\n"
" movl $97, %%edx\n"
" movl $1016, %%eax\n"
" call uart8250_tx_byte\n"
" movl $99, %%edx\n"
" movl $1016, %%eax\n"
" call uart8250_tx_byte\n"
" movl $104, %%edx\n"
" movl $1016, %%eax\n"
" call uart8250_tx_byte\n"
" movl $101, %%edx\n"
" movl $1016, %%eax\n"
" call uart8250_tx_byte\n"
" movl $32, %%edx\n"
" movl $1016, %%eax\n"
" call uart8250_tx_byte\n"
" movl $100, %%edx\n"
" movl $1016, %%eax\n"
" call uart8250_tx_byte\n"
" movl $105, %%edx\n"
" movl $1016, %%eax\n"
" call uart8250_tx_byte\n"
" movl $115, %%edx\n"
" movl $1016, %%eax\n"
" call uart8250_tx_byte\n"
" movl $97, %%edx\n"
" movl $1016, %%eax\n"
" call uart8250_tx_byte\n"
" movl $98, %%edx\n"
" movl $1016, %%eax\n"
" call uart8250_tx_byte\n"
" movl $108, %%edx\n"
" movl $1016, %%eax\n"
" call uart8250_tx_byte\n"
" movl $101, %%edx\n"
" movl $1016, %%eax\n"
" call uart8250_tx_byte\n"
" movl $100, %%edx\n"
" movl $1016, %%eax\n"
" call uart8250_tx_byte\n"
" movl $10, %%edx\n"
" movl $1016, %%eax\n"
" call uart8250_tx_byte\n"
/* disable fixed mtrr from now on, it will be enabled by
coreboot_ram again*/ " movl %[_SYSCFG_MSR], %%ecx \n" " rdmsr \n" @@ -64,6 +122,67 @@ " wrmsr \n" #warning Must clear MTRR 0x200 and 0x201
" movl $102, %%edx\n"
" movl $1016, %%eax\n"
" call uart8250_tx_byte\n"
" movl $105, %%edx\n"
" movl $1016, %%eax\n"
" call uart8250_tx_byte\n"
" movl $120, %%edx\n"
" movl $1016, %%eax\n"
" call uart8250_tx_byte\n"
" movl $101, %%edx\n"
" movl $1016, %%eax\n"
" call uart8250_tx_byte\n"
" movl $100, %%edx\n"
" movl $1016, %%eax\n"
" call uart8250_tx_byte\n"
" movl $32, %%edx\n"
" movl $1016, %%eax\n"
" call uart8250_tx_byte\n"
" movl $109, %%edx\n"
" movl $1016, %%eax\n"
" call uart8250_tx_byte\n"
" movl $116, %%edx\n"
" movl $1016, %%eax\n"
" call uart8250_tx_byte\n"
" movl $114, %%edx\n"
" movl $1016, %%eax\n"
" call uart8250_tx_byte\n"
" movl $114, %%edx\n"
" movl $1016, %%eax\n"
" call uart8250_tx_byte\n"
" movl $32, %%edx\n"
" movl $1016, %%eax\n"
" call uart8250_tx_byte\n"
" movl $100, %%edx\n"
" movl $1016, %%eax\n"
" call uart8250_tx_byte\n"
" movl $105, %%edx\n"
" movl $1016, %%eax\n"
" call uart8250_tx_byte\n"
" movl $115, %%edx\n"
" movl $1016, %%eax\n"
" call uart8250_tx_byte\n"
" movl $97, %%edx\n"
" movl $1016, %%eax\n"
" call uart8250_tx_byte\n"
" movl $98, %%edx\n"
" movl $1016, %%eax\n"
" call uart8250_tx_byte\n"
" movl $108, %%edx\n"
" movl $1016, %%eax\n"
" call uart8250_tx_byte\n"
" movl $101, %%edx\n"
" movl $1016, %%eax\n"
" call uart8250_tx_byte\n"
" movl $100, %%edx\n"
" movl $1016, %%eax\n"
" call uart8250_tx_byte\n"
" movl $10, %%edx\n"
" movl $1016, %%eax\n"
" call uart8250_tx_byte\n"
/* Set the default memory type and disable fixed and enable
variable MTRRs */ " movl %[_MTRRdefType_MSR], %%ecx \n" " xorl %%edx, %%edx \n" @@ -71,14 +190,202 @@ " movl $0x00000800, %%eax \n" " wrmsr \n"
" movl $118, %%edx\n"
" movl $1016, %%eax\n"
" call uart8250_tx_byte\n"
" movl $97, %%edx\n"
" movl $1016, %%eax\n"
" call uart8250_tx_byte\n"
" movl $114, %%edx\n"
" movl $1016, %%eax\n"
" call uart8250_tx_byte\n"
" movl $105, %%edx\n"
" movl $1016, %%eax\n"
" call uart8250_tx_byte\n"
" movl $97, %%edx\n"
" movl $1016, %%eax\n"
" call uart8250_tx_byte\n"
" movl $98, %%edx\n"
" movl $1016, %%eax\n"
" call uart8250_tx_byte\n"
" movl $108, %%edx\n"
" movl $1016, %%eax\n"
" call uart8250_tx_byte\n"
" movl $101, %%edx\n"
" movl $1016, %%eax\n"
" call uart8250_tx_byte\n"
" movl $32, %%edx\n"
" movl $1016, %%eax\n"
" call uart8250_tx_byte\n"
" movl $109, %%edx\n"
" movl $1016, %%eax\n"
" call uart8250_tx_byte\n"
" movl $116, %%edx\n"
" movl $1016, %%eax\n"
" call uart8250_tx_byte\n"
" movl $114, %%edx\n"
" movl $1016, %%eax\n"
" call uart8250_tx_byte\n"
" movl $114, %%edx\n"
" movl $1016, %%eax\n"
" call uart8250_tx_byte\n"
" movl $115, %%edx\n"
" movl $1016, %%eax\n"
" call uart8250_tx_byte\n"
" movl $32, %%edx\n"
" movl $1016, %%eax\n"
" call uart8250_tx_byte\n"
" movl $101, %%edx\n"
" movl $1016, %%eax\n"
" call uart8250_tx_byte\n"
" movl $110, %%edx\n"
" movl $1016, %%eax\n"
" call uart8250_tx_byte\n"
" movl $97, %%edx\n"
" movl $1016, %%eax\n"
" call uart8250_tx_byte\n"
" movl $98, %%edx\n"
" movl $1016, %%eax\n"
" call uart8250_tx_byte\n"
" movl $108, %%edx\n"
" movl $1016, %%eax\n"
" call uart8250_tx_byte\n"
" movl $101, %%edx\n"
" movl $1016, %%eax\n"
" call uart8250_tx_byte\n"
" movl $100, %%edx\n"
" movl $1016, %%eax\n"
" call uart8250_tx_byte\n"
" movl $10, %%edx\n"
" movl $1016, %%eax\n"
" call uart8250_tx_byte\n"
/* enable cache */ " movl %%cr0, %%eax \n" " andl $0x9fffffff,%%eax \n" " movl %%eax, %%cr0 \n"
" movl $99, %%edx\n"
" movl $1016, %%eax\n"
" call uart8250_tx_byte\n"
" movl $97, %%edx\n"
" movl $1016, %%eax\n"
" call uart8250_tx_byte\n"
" movl $99, %%edx\n"
" movl $1016, %%eax\n"
" call uart8250_tx_byte\n"
" movl $104, %%edx\n"
" movl $1016, %%eax\n"
" call uart8250_tx_byte\n"
" movl $101, %%edx\n"
" movl $1016, %%eax\n"
" call uart8250_tx_byte\n"
" movl $32, %%edx\n"
" movl $1016, %%eax\n"
" call uart8250_tx_byte\n"
" movl $101, %%edx\n"
" movl $1016, %%eax\n"
" call uart8250_tx_byte\n"
" movl $110, %%edx\n"
" movl $1016, %%eax\n"
" call uart8250_tx_byte\n"
" movl $97, %%edx\n"
" movl $1016, %%eax\n"
" call uart8250_tx_byte\n"
" movl $98, %%edx\n"
" movl $1016, %%eax\n"
" call uart8250_tx_byte\n"
" movl $108, %%edx\n"
" movl $1016, %%eax\n"
" call uart8250_tx_byte\n"
" movl $101, %%edx\n"
" movl $1016, %%eax\n"
" call uart8250_tx_byte\n"
" movl $100, %%edx\n"
" movl $1016, %%eax\n"
" call uart8250_tx_byte\n"
" movl $10, %%edx\n"
" movl $1016, %%eax\n"
" call uart8250_tx_byte\n"
" wbinvd \n"
" movl $119, %%edx\n"
" movl $1016, %%eax\n"
" call uart8250_tx_byte\n"
" movl $98, %%edx\n"
" movl $1016, %%eax\n"
" call uart8250_tx_byte\n"
" movl $105, %%edx\n"
" movl $1016, %%eax\n"
" call uart8250_tx_byte\n"
" movl $110, %%edx\n"
" movl $1016, %%eax\n"
" call uart8250_tx_byte\n"
" movl $118, %%edx\n"
" movl $1016, %%eax\n"
" call uart8250_tx_byte\n"
" movl $100, %%edx\n"
" movl $1016, %%eax\n"
" call uart8250_tx_byte\n"
" movl $32, %%edx\n"
" movl $1016, %%eax\n"
" call uart8250_tx_byte\n"
" movl $100, %%edx\n"
" movl $1016, %%eax\n"
" call uart8250_tx_byte\n"
" movl $111, %%edx\n"
" movl $1016, %%eax\n"
" call uart8250_tx_byte\n"
" movl $110, %%edx\n"
" movl $1016, %%eax\n"
" call uart8250_tx_byte\n"
" movl $101, %%edx\n"
" movl $1016, %%eax\n"
" call uart8250_tx_byte\n"
" movl $10, %%edx\n"
" movl $1016, %%eax\n"
" call uart8250_tx_byte\n"
" movl %[newesp], %%esp \n"
" movl $101, %%edx\n"
" movl $1016, %%eax\n"
" call uart8250_tx_byte\n"
" movl $115, %%edx\n"
" movl $1016, %%eax\n"
" call uart8250_tx_byte\n"
" movl $112, %%edx\n"
" movl $1016, %%eax\n"
" call uart8250_tx_byte\n"
" movl $32, %%edx\n"
" movl $1016, %%eax\n"
" call uart8250_tx_byte\n"
" movl $99, %%edx\n"
" movl $1016, %%eax\n"
" call uart8250_tx_byte\n"
" movl $104, %%edx\n"
" movl $1016, %%eax\n"
" call uart8250_tx_byte\n"
" movl $97, %%edx\n"
" movl $1016, %%eax\n"
" call uart8250_tx_byte\n"
" movl $110, %%edx\n"
" movl $1016, %%eax\n"
" call uart8250_tx_byte\n"
" movl $103, %%edx\n"
" movl $1016, %%eax\n"
" call uart8250_tx_byte\n"
" movl $101, %%edx\n"
" movl $1016, %%eax\n"
" call uart8250_tx_byte\n"
" movl $100, %%edx\n"
" movl $1016, %%eax\n"
" call uart8250_tx_byte\n"
" movl $10, %%edx\n"
" movl $1016, %%eax\n"
" call uart8250_tx_byte\n"
" call stage1_phase3 \n" :: [newesp] "i" (newlocation), [_SYSCFG_MSR] "i" (SYSCFG_MSR),
Index: arch/x86/stage1.c
--- arch/x86/stage1.c (Revision 976) +++ arch/x86/stage1.c (Arbeitskopie) @@ -263,6 +263,7 @@ #ifdef CONFIG_CONSOLE_BUFFER /* Move the printk buffer to PRINTK_BUF_ADDR_RAM */ printk_buffer_move((void *)PRINTK_BUF_ADDR_RAM, PRINTK_BUF_SIZE_RAM);
printk(BIOS_DEBUG, "Done printk() buffer move\n");
#endif /* Turn off Cache-As-Ram */ disable_car();