OpenWrt NetSoM developers guide. Adding support of microSD card.
Here explained steps of SDHC interface usage to get on OpenWrt MicroSD card.
Schematic
First of all we need to check schematic to determine what pads used for microSD:
There is connection to MicroSD socket.
Following Microprocessor pads used:
DTS
Next step is modification of DTS to be related to schematic.
Root node presenting each interface:
usdhc1 = &usdhc1;
Node implementation:
&usdhc1 {
pinctrl-names = “default”;
pinctrl-0 = <&pinctrl_usdhc1>;
cd-gpios = <&gpio1 19 GPIO_ACTIVE_LOW>;
keep-power-in-suspend;
wakeup-source;
status = “okay”;
}
pinctrl-names = “default”;
pinctrl-0 = <&pinctrl_usdhc1>;
cd-gpios = <&gpio1 19 GPIO_ACTIVE_LOW>;
keep-power-in-suspend;
wakeup-source;
status = “okay”;
}
And the last one is map of PADS used by interface:
pinctrl_usdhc1: usdhc1grp {
fsl,pins = <
MX6UL_PAD_SD1_CMD__USDHC1_CMD 0x170b9
MX6UL_PAD_SD1_CLK__USDHC1_CLK 0x100b9
MX6UL_PAD_SD1_DATA0__USDHC1_DATA0 0x170b9
MX6UL_PAD_SD1_DATA1__USDHC1_DATA1 0x170b9
MX6UL_PAD_SD1_DATA2__USDHC1_DATA2 0x170b9
MX6UL_PAD_SD1_DATA3__USDHC1_DATA3 0x170b9
>;
};
fsl,pins = <
MX6UL_PAD_SD1_CMD__USDHC1_CMD 0x170b9
MX6UL_PAD_SD1_CLK__USDHC1_CLK 0x100b9
MX6UL_PAD_SD1_DATA0__USDHC1_DATA0 0x170b9
MX6UL_PAD_SD1_DATA1__USDHC1_DATA1 0x170b9
MX6UL_PAD_SD1_DATA2__USDHC1_DATA2 0x170b9
MX6UL_PAD_SD1_DATA3__USDHC1_DATA3 0x170b9
>;
};
After DTS modification it is time to rebuild image and update firmware. Explained here. The only last step after that is mount microSD card after your system boots with new image:
# ls /dev/mmc*
/dev/mmcblk0 /dev/mmcblk0p1
/dev/mmcblk0 /dev/mmcblk0p1
Here we see microSD card with one partition.
Mount it:
# mount /dev/mmcblk0p1 /mnt/
And check:
# ls /mnt/
hello.txt lost+found
hello.txt lost+found
Here is previously prepared MicroSD card (EXT4 formatted).