SD卡移植
在linux-2.6.30.4 中自带了SD卡的驱动,我们只需要做简单的改懂就可以使用SD卡。并且该SD卡驱动支持到32GB 的超大容量。
参考资料:tq移植手册
修改"arch/arm/plat-s3c24xx/common-smdk.c" 在186行添加
- smdk_devs数组中需要添加s3c_device_sdi设备
修改"divers/mmc/host/s3cmci.c"
- 修改mmc驱动。drivers/mmc/host/s3cmci.c文件的s3cmci_probe()函数中需要修改CardDetect中断号,根据开发板的设置此中断号为EINT16,对应s3c2440为GPG8引脚。具体添加内容如下:
//host->irq_cd = s3c2410_gpio_getirq(host->pdata->gpio_detect);
//添加irq_cd的中断号为IRQ_EINT16且设置GPG8脚为16号中断的输入引脚
host->irq_cd = IRQ_EINT16;
s3c2410_gpio_cfgpin(S3C2410_GPG(8),S3C2410_GPG8_EINT16);
make menuconfig 选项支持 SD卡
- Device Driver
- <*>MMC/SD/SDIO card support->
- ---MMC/SD/SDIO card support
- <*> MMC block device driver
- [*] MMC block device driver
- [*] Use bounce buffer for simple hosts
- <*> Samsung S3C SD/MMC Card Interface suppoet
- 其他的不选
启动过程
- 。。。。。。。
- usbcore: registered new interface driver libusual
-
usbcore: registered new interface driver usbserial
-
USB Serial support registered for generic
-
usbcore: registered new interface driver usbserial_generic
-
usbserial: USB Serial Driver core
-
USB Serial support registered for FTDI USB Serial Device
-
usbcore: registered new interface driver ftdi_sio
-
ftdi_sio: v1.4.3:USB FTDI Serial Converters Driver
-
USB Serial support registered for pl2303
-
usbcore: registered new interface driver pl2303
-
pl2303: Prolific PL2303 USB to serial adaptor driver
-
mice: PS/2 mouse device common for all mice
-
S3C2410 Watchdog Timer, (c) 2004 Simtec Electronics
-
s3c2410-wdt s3c2410-wdt: watchdog inactive, reset disabled, irq enabled
-
mapped channel 0 to 0
-
s3c2440-sdi s3c2440-sdi: powered down.
-
s3c2440-sdi s3c2440-sdi: initialisation done.
-
s3c2440-sdi s3c2440-sdi: running at 0kHz (requested: 0kHz).
-
Advanced Linux Sound Architecture Driver Version 1.0.20.
-
ALSA device list:
-
No soundcards found.
-
s3c2440-sdi s3c2440-sdi: running at 196kHz (requested: 195kHz).
-
TCP cubic registered
-
NET: Registered protocol family 17
-
RPC: Registered udp transport module.
-
RPC: Registered tcp transport module.
-
s3c2440-sdi s3c2440-sdi: running at 196kHz (requested: 195kHz).
-
s3c2440-sdi s3c2440-sdi: running at 196kHz (requested: 195kHz).
-
s3c2440-sdi s3c2440-sdi: powered down.
-
yaffs: dev is 32505858 name is "mtdblock2"
-
yaffs: passed flags ""
-
yaffs: Attempting MTD mount on 31.2, "mtdblock2"
- 。。。。。。
操作过程
- [\u@\h \W]# ls
-
bin lib opt sddisk usr
-
dev linuxrc proc sys var
-
etc lost+found root tmp web
-
home mnt sbin udisk
-
[\u@\h \W]# s3c2440-sdi s3c2440-sdi: running at 0kHz (requested: 0kHz).
-
s3c2440-sdi s3c2440-sdi: running at 196kHz (requested: 195kHz).
-
s3c2440-sdi s3c2440-sdi: running at 196kHz (requested: 195kHz).
-
s3c2440-sdi s3c2440-sdi: running at 196kHz (requested: 195kHz).
-
s3c2440-sdi s3c2440-sdi: running at 196kHz (requested: 195kHz).
-
s3c2440-sdi s3c2440-sdi: running at 196kHz (requested: 195kHz).
-
s3c2440-sdi s3c2440-sdi: running at 196kHz (requested: 195kHz).
-
s3c2440-sdi s3c2440-sdi: running at 196kHz (requested: 195kHz).
-
s3c2440-sdi s3c2440-sdi: running at 25000kHz (requested: 25000kHz).
-
s3c2440-sdi s3c2440-sdi: running at 25000kHz (requested: 25000kHz).
-
mmc0: new SD card at address d175
-
mmcblk1: mmc0:d175 SD02G 1.83 GiB
-
mmcblk1: p1 ####注意这里 把mmcblk1 和p1 和在一起就是设备名称,挂载时使用
-
FAT: utf8 is not a recommended IO charset for FAT filesystems, filesystem will be case
-
-
[\u@\h \W]# mount /dev/mmcblk1p1 /mnt/sd/
-
[\u@\h \W]# ls /mnt/sd/
-
libpng12.so test.txt
-
[\u@\h \W]# umount /mnt/sd/
阅读(2992) | 评论(0) | 转发(0) |