From mboxrd@z Thu Jan 1 00:00:00 1970 From: victor Date: Thu, 22 Nov 2012 10:24:47 +0800 Subject: [U-Boot] USB mass storage gadget patch References: <033201cdb8ea$3fe03a10$bfa0ae30$@keyasic.com> <20121102141909.14571cb3@amdc308.digital.local> <019901cdbbea$73d9b000$5b8d1000$@keyasic.com> <20121106100343.3db7cc1a@amdc308.digital.local> Message-ID: <009101cdc858$8d162b50$a74281f0$@keyasic.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Lukasz, > -----Original Message----- > From: victor [mailto:victor at keyasic.com] > Sent: Tuesday, 6 November, 2012 7:09 PM > To: 'Lukasz Majewski' > Cc: 'u-boot at lists.denx.de'; 'Marek Vasut'; 'Kyungmin Park' > Subject: RE: [U-Boot] USB mass storage gadget patch > > Lukasz, > > > Lukasz, > > > > > Hi victor, > > > > > > Regarding UMS support: > > > > > > The last version posted at u-boot ML can be found at [**]: > > > http://thread.gmane.org/gmane.comp.boot-loaders.u- > > > boot/113004/match=ums > > > > > > > > > +if (fsg_fs_bulk_out_desc.bEndpointAddress != 0x1) > > > + fsg_fs_bulk_out_desc.bEndpointAddress = 0x1; > > > + > > > > > > If possible, please align to patch set [**], so we can have the same setup. > > > > > > However, I will try to find some time to help you with the problem > > > (that's why I've asked for description of the problem, which you are > > > trying > > to fix). > > > > > > > I hardcode bulk out endpoint to EP1 because the hardware only got one > > endpoint. So the code has to use EP1 for both bulk in and bulk out > > data transfer. Will this break the usb mass storage gadget code? > > > > I will get the file_storage.c from [**]. > > > > The short description of the problem: > > The U-boot usb mass storage gadget driver has problem with buffer > > management, sometimes the buffer returned by IRQ routine and the > > get_next_command function are different. It causes problem in > > processing > > SCSI_MODE_SELECT_6 command. > > > > The detailed description of the problem: > > When receiving the SCSI_MODE_SELECT_6 command, in > bulk_out_complete(), > > the bh pointer is 0x1b872e4. Then, in get_next_command(), before > > calling start_transfer(), the bh pointer becomes 0x1b87304. This > > changes in bh pointer can cause data not to be processed by the usb > > mass storage gadget code. > > > > Thanks, > > Victor > > I use the file_storage.c from [**]. Basically, I replace file_storage.c and > hardcode bulk out endpoint to EP1. The IRQ routine can receive the > SCSI_INQUIRY but the get_next_command() do not process it. The > get_next_command is listening on a different bh than the one returned by > IRQ routine. > > Regards, > victor Any comments or opinion on the above buffer mismatch issue in usb mass storage gadget? Regards, Victor ================================================================================================ CONFIDENTIALITY NOTE: This e-mail and any attachments may contain confidential information and may be protected by legal privilege. If you are not the intended addressee (or authorized to receive for the addressee). be aware that any disclosure, copying, distribution or use of this e-mail or any attachment is prohibited. If you have received this e-mail in error, please notify us immediately by returning it to the sender and delete this copy from your system. Thank you for your cooperation. KeyASIC Inc. ================================================================================================