Linux4.9.9内核SD卡移植(适配fs4412平台)


本文适配fs4412开发板,使用的内核为linux4.9.9。
1.修改设备树
vi arch/arm/boot/dts/exynos4412-liebao.dts
修改:

              &sdhci_2 {
              bus-width = <4>;
              pinctrl-0 = <&sd2_clk &sd2_cmd &sd2_bus4 &sd2_cd>;
              pinctrl-names = "default";
              vmmc-supply = <&mmc_reg>;
              status = "okay";
              };
              为:
              &sdhci_2 {
              bus-width = <4>;
              pinctrl-0 = <&sd2_clk &sd2_cmd &sd2_bus4>;
              cd-gpios = <&gpx0 7 0>;
              cd-inverted = <0>;
              pinctrl-names = "default";
              // vmmc-supply = <&mmc_reg>;
              status = "okay";
              };
              
2.配置内核
make menuconfig
2.1 配置SD卡驱动
              Device Drivers --->
              <*> MMC/SD/SDIO card support --->
              <*> Secure Digital Host Controller Interface support
              <*> SDHCI support on Samsung S3C SoC
              
2.2 文件系统的支持
              File systems --->
              DOS/FAT/NT Filesystems --->
              <*> MSDOS fs support
              <*> VFAT (Windows-95) fs support
              (437) Default codepage for FAT
              (iso8859-1) Default iocharset for FAT
              
2.3 本地语言编码支持
              -*- Native language support --->
              <*> Codepage 437 (United States, Canada)
              <*> Simplified Chinese charset (CP936, GB2312)
              <*> ASCII (United States)
              <*> NLS ISO 8859-1 (Latin 1; Western European Languages)
              <*> NLS UTF-8
              
3.编译内核和设备树
              make uImage -j2 LOADADDR=0X40008000
              make dtbs
              
4 .测试
拷贝内核和设备树文件到/tftpboot 目录下
cp arch/arm/boot/uImage /tftpboot
cp arch/arm/boot/dts/exynos4412-liebao.dtb /tftpboot/
启动开发板:
将SD卡插入开发板,关注终端打印信息。
[ 499.301302] mmc0: new high speed SDHC card at address 1234
[ 499.305842] mmcblk0: mmc0:1234 SA04G 3.71 GiB
[ 499.312642] mmcblk0: p1
挂载, 注意不要挂在 C EMMC 的分区
$ mount -t vfat /dev/mmcblk0p1 /mnt
查看/mnt/目录即可看到 sd 卡中内容
注:有关linux4.9.9内核的移植见《移植最新的linux4.9.9内核(适配fs4412平台)》:
http://blog.csdn.net/liebao_han/article/details/79436819
文章内容持续更新。
————————————————
版权声明:本文为CSDN博主「做一个有追求的工程师」的编辑整理,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/liebao_han/article/details/79439555

相关阅读:
linux基础
linux怎么学
linux和GNU
GNU Free Documentation License
最受欢迎的linux发行版
initroot编辑整理,转载请注明www.initroot.com

100次点赞 100次阅读