受保護的文章:S3C2440, USB in Linux

Posted on 四月 28, 2008. Filed under: 菸酒生歲月, Linux, 嵌入式相關 | 標籤:, , , , , , , , , , |

該內容受密碼保護。如欲檢視請在下方輸入你的密碼:

繼續閱讀 | Make a Comment ( 輸入你的密碼方能觀看迴響。 )

ASUS WL-167G (USB WLAN Adapter) For ARM Linux

Posted on 四月 28, 2008. Filed under: 菸酒生歲月, Linux | 標籤:, , , , , , |

great~ it offers linux driver~

copy the directory Linux/rt73 in the Driver CDROM    ( remember to chmod +w )

follow the README in Linux/rt73/module/

if you got error “undefined get_wireless_stats"

just fix rtmp_main.c, replace  netdev->get_wireless_stats to netdev->get_stats

=======================================

編譯module

網路上有非官方driver : rt2x00 project

每天最新版本

或是直接用CVS更新

cvs -d:pserver:anonymous@rt2400.cvs.sourceforge.net:/cvsroot/rt2400 login

cvs -z3 -d:pserver:anonymous@rt2400.cvs.sourceforge.net:/cvsroot/rt2400 co -P source/rt73

修改Makefile

最前面增加五行

ARCH=arm

CROSS_COMPILE=/usr/local/arm/3.4.1/bin/arm-linux-

KERNDIR=/home2/fyodor/kernel/linux-2.6.25__from__2.6.24.3

(KERNDIR要指到目標板所使用的KERNEL SOURCE,而且KERNEL必須先設定好交叉編譯)

ROOTFS = /home2/fyodor/filesystem/rootfs

MODDIR = /lib/modules/2.6.24.3/extra

把module install 的目標位置依照目標kernel版本設定

否則就會安裝到目前uname -r 所找到的kernel module位置…

ps. make install時,modules.dep的設定不會跟著MODDIR而改變

所以還是得設定成extra

修改一行

FIRM_DIR :=    $(ROOTFS)/lib/firmware
編譯

(host)# make armdebug

警告訊息

!!! WARNING: Module file much too big (>1MB)
!!! Check your kernel settings or use ‘strip’
*** Module rt73.ko built successfully

表示編出來的module太大了,這個好解決

必須削減(strip)多餘訊息 (strip之後,板子上無法modprobe!format不合)

(host)# arm-linux-strip ./rt73.ko

把module安裝到target rootfs

這一步,我不很確定怎麼做,試看看吧~

(host)# sudo make install

*** Install module in /lib/modules/2.6.24.3/extra
make[1]: Entering directory `/home2/fyodor/kernel/linux-2.6.25__from__2.6.24.3′
INSTALL /home2/fyodor/filesystem/tools/wirelessTool/WL-167G/rt73-cvs/rt73-cvs-2008042100/Module/rt73.ko
DEPMOD  2.6.24.3
make[1]: Leaving directory `/home2/fyodor/kernel/linux-2.6.25__from__2.6.24.3′
/sbin/depmod -a
*** Update /etc/modprobe.d/ralink alias for wlan*
*** Install firmware in /home2/fyodor/filesystem/rootfs/lib/firmware
*** Check old config …

警告訊息

WARNING: Couldn’t find symtab and strtab in module /lib/modules/2.6.20-15-generic/extra/rt73.ko
*** Update /etc/modprobe.d/ralink alias for wlan*
*** Install firmware in /home2/fyodor/filesystem/rootfs/lib/firmware …
*** Check old config …

因為這一個編譯所使用的kernel版本2.6.24.3,和host機器上目前使用的版本2.6.15不同導致這個錯誤不知道怎麼處理… 應該是沒關係因為真正運作時,這個module在板子上所配合的kernel 版本就對上了參考: http://www.linuxsir.org/bbs/thread307321.html

結束

一樣照著路徑複製到rootfs裡面

module : /lib/modules/2.6.24.3/extra/rt73.ko

firmware : /lib/firmware/rt73.bin

status code :

s3c2410-ohci s3c2410-ohci: urb c2704ec0 path 1 ep0in 5ec20000 cc 5
–> status -62

all status code : include/asm-generic/errno.h

#define ETIME 62      /* Timer expired */

Document of error codes : Documentation/usb/error-codes.txt

-ETIME (**)

No response packet received within the prescribed bus turn-around time.  This error may instead be reported as -EPROTO or -EILSEQ.

懶惰的script


ROOTFS=/home2/fyodor/filesystem/rootfs
echo " install module to $ROOTFS/lib/modules/2.6.24.3/extra/"
cp /lib/modules/2.6.24.3/extra/rt73.ko $ROOTFS/lib/modules/2.6.24.3/extra/rt73.ko
echo " install firmware to $ROOTFS/lib/firmware/"
cp /lib/firmware/rt73.bin $ROOTFS/lib/firmware/
ls -alh $ROOTFS/lib/modules/2.6.24.3/extra/rt73.ko
ls -alh $ROOTFS/lib/firmware/rt73.bin

modprobe

[busybox] # modprobe rt73 debug=15 firmware=/lib/firmware/rt73.bin

[busybox] # ifconfig wlan0 up

[busybox] # dmesg

rt73: USBVendorRequest TIMEOUT
rt73: Retry count exhausted or device removed!!!
rt73: BBP version = 0
s3c2410-ohci s3c2410-ohci: urb c1980840 path 1 ep0in 5ec20000 cc 5 –> status -62

rt73: USBVendorRequest TIMEOUT
s3c2410-ohci s3c2410-ohci: urb c1980840 path 1 ep0out 5ec20000 cc 5 –> status -62

rt73: USBVendorRequest TIMEOUT
s3c2410-ohci s3c2410-ohci: urb c1980840 path 1 ep0in 5ec20000 cc 5 –> status -62

rt73: USBVendorRequest TIMEOUT
s3c2410-ohci s3c2410-ohci: urb c1980840 path 1 ep0in 5ec20000 cc 5 –> status -62

rt73: USBVendorRequest TIMEOUT
s3c2410-ohci s3c2410-ohci: urb c1980840 path 1 ep0in 5ec20000 cc 5 –> status -62

rt73: USBVendorRequest TIMEOUT
rt73: Retry count exhausted or device removed!!!
rt73: BBP version = 0

為什麼會timeout勒…..  搞了一個禮拜還是搞不清楚

rt73: USBVendorRequest TIMEOUT是我自己加的訊息

總之status -62 = -ETIME,就是TIMEOUT

上面說過了,status code的詳細定義在$(KERNDIR)/include/asm-generic/errno.h

error的解釋在$(KERNDIR)/Documentation/usb/error-codes.txt

去rt2x00.serialmonkey.com post問題,一邊trace driver 一邊等

覺得問題比較有可能出在s3c2410-ohci

畢竟這部份的2440移植,我做的很粗糙

Error Code Tracing

rt73: USBVendorRequest TIMEOUT

$(RT73)/Module/rtusb_io.c ===> RTUSB_VendorRequest function內的ret 值

ret=usb_control_msg(pAd->pUsb_Dev, usb_sndctrlpipe( pAd->pUsb_Dev, 0 ), \

Request, RequestType, Value,Index, TransferBuffer, TransferBufferLength, \

CONTROL_TIMEOUT_JIFFIES);

message : s3c2410-ohci s3c2410-ohci: urb c1980840 path 1 ep0out 5ec20000 cc 5 –> status -62

來源:drivers/usb/host/ohci-q.c : dl_done_list() –> dl_reverse_done_list() –> ed_halted()

誰呼叫RTUSB_VendorRequest

RTUSBReadMACRegister

RTUSBWriteMACRegister

繼續閱讀 | Make a Comment ( 4 so far )

受保護的文章:Linux Driver – Platform Device

Posted on 四月 11, 2008. Filed under: 菸酒生歲月, Linux, 嵌入式相關 | 標籤:, , , |

該內容受密碼保護。如欲檢視請在下方輸入你的密碼:

繼續閱讀 | Make a Comment ( 輸入你的密碼方能觀看迴響。 )

受保護的文章:交叉編譯usbutils

Posted on 三月 28, 2008. Filed under: 菸酒生歲月, Linux | 標籤:, , , |

該內容受密碼保護。如欲檢視請在下方輸入你的密碼:

繼續閱讀 | Make a Comment ( 輸入你的密碼方能觀看迴響。 )

Liked it here?
Why not try sites on the blogroll...