I am trying to write a UBL that accesses the SD card.

I am turning on mmc0 in the PSC using the following code:

=====================================
/* ---------------------------------------------- */
    /* initialize SD card */
/* ---------------------------------------------- */

stillson:            /* just added for a break point*/

    /* if (ptstat & 1 == 1) goto mmc_pstat_loop1 */
    ldr    r0, PTSTAT
mmc_ptstat_loop1: /* wait for something! */
    ldr    r2, [r0]
    tst    r2, $0x01
    bne    mmc_ptstat_loop1


#if 0
    /* if (mdstat_mmc & 0x1f == 0x03) goto mmc_is_on */
    ldr    r0, MDSTAT_MMC
    ldr    r1, [r0]
    and    r1, r1, $0x1f
    teq    r1, $0x03
    beq    mmc_is_on
#endif



    /* MDCTL_MMC |= 0x03 */
    ldr    r1, MDCTL_MMC
    ldr    r2, [r1]
    and    r2, r2, $0xfffffff8
    orr    r2, r2, $0x03
    str    r2, [r1]

    /* PTCMD = 1 */
    ldr    r1, PTCMD
    mov    r2, $0x01
    str    r2, [r1]

    ldr    r0, PTSTAT
mmc_ptstat_loop2:
    /* if (ptstat == 1) goto mmc_ptstat_loop2 */
    ldr    r2, [r0]
    tst    r2, $0x01
    bne    mmc_ptstat_loop2

    ldr r0, MDSTAT_MMC
mmc_mdstat_loop:
    /* if ( (mdstat_mmc & 0x1f) != 0x03 ) goto mmc_mdstat_loop*/
    ldr    r2, [r0]
    and    r2, r2, $0x1f
    teq    r2, $0x03
    bne    mmc_mdstat_loop

mmc_is_on:
    nop

MDCTL_MMC:
    .word    0x01c41a3c
MDSTAT_MMC:
    .word    0x01c4183c
PTCMD:
    .word    0x01c41120
PTSTAT:
    .word    0x01c41128


================================

Later, when I go to access the mmc0 registers at 0x01e11000, they are
all 0x00000000

This happens whether I run the code to turn it on or not.

The MDSTAT[15] seems to say that it is disabled (not syncReset as the
documentation says). ( I am set to nand boot, although I load the UBL
over jtag)

Does using jtag affect this?

Why are the mmc0 registers blank?


Chris

_______________________________________________
Davinci-linux-open-source mailing list
[email protected]
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source

Reply via email to