
26 Nov
2011
26 Nov
'11
11:33 p.m.
Hi,
2011/10/20 Stefan Kristiansson stefan.kristiansson@saunalahti.fi:
The usb_endpoint_descriptor struct is 7 bytes large and is defined as an array (ep_desc[USB_MAXENDPOINTS]) in the usb_interface struct in include/usb.h
This fact will result in that every odd index in that array will start at an uneven address, this in turn makes accesses to u16 wMaxPacketSize unaligned. Such accesses are illegal on the OpenRISC architecture (as well as other architectures) and will render a bus error.
Setting the aligned(2) attribute on usb_endpoint_descriptor will force wMaxPacketSize to a 16-bit boundary.
Signed-off-by: Stefan Kristiansson stefan.kristiansson@saunalahti.fi
Applied to u-boot-usb.
Kind regards,
Remy