1.1、修改arch/arm/mach-s3c2440/mach-smdk2440.c,在Platform_device结构体中,加入:
#if defined(CONFIG_MMC_S3C)
&s3c_device_sdi,
#endif
1.2、修改drivers/mmc/host/s3cmci.c文件,将s3cmci_def_pdata结构的内容修改为:
static struct s3c24xx_mci_pdata s3cmci_def_pdata = {
.gpio_detect = S3C2410_GPG(8),
.gpio_wprotect = S3C2410_GPH(8),
.set_power = NULL,
.ocr_avail = MMC_VDD_32_33|MMC_VDD_33_34,
};
1.3、配置内核,支持SD:
Device Drivers --->
<*> MMC/SD/SDIO card support --->
<*> MMC block device driver
Use bounce buffer for simple hosts
<*> Sumsung S3C SD/MMC Card Interface support
Hardware support for SDIO IRQ
Samsung S3C SD/MMC transfer code (Use PIO transfers only)
编译内核然后下载
插入SD卡后出现
说明驱动移植成功
查看SD在/dev下的文件
挂在到mnt/mmc上
#mount -t vfat dev/mmcblk0p4 /mnt/mmc/
ls /mnt/mmc
可看到SD卡中的内容