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.

Problem with MMC0 on DM8148

MMC1 port is working fine, I am trying to make the physical MMC0 port work.

My code is based on IPNC-RDK3.0, which uses psp4.04

I followed the guide on the Wiki, here's what I have changed.

1. in board_ti8148ipnc.c

static struct omap2_hsmmc_info mmc[] = {
       {
               .mmc            = 1,
               .caps           = MMC_CAP_4_BIT_DATA,
               .gpio_cd        = -EINVAL,/* Dedicated pins for CD and WP */
               .gpio_wp        = -EINVAL,
               .ocr_mask       = MMC_VDD_33_34,
       },
       {
              .mmc            = 2,
              .caps           = MMC_CAP_4_BIT_DATA,
              .gpio_cd        = -EINVAL,/* Dedicated pins for CD and WP */
              .gpio_wp        = -EINVAL,
              .ocr_mask       = MMC_VDD_33_34,
      },
       {}      /* Terminator */
};

2. in arch/arm/mach-omap2/devices.c: omap2_init_mmc()

        case 0:
            base = TI814X_MMC1_BASE;
            irq = TI814X_IRQ_SD1;
            break;
        case 1:
            base = TI814X_MMC0_BASE; //which is defined as 0x48060100 in mmc.h
            irq = TI81XX_IRQ_SD;
            break;

3. CM_ALWON_MMCHS_0_CLKCTRL is set to 2

4. not sure it's necessary, but I added these in devices.c:omap2_mmc_mux()

    if (cpu_is_ti814x()) {
        omap_mux_init_signal("mmc0_clk", OMAP_PULL_UP);
        omap_mux_init_signal("mmc0_cmd", OMAP_PULL_UP);
        omap_mux_init_signal("mmc0_dat0", OMAP_PULL_UP);
        omap_mux_init_signal("mmc0_dat1", OMAP_PULL_UP);
        omap_mux_init_signal("mmc0_dat2", OMAP_PULL_UP);
        omap_mux_init_signal("mmc0_dat3", OMAP_PULL_UP);
        omap_mux_init_signal("mmc0_dat4", OMAP_PULL_UP);
        omap_mux_init_signal("mmc0_dat5", OMAP_PULL_UP);
        omap_mux_init_signal("mmc0_dat6", OMAP_PULL_UP);
        omap_mux_init_signal("mmc0_dat7", OMAP_PULL_UP);
        omap_mux_init_signal("mmc0_sdcd", OMAP_PULL_UP);
    }

Upon powerup I don't see any message related to mmc0(in linux,it is called mmc1)

here's the dmesg

PM: Adding info for platform:mmci-omap-hs.1
PM: Adding info for No Bus:mmc1

and that's it. did i miss anything?

  • Wang,

    Did you check the value of the macro TI81XX_NR_MMC defined in arch/arm/plat-omap/include/plat/mmc.h? Right now it is set to 1, you have to make it 2.

  • Thanks for the reply.

    I did change it to 2.

  • Is it working for you? If so, can you mark this post as answered?

  • No, it's not working yet.

    I meant I changed it to value 2 from the very beginning.

  • Hi Hongfeng,

    I have exactly the same issue.

    Did you find the way to make it working?

    if yes, I'll be pleased if you could share with me the thing we missed.

    I'll update the post if I find.

    Thanks,

  • Hi HongFeng,

    I think I have the point. the internal pull-up must be enabled, the define OMAP_PULL_UP could not be used for the TI814x processor. Instead use the define TI814X_PULL_UP

    So you have to replace in the omap2_mmc_mux function (devices.c file):

    if (cpu_is_ti814x()) {
            omap_mux_init_signal("mmc0_clk", OMAP_PULL_UP);
            omap_mux_init_signal("mmc0_cmd", OMAP_PULL_UP);
            omap_mux_init_signal("mmc0_dat0", OMAP_PULL_UP);
            omap_mux_init_signal("mmc0_dat1", OMAP_PULL_UP);
            omap_mux_init_signal("mmc0_dat2", OMAP_PULL_UP);
            omap_mux_init_signal("mmc0_dat3", OMAP_PULL_UP);
            omap_mux_init_signal("mmc0_dat4", OMAP_PULL_UP);
            omap_mux_init_signal("mmc0_dat5", OMAP_PULL_UP);
            omap_mux_init_signal("mmc0_dat6", OMAP_PULL_UP);
            omap_mux_init_signal("mmc0_dat7", OMAP_PULL_UP);
            omap_mux_init_signal("mmc0_sdcd", OMAP_PULL_UP);
        }

    by :

    if (cpu_is_ti814x() && controller_nr == 1 ){
            omap_mux_init_signal("mmc0_clk", TI814X_PULL_UP);
            omap_mux_init_signal("mmc0_cmd", TI814X_PULL_UP);
            omap_mux_init_signal("mmc0_dat0", TI814X_PULL_UP);
            omap_mux_init_signal("mmc0_dat1", TI814X_PULL_UP);
            omap_mux_init_signal("mmc0_dat2",TI814X_PULL_UP);
            omap_mux_init_signal("mmc0_dat3", TI814X_PULL_UP);
            omap_mux_init_signal("mmc0_dat4",TI814X_PULL_UP);
            omap_mux_init_signal("mmc0_dat5",TI814X_PULL_UP);
            omap_mux_init_signal("mmc0_dat6", TI814X_PULL_UP);
            omap_mux_init_signal("mmc0_dat7", TI814X_PULL_UP);
            omap_mux_init_signal("mmc0_sdcd",TI814X_PULL_UP);
        }

    Enjoy,

  • I just got back to this problem. It is still not working.

    I verified the related mux and mmchs_0_clkctrl registers, they all look normal. When I measure sd0_bclk signal, i don't see any pulse there.

  • mmc0 finally is working after changed the DMA number in dma.h

    //I mapped physical mmc0 to MMC2 in linux

    -#define OMAP24XX_DMA_MMC2_TX           47      /* S_DMA_46 */
    -#define OMAP24XX_DMA_MMC2_RX           48      /* S_DMA_47 */
    +#define OMAP24XX_DMA_MMC2_TX           24      /* S_DMA_46 */
    +#define OMAP24XX_DMA_MMC2_RX           25      /* S_DMA_47 */