linux-2.6.24.3下移植SD/MMC到S3C2440上的全过程
creator
sz111@126.com
移植SD/MMC驱动,费劲周折,问题最大是patch不对。不过千辛万苦总算是
找到了。特来分享。
1。首先下载2.6.24.3内核源码。其他内核不保证可以。移植部分就不讲了,如果不会参考我的其他文章。我仅仅测试了这个。
2.去*checkout*/branches/src/target/kernel/2.6.24.x/patches/s3c_mci.patch?rev=4096
下载SD/MMC patch,其他早期版本不行,我就栽倒了这个地方。
3.把 s3c_mci.patch copy到linux-2.6.24.3下。执行patch -p1 4.make menuconfig,选择MMC/SD ,选择语言CP437,ISO 8859-1,最好也同时选择SCSI相关的东西吧,连USB也一块支持了。
(昨天SD一直不成功,就把U盘测试了,至少要保证有成绩啊。
5.对于patch生成的s3cmci.c还要加入detect脚位,我选择的是S3C2410_GPG8。设定:
static struct s3c24xx_mci_pdata s3cmci_def_pdata = {
.do_dma = 0,
.gpio_detect = S3C2410_GPG8,
.set_power = NULL,
.ocr_avail = MMC_VDD_32_33,
};
6.编译下载。
出现信息如下:
--------start mdev-------
s3c2440-sdi s3c2410-sdi: running at 0kHz (requested: 0kHz).
s3c2440-sdi s3c2410-sdi: running at 198kHz (requested: 197kHz).
s3c2440-sdi s3c2410-sdi: running at 198kHz (requested: 197kHz).
s3c2440-sdi s3c2410-sdi: running at 198kHz (requested: 197kHz).
s3c2440-sdi s3c2410-sdi: CMD[FAIL(-110)] #2 op:CMD8 arg:0x000001aa flags:0x082f5
retries:0 Status:nothing to complete
s3c2440-sdi s3c2410-sdi: CMD[FAIL(-110)] #3 op:CMD5 arg:0x00000000 flags:0x082e1
retries:3 Status:nothing to complete
s3c2440-sdi s3c2410-sdi: CMD[FAIL(-110)] #4 op:CMD5 arg:0x00000000 flags:0x082e1
retries:2 Status:nothing to complete
s3c2440-sdi s3c2410-sdi: CMD[FAIL(-110)] #5 op:CMD5 arg:0x00000000 flags:0x082e1
retries:1 Status:nothing to complete
s3c2440-sdi s3c2410-sdi: CMD[FAIL(-110)] #6 op:CMD5 arg:0x00000000 flags:0x082e1
retries:0 Status:nothing to complete
s3c2440-sdi s3c2410-sdi: running at 198kHz (requested: 197kHz).
s3c2440-sdi s3c2410-sdi: running at 198kHz (requested: 197kHz).
s3c2440-sdi s3c2410-sdi: running at 198kHz (requested: 197kHz).
s3c2440-sdi s3c2410-sdi: CMD[FAIL(-110)] #10 op:CMD8 arg:0x000001aa flags:0x082f
5 retries:0 Status:nothing to complete
s3c2440-sdi s3c2410-sdi: running at 198kHz (requested: 197kHz).
s3c2440-sdi s3c2410-sdi: running at 16875kHz (requested: 25000kHz).
s3c2440-sdi s3c2410-sdi: running at 16875kHz (requested: 25000kHz).
mmc0: new SD card at address 73ef
mmcblk0: mmc0:73ef SD064 62080KiB
mmcblk0:<7>mmc0: starting CMD18 arg 00000000 flags 000000b5
p1
***********************
love linux
starting pid 801, tty '': '-/bin/sh'
Processing /etc/profile...
Set search library path in /etc/profile
Set user path in /etc/profile
Done
[root@/]#cat /proc/partitions
major minor #blocks name
31 0 384 mtdblock0
31 1 2048 mtdblock1
31 2 63040 mtdblock2
179 0 62080 mmcblk0
179 1 62060 mmcblk0p1
[root@/]#mount -t vfat /dev/mmcblk0p1 /mnt/temp
成功,ok。感谢所有的Linux开发和支持者。感谢openmoko开源软件。
阅读(4395) | 评论(5) | 转发(0) |