Files
u-boot-tk1-som/include
Stefan Althoefer d277682731 USB: descriptor handling
Hi,

I found a bug when working with the u-boot USB subsystem on IXP425 processor
(big endian Xscale aka ARMv5).
I recognized that the second usb_endpoint_descriptor of the attached memory
stick was corrupted.

The reason for this are the packed structures below (either u-boot and
u-boot-usb):

--------------
/* Endpoint descriptor */
struct usb_endpoint_descriptor {
	unsigned char  bLength;
	unsigned char  bDescriptorType;
	unsigned char  bEndpointAddress;
	unsigned char  bmAttributes;
	unsigned short wMaxPacketSize;
	unsigned char  bInterval;
	unsigned char  bRefresh;
	unsigned char  bSynchAddress;

} __attribute__ ((packed));
/* Interface descriptor */
struct usb_interface_descriptor {
	unsigned char  bLength;
	unsigned char  bDescriptorType;
	unsigned char  bInterfaceNumber;
	unsigned char  bAlternateSetting;
	unsigned char  bNumEndpoints;
	unsigned char  bInterfaceClass;
	unsigned char  bInterfaceSubClass;
	unsigned char  bInterfaceProtocol;
	unsigned char  iInterface;

	unsigned char  no_of_ep;
	unsigned char  num_altsetting;
	unsigned char  act_altsetting;
	struct usb_endpoint_descriptor ep_desc[USB_MAXENDPOINTS];
} __attribute__ ((packed));
------------

As usb_endpoint_descriptor is only 7byte in length, the start of all
odd ep_desc[] structures is not word aligned. This makes wMaxPacketSize
of these structures also not word aligned.

ARMv5 Architecture however does not support non-aligned multibyte
data type (see A2.8 of ARM Architecture Reference Manual).

Signed-off-by: Stefan Althoefer <stefan.althoefer@web.de>
Signed-off-by: Remy Böhmer <linux@bohmer.net>
2008-12-09 21:26:45 +01:00
..
2008-10-18 21:54:03 +02:00
2008-10-18 21:54:03 +02:00
2008-09-19 11:05:22 +09:00
2008-05-21 00:14:08 +02:00
2008-10-18 21:54:03 +02:00
2008-10-18 21:54:03 +02:00
2008-05-21 00:14:08 +02:00
2008-10-18 21:54:03 +02:00
2008-10-18 21:54:03 +02:00
2008-05-21 00:14:08 +02:00
2008-10-18 21:54:03 +02:00
2008-05-10 11:44:55 +02:00
2008-05-21 00:14:08 +02:00
2008-05-21 00:14:08 +02:00
2008-10-18 21:54:03 +02:00
2008-10-18 21:54:03 +02:00
2008-05-21 00:14:08 +02:00
2008-10-18 21:54:03 +02:00
2008-05-21 00:14:08 +02:00
2008-05-21 00:14:08 +02:00
2008-10-18 21:54:03 +02:00
2008-05-21 00:14:08 +02:00
2008-10-18 21:54:03 +02:00
2008-03-26 23:38:54 +01:00
2008-11-24 11:05:25 +01:00
2008-10-18 21:54:03 +02:00
2008-10-18 21:54:03 +02:00
2008-10-18 21:54:03 +02:00
2008-10-18 21:54:03 +02:00
2008-10-29 00:59:50 +01:00
2008-10-18 21:54:03 +02:00
2008-07-10 00:39:28 +02:00
2008-01-11 16:05:36 +01:00
2008-10-18 21:54:03 +02:00
2008-10-18 21:54:03 +02:00
2008-10-18 21:54:03 +02:00
2008-10-18 21:54:03 +02:00
2008-10-18 21:54:03 +02:00
2008-06-10 18:22:25 -05:00
2008-10-18 21:54:03 +02:00
2008-10-18 21:54:03 +02:00
2008-10-18 21:54:03 +02:00
2008-10-18 21:54:03 +02:00
2008-10-18 21:54:03 +02:00
2008-10-18 21:54:03 +02:00
2008-12-04 22:51:54 -08:00
2008-05-21 00:14:08 +02:00
2008-05-21 00:14:08 +02:00
2008-05-21 00:14:08 +02:00
2008-05-21 00:14:08 +02:00
2008-05-21 00:14:08 +02:00
2008-05-21 00:14:08 +02:00
2008-10-18 21:54:03 +02:00
2008-10-18 21:54:03 +02:00
2008-05-21 00:14:08 +02:00
2008-08-27 11:43:54 -05:00
2008-10-18 21:54:03 +02:00
2008-10-18 21:54:03 +02:00
2008-10-18 21:54:03 +02:00
2008-10-18 21:54:03 +02:00
2008-10-18 21:54:03 +02:00
2008-10-18 21:54:03 +02:00
2008-05-21 00:14:08 +02:00
2008-05-21 00:14:08 +02:00
2008-04-13 14:57:46 -07:00
2008-05-21 00:14:08 +02:00
2008-05-21 00:14:08 +02:00
2008-10-18 21:54:03 +02:00
2008-05-21 00:14:08 +02:00
2008-09-22 22:07:20 +02:00
2008-06-03 20:31:34 +02:00
2008-10-18 21:54:03 +02:00
2008-04-13 14:52:48 -07:00
2008-05-21 00:14:08 +02:00
2008-12-09 21:26:45 +01:00
2008-05-21 00:14:08 +02:00
2008-11-02 16:23:46 +01:00
2008-05-21 00:14:08 +02:00
2008-05-21 00:14:08 +02:00
2008-05-21 00:14:08 +02:00
2008-10-18 21:54:03 +02:00
2008-10-18 21:54:03 +02:00