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.

AM6442: Changing SD card speed rate in Linux SDK

Part Number: AM6442

Hi,

This is additional question to the original thread (above link).
In the last answer from the thread is;

Page 30:

3.4.8.2.1 Micro SD Interface:

The processor board provides an uSD card interface connected to MMC1 port of AM64x SoC. The uSD card interface supports UHS1 operation including operations at both 1.8V and 3.3V IO levels.. The AM64x SoC includes a circuit to generate the uSD voltage based on IO level negotiation with the uSD card. For high-speed cards, ROM code of the SoC attempts to find the fastest speed that the card and controller can support and can have a transition to 1.8V. The internal SDIO LDO output from the SoC is provided on the CAP_VDDSHV_SDLDO pin. CAP_VDDSHV_SDLDO is connected to both the IO voltage of SD signals and VDDSHV_MMC1 power pins of the SoC. 

Does it mean ROM code automatically configure SD card speed rate at the fastest supported speed?
Users cannot change the speed slower for evaluation or other purpose?

Thanks and regards,
Koichiro Tashiro

  • Hi,

    Could you also answer below original question which was not answered clearly in the original post?

    >My customer wants to know how to limit speed rate up to HS200 in case HS400 eMMC device is connected, both in u-boot and kernel.

    Thanks and regards,
    Koichiro Tashiro

  • Hi Tashiro-san,

    Our Linux MMC expert is out of office, but I will take a look and get back to you in a couple days.

  • Hi Tashiro-san,

    I am working on how to configure u-boot and kernel to limit mmc to HS200. Meanwhile, I am routing your query to our ROM expert to comment on whether ROM will automatically configure SD card in fastest speed.

    > Does it mean ROM code automatically configure SD card speed rate at the fastest supported speed?
    > Users cannot change the speed slower for evaluation or other purpose?

  • No, ROM only supports legacy mode speeds of 25MHz

    Regards,

    James

  • Hi James, Bin,

    No, ROM only supports legacy mode speeds of 25MHz

    Do you mean the ROM code only support 25MHz for both SD and MMC?
    If customer wants to change speed rate, how to modify u-boot/kernel?
    Answers for both SD card and MMC card are required.

    Thanks and regards,
    Koichiro Tashiro

  • Hi Tashiro-san,

    ROM will access SD & MMC in 25MHz, but U-Boot and kernel will re-enumerate SD & MMC and configure the highest speed possible to access them.

  • Hi Bin,

    U-Boot and kernel will re-enumerate SD & MMC and configure the highest speed possible to access them.


    I see. The customer is asking how to configure SD & MMC with less than the highest speed as they want.

    Thanks and regards,
    Koichiro Tashiro

  • Hi Tashirio-san,

    The U-Boot and kernel device tree file k3-am64-main.dtsi define many properties like "ti,otap-del-sel-*" in sdhciX nodes. Remove any of these properties will disable the corresponding SD/MMC speed support. Please see the comment message in kernel file Documentation/devicetree/bindings/mmc/sdhci-am654.yaml for details.

  • Hi Tashiro-san,

    I just found a better way to limit the MMC/SDcard speed. It is applicable to both U-Boot and kernel:

    #. Restricting to a given speed mode
    
    - By default the U-Boot driver tries to enumerate a SD card in the highest
      supported speed mode. Given below is the order in which the driver
      tries to enumerate a SD card
    
        - SDR104
        - SDR50
        - DDR50
        - SD HS
        - SD legacy
    
    - These speed capabilites can be masked using device tree property
      sdhci-caps-mask.
    
        - Limit to SDR50:     sdhci-caps-mask = <0x00000004 0x00000000>;
        - Limit to DDR50:     sdhci-caps-mask = <0x00000006 0x00000000>;
        - Limit to SD HS:     sdhci-caps-mask = <0x00000007 0x00000000>;
        - Limit to SD legacy: sdhci-caps-mask = <0x00000007 0x00200000>;
    
    For example:
    
               &sdhci1 {
                  sdhci-caps-mask = <0x00000006 0x00000000>; /* Limiting to DDR50 speed mode */
               }; 

  • Hi Bin,

    Thanks for your reply.
    In case the customer wants to use HS200 speed with HS400 capable card, below configuration should be used?
    - Limit to SD HS:     sdhci-caps-mask = <0x00000007 0x00000000>;

    Thanks and regards,
    Koichiro Tashiro

  • Hi Tashiro-san,

    In case the customer wants to use HS200 speed with HS400 capable card, below configuration should be used?
    - Limit to SD HS:     sdhci-caps-mask = <0x00000007 0x00000000>;

    It doesn't seem to be correct. It is to disable all the HS mode.

    The AM64x TRM shows the MMC register MMCSD0_SS_CTL_CFG_3_REG bit 31 (HS400SUPPORT) seems can be used to disable HS400 mode. I am reviewing the MMC drivers to understand how to disable HS400. I will update once I find the solution.

  • Hi Tashiro-san,

    Sorry for my late response. I finally got the MMC controller documentation, the highest bit (bit63) of the caps mask is for HS400 mode, so to disable HS400 mode, please use the following sdhci-caps-mask in both uboot and kernel device tree sdhci node:

    sdhci-caps-mask = <0x80000000 0x00000000>; /* disable HS400 speed mode */