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.

AM3352: Can't get eMMC working at 8-bit in u-boot

Part Number: AM3352

Hey everyone, this may just be a "that's just the way it is" type of question but I'm porting u-boot over to a custom AM3352 board and have an eMMC that I'm using as the main boot device and I'd like to get it running at 8-bit to hopefully decrease the programming and boot times... this is going in a high volume product so every second counts.

I'm using Robert Nelson's 2019.04 u-boot from eewiki but I'm hoping that it's similar enough to the SDK's 2019.01 that someone here may know the answer.

I've been working at this for a couple days with no luck, the eMMC keeps showing up in u-boot as a 4-bit device:

I know that the platdata stucts at the bottom of the board.c are supposed to set this up, and I've verified my settings are the same as what's in the am3352_evm  board.c file:

#if !CONFIG_IS_ENABLED(OF_CONTROL)
static const struct omap_hsmmc_plat am335x_mmc0_platdata = {
	.base_addr = (struct hsmmc *)OMAP_HSMMC1_BASE,
	.cfg.host_caps = MMC_MODE_HS_52MHz | MMC_MODE_HS | MMC_MODE_4BIT,
	.cfg.f_min = 400000,
	.cfg.f_max = 52000000,
	.cfg.voltages = MMC_VDD_32_33 | MMC_VDD_33_34 | MMC_VDD_165_195,
	.cfg.b_max = CONFIG_SYS_MMC_MAX_BLK_COUNT,
};

U_BOOT_DEVICE(am335x_mmc0) = {
	.name = "omap_hsmmc",
	.platdata = &am335x_mmc0_platdata,
};

static const struct omap_hsmmc_plat am335x_mmc1_platdata = {
	.base_addr = (struct hsmmc *)OMAP_HSMMC2_BASE,
	.cfg.host_caps = MMC_MODE_HS_52MHz | MMC_MODE_HS | MMC_MODE_8BIT,
	.cfg.f_min = 400000,
	.cfg.f_max = 52000000,
	.cfg.voltages = MMC_VDD_32_33 | MMC_VDD_33_34 | MMC_VDD_165_195,
	.cfg.b_max = CONFIG_SYS_MMC_MAX_BLK_COUNT,
};

U_BOOT_DEVICE(am335x_mmc1) = {
	.name = "omap_hsmmc",
	.platdata = &am335x_mmc1_platdata,
};
#endif

It clearly says "MMC_MODE_8bit" but that isn't sticking for some reason.

I do get the standard "No match for driver ‘omap_hsmmc" error for both MMC instances.

The interesting part: If I comment out all the code above, the omap_hsmmc driver message disappears, and both MMC interfaces work exactly the same as if the code was still in the board.c

Anyone have any ideas?

Thanks

  • Also of note, I tried using mainline u-boot 2020.10 to switch everything to DM, which didn't work out but the eMMC did successfully run at 8-bit using that u-boot so I don't think it's a hardware issue.

  • Hi Adam,
    With DM in SPL/u-boot, am335x_mmc0_platdata[] and am335x_mmc1_platdata[] defined at the end of "/board/ti/am335x/board.c" are not used, instead mmc0/mmc1 are configured in board DTS file.
    Have you got chance to check dts file in the u-boot tree you're using (Robert Nelson's 2019.04 u-boot from eewiki) ?
    Best,
    -Hong

  • Hey Hong, I am not using DM. That's the problem. Neither Robert's u-boot nor the TI SDK uses DM for anything so I've reverted back. It doesn't even compile the dts file into a dtb. Therefor, it should be using the defines in the board.c file but it doesn't appear to be.

  • Hey Adam,
    In fact, in TI SDK6.3 release(u-boot 2019.01), DM is used for mmc ports in SPL/u-boot.
    I'm listing u-boot "dm tree" log I captured on AM335x GP EVM (note that only SD/MMC is on AM335x GP EVM => mmc@48060000 node)
    You may need to add "CONFIG_CMD_DM=y" in your u-boot am335x_xyz_defconfig if not set to enable "dm ..." cmd.

    => dm ttr  ree
     Class    index  Probed  Driver                Name
    -----------------------------------------------------------
     root        0  [ + ]   root_driver           root_driver
     rsa_mod_ex  0  [   ]   mod_exp_sw            |-- mod_exp_sw
     simple_bus  0  [ + ]   generic_simple_bus    `-- ocp
     simple_bus  1  [   ]   generic_simple_bus        |-- l4_wkup@44c00000
     simple_bus  2  [   ]   generic_simple_bus        |   |-- prcm@200000
     simple_bus  3  [   ]   generic_simple_bus        |   `-- scm@210000
     simple_bus  4  [   ]   generic_simple_bus        |       `-- scm_conf@0
     gpio        0  [ + ]   gpio_omap                 |-- gpio@44e07000
     gpio        1  [   ]   gpio_omap                 |-- gpio@4804c000
     gpio        2  [   ]   gpio_omap                 |-- gpio@481ac000
     gpio        3  [   ]   gpio_omap                 |-- gpio@481ae000
     serial      0  [ + ]   omap_serial               |-- serial@44e09000
     serial      1  [   ]   omap_serial               |-- serial@48022000
     i2c         0  [   ]   i2c_omap                  |-- i2c@44e0b000
     i2c         1  [   ]   i2c_omap                  |-- i2c@4802a000
     mmc         0  [ + ]   omap_hsmmc                |-- mmc@48060000
     blk         0  [ + ]   mmc_blk                   |   `-- mmc@48060000.blk
     timer       0  [ + ]   omap_timer                |-- timer@48040000
     timer       1  [   ]   omap_timer                |-- timer@48042000
     timer       2  [   ]   omap_timer                |-- timer@48044000
     timer       3  [   ]   omap_timer                |-- timer@48046000
     timer       4  [   ]   omap_timer                |-- timer@48048000
     timer       5  [   ]   omap_timer                |-- timer@4804a000
     misc        0  [ + ]   ti-musb-wrapper           |-- usb@47400000
     usb         0  [ + ]   ti-musb-peripheral        |   |-- usb@47401000
     eth         1  [ + ]   usb_ether                 |   |   `-- usb_ether
     usb         0  [   ]   ti-musb-host              |   `-- usb@47401800
     eth         0  [ + ]   eth_cpsw                  `-- ethernet@4a100000
    => 

    Best,
    -Hong

  • Interesting. I'll check that out and see if I can get it working via DM. I tried very briefly and it didn't work... I'll check out the SDK to see how the MMC is set up. THanks.