[U-Boot] USB storage problem with SCSI commands

Hello. I'm making custom version of u-boot for our device, based on 1.1.6. I can't get usb storage to work. My usb host successfully gets initiated, finds storage device, and fails to connect it. The problem probably is on SCSI commands level. In usb storage driver(file common/usb_storage.c), there is the function usb_stor_get_info(). It sends different SCSI commands. I got the following things. Inquiry command passes well. In the source version, there was test_unit_ready command, that failed every time. I've tried to place it before inquiry, and i also have tried to place request_sense before them all. These commands failed, and caused device to disconnect, so no more commands can be passed. What can be problem, that makes these commands fail? Usb flash stick works good with Linux.
Here is some debug output.
Test unit ready:
COMMAND phase cbw.dCBWSignature == 43425355 CBWSIGNATURE==43425355 td->hwBE == 33fffda6 td->hwCBP == 33fffd88 td->hwNextTD == 33e55580 STATUS phase td->hwBE == 33fffde8 td->hwCBP == 33fffddc td->hwNextTD == 33e555c0 dCSWSignature == 53425355 dCSWTag == 0 dCSWDataResidue == 0 bCSWStatus == 1 ptr[0] 0x55 ptr[1] 0x53 ptr[2] 0x42 ptr[3] 0x53 ptr[4] 0x0 ptr[5] 0x0 ptr[6] 0x0 ptr[7 FAILED
Request sense:
COMMAND phase td->hwBE == 33fffda6 td->hwCBP == 33fffd88 td->hwNextTD == 33e55580 DATA phase td->hwBE == 33e525d5 td->hwCBP == 33e525c4 td->hwNextTD == 33e555c0 stat = USB_ST_CRC_ERR; usb_bulk_msg error status 32
Inquiry:
COMMAND phase td->hwBE == 33fffdb6 td->hwCBP == 33fffd98 td->hwNextTD == 33e55580 DATA phase td->hwBE == 33e523d7 td->hwCBP == 33e523b4 td->hwNextTD == 33e555c0 pdata[0] 0x0 pdata[1] 0x80 pdata[2] 0x0 pdata[3] 0x1 pdata[4] 0x1f pdata[5] 0x0 pdata[ STATUS phase td->hwBE == 33fffdf8 td->hwCBP == 33fffdec td->hwNextTD == 33e55500 dCSWSignature == 53425355 dCSWTag == 0 dCSWDataResidue == 0 bCSWStatus == 0 ptr[0] 0x55 ptr[1] 0x53 ptr[2] 0x42 ptr[3] 0x53 ptr[4] 0x0 ptr[5] 0x0 ptr[6] 0x0 ptr[7 inquiry returns 0 vendor: product: silicon-power revision: PMAP type == 0 ISO Vers 0, Response Data 1

Hi,
2010/1/24 Alexander Varnin fenixk19@mail.ru:
Hello. I'm making custom version of u-boot for our device, based on 1.1.6.
Please use a recent version of U-boot. This version is old and outdated.
I can't get usb storage to work.
Would not surprise me. A lot of (USB) fixes have been integrated in U-boot since version 1.1.6.
Kind regards,
Remy

Remy Bohmer пишет:
Hi,
Please use a recent version of U-boot. This version is old and outdated.
I can't, because this version has been given with samsung SMDK2443 board, and there is some special additions for it, that is not present in main u-boot tree.
Would not surprise me. A lot of (USB) fixes have been integrated in U-boot since version 1.1.6.
Kind regards,
Remy
As I can see in git, there is not so much changes in common/usb_storage.c file, and I've tested all of them, to fix my problem. And none helped. So I'm using quite actual version of usb-storage subsystem.

Dear Alexander Varnin,
In message 4B5C3869.4060401@mail.ru you wrote:
Please use a recent version of U-boot. This version is old and outdated.
I can't, because this version has been given with samsung SMDK2443 board, and there is some special additions for it, that is not present in main u-boot tree.
Then port those additions forward to a current version.
Would not surprise me. A lot of (USB) fixes have been integrated in U-boot since version 1.1.6.
As I can see in git, there is not so much changes in common/usb_storage.c file, and I've tested all of them, to fix my problem. And none helped. So I'm using quite actual version of usb-storage subsystem.
U-Boot 1.1.6 is 4 years old. Since then, 7489 commits have been checked in, which added 1037072 lines, removed 557110 lines, and changed 479962 lines.
Do yourself and us a favour, and update to current code.
Best regards,
Wolfgang Denk

Wolfgang Denk пишет:
Dear Alexander Varnin,
In message 4B5C3869.4060401@mail.ru you wrote:
Please use a recent version of U-boot. This version is old and outdated.
I can't, because this version has been given with samsung SMDK2443 board, and there is some special additions for it, that is not present in main u-boot tree.
Then port those additions forward to a current version.
It is useless work, because in my version works everything, except the things, that didn't change since 1.1.6.
Would not surprise me. A lot of (USB) fixes have been integrated in U-boot since version 1.1.6.
As I can see in git, there is not so much changes in common/usb_storage.c file, and I've tested all of them, to fix my problem. And none helped. So I'm using quite actual version of usb-storage subsystem.
U-Boot 1.1.6 is 4 years old. Since then, 7489 commits have been checked in, which added 1037072 lines, removed 557110 lines, and changed 479962 lines.
That means this commits at most is not concerned with usb storage, because the differences from my version contain only spacing changes, added writing support(which is not in my task) and some other minor fixes. I can replace this file(common/usb_storage.c) with modern one, and it won't change the case(I've tried). The lower level of usb stack is device-dependent and works correct on other usb devices(hub, for example). So the problem is not here. Are you still think that my version is not actual?
Do yourself and us a favour, and update to current code.
Best regards,
Wolfgang Denk

Dear Alexander Varnin,
In message 4B5C5A5F.8040905@mail.ru you wrote:
U-Boot 1.1.6 is 4 years old. Since then, 7489 commits have been checked in, which added 1037072 lines, removed 557110 lines, and changed 479962 lines.
That means this commits at most is not concerned with usb storage, because the differences from my version contain only spacing changes, added writing support(which is not in my task) and some other minor fixes. I can replace this file(common/usb_storage.c) with modern one, and it won't change the case(I've tried). The lower level of usb stack is device-dependent and works correct on other usb devices(hub, for example). So the problem is not here. Are you still think that my version is not actual?
Frankly, I don't care.
You are using ancient code, and ignore the advice you receive. Such a combination kills all motiviation to spend time and efforts trying to help you.
Good luck.
Wolfgang Denk

Wolfgang Denk пишет:
Dear Alexander Varnin,
In message 4B5C5A5F.8040905@mail.ru you wrote:
U-Boot 1.1.6 is 4 years old. Since then, 7489 commits have been checked in, which added 1037072 lines, removed 557110 lines, and changed 479962 lines.
That means this commits at most is not concerned with usb storage, because the differences from my version contain only spacing changes, added writing support(which is not in my task) and some other minor fixes. I can replace this file(common/usb_storage.c) with modern one, and it won't change the case(I've tried). The lower level of usb stack is device-dependent and works correct on other usb devices(hub, for example). So the problem is not here. Are you still think that my version is not actual?
Frankly, I don't care.
You are using ancient code, and ignore the advice you receive. Such a combination kills all motiviation to spend time and efforts trying to help you.
It is sad... The problem is, that it is impossible to follow your advice. So I'll go fixing it myself.
Good luck.
Wolfgang Denk
participants (3)
-
Alexander Varnin
-
Remy Bohmer
-
Wolfgang Denk