- 论坛徽章:
- 0
|
16)、SD卡驱动移植
添加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
去除SD驱动bug
# gedit drivers/mmc/host/s3cmci.c
if (s3c2410_dma_request(host->dma, &s3cmci_dma_client, NULL)) {
dev_err(&pdev->dev, "unable to get DMA channel.\n");
//ret = -EBUSY;
//goto probe_free_irq_cd;
}
配置
# 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: 25000kHz).s3c2440-sdi s3c2440-sdi: running at 16875kHz (requested: 25000kHz).mmc0: new SD card at address e624mmcblk0: mmc0:e624 SD128 120 MiB mmcblk0: p1 p2FAT: bogus number of reserved sectors
[color="#660199"]OK!
[color="#02368d"]使用Busybox定制根文件系统
[color="#02368d"]
本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u1/49274/showart_2059915.html |
|