Page tree
Skip to end of metadata
Go to start of metadata

SDMMC外设用于将STM32MP1与SD存储卡、SDIO和MMC设备互连。

特性:

  • 三个MMC外设控制器
  • 完全符合MultiMediaCard系统规范4.51版。卡支持三种不同的数据总线模式:1位(默认),4位和8位。


启动支持

SDMMC1 / 2实例可用于支持SD或MMC Flash设备上的内存引导。

SDMMC3不能被用于启动。

SDMMC实例按设备树arch/arm/boot/dts/stm32mp157c.dtsi文件中的地址排序:

sdmmc3: sdmmc@48004000 {
...
sdmmc1: sdmmc@58005000 {
...
sdmmc2: sdmmc@58007000 {

PanGu开发板上默认,sdmmc3是被禁用的,sdmmc1作为SDCard功能,sdmmc2作为eMMC,所以被别名为mmc0和mmc1。如果需要启用sdmmc3,它会被命名为mmc0,并一次类推,所以不要忘记变更启动设备的命令。比如,'root=/dev/mmclkb0p6'变更为''root=/dev/mmcblk1p6,这样系统会从sdmmc1(SDCard)来挂载rootfs。


外设分配

DomainPeripheralRuntime allocationComment
InstanceCortex-A7
secure
(OP-TEE)
Cortex-A7
non-secure
(Linux)
Cortex-M4

(STM32Cube)
Mass storageSDMMCSDMMC1


SDMMC2


SDMMC3
Assignment (single choice)

CA7配置SDMMC1和SDMMC2


下例显示如何配置SDMMC与eMMC Flash连接,使用8bit数据宽度。

   &sdmmc2{                                                  Comments     
       pinctrl-names = "default", "opendrain", "sleep";      
       pinctrl-0 = <&sdmmc2_b4_pins_a &sdmmc2_dir_pins_a>;
       pinctrl-1 = <&sdmmc2_b4_od_pins_a &sdmmc2_dir_pins_a>;
       pinctrl-2 = <&sdmmc2_b4_sleep_pins_a &sdmmc2_dir_sleep_pins_a>;             
       non-removable;                                        --> Non-removable slot, assume always present
       no-sd;                                                --> Avoid to send SD command during initialization
       no-sdio;                                              --> Avoid to send SDIO command during initialization
       st,neg-edge;                                           
       bus-width = <8>;                                    
       vmmc-supply = <&v3v3>;                      
       vqmmc-supply = <&vdd>;
       mmc-ddr-3_3v;                                         --> Host supports e•MMC™ DDR 3.3V                         
       status = "okay";                                     
   };


以下示例显示了如何配置SDMMC与SDCard连接,使用4bit数据宽度。

 &sdmmc1{                                                  Comments     
       pinctrl-names = "default", "opendrain", "sleep";    
       pinctrl-0 = <&sdmmc1_b4_pins_a &sdmmc1_dir_pins_a>;
       pinctrl-1 = <&sdmmc1_b4_od_pins_a &sdmmc1_dir_pins_a>;
       pinctrl-2 = <&sdmmc1_b4_sleep_pins_a &sdmmc1_dir_sleep_pins_a>;               
       broken-cd;                                            --> use polling mode for card detection
       st,neg-edge;
       st,sig-dir;
       st,use-ckin;                                    
       bus-width = <4>;
       sd-uhs-sdr12;                                         --> sd modes supported [1]
       sd-uhs-sdr25;
       sd-uhs-sdr50;
       sd-uhs-ddr50;
       sd-uhs-sdr104;
       vmmc-supply = <&vdd_sd>;                      
       vqmmc-supply = <&sd_switch>;                          
       status = "okay";                                     
   };


  • No labels