DESK-MX6UL-L/Peripherals/SD

From DAVE Developer's Wiki
Jump to: navigation, search
History
Issue Date Notes

2021/07/20

First DESK-MX6UL-L release

2022/03/16

DESK-MX6UL-L 3.0.0 release

2023/05/04

DESK-MX6UL-L 4.0.0 release
2024/08/07 DESK-MX6UL-L 4.2.x release


Peripheral SD[edit | edit source]

Device tree configuration[edit | edit source]

Axel ULite SOM[edit | edit source]

Here below is an example of device tree configuration used on standard DAVE's kit for the AXEL ULite SOM:

From imx6ul-axelulite.dtsi:

&usdhc1 {
        pinctrl-names = "default";
        pinctrl-0 = <&pinctrl_usdhc1>;
        cd-gpios = <&gpio1 19 GPIO_ACTIVE_LOW>;
        bus-width = <4>;
        no-1-8-v;
        keep-power-in-suspend;
        enable-sdio-wakeup;
        status = "okay";
};
...
...
&iomuxc {
...
...
        pinctrl_usdhc1: usdhc1grp {
            fsl,pins = <
                MX6UL_PAD_SD1_CMD__USDHC1_CMD       0x17059
                MX6UL_PAD_SD1_CLK__USDHC1_CLK       0x10071
                MX6UL_PAD_SD1_DATA0__USDHC1_DATA0   0x17059
                MX6UL_PAD_SD1_DATA1__USDHC1_DATA1   0x17059
                MX6UL_PAD_SD1_DATA2__USDHC1_DATA2   0x17059
                MX6UL_PAD_SD1_DATA3__USDHC1_DATA3   0x17059
                MX6UL_PAD_UART1_RTS_B__GPIO1_IO19   0x17059     /* SD1 CD */
            >;
        };
...
...
};

The USDHC interface is re-configured on the carrier device tree because of the Card Detect pin (which is related to the real board hardware implementation).

RIALTO SBC[edit | edit source]

Here below is an example of device tree configuration used on standard DAVE's kit for the RIALTO SBC:

From imx6ul-axelulite.dtsi:

&usdhc1 {
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_usdhc1>;
	cd-gpios = <&gpio1 19 GPIO_ACTIVE_LOW>;
	no-1-8-v;
	keep-power-in-suspend;
	enable-sdio-wakeup;
	status = "okay";
};
...
...
&iomuxc {
...
...
		pinctrl_usdhc1: usdhc1grp {
			fsl,pins = <
				MX6UL_PAD_SD1_CMD__USDHC1_CMD       0x17059
				MX6UL_PAD_SD1_CLK__USDHC1_CLK       0x10071
				MX6UL_PAD_SD1_DATA0__USDHC1_DATA0   0x17059
				MX6UL_PAD_SD1_DATA1__USDHC1_DATA1   0x17059
				MX6UL_PAD_SD1_DATA2__USDHC1_DATA2   0x17059
				MX6UL_PAD_SD1_DATA3__USDHC1_DATA3   0x17059
				MX6UL_PAD_UART1_RTS_B__GPIO1_IO19   0x17059	/* SD2 CD */
			>;
		};
...
...
};

The USDHC interface is re-configured on the carrier device tree because of the Card Detect pin (which is related to the real board hardware implementation).

Accessing the peripheral in Axel ULite SOM[edit | edit source]

Once initialized, the SD device is mapped to the standard /dev/mmcblk0pX block device, depending on how many partitions are created on the SD card.

Linux messages at boot time[edit | edit source]

If the microSd card is inserted at boot time, the kernel - once the USDHC interface has been initialized - prints the device information and the partition detected like p1, p2, etc.:

...
...
[    2.394568] sdhci-esdhc-imx 2190000.mmc: Got CD GPIO
[    2.451067] mmc0: SDHCI controller on 2190000.mmc [2190000.mmc] using ADMA
[    2.501056] mmc0: host does not support reading read-only switch, assuming write-enable
[    2.512002] mmc0: new high speed SDHC card at address 5048
[    2.521767] mmcblk0: mmc0:5048 SD32G 28.9 GiB 
[    2.546074]  mmcblk0: p1 p2
[    3.055471] EXT4-fs (mmcblk0p2): mounting ext3 file system using the ext4 subsystem
[    3.139912] EXT4-fs (mmcblk0p2): recovery complete
[    3.146027] EXT4-fs (mmcblk0p2): mounted filesystem with ordered data mode. Opts: (null). Quota mode: none.
[    7.093243] EXT4-fs (mmcblk0p2): re-mounted. Opts: (null). Quota mode: none.
...
...

Additional information[edit | edit source]

If the root file system configuration does not automatically mount the partition, it is possible to mount the device using the following command:

root@desk-mx6ul-axelulite:~# mkdir -p /mnt/boot
root@desk-mx6ul-axelulite:~# mount /dev/mmcblk0p1 /mnt/boot/
root@desk-mx6ul-axelulite:~# ls /mnt/boot/
boot.scr  desk-mx6ul-l-4.0.0_imx6ul-axelulite-cb003a.dtb  desk-mx6ul-l-4.0.0_uImage  splash_image.bmp

and then the mounted partition is available on the /mnt/boot root file system directory.

Accessing the peripheral in RIALTO SBC[edit | edit source]

Once initialized, the SD device is mapped to the standard /dev/mmcblk0pX block device, depending on how many partitions are created on the SD card.

Linux messages at boot time[edit | edit source]

If the microSd card is inserted at boot time, the kernel - once the USDHC interface has been initialized - prints the device information and the partition detected like p1, p2, etc.:

...
...
[    2.664756] sdhci: Secure Digital Host Controller Interface driver
[    2.671049] sdhci: Copyright(c) Pierre Ossman
[    2.675429] sdhci-pltfm: SDHCI platform and OF driver helper
[    2.683712] sdhci-esdhc-imx 2190000.mmc: Got CD GPIO
[    2.752188] mmc0: SDHCI controller on 2190000.mmc [2190000.mmc] using ADMA
[    2.819418] mmc0: host does not support reading read-only switch, assuming write-enable
[    2.837977] mmc0: new high speed SDHC card at address aaaa
[    2.856731] mmcblk0: mmc0:aaaa SA16G 14.8 GiB
[    3.404407] EXT4-fs (mmcblk0p2): mounted filesystem with ordered data mode. Opts: (null). Quota mode: none.
[    3.414605] VFS: Mounted root (ext4 filesystem) on device 179:2.
[    7.470880] EXT4-fs (mmcblk0p2): re-mounted. Opts: (null). Quota mode: none.
...
...

Additional information[edit | edit source]

If the root file system configuration does not automatically mount the partition, it is possible to mount the device using the following command:

root@desk-mx6ul-rialto:~# mkdir -p /mnt/boot
root@desk-mx6ul-rialto:~# mount /dev/mmcblk0p1 /mnt/boot/
root@desk-mx6ul-rialto:~# ls /mnt/boot/
'System Volume Information'   boot.scr   imx6ul-lynx-som0022-cb0090.dtb   linux_testfile.txt   splash_image.bmp   uImage   uboot_testfile.txt
root@desk-mx6ul-rialto:~#

and then the mounted partition is available on the /mnt/boot root file system directory.