添加SD设备到设备初始化列表中:
# gedit arch/arm/plat-s3c24xx/common-smdk.c
在186行:
/* devices we initialise */
static struct platform_device __initdata *smdk_devs[] = {
&s3c_device_nand,
&s3c_device_sdi, //加入这一句
&smdk_led4,
&smdk_led5,
&smdk_led6,
&smdk_led7,
};
|
添加和开发板相关的 SD 卡插拔引发的中断:
# gedit drivers/mmc/host/s3cmci.c
在1335行,添加如下内容:
host->irq_cd = IRQ_EINT16;
s3c2410_gpio_cfgpin(S3C2410_GPG8, S3C2410_GPG8_EINT16);
|
后来发现,系统启动后插入大容量卡时会出现初始化错误的问题,网上找到答案--供电未稳定~~解决方法:
# gedit drivers/mmc/core/sd.c
找到 mmc_sd_init_card() 函数的定义,
在调用 mmc_read_switch(card) 函数前加上10ms的延时,即加入下面的一句:
mdelay(10);
配置:
# make menuconfig
选上以下几项:
Device Drivers --->
<*> MMC/SD/SDIO card support --->
--- MMC/SD/SDIO card support
*** MMC/SD/SDIO Card Drivers ***
<*> MMC block device driver
*** MMC/SD/SDIO Host Controller Drivers ***
<*> Samsung S3C SD/MMC Card Interface suppor
|
编译:
# make zImage
下载新内核,启动后插入SD卡:
s3c2440-sdi s3c2440-sdi: running at 0kHz (requested: 0kHz.
s3c2440-sdi s3c2440-sdi: running at 198kHz (requested: 197kHz).
s3c2440-sdi s3c2440-sdi: running at 198kHz (requested: 197kHz).
s3c2440-sdi s3c2440-sdi: running at 198kHz (requested: 197kHz).
s3c2440-sdi s3c2440-sdi: running at 198kHz (requested: 197kHz).
s3c2440-sdi s3c2440-sdi: running at 198kHz (requested: 197kHz).
s3c2440-sdi s3c2440-sdi: running at 198kHz (requested: 197kHz).
s3c2440-sdi s3c2440-sdi: running at 198kHz (requested: 197kHz).
s3c2440-sdi s3c2440-sdi: running at 16875kHz (requested:).
s3c2440-sdi s3c2440-sdi: running at 16875kHz (requested:).
mmc0: new SD card at address e624
mmcblk0: mmc0:e624 SD128 120 MiB
mmcblk0: p1 p2
FAT: bogus number of reserved sectors 25000kHz 25000kHz
----
farsight 内核移植实验手册 .doc ----
Mini2440SDI.doc ====
http://hi.baidu.com/wenes/blog/item/c83650d7d00dbdd0a144df2e.html
阅读(789) | 评论(0) | 转发(0) |