Linux4.9.9核心SD卡移植(適配fs4412平臺)
阿新 • • 發佈:2018-11-28
本文適配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
文章內容持續更新。