分类: LINUX
2014-10-09 15:16:12
原文地址:Linux3.6.7在OK6410平台的移植(九)MMC 作者:STANzxd
mach-ok6410.c文件里面增加以下内容:
#include
/* MMC/SD config */
static struct s3c_sdhci_platdata ok6410_hsmmc0_pdata = {
.max_width = 4,
.cd_type = S3C_SDHCI_CD_INTERNAL,
};
static struct s3c_sdhci_platdata ok6410_hsmmc1_pdata = {
.max_width = 4,
.cd_type = S3C_SDHCI_CD_PERMANENT,
};
ok6410_machine_init()函数中添加:
s3c_sdhci0_set_platdata(&ok6410_hsmmc0_pdata);
s3c_sdhci1_set_platdata(&ok6410_hsmmc1_pdata);
内核配置:
系统默认已经有选上MMC/SD驱动选项,所以需要增加的是File systems 内容如下:
编译生成新的uImage,下载到开发板,重启后显示:
.........
yaffs: dev is 32505858 name is "mtdblock2" rw
yaffs: passed flags ""
mmc0: new high speed SD card at address c7b6
mmcblk0: mmc0:c7b6 SD02G 1.83 GiB
mmcblk0:
mmc1: mmc_rescan_try_freq: trying to init card at 400000 Hz
VFS: Mounted root (yaffs2 filesystem) on device 31:2.
devtmpfs: mounted the root filesystem.
Freeing init memory: 112K
.........
说明SD卡驱动已经完成,在开发板根目录下新建一个文件夹sdcard,然后挂载
[root@STANzxd /]# mkdir sdcard
[root@STANzxd /]# mount -t vfat /dev/mmcblk0 /sdcard/
[root@STANzxd /]# cd sdcard/
[root@STANzxd /sdcard]# ls
test1.txt
[root@STANzxd /sdcard]# cat test1.txt
this is a test file.