前一篇文章已经移植好CAN,本文来移植eMMC。eMMC的移植一般来讲比较简单,因为MMC驱动是由官方维护的,一般来讲,不会有什么问题,对我们来说,只需要正确的配置各个pin脚的复用关系,这种情况也是DTS最擅长的。下面我们开始eMMC移植。
DTS编写
参考sabresd的DTS,我们可以如下编写DTS:
&usdhc4 {
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_usdhc4_1>;
bus-width = <8>;
non-removable;
no-1-8-v;
keep-power-in-suspend;
status = "okay";
};
由于tqimx6q的eMMC管脚复用关系与imx6qdl.dtsi中的pinctrl_usdhc4_1是完全一致的,因此,可以直接使用该组配置。修改好以上内容后重新编译并烧写DTB。
测试方法
测试eMMC是否好用的方法有很多,本文的测试手段是将MMC的整体划分为一个分区并格式化为FAT32文件系统,如果以上操作能够成功完成,则表示eMMC已经正常工作。
Step1. 创建分区。使用fdisk创建分区:
@tqimx6q #fdisk /dev/mmcblk1
The number of cylinders for this disk is set to 238592.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) sof