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.

Linux: The power of SDIO bus

Other Parts Discussed in Thread: DM385

Tool/software: Linux

Hi Sir,

For level shift,about the power of SDIO bus,How do we select the voltage 1.8v or 3.3v?

Best Regards,

Byron

  • Hi Byron,

    Which TI device exactly you are using?

    Regards,
    Pavel
  • Hi Pavel,

    The wireless connect to DM385 via SDIO interface.

    Best Regards,
    Byron
  • Byron,

    In general, selecting between 1.8V and 3.3V is achieved with selecting the proper voltage of the power domain. In example, see DVDD_SD (SDIO0 and SDIO1) and DVDD_RGMII (SDIO2).

    Could you please clarify if you are using DM385x TI board or custom board?

    Regards,
    Pavel
  • Hi Pavel,

    We are using the custom board.But we also refer to TI board to design.

    So, don't we set any parameter in the kernel/mmc driver for SDIO power?

    Best Regards,

    Byron

  • Hi Pavel,

    We found the function as below.Is it mean Only MMC1 support 3.3v and the others support 1.8V ?


    static void omap_hsmmc_conf_bus_power(struct omap_hsmmc_host *host)
    {
    u32 hctl, capa, value;

    /* Only MMC1 supports 3.0V */
    if (host->id == OMAP_MMC1_DEVID) {
    hctl = SDVS30;
    capa = VS30 | VS18;
    } else {
    hctl = SDVS18;
    capa = VS18;
    }

    Best Regards,
    Byron
  • Hi Pavel,

    Please see the function as below,Is it mean Only MMC1 support 3.3V, others support 1.8V?

    static void omap_hsmmc_conf_bus_power(struct omap_hsmmc_host *host)

    {

    u32 hctl, capa, value;

    /* Only MMC1 supports 3.0V */

    if (host->id == OMAP_MMC1_DEVID) {

    hctl = SDVS30;

    capa = VS30 | VS18;

    } else {

    hctl = SDVS18;

    capa = VS18;

    }

    Best Regards,

    Byron

  • Byron,

    No, I do not think we can switch the DVDD_SD/DVDD_RGMII voltage supply between 1.8V and 3.3V by software.

    kernel/drivers/mmc/host/omap_hsmmc.c driver configures the registers described in DM38x TRM, chapter 17 MMC/SD/SDIO

    In this TRM chapter is stated that the host driver should set these bits to select the voltage level for the card according to the voltage supported by the system.

    MMCHS_HCTL[11:9] SDVS

    Regards,
    Pavel
  • Hi Pavel,

    No,I do not switch the voltage between 1.8V and 3.3V by software.I would like to know how/where do we set these bits to select the voltage level for the card according to the voltage supported by the system?Is it on this function?


    static void omap_hsmmc_conf_bus_power(struct omap_hsmmc_host *host)
    {
    u32 hctl, capa, value;

    /* Only MMC1 supports 3.0V */
    if (host->id == OMAP_MMC1_DEVID) {
    hctl = SDVS30;
    capa = VS30 | VS18;
    } else {
    hctl = SDVS18;
    capa = VS18;
    }

    Best Regards,
    Byron
  • Byron,

    Yes, omap_hsmmc_conf_bus_power function is used to select between 1.8V and 3.3V. See also the below e2e thread:

    e2e.ti.com/.../359852

    Seems like you are using old kernel, latest kernel that is available for DM385 device is 4.4.x and comes with IPNC RDK 3.9.1, where we have:

    static void omap_hsmmc_conf_bus_power(struct omap_hsmmc_host *host, int iov)
    {
    u32 hctl, value;

    value = OMAP_HSMMC_READ(host->base, HCTL) & ~SDVS_MASK;
    hctl = (iov == MMC_SIGNAL_VOLTAGE_180) ? SDVS18 : SDVS30;
    OMAP_HSMMC_WRITE(host->base, HCTL, value | hctl);

    /* Set SD bus power bit */
    set_sd_bus_power(host);
    }

    Also on latest TI kernel 4.9.x this function is:

    static void omap_hsmmc_conf_bus_power(struct omap_hsmmc_host *host, int iov)
    {
    u32 hctl = SDVS30, value;

    value = OMAP_HSMMC_READ(host->base, HCTL) & ~SDVS_MASK;

    if (iov == MMC_SIGNAL_VOLTAGE_180)
    hctl = SDVS18;
    else if (host->io_3_3v_support)
    hctl = SDVS33;

    OMAP_HSMMC_WRITE(host->base, HCTL, value | hctl);

    /* Set SD bus power bit */
    set_sd_bus_power(host);
    }


    Note that in DM38x CSK, the WLAN is attached to MMC0, and MMC0 is configured for 3.3V in the dm38x-csk.dts file. I mean that voltage between 1.8V and 3.3V is selected in DTS file, then MMC driver auto select between 1.8V and 3.3V based on what we have in DTS file.

    Regards,
    Pavel
  • Hi Pavel,

    1.You said the mmc0 is configured for 3.3v. But the function is as below.The mmc0 is configured to 1.8V,So do I need to modify it?

    2.Yes,our kernel is 2.6.37.Is the file of dm38x-csk.dts only on latest kernel version?I can not find it.But In kernel/arch/powerpc/boot/dts folder.I can see lot of dts files.But I am not sure which file I used it.How could we check it?

    <Before>

    static void omap_hsmmc_conf_bus_power(struct omap_hsmmc_host *host)
    {
    u32 hctl, capa, value;

    /* Only MMC1 supports 3.0V */
    if (host->id == OMAP_MMC1_DEVID) {
    hctl = SDVS30;
    capa = VS30 | VS18;
    } else {
    hctl = SDVS18;
    capa = VS18;
    }

    value = OMAP_HSMMC_READ(host->base, HCTL) & ~SDVS_MASK;
    OMAP_HSMMC

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

    <Modified>

    static void omap_hsmmc_conf_bus_power(struct omap_hsmmc_host *host)
    {
    u32 hctl, capa, value;

    /* Only MMC1 supports 3.0V */
    if (host->id == OMAP_MMC1_DEVID) {
    hctl = SDVS30;
    capa = VS30 | VS18;
    } else {
    hctl = SDVS30;
    capa = VS30 | VS18;
    }

    value = OMAP_HSMMC_READ(host->base, HCTL) & ~SDVS_MASK;
    OMAP_HSMMC

    Best Regards,

    Byron

  • Byron,

    Byron Tien said:
    1.You said the mmc0 is configured for 3.3v. But the function is as below.The mmc0 is configured to 1.8V,So do I need to modify it?

    No, mmc0 is not configured to 1.8V, it is configured to 3V. In DM385 datasheet MMC numburing starts from 0, we have mmc0, mmc1, mmc2. While in linux kernel 2.6.37 (IPNC RDK 3.8.x) the numburing starts from 1, we have OMAP_MMC1_DEVID, OMAP_MMC2_DEVID, OMAP_MMC3_DEVID. Thus mmc0 from datasheet (base address 0x48060000) correspond to OMAP_MMC1_DEVID, and is set to 3V.

    If you need 3.3V on MMC0, no need to change the MMC driver.

    Byron Tien said:
    2.Yes,our kernel is 2.6.37.Is the file of dm38x-csk.dts only on latest kernel version?I can not find it.But In kernel/arch/powerpc/boot/dts folder.I can see lot of dts files.But I am not sure which file I used it.How could we check it?

    This is old kernel, we do not have DTS files here, we have board files instead. Check kernel/arch/arm/mach-omap2/ files board-dm385evm.c and/or board-dm385ipnc.c and devices.c

    Regards,
    Pavel

  • Hi Pavel,

    1.If we would like to configured to 1.8V,I need to connect to MMC1 or modify the MMC0 driver from 3V to 1.8V as below?

    ======Before============

    static void omap_hsmmc_conf_bus_power(struct omap_hsmmc_host *host)

    {

         u32 hctl, capa, value;

     

         /* Only MMC1 supports 3.0V */

         if (host->id == OMAP_MMC1_DEVID) {

               hctl = SDVS30;

               capa = VS30 | VS18;

         } else {

               hctl = SDVS18;

               capa = VS18;

         }

    ====After============

    static void omap_hsmmc_conf_bus_power(struct omap_hsmmc_host *host)

    {

         u32 hctl, capa, value;

     

         /* Only MMC1 supports 3.0V */

     //    if (host->id == OMAP_MMC1_DEVID) {

     //          hctl = SDVS30;

     //          capa = VS30 | VS18;

     //    } else {

               hctl = SDVS18;

               capa = VS18;

     //    }

    2. About the am335x_wl_irq and am335x_wl_en,What's our rated voltage(1.8V or 3.3V)?Could we change them in the kernel?

    Best Regards,

    Byron

  • Byron Tien said:
    1.If we would like to configured to 1.8V,I need to connect to MMC1 or modify the MMC0 driver from 3V to 1.8V as below?

    You can do both. In the first case (connect to MMC1), you do not need to change the driver. In the second case, your driver update seems to be correct (for setting MMC0 to 1.8V).

    Byron Tien said:
    2. About the am335x_wl_irq and am335x_wl_en,What's our rated voltage(1.8V or 3.3V)?Could we change them in the kernel?

    I can not find such DM385 pins (am335x_wl_irq, am335x_wl_en), do you ask for DM385 internal signals or DM385 pins? If you refer to DM385 pins, which ball numbers you refer (in example AA26)?

    Regards,
    Pavel

  • Hi Pavel,

    Sorry,It's the enable pin and irq pin on wifi module.They are connecting to DM385's C9 pin(irq pin/wifi) and J10 pin(enable pin/wifi).What's rated voltage(1.8V or 3.3V)?Could we change them in the kernel?

    Best Regards,

    Byron

  • Hi Pavel,

    Another question,If the power of MMC0 is 3.3V. Is it mean all the pin (CLK,CMD,DAT0~DAT3) are the 3.3V?Can we set them separately?

    Best Regards,
    Byron
  • Byron,

    These C9/J10 pins are dual voltage I/Os, thus can work at 3.3V or 1.8V. See DM385x datasheet, section 7.2.5 Dual Voltage I/Os.

    Voltage level (3.3V or 1.8V) on pin C9 depends on DVDD power rail, voltage level (3.3V or 1.8V) on pin J10 depends on DVDD_C power rail.


    This voltage selection (3.3V or 1.8V) can not be made by SW (in kernel or elsewhere).



    Regards,
    Pavel

  • Byron Tien said:
    If the power of MMC0 is 3.3V. Is it mean all the pin (CLK,CMD,DAT0~DAT3) are the 3.3V?

    Yes, all these pins (CLK,CMD,DAT0~DAT3) are powered by DVDD_SD. The voltage level (3.3V or 1.8V) depends on this DVDD_SD power rail.

    Regards,
    Pavel

  • Hi Pavel,

    I have tried to modify the code as below.make sure the mmc1 and mmc2 are on 1.8V. But when I checked the voltage on mmc1 pin,I got 3.3V. It did not seem to work.Where do we need to modify?

    static void omap_hsmmc_conf_bus_power(struct omap_hsmmc_host *host)
    {
    u32 hctl, capa, value;

    /* Only MMC1 supports 3.0V */
    //if (host->id == OMAP_MMC1_DEVID) {
    // hctl = SDVS30;
    // capa = VS30 | VS18;
    //} else {
    hctl = SDVS18;
    capa = VS18;
    //}

    }

    BR,

    Byron

  • Byron Tien said:
    I have tried to modify the code as below.make sure the mmc1 and mmc2 are on 1.8V. But when I checked the voltage on mmc1 pin,I got 3.3V. It did not seem to work.Where do we need to modify?

    As I already explained several times in this e2e thread, mmc0 (mmc1 in kernel) pins voltage level can NOT be changed from 3.3V to 1.8V by software (kernel or other). The only option for you is HW change of power supply of DVDD_SD power domain (from 3.3V to 1.8V).

    Regards,
    Pavel

  • Hi Pavel,

    I am confused,

    Last Wednesday,My question is 

    >>If we would like to configured to 1.8V,I need to connect to MMC1 or modify the MMC0 driver from 3V to 1.8V as below?

    Your answer is

    >>You can do both. In the first case (connect to MMC1), you do not need to change the driver. In the second case, your driver update seems to be correct (for setting MMC0 to 1.8V).

    Last Friday,My question is 

    >>I have tried to modify the code as below.make sure the mmc1 and mmc2 are on 1.8V. But when I checked the voltage on mmc1 pin,I got 3.3V. It did not seem to work.Where do we need to modify?

    Your answer is

    >>As I already explained several times in this e2e thread, mmc0 (mmc1 in kernel) pins voltage level can NOT be changed from 3.3V to 1.8V by software (kernel or other). The only option for you is HW change of power supply of DVDD_SD power domain (from 3.3V to 1.8V).

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

    1. You mean all the power level of MMC is depended on the DVDD_SD.

    if DVDD_SD is 3.3V,The MMC0 can support 3.3V and 1.8V. The MMC1 only support  1.8V.

    if DVDD_SD is 1.8V,The MMC0 can support 1.8V. The MMC1 only support  1.8V. 

    2. your answer on last Wednesday.

    ".... In the second case, your driver update seems to be correct (for setting MMC0 to 1.8V)."

    you mean need to modify kernel/mmc driver not only parameter of  omap_hsmmc_conf_bus_power function as below

    static void omap_hsmmc_conf_bus_power(struct omap_hsmmc_host *host)

    {

         u32 hctl, capa, value;

     

         /* Only MMC1 supports 3.0V */

         if (host->id == OMAP_MMC1_DEVID) {

               hctl = SDVS30;

               capa = VS30 | VS18;

         } else {

               hctl = SDVS18;

               capa = VS18;

         }

    .

    Best Regards,

    Byron

  • Byron,

    When you select the voltage mode (1.8V, 3.0V or 3.3V) in DM38x MMC/SD/SDIO controller kernel driver, this does NOT impact the MMC/SD/SDIO Input/Output pins voltage level (1.8V or 3.3V).

    When you select the voltage mode (1.8V, 3.0V or 3.3V) in DM38x MMC/SD/SDIO controller kernel driver, you define in which transfer speed mode this DM38x MMC/SD/SDIO controller will work (i.e. SDR12, SDR25), thus to be aligned with the transfer speed of the external chip.


    Regards,
    Pavel