cancel
Showing results for 
Search instead for 
Did you mean: 

What clock need to enabled for SDMMC1?

DMårt
Lead

Hi!

I have a STM32MP257F processor. The clock for SDMMC1 is constant at 3.3V. Therefore the U-boot cannot read the SD-card.

My question is: What clock need to be active/chosed in the device tree so it u-boot can read the SD-card sdmmc1?

 

Hit any key to stop autoboot:  0 
Boot over mmc0!
Saving Environment to MMC... stm32_sdmmc2 mmc@48220000: stm32_sdmmc2_getcd called
stm32_sdmmc2 mmc@48220000: bus_with = 1, clock = 0
stm32mp25_reset clock-controller@44200000: reset id=69 offset=0x830 bit=0 status=1
stm32mp25_reset clock-controller@44200000: reset id=69 offset=0x830 bit=0 status=0
D/TC:? 0 tee_ta_init_session_with_context:562 Re-open trusted service a8cfe406-d4f5-4a2e-9f8d-a25dc754c099
F/TC:? 0 pta_scmi_invoke_command:404 SCMI command 0x3 ptypes 0x3
F/TC:? 0 pta_scmi_invoke_command:404 SCMI command 0x4 ptypes 0x651
F/TC:? 0 regulator_disable:142 v3v3
D/TC:? 0 tee_ta_close_session:465 csess 0x8212f890 id 1
D/TC:? 0 tee_ta_close_session:484 Destroy session
D/TC:? 0 tee_ta_init_session_with_context:562 Re-open trusted service a8cfe406-d4f5-4a2e-9f8d-a25dc754c099
F/TC:? 0 plat_prng_add_jitter_entropy:74 0xA7
F/TC:? 0 pta_scmi_invoke_command:404 SCMI command 0x3 ptypes 0x3
F/TC:? 0 pta_scmi_invoke_command:404 SCMI command 0x4 ptypes 0x651
F/TC:? 0 regulator_enable:94 v3v3
D/TC:? 0 tee_ta_close_session:465 csess 0x8212f890 id 1
D/TC:? 0 tee_ta_close_session:484 Destroy session
stm32_sdmmc2 mmc@48220000: bus_with = 1, clock = 0
stm32_sdmmc2 mmc@48220000: bus_with = 1, clock = 400000
stm32_sdmmc2 mmc@48220000: send cmd 0 data: 0x0 @ 0x0000000000000000
stm32_sdmmc2 mmc@48220000: timeout reading SDMMC_STA register
stm32_sdmmc2 mmc@48220000: send STOP command to abort dpsm treatments
stm32_sdmmc2 mmc@48220000: timeout reading SDMMC_STA register
stm32_sdmmc2 mmc@48220000: end for CMD 0, ret = -110
No block device
Failed (1)

 

STM32MP151AAC3 custom board with STM32-OS as operating system: https://github.com/DanielMartensson/STM32-Computer

STM32MP257FAK3 custom board with STM64-OS as operating system: https://github.com/DanielMartensson/STM64-Computer
1 ACCEPTED SOLUTION

Accepted Solutions

Hi @PatrickF 

 

Here is the feedback.

LDO2 was connected to both VDDIO_SDMMC1 and VDD_SDMMC1. Did not work.

 

I copy the node &sdmmc1 from DK. LDO2 drives VDDIO_SDMMC1 and BUCK7 drives VDD_SDMMC1.

Linux is now booting.

 

STM32MP151AAC3 custom board with STM32-OS as operating system: https://github.com/DanielMartensson/STM32-Computer

STM32MP257FAK3 custom board with STM64-OS as operating system: https://github.com/DanielMartensson/STM64-Computer

View solution in original post

5 REPLIES 5
PatrickF
ST Employee

HI @DMårt 

 

  • SDMMC1 bus clock is from FlexClkGen channel 1 (ck_icn_sdmmc --> ck_icn_m_sdmmc1). max 200MHz
  • SDMMC1 kernel clock is from FlexClkGen channel 51 (ck_ker_sdmmc1). Max 200MHz

on our board DT, come from PLL4 (1200 MHz from HSE)

https://wiki.st.com/stm32mpu/wiki/Clock_device_tree_configuration#STM32MP2_series_for_A35-TD_flavor

 

As I see in the log that clock is set to bus width 1 and 400kHz (this is normal during card discovery/init), maybe clock tree is correct.

stm32_sdmmc2 mmc@48220000: bus_with = 1, clock = 400000

If clock is still not present on pin, please cross-check your pinmux.

 

Regards.

 

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.
Tip of the day: Try Sidekick STM32 AI agent, see here

Hi @PatrickF 

I have activated the clock and still no success. Instead, I got some new messages. 

Can you scroll through this and see if you seeing som interesting why the SDMMC1 returns -110 = Time out?

The clock works at TF-A, but not in U-boot. The Clock of SDMMC1 is constant 3.3V.

I think it might be optee that is not giving any access to the GPIO pins.

See the attached .txt file.

 

Note: I'm using no-1-8-v in my DT for SDMMC1. I'm planning to use constant 3.3V at pull-up. perhaps this is the issue?

STM32MP151AAC3 custom board with STM32-OS as operating system: https://github.com/DanielMartensson/STM32-Computer

STM32MP257FAK3 custom board with STM64-OS as operating system: https://github.com/DanielMartensson/STM64-Computer

Hi,

SD-Card will work with 3.3V I/Os, just the UHS-I speed will not be available (but here seems to block before any negotiation).
Warning: If you play with VDDIO1VRSEL to set IOs for 1.8V operation while you still have 3.3V supply, this could destroy the IOs.

Please note that in addition to security concerns, the IOs domain supplied by VDDIO1 should be enabled by VDDIO1SV bit (but this is done by BootROM in case of SD-Card boot).

 

as BootROM and TF-A are accessing SD-Card, and the fail only occurs on uBoot, the HW should be OK.

 

Maybe compare your DT with those of STM32MP257F-EV1 or -DK as boot starter package from SD-Card is done natively.

https://wiki.st.com/stm32mpu/wiki/STM32_MPU_device_tree#STM32MP2_series

 

Regards.

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.
Tip of the day: Try Sidekick STM32 AI agent, see here

Thank you @PatrickF 

I think I have a solution. It seems that LDO2 is for both VDD and IO for SDMMC1...

I will do a quick fix and reply to you tomorrow with a solution.

STM32MP151AAC3 custom board with STM32-OS as operating system: https://github.com/DanielMartensson/STM32-Computer

STM32MP257FAK3 custom board with STM64-OS as operating system: https://github.com/DanielMartensson/STM64-Computer

Hi @PatrickF 

 

Here is the feedback.

LDO2 was connected to both VDDIO_SDMMC1 and VDD_SDMMC1. Did not work.

 

I copy the node &sdmmc1 from DK. LDO2 drives VDDIO_SDMMC1 and BUCK7 drives VDD_SDMMC1.

Linux is now booting.

 

STM32MP151AAC3 custom board with STM32-OS as operating system: https://github.com/DanielMartensson/STM32-Computer

STM32MP257FAK3 custom board with STM64-OS as operating system: https://github.com/DanielMartensson/STM64-Computer