SD dts设置说明
1. 概况¶
SSD26x系列芯片有两组SDIO接口,当用户只使用其中一组SDIO而将另一组复用为其他功能时需正确配置SD dts,否则加载SDMMC驱动时会出现异常。这里分为以下两种情况说明。
2. 只使用SD0¶
当用户只使用SD0,而SD1要配置为其他功能(如PWM、RMII等,请参考相关文档)时:
-
根据tmux表格,在所使用的padmux.dtsi文件中将SD1引脚设置为所需要的功能,同时注释掉默认的SD1 for SDMMC1的配置
-
修改dts中sdmmc的slotnum为1,如下:
sdmmc { - slotnum = <2>; + slotnum = <1>; };
3. 只使用SD1¶
只使用SD1,而SD0要设置为其他功能(如FUART)时:
-
与只使用SD0时类似,设置padmux slotnum为1并注释掉SD0 for SDMMC0的配置
-
调整顺序
sdmmc { - slotnum = <2>; + slotnum = <1>; - slot-ip-orders = <0>,<1>,<2>; + slot-ip-orders = <1>,<0>,<2>; - slot-max-clks = <200000000>,<48000000>,<48000000>; + slot-max-clks = <48000000>,<200000000>,<48000000>; - slot-support-sd30 = <1>,<0>,<0>; + slot-support-sd30 = <0>,<1>,<0>; - slot-cdzs-gpios = <PAD_SD0_CDZ>,<PAD_SD1_CDZ>,<0>; - slot-pwr-gpios = <PAD_SD_GPIO0>,<PAD_SD1_GPIO0>,<0>; + slot-cdzs-gpios = <PAD_SD1_CDZ>,<PAD_SD0_CDZ>,<0>; + slot-pwr-gpios = <PAD_SD1_GPIO0>,<PAD_SD_GPIO0>,<0>; slot-sdio-use = <0>,<0>,<0>; slot-removable = <1>,<1>,<1>; - interrupts-extended = <&ms_main_intc GIC_SPI INT_IRQ_SD IRQ_TYPE_LEVEL_HIGH>,//was INT_IRQ_SDIO - <&ms_main_intc GIC_SPI INT_IRQ_SDIO IRQ_TYPE_LEVEL_HIGH>, - <&ms_main_intc GIC_SPI INT_FIQ_SD_CDZ_0 IRQ_TYPE_LEVEL_HIGH>, + interrupts-extended = <&ms_main_intc GIC_SPI INT_IRQ_SDIO IRQ_TYPE_LEVEL_HIGH>, + <&ms_main_intc GIC_SPI INT_IRQ_SD IRQ_TYPE_LEVEL_HIGH>,//was INT_IRQ_SDIO <&ms_main_intc GIC_SPI INT_FIQ_SD_CDZ_1 IRQ_TYPE_LEVEL_HIGH>, + <&ms_main_intc GIC_SPI INT_FIQ_SD_CDZ_0 IRQ_TYPE_LEVEL_HIGH>, <&ms_main_intc GIC_SPI INT_FIQ_SD_CDZ_0 IRQ_TYPE_LEVEL_HIGH>; - interrupt-names = "mie0_irq", "mie1_irq", "cdz_slot0_irq", "cdz_slot1_irq", "cdz_slot2_irq"; + interrupt-names = "mie1_irq", "mie0_irq", "cdz_slot1_irq", "cdz_slot0_irq", "cdz_slot2_irq"; };