LinuxBios support for Via Mini-ITX motherboard

Steve M. Gehlbach steve at nexpath.com
Wed Oct 9 23:02:00 CEST 2002


> > I spent some time on it.  It has trouble to jump to hardwaremain from
> > crt0.base somehow.  I'm tracking it at the moment.
>
> When I had this problem it always got back to a DRAM issue.
>

I agree. Below is my favorite "check and see if the copy worked" hack for
crt0.base.  There is an extra pattern test if the copy fails for some reason
or other that I don't remember.  Maybe we ought to always compare ram to
flash as a sanity check after the copy.

-Steve

// see if copy succeeded
        leal    EXT(_liseg), %esi
        leal    EXT(_iseg), %edi
        cmpl    %esi, %edi
        jz      .Lnocopy
        movl    $EXT(_eliseg), %ecx
        subl    %esi, %ecx
        jz      .Lnocopy                /* should not happen */
0:      cmpsb
        jnz .failed
        loop 0b

        CONSOLE_DEBUG_TX_STRING($str_success)
        jmp .Lnocopy

.failed:
        CONSOLE_DEBUG_TX_STRING($str_failed)
        CONSOLE_DEBUG_TX_HEX32(%ecx)
        CONSOLE_DEBUG_TX_STRING($str_crlf)
        leal    EXT(_liseg), %esi
        movl    $0xa5a5a5a5,0(%esi)
        movl    0(%esi),%eax
        cmpl    $0xa5a5a5a5,%eax
        jne 1f
        CONSOLE_DEBUG_TX_STRING($str_g1)
        jmp .Lnocopy
1:
        CONSOLE_DEBUG_TX_STRING($str_f1)
        CONSOLE_DEBUG_TX_STRING($str_failed)
        CONSOLE_DEBUG_TX_HEX32(%eax)
        CONSOLE_DEBUG_TX_STRING($str_crlf)
        jmp . - 2
        hlt     /* no sense in going on */

.Lnocopy ....

(at the end)

str_success:   .string "\n\rRam compare succeeded.\r\n"
str_failed:    .string "\n\rRam compare failed: val: "
str_crlf:      .string "\n\r"
str_f1:        .string "test 1 failed.\n\r"
str_g1:        .string "test 1 okay.\n\r"




More information about the coreboot mailing list