Linux USB mass storage porting guide

今天接收到一個任務,是在ARM的版子上加入USB SD讀卡機的功能,
本想說是個簡單任務,只要把以下幾項加入就OKAY了
#USB support
CONFIG_USB=y
#platform specific
CONFIG_USB_ARCH_HAS_HCD=y
CONFIG_USB_ARCH_HAS_OHCI=y
#IXP host driver
CONFIG_USB_EHCI_HCD=y
CONFIG_IXP4XX_USB_EHCI_HCD=y
#USB storage
CONFIG_USB_STORAGE=y
#SCSI support
CONFIG_SCSI=y
#SCSI storage device
CONFIG_BLK_DEV_SD=y
CONFIG_FAT_FS=y
CONFIG_MSDOS_FS=y
CONFIG_VFAT_FS=y

可是卻得到以下的錯誤:
usb 2-1: USB disconnect, address 2
usb 1-1: new high speed USB device using ixp4xx-ehci and address 2
usb 1-1: configuration #1 chosen from 1 choice
scsi1 : SCSI emulation for USB Mass Storage devices
Vendor: Generic Model: USB SD Reader Rev: 1.00
Type: Direct-Access ANSI SCSI revision: 00
SCSI device sda: 497664 512-byte hdwr sectors (255 MB)
sda: Write Protect is off
sda: assuming drive cache: write through
SCSI device sda: 497664 512-byte hdwr sectors (255 MB)
sda: Write Protect is off
sda: assuming drive cache: write through
sda: unknown partition table

找了一下,在Partition Types裡面找到這兩項
CONFIG_PARTITION_ADVANCED=y
CONFIG_MSDOS_PARTITION=y
把他們加入就沒問題了

留言

damien表示…
Hi 河馬,
Do you know how to build a kernel without composite USB support? I would like to build a kernel that only appears as a gadget device (e.g. keyboard) to the host machine. if you can help would be much appreciated.
嗨!Damien,
你沒有留信箱就回在這裡
剛google了一下,發現這篇蠻接近你說的,你可以參考看看
http://www.linux-usb.org/gadget/

這個網誌中的熱門文章

RTC & CMOS 技術詳解

[自由網路] 如何取得 Google Drive (真實)外連位址 (Direct Link)

教你三招突破網管封鎖