Cannot use either MMC device from u-boot

Forums Devices OSD32MP15x Cannot use either MMC device from u-boot

Viewing 2 reply threads
  • Author
    Posts
    • #15369
      c spenglerc spengler
      Participant

         
        <p style=”line-height: 100%; margin-bottom: 0in;”>We have a custom design OSD32MP157f/512 device that has been designed to follow the red board design closely. It is setup for the Dunfell distribution but will be moved to Kirkstone now that I know it exists.
        <p style=”line-height: 100%; margin-bottom: 0in;”>
        <p style=”line-height: 100%; margin-bottom: 0in;”>We used the breakout board device trees as a basis and merged in the Ethernet, the second MMC and a few other items from the red board device trees for things that are on our boards and left the other stuff out. The board is supposed to run at 800MHz so we include stm32mp15xf.dtsi instead of stm32mp15xc.dtsi . The contents of the rest of the image run just fine on the breakout board with it’s device tree.
        <p style=”line-height: 100%; margin-bottom: 0in;”>
        <p style=”line-height: 100%; margin-bottom: 0in;”>
        <p style=”line-height: 100%; margin-bottom: 0in;”>Our issue is that the board boots from the sd card attached to sdmmc1 into u-boot but stops. The sdmmc1 is aliased as mmc0 in our u-boot device trees. The mmc list command shows both of the devices and the mmc dev command shows mmc1 part 0 as the current device. But, it shows the following at boot:
        <p style=”line-height: 100%; margin-bottom: 0in;”>
        <p style=”line-height: 100%; margin-bottom: 0in;”>### main_loop: bootcmd=”run bootcmd_stm32mp”
        <p style=”line-height: 100%; margin-bottom: 0in;”>Hit any key to stop autoboot: 0
        <p style=”line-height: 100%; margin-bottom: 0in;”>Boot over mmc0!
        <p style=”line-height: 100%; margin-bottom: 0in;”>: returns 1
        <p style=”line-height: 100%; margin-bottom: 0in;”>Command failed, result=1
        <p style=”line-height: 100%; margin-bottom: 0in;”>: returns 1
        <p style=”line-height: 100%; margin-bottom: 0in;”>Command failed, result=1
        <p style=”line-height: 100%; margin-bottom: 0in;”>Saving Environment to MMC… blk_find_device: if_type=6, devnum=0: sdmmc@58005000.blk, 6, 0
        <p style=”line-height: 100%; margin-bottom: 0in;”>0 -1
        <p style=”line-height: 100%; margin-bottom: 0in;”>0 0
        <p style=”line-height: 100%; margin-bottom: 0in;”>- -1 -1 ‘sdmmc@58005000.blk’
        <p style=”line-height: 100%; margin-bottom: 0in;”>- -1 -1 ‘sdmmc@58007000.blk’
        <p style=”line-height: 100%; margin-bottom: 0in;”>- not found
        <p style=”line-height: 100%; margin-bottom: 0in;”>stm32_sdmmc2_getcd called
        <p style=”line-height: 100%; margin-bottom: 0in;”>MMC: no card present
        <p style=”line-height: 100%; margin-bottom: 0in;”>mmc_blk_probe: mmc_init() failed (err=-123)
        <p style=”line-height: 100%; margin-bottom: 0in;”>No block device
        <p style=”line-height: 100%; margin-bottom: 0in;”>Failed (1)
        <p style=”line-height: 100%; margin-bottom: 0in;”>Command failed, result=1
        <p style=”line-height: 100%; margin-bottom: 0in;”>Command failed, result=1
        <p style=”line-height: 100%; margin-bottom: 0in;”>: returns 0
        <p style=”line-height: 100%; margin-bottom: 0in;”>Initial value for argc=3
        <p style=”line-height: 100%; margin-bottom: 0in;”>Final value for argc=3
        <p style=”line-height: 100%; margin-bottom: 0in;”>: returns 1
        <p style=”line-height: 100%; margin-bottom: 0in;”>Command failed, result=1
        <p style=”line-height: 100%; margin-bottom: 0in;”>: returns 1
        <p style=”line-height: 100%; margin-bottom: 0in;”>Command failed, result=1
        <p style=”line-height: 100%; margin-bottom: 0in;”>: returns 1
        <p style=”line-height: 100%; margin-bottom: 0in;”>Command failed, result=1
        <p style=”line-height: 100%; margin-bottom: 0in;”>blk_find_device: if_type=6, devnum=0: sdmmc@58005000.blk, 6, 0
        <p style=”line-height: 100%; margin-bottom: 0in;”>stm32_sdmmc2_getcd called
        <p style=”line-height: 100%; margin-bottom: 0in;”>stm32_sdmmc2_getcd called
        <p style=”line-height: 100%; margin-bottom: 0in;”>MMC: no card present
        <p style=”line-height: 100%; margin-bottom: 0in;”>Command failed, result=1
        <p style=”line-height: 100%; margin-bottom: 0in;”>Command failed, result=1
        <p style=”line-height: 100%; margin-bottom: 0in;”>Command failed, result=1
        <p style=”line-height: 100%; margin-bottom: 0in;”>Command failed, result=1
        <p style=”line-height: 100%; margin-bottom: 0in;”>Command failed, result=1
        <p style=”line-height: 100%; margin-bottom: 0in;”>
        <p style=”line-height: 100%; margin-bottom: 0in;”>
        <p style=”line-height: 100%; margin-bottom: 0in;”>As the result code is ENOMEDIUM, we know this is incorrect as we booted u-boot from this medium. Any ideas how to fix this? Are there timings that need to change in the secure device tree to accommodate the 800MHz clock?
        Also, as it cannot see the MMC it cannot load the environment…

         

         

         

      • #15387
        Neeraj Dantu
        Moderator

          spengler,

          First thought is that you should check the card detect pin. It is different for OSD32MP1-RED and OSD32MP1-BRK. If you are using BRK device tree, the card detect pin is set to PG7(https://github.com/octavosystems/OSD32MP1-BRK-device-tree/blob/kirkstone/u-boot-v2021.10-stm32mp-r1/stm32mp157c-osd32mp1-brk.dts#L881).

          Best,

          Neeraj

        • #15397
          c spenglerc spengler
          Participant

            Thank you for pointing me in the right direction.

            For those that find themselves in this pickle, the answer is the breakout board has no discreet card detect line. The sd card holder used on it uses D3 for that function. The part used on the red board has a discreet card detection line. So, the red board device tree has a line item in the “&sdmmc1” entry “cd-gpios”, if that line is present for a sd card reader without that card detect line, it will always fail to find the card.

            • This reply was modified 1 month, 1 week ago by c spenglerc spengler.
        Viewing 2 reply threads
        • You must be logged in to reply to this topic.