[LinuxBIOS] romcc and epia

Ben Hewson ben at hewson-venieri.com
Tue Sep 12 20:17:24 CEST 2006


I have been looking through auto.inc and it would be very helpful if
besides
printing the line no inside auto.c, it would also print the actual C line.

Does anyone know how easy this would be to do ?


The reason I am asking this is because of the problem I am having with
the epia code.


There is this bit of C code

    // SDRAM in all banks
    pci_write_config8(north, 0x60, 0x3F);

    // DRAM timing. I'm suspicious of this
    // This is for all banks, 64 is 0,1.  65 is 2,3. 66 is 4,5.
    // ras precharge 4T, RAS pulse 5T
    // cas2 is 0xd6, cas3 is 0xe6
    // we're also backing off write pulse width to 2T, so result is 0xee

#if DIMM_CL2
    pci_write_config8(north, 0x64, 0xd6);
    pci_write_config8(north, 0x65, 0xd6);
    pci_write_config8(north, 0x66, 0xd6);
#else                // CL=3
    pci_write_config8(north, 0x64, 0xe6);
    pci_write_config8(north, 0x65, 0xe6);
    pci_write_config8(north, 0x66, 0xe6);
#endif


    print_debug_hex8(pci_read_config8(north, 0x64));
    print_debug_hex8(pci_read_config8(north, 0x65));
    print_debug_hex8(pci_read_config8(north, 0x66));

ok now loking at the serial output I get the following snippet

1106 0601
ece6e6init 1 done

the important bit is the ece6e6

Ok now as you can see it is not writing to the register properly. So I
am now looking
through auto.inc and trying to find the relevant code. While I will be
honest and say
at the moment I do not 100% understand it, I can never the less find the
relevant
assembler code. Anyway this is it


**********
     first bit I think is for this line
    pci_write_config8(north, 0x60, 0x3F);
***********

    mov  $63 , %al
    mov  $3324 , %dx
    outb %al, %dx
    /* ,:0.0 */
    /*
     * pci_write_config8,romcc_io.h:148.38
     * sdram_set_registers,raminit.c:164.26
     * main,auto.c:107.28
     */
    /* ,:0.0 */
    /*
     * __builtin_outl,<built-in>:1.0
     * outl,io.h:25.23
     * pci_write_config8,romcc_io.h:148.13
     * sdram_set_registers,raminit.c:164.26
     * main,auto.c:107.28
     */
    mov  $-2147483548 , %eax
    mov  $3320 , %dx
    outl %eax, %dx
    /* ,:0.0 */
    /*
     * __builtin_outb,<built-in>:1.0
     * outb,io.h:15.23
     * pci_write_config8,romcc_io.h:149.13
     * sdram_set_registers,raminit.c:164.26
     * main,auto.c:107.28
     */

********* ok here is 1 write of 0xe6 **********



    mov  $230 , %al
    mov  $3325 , %dx
    outb %al, %dx
    /* ,:0.0 */
    /*
     * pci_write_config8,romcc_io.h:148.38
     * sdram_set_registers,raminit.c:165.26
     * main,auto.c:107.28
     */
    /* ,:0.0 */
    /*
     * __builtin_outl,<built-in>:1.0
     * outl,io.h:25.23
     * pci_write_config8,romcc_io.h:148.13
     * sdram_set_registers,raminit.c:165.26
     * main,auto.c:107.28
     */
    mov  $-2147483548 , %eax
    mov  $3320 , %dx
    outl %eax, %dx
    /* ,:0.0 */
    /*
     * __builtin_outb,<built-in>:1.0
     * outb,io.h:15.23
     * pci_write_config8,romcc_io.h:149.13
     * sdram_set_registers,raminit.c:165.26
     * main,auto.c:107.28
     */

********** here is 2nd write of 0xe6 ************

    mov  $230 , %al
    mov  $3326 , %dx
    outb %al, %dx
    /*
     * pci_read_config8,romcc_io.h:124.38
     * sdram_set_registers,raminit.c:169.42
     * main,auto.c:107.28
     */
    /* ,:0.0 */
    /*
     * __builtin_outl,<built-in>:1.0
     * outl,io.h:25.23
     * pci_read_config8,romcc_io.h:124.13
     * sdram_set_registers,raminit.c:169.42
     * main,auto.c:107.28
     */
    mov  $-2147483548 , %eax
    mov  $3320 , %dx
    outl %eax, %dx
    /* ,:0.0 */
    /*

******** now we get to read back the values ready to print   ************

     * __builtin_inb,<built-in>:1.0
     * inb,io.h:31.29
     * pci_read_config8,romcc_io.h:125.19
     * sdram_set_registers,raminit.c:169.42
     * main,auto.c:107.28



Ok now unless I am going crazy there appear to only be 2 writes of 0xe6
!!!! Where is the 3rd one?
Also if romcc has missed this out, it is also possible that other bits
of code are not getting executed.

Ok now maybe I am wrong and not understanding auto.inc but I am pretty
sure I am looking at the
right bit of code here.

What do you think ?








More information about the coreboot mailing list