Open main menu

DAVE Developer's Wiki β

Changes

DESK-MX9-L/Peripherals/SD

3,972 bytes added, 30 January
Created page with "<section begin=History/> {| style="border-collapse:collapse; " !colspan="4" style="width:100%; text-align:left"; border-bottom:solid 2px #ededed"|History |- ! style="border-l..."
<section begin=History/>
{| style="border-collapse:collapse; "
!colspan="4" style="width:100%; text-align:left"; border-bottom:solid 2px #ededed"|History
|-
! style="border-left:solid 2px #73B2C7; border-right:solid 2px #73B2C7;border-top:solid 2px #73B2C7; border-bottom:solid 2px #73B2C7; background-color:#ededed; padding:5px; color:#000000" |2024/01/30
! style="border-left:solid 2px #73B2C7; border-right:solid 2px #73B2C7;border-top:solid 2px #73B2C7; border-bottom:solid 2px #73B2C7; background-color:#ededed; padding:5px; color:#000000" |DESK-MX9-L-5.0.0 release
|-
|}
<section end=History/>
<section begin=Body/>

==Peripheral SD==

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

==== AURA SOM ====
Here below an example of device tree configuration used on standard DAVE's kit for the ORCA SOM:

From <code>imx93-aura-cb2001.dts</code>:

<pre>
...
&usdhc2 {
status = "okay";
};
...
</pre>

From <code>imx93-aura.dtsi</code>:

<pre>
...
&usdhc2 {
pinctrl-names = "default", "state_100mhz", "state_200mhz";
pinctrl-0 = <&pinctrl_usdhc2>, <&pinctrl_usdhc2_gpio>;
pinctrl-1 = <&pinctrl_usdhc2>, <&pinctrl_usdhc2_gpio>;
pinctrl-2 = <&pinctrl_usdhc2>, <&pinctrl_usdhc2_gpio>;
cd-gpios = <&gpio3 00 GPIO_ACTIVE_LOW>;
bus-width = <4>;
no-sdio;
no-mmc;
disable-wp;
no-1-8-v;
status = "disabled";
};
...
&iomuxc {
...
pinctrl_usdhc2_gpio: usdhc2gpiogrp {
fsl,pins = <
MX93_PAD_SD2_CD_B__GPIO3_IO00 0x31e
>;
};

pinctrl_usdhc2: usdhc2grp {
fsl,pins = <
MX93_PAD_SD2_CLK__USDHC2_CLK 0x17fe
MX93_PAD_SD2_CMD__USDHC2_CMD 0x13fe
MX93_PAD_SD2_DATA0__USDHC2_DATA0 0x13fe
MX93_PAD_SD2_DATA1__USDHC2_DATA1 0x13fe
MX93_PAD_SD2_DATA2__USDHC2_DATA2 0x13fe
MX93_PAD_SD2_DATA3__USDHC2_DATA3 0x13fe
MX93_PAD_SD2_VSELECT__USDHC2_VSELECT 0x51e
>;
};
...
};
</pre>

===Accessing the peripheral in AURA SOM===

Once initialized, the SD device is mapped to the standard <code>/dev/mmcblk1pX</code> block device, depending on how many partition are created on the SD card.

====Linux messages at boot time====

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.:

<pre class="workstation-terminal">
...
...
[ 1.347520] sdhci: Secure Digital Host Controller Interface driver
[ 1.353715] sdhci: Copyright(c) Pierre Ossman
[ 1.365042] sdhci-pltfm: SDHCI platform and OF driver helper
...
[ 1.402850] mmc0: SDHCI controller on 42850000.mmc [42850000.mmc] using ADMA
[ 1.525510] mmc0: new DDR MMC card at address 0001
[ 1.532646] mmcblk0: mmc0:0001 DG4008 7.28 GiB
[ 1.543004] mmcblk0: p1 p2
[ 1.549076] mmcblk0boot0: mmc0:0001 DG4008 4.00 MiB
[ 1.557364] mmcblk0boot1: mmc0:0001 DG4008 4.00 MiB
[ 1.566409] mmcblk0rpmb: mmc0:0001 DG4008 4.00 MiB, chardev (234:0)
[ 1.814684] sdhci-esdhc-imx 42860000.mmc: Got CD GPIO
[ 1.851039] mmc1: SDHCI controller on 42860000.mmc [42860000.mmc] using ADMA
[ 1.889752] mmc1: new high speed SDHC card at address 5048
[ 1.900514] mmcblk1: mmc1:5048 SD32G 28.9 GiB
[ 1.906361] mmcblk1: p1 p2
[ 2.358195] EXT4-fs (mmcblk1p2): mounted filesystem with ordered data mode. Quota mode: none.
[ 4.890543] EXT4-fs (mmcblk1p2): re-mounted. Quota mode: none.
...
</pre>

=== Additional information ===

If are executed the boot with NFS the file system configuration does automatically mount the uSD partitions.

<pre class="workstation-terminal">
root@desk-mx93:~# lsblk /dev/mmcblk1
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
mmcblk1 179:96 0 28.9G 0 disk
|-mmcblk1p1 179:97 0 83.2M 0 part /run/media/boot-mmcblk1p1
`-mmcblk1p2 179:98 0 6.5G 0 part /run/media/root-mmcblk1p2
root@desk-mx93:~#
</pre>

----

[[Category:AURA]] [[Category:SBCX AURA]]
dave_user
226
edits