Chinaunix首页 | 论坛 | 博客
  • 博客访问: 4471513
  • 博文数量: 1148
  • 博客积分: 25453
  • 博客等级: 上将
  • 技术积分: 11949
  • 用 户 组: 普通用户
  • 注册时间: 2010-05-06 21:14
文章分类

全部博文(1148)

文章存档

2012年(15)

2011年(1078)

2010年(58)

分类: 嵌入式

2011-04-01 11:25:29

SD卡移植
    在linux-2.6.30.4 中自带了SD卡的驱动,我们只需要做简单的改懂就可以使用SD卡。并且该SD卡驱动支持到32GB 的超大容量。

参考资料:tq移植手册
         



    修改"arch/arm/plat-s3c24xx/common-smdk.c" 在186行添加
  1. smdk_devs数组中需要添加s3c_device_sdi设备

    修改"divers/mmc/host/s3cmci.c"
  1. 修改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卡
  1. Device Driver
  2.     <*>MMC/SD/SDIO card support->
  3.      ---MMC/SD/SDIO card support
  4.         <*> MMC block device driver
  5.         [*] MMC block device driver
  6.         [*] Use bounce buffer for simple hosts
  7.         <*> Samsung S3C SD/MMC Card Interface suppoet 
  8.        其他的不选

启动过程

  1. 。。。。。。。
  2. usbcore: registered new interface driver libusual
  3. usbcore: registered new interface driver usbserial
  4. USB Serial support registered for generic
  5. usbcore: registered new interface driver usbserial_generic
  6. usbserial: USB Serial Driver core
  7. USB Serial support registered for FTDI USB Serial Device
  8. usbcore: registered new interface driver ftdi_sio
  9. ftdi_sio: v1.4.3:USB FTDI Serial Converters Driver
  10. USB Serial support registered for pl2303
  11. usbcore: registered new interface driver pl2303
  12. pl2303: Prolific PL2303 USB to serial adaptor driver
  13. mice: PS/2 mouse device common for all mice
  14. S3C2410 Watchdog Timer, (c) 2004 Simtec Electronics
  15. s3c2410-wdt s3c2410-wdt: watchdog inactive, reset disabled, irq enabled
  16. mapped channel 0 to 0
  17. s3c2440-sdi s3c2440-sdi: powered down.
  18. s3c2440-sdi s3c2440-sdi: initialisation done.
  19. s3c2440-sdi s3c2440-sdi: running at 0kHz (requested: 0kHz).
  20. Advanced Linux Sound Architecture Driver Version 1.0.20.
  21. ALSA device list:
  22.   No soundcards found.
  23. s3c2440-sdi s3c2440-sdi: running at 196kHz (requested: 195kHz).
  24. TCP cubic registered
  25. NET: Registered protocol family 17
  26. RPC: Registered udp transport module.
  27. RPC: Registered tcp transport module.
  28. s3c2440-sdi s3c2440-sdi: running at 196kHz (requested: 195kHz).
  29. s3c2440-sdi s3c2440-sdi: running at 196kHz (requested: 195kHz).
  30. s3c2440-sdi s3c2440-sdi: powered down.
  31. yaffs: dev is 32505858 name is "mtdblock2"
  32. yaffs: passed flags ""
  33. yaffs: Attempting MTD mount on 31.2, "mtdblock2"
  34. 。。。。。。



操作过程

  1. [\u@\h \W]# ls
  2. bin lib opt sddisk usr
  3. dev linuxrc proc sys var
  4. etc lost+found root tmp web
  5. home mnt sbin udisk
  6. [\u@\h \W]# s3c2440-sdi s3c2440-sdi: running at 0kHz (requested: 0kHz).
  7. s3c2440-sdi s3c2440-sdi: running at 196kHz (requested: 195kHz).
  8. s3c2440-sdi s3c2440-sdi: running at 196kHz (requested: 195kHz).
  9. s3c2440-sdi s3c2440-sdi: running at 196kHz (requested: 195kHz).
  10. s3c2440-sdi s3c2440-sdi: running at 196kHz (requested: 195kHz).
  11. s3c2440-sdi s3c2440-sdi: running at 196kHz (requested: 195kHz).
  12. s3c2440-sdi s3c2440-sdi: running at 196kHz (requested: 195kHz).
  13. s3c2440-sdi s3c2440-sdi: running at 196kHz (requested: 195kHz).
  14. s3c2440-sdi s3c2440-sdi: running at 25000kHz (requested: 25000kHz).
  15. s3c2440-sdi s3c2440-sdi: running at 25000kHz (requested: 25000kHz).
  16. mmc0: new SD card at address d175
  17. mmcblk1: mmc0:d175 SD02G 1.83 GiB
  18.  mmcblk1: p1      ####注意这里  把mmcblk1 和p1 和在一起就是设备名称,挂载时使用
  19. FAT: utf8 is not a recommended IO charset for FAT filesystems, filesystem will be case

  20. [\u@\h \W]# mount /dev/mmcblk1p1 /mnt/sd/
  21. [\u@\h \W]# ls /mnt/sd/
  22. libpng12.so test.txt
  23. [\u@\h \W]# umount /mnt/sd/






阅读(2986) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~