Difference between revisions of "DESK-MX9-L/Peripherals/SD"

From DAVE Developer's Wiki
Jump to: navigation, search
Line 3: Line 3:
 
! colspan="4" style="width:100%; text-align:left" ; border-bottom:solid 2px #ededed" |History
 
! 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:#73B2C7; padding:5px; color:white"|Issue Date
! 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
+
!style="border-left:solid 2px #73B2C7; border-right:solid 2px #73B2C7;border-top:solid 2px #73B2C7; border-bottom:solid 2px #73B2C7; background-color:#73B2C7; padding:5px; color:white"|Notes
 +
|-
 +
| style="border-left:solid 2px #73B2C7; border-right:solid 2px #73B2C7;border-top:solid 2px #73B2C7; border-bottom:solid 2px #73B2C7; background-color:#edf8fb; 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:#edf8fb; padding:5px; color:#000000" |DESK-MX9-L-5.0.0 release
 
|-
 
|-
 
|}
 
|}
 
<section end="History" />
 
<section end="History" />
 +
__FORCETOC__
 
<section begin="Body" />
 
<section begin="Body" />
  
Line 13: Line 17:
  
 
=== Device tree configuration ===
 
=== 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).
+
''N.B.'' 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).
  
==== AURA SOM ====
+
Here below is an example of device tree configuration used on standard DAVE's kit for the AURA SOM:
Here below an example of device tree configuration used on standard DAVE's kit for the AURA SOM:
 
  
 
From <code>imx93-aura-cb2001.dts</code>:
 
From <code>imx93-aura-cb2001.dts</code>:
Line 69: Line 72:
 
</pre>
 
</pre>
  
===Accessing the peripheral in AURA SOM===
+
===Accessing the peripheral ===
  
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.
+
Once initialized, the SD device is mapped to the standard <code>/dev/mmcblk1pX</code> block device, depending on how many partitions are created on the SD card.
  
 
====Linux messages at boot time====
 
====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.:
+
If the microSD card is inserted at boot time, the kernel - once the USDHC interface has been initialized - prints the device information and the partitions detected like ''p1'', ''p2'', etc.:
  
 
<pre class="workstation-terminal">
 
<pre class="workstation-terminal">
Line 103: Line 106:
 
=== Additional information ===
 
=== Additional information ===
  
If are executed the boot with NFS the file system configuration does automatically mount the uSD partitions.
+
If booting from NFS, the file system configuration automatically mounts the uSD partitions.
  
 
<pre class="workstation-terminal">
 
<pre class="workstation-terminal">
Line 114: Line 117:
 
</pre>
 
</pre>
  
----
+
<section end="Body" />
  
[[Category:AURA]]
+
[[Category:AURA]]
[[Category:SBCX AURA]]
 

Revision as of 09:20, 1 February 2024

History
Issue Date Notes
2024/01/30 DESK-MX9-L-5.0.0 release



Peripheral SD[edit | edit source]

Device tree configuration[edit | edit source]

N.B. 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).

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

From imx93-aura-cb2001.dts:

...
&usdhc2 {
	status = "okay";
};
...

From imx93-aura.dtsi:

...
&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
		>;
	};
...
};

Accessing the peripheral[edit | edit source]

Once initialized, the SD device is mapped to the standard /dev/mmcblk1pX 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 partitions detected like p1, p2, etc.:

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

Additional information[edit | edit source]

If booting from NFS, the file system configuration automatically mounts the uSD partitions.

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:~#