This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

eMMC PSP drivers for C6748

Other Parts Discussed in Thread: TMS320C6748, CSD

I added Micron MTFC16GJVEC-2M WT, which is 16 GB v4.41 eMMC chip to my custom TMS320C6748 based board.

What I found out is that PSP 03.00.01.00 drivers do not support eMMC out of the box. They try to open it in byte access mode instead of sector acces mode, therefore response to CMD1 will be always busy. I managed to change this behavior and got beyond init. Next hurdle is that I guess driver read info about card capacity from CSD register instead of EXT_CSD.

I try to create a patch to overcome these problems, however my question is that maybe this is already sorted out somewhere. Maybe I could get newer version from PSP drivers.

I am not tested it yet, however I bet there are the same problem with ROM bootloader, which might not support boot from eMMC at all. Does someone know if this is true?

Andres


  • ddc_mmcsd.c

    line:3329 (0x80000000 | devDDC->drvrHwCfg->ocr),

    Notice that here CMD1 is sent always with bytemode and card answers always with busy. Moreover card also answers that it supports bytemode, however actually it does not.

    I changed 0x80000000 to 0x40000000, which commands card to use sector mode access. After that everything is okay with the init. Card is not busy anymore and response to CMD1 from the card comes also with sector mode bits set. Great.

    Now another issue is that I would like to use > 2GB eMMC. It seems that TI PSP driver only supports MMC cards that are < 2GB, therefore some further modifications must be made.

    With > 2GB cards there are special register called EXT_CSD where card sector count and other stuff can be read out. I tried to implement read back for that register but I failed. It is little bit different than other registers because answer is sent to DAT0 line as 512 byte block. Typically card answers using the same CMD line, but this is different. I did not get it to works right away so I gave up and just hardcoded main things to get it to work.

    ddc_mmcsd.c

    line:3521

             devDDC->sectorCnt = cardCapacity / devDDC->blkSize;
             devDDC->devState = DDC_MMCSD_DEVICESTATE_TRAN;
     
            /*Hack:
             * EXT_CSD should be read out somewhere, however it is little bit cumbersome, so just hardcode values for 16 GB eMMC here and call it a day
             */
            devDDC->isHighCapacitySDCard = TRUE;
            devDDC->sectorCnt = 0x01D40000; // SEC_COUNT field from Micron MTFC16GJVEC-2M WT


             /*Clear the status register before enabling the dma interrupt restore DMA
               mode after initialization. Clear the status register before enabling the
               interrupt to avoid dummy interrupt*/

    isHighCapacitySDCard must be set to TRUE otherwise addresses are calculated incorrectly (multipled by 512). sectorCnt = 0x01D40000 is taken from Micron MTFC16GJVEC-2M WT datasheet.

    TODO:I could not get it to work with 4 bit mode (only 1 bit mode currently works). Maybe i messed up SWITCH command (CMD6).

    It would be great to here from TI if it plans to add native eMMC support to their C6748 PSP driver.

    Andres

  • Hi Andres,

    Thanks for your post.

    I have reviewed your code which is modified for which command card to use sector mode access. I appreciate your great effors and brainstorming analysis.

    Also, i understand that, you have issues to use >2GB eMMC and i see your efforts to modify the code to read card sector count and other stuff, it is really appreciable.

    To address your suggestion to TI to add eMMC support to C6748 PSP driver, please give me some time, so that, I will check with TI team regarding any plan to support eMMC support to C6748 PSP driver and will let you know the update for the same.

    Again, thanks for your valuable suggestion to TI and your analysis are greatly appreciated.

    Thanks & regards,

    Sivaraj K

    ----------------------------------------------------------------------------------------------------------
    Please click the Verify Answer button on this post if it answers your question.
    ----------------------------------------------------------------------------------------------------------
  • Hi,

    Did you get any response from PSP driver team concerning eMMC support for C6748 PSP driver?

    Andres

  • Hi Andres,

    I will get back to you with the update.

    It is still in progress.

    Thanks & regards,

    Sivaraj K

    ---------------------------------------------------------------------------------
    Please click the
    Verify Answer button on this post if it answers your question.
    ---------------------------------------------------------------------------------
  • Hi Andres,

    A piece of information which might be helpful to you. The MMC/SD boot mode supports version 4.2 of the eMMC specification. Please refer Section 6.5 in the C6748 Bootloader application report as below:

    http://www.ti.com/lit/an/spraat2e/spraat2e.pdf

    Regards,

    Sivaraj K

    ---------------------------------------------------------------------------------
    Please click the
    Verify Answer button on this post if it answers your question.
    ---------------------------------------------------------------------------------