Chinaunix首页 | 论坛 | 博客
  • 博客访问: 214717
  • 博文数量: 20
  • 博客积分: 1410
  • 博客等级: 上尉
  • 技术积分: 235
  • 用 户 组: 普通用户
  • 注册时间: 2008-03-14 18:47
文章分类

全部博文(20)

文章存档

2009年(6)

2008年(14)

我的朋友

分类: LINUX

2008-04-09 18:46:57

Linux 2.6.24.4移植到S3C2410(nano2410)之:USB

 

 

 

【平台信息】

目标板(Nano2410)------------------------

CPU:        S3C2410X

SDRAM:    HY57V561620(32MB)

FLASH:    K9F1208(64MB)

NET:         CS8900

 

HOST---------------------------------------

Linux Realse Version:       Fecora Cor 8 (FC8)

CrossCompiler:                 gcc-4.1.1/glibc-2.3.2

 

 

 

问题的提出:

 

内核配置时使用smdk2410的默认配置. U盘不能挂载!

 

    插拔U盘提示信息为:

$ usb 1-1: USB disconnect, address 2

usb 1-1: new full speed USB device using s3c2410-ohci and address 3

usb 1-1: configuration #1 chosen from 1 choice

 

查看partitions下的分区信息,没有出现USB设备

root@kevin /proc

$ cat partitions

major minor  #blocks  name

 

  31     0       1024 mtdblock0

  31     1       3072 mtdblock1

  31     2      40960 mtdblock2

  31     3      20480 mtdblock3

 

root@kevin /dev

$ ls u*

urandom         usbdev1.1_ep00  usbdev1.2       usbdev1.2_ep01

usbdev1.1       usbdev1.1_ep81  usbdev1.2_ep00  usbdev1.2_ep82

 

 

解决方法:

 

   重新配置内核, 启用SCSI device support, SCSI相关模块最好编译进内核,不要以module形式编译.

   插上U盘后,显示:

usb 1-1: new full speed USB device using s3c2410-ohci and address 3

usb 1-1: configuration #1 chosen from 1 choice

scsi1 : SCSI emulation for USB Mass Storage devices

scsi 1:0:0:0: Direct-Access              USB Flash Disk   1.06 PQ: 0 ANSI: 0 CCS

 

sd 1:0:0:0: [sda] 129312 512-byte hardware sectors (66 MB)

sd 1:0:0:0: [sda] Write Protect is off

sd 1:0:0:0: [sda] Assuming drive cache: write through

sd 1:0:0:0: [sda] 129312 512-byte hardware sectors (66 MB)

sd 1:0:0:0: [sda] Write Protect is off

sd 1:0:0:0: [sda] Assuming drive cache: write through

 sda: sda1

 sda: p1 exceeds device capacity

sd 1:0:0:0: [sda] Attached SCSI removable disk

 

 

dmesg查看信息:

dmesg

sd 0:0:0:0: [sda] 129312 512-byte hardware sectors (66 MB)

sd 0:0:0:0: [sda] Write Protect is off

sd 0:0:0:0: [sda] Mode Sense: 00 06 00 00

sd 0:0:0:0: [sda] Assuming drive cache: write through

sd 0:0:0:0: [sda] 129312 512-byte hardware sectors (66 MB)

sd 0:0:0:0: [sda] Write Protect is off

sd 0:0:0:0: [sda] Mode Sense: 00 06 00 00

sd 0:0:0:0: [sda] Assuming drive cache: write through

 sda: sda1

 sda: p1 exceeds device capacity

sd 0:0:0:0: [sda] Attached SCSI removable disk

selected clock c03200b4 (pclk) quot 27, calc 113169

 

 

root@kevin /

$ cat proc/partitions

major minor  #blocks  name

 

  31     0       1024 mtdblock0

  31     1       3072 mtdblock1

  31     2      40960 mtdblock2

  31     3      20480 mtdblock3

   8     0      64656 sda

   8     1      64656 sda1

 

 

 

u盘设备名为sda1.

$ mount -t vfat sda1 /mnt

Unable to load NLS charset cp437

FAT: codepage cp437 not found

mount: mounting sda1 on /mnt failed: Invalid argument

 

内核缺少cp437字符集. 重新配置内核, filesystems-->native language support-> 中选择Codepage 437和其他的一些常用的字符集.

 

重新mount

root@kevin /

$ mount -t vfat /dev/sda1 /mnt/usb

查看usb目录下被挂载的文件.

root@kevin /

$ ls /mnt/usb

070723_LE20C3.rar              dvpc3_tc003_070609.opj

070726_2101_LE20C3.rar         icebox.hex

080128_1313_UCOS_44B0          iic pic

080128_1313_UCOS_44B0.rar      ldlinux.sys

???????!??.txt                 le20c3.rar

DVPC3_T002_070621-2.pcb        msvcr71.dll

DVPC3_TC002_070606_LAYOUT.DSN  pcb footprint.xls

DVPC3_TC003_070609.DSN         pcb_lib

DVPC3_TC003_070609_0.DBK       rootfs.gz

DVPC3_TC03 GERBER.pcb          sr81.exe

GPIO alloc                     syslinux.cfg

MEDIAPLAYER.DSN                test

av                             test.c

bzImage                        test.txt

ch375

 

 

 

OK, U盘挂载成功了~~~

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

zhang80832008-05-18 01:03:51

hrz2008 ,谢谢支持,我现在还没做SD卡这块.不好意思 :( 你可以在驱动中添加debug信息,看看是哪里导致以上错误的.

hrz20082008-05-15 20:19:40

以下是打印的分区信息: [root@192 /]# cat /proc/partitions major minor #blocks name 31 0 192 mtdblock0 31 1 2048 mtdblock1 31 2 63280 mtdblock2 179 0 1990656 mmcblk0 179 1 1990531 mmcblk0p1 hrz66@163.com QQ 805396213 TKS

hrz20082008-05-15 20:17:29

师兄你好: 我在2.6.24下开发sd卡驱动,老板要求支持4G! 现在驱动编译出现如下错误是怎么回事? 谢谢! [root@192 /]# insmod s3cmci.ko Using s3cmci.ko s3c2410-sdi s3c2410-sdi: powered down. s3c2410-sdi s3c2410-sdi: initialisation done. [root@192 /]# s3c2410-sdi s3c2410-sdi: running at 0kHz (requested: 0kHz). s3c2410-sdi s3c2410-sdi: running at 98kHz (requested: 97kHz). s3c2410-sdi s3c2410-sdi: running at 98kHz (requested: 97kHz). s3c2410-sdi s3c2410-sdi: running at 98kHz (requested: 97kHz). s3c2410-sdi s3c2410-sdi: CMD[FAIL(-110)