u-boot/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
..
asm-arm AT91: Replace AT91_BASE_EMAC by the board specific values. 2008-11-07 13:54:31 +01:00
asm-avr32 rename CFG_ macros to CONFIG_SYS 2008-10-18 21:54:03 +02:00
asm-blackfin Blackfin: fix SWRST register definition 2008-10-23 05:03:50 -04:00
asm-i386 rename CFG_ macros to CONFIG_SYS 2008-10-18 21:54:03 +02:00
asm-m68k ColdFire: Add MCF5301x CPU and M53017EVB support 2008-11-03 09:45:58 -07:00
asm-microblaze rename CFG_ macros to CONFIG_SYS 2008-10-18 21:54:03 +02:00
asm-mips rename CFG_ macros to CONFIG_SYS 2008-10-18 21:54:03 +02:00
asm-nios Allow console input to be disabled 2008-09-06 22:36:54 +02:00
asm-nios2 Allow console input to be disabled 2008-09-06 22:36:54 +02:00
asm-ppc FSL: Moved BR_PHYS_ADDR for localbus to common header 2008-12-04 03:15:43 -06:00
asm-sh sh: Fix compile warning 2008-09-19 11:05:22 +09:00
asm-sparc rename CFG_ macros to CONFIG_SYS 2008-10-18 21:54:03 +02:00
bedbug Big white-space cleanup. 2008-05-21 00:14:08 +02:00
configs Merge branch 'master' of git://git.denx.de/u-boot-at91 2008-12-09 01:06:14 +01:00
cramfs Fix endianess problem in cramfs code (cramfs is always host-endian in Linux) 2008-03-03 22:08:08 +01:00
galileo rename CFG_ macros to CONFIG_SYS 2008-10-18 21:54:03 +02:00
jffs2 UBI: Add basic UBI support to U-Boot (Part 6/8) 2008-11-19 20:34:39 +01:00
linux UBI: Add basic UBI support to U-Boot (Part 8/8) 2008-11-19 20:34:39 +01:00
lzma Add support for LZMA uncompression algorithm. 2008-09-13 01:59:07 +02:00
mtd UBI: Add basic UBI support to U-Boot (Part 7/8) 2008-11-19 20:34:39 +01:00
pcmcia
u-boot Add support for calculating hashes with watchdog triggering 2008-04-25 00:01:06 +02:00
_exports.h [ARM] TI DaVinci support, hopefully final 2007-08-10 20:26:18 +02:00
.gitignore Update U-Boot's build timestamp on every compile 2008-12-06 23:36:43 +01:00
4xx_i2c.h rename CFG_ macros to CONFIG_SYS 2008-10-18 21:54:03 +02:00
74xx_7xx.h
405_dimm.h
405_mal.h ppc4xx: Add basic support for AMCC 460EX/460GT (3/5) 2008-03-15 07:28:04 +01:00
ACEX1K.h Add size #defines for Altera Cyclone-II EP2C8 and EP2C20. 2008-06-03 21:40:09 +02:00
ahci.h Big white-space cleanup. 2008-05-21 00:14:08 +02:00
altera.h rename CFG_ macros to CONFIG_SYS 2008-10-18 21:54:03 +02:00
ambapp.h Coding Style cleanup; update CHANGELOG 2008-04-13 09:59:26 -07:00
api_public.h rename CFG_ macros to CONFIG_SYS 2008-10-18 21:54:03 +02:00
arm920t.h
arm925t.h
arm926ejs.h
arm946es.h
armcoremodule.h Big white-space cleanup. 2008-05-21 00:14:08 +02:00
at45.h Coding style cleanup. Update CHANGELOG. 2007-08-14 18:42:36 +02:00
at91rm9200_i2c.h
at91rm9200_net.h
ata.h rename CFG_ macros to CONFIG_SYS 2008-10-18 21:54:03 +02:00
atmel_lcdc.h Add ATMEL LCD driver 2008-05-10 11:44:55 +02:00
bcd.h rtc: Add Xicor/Intersil X1205 RTC support 2007-10-31 21:20:50 +01:00
bcm5221.h Big white-space cleanup. 2008-05-21 00:14:08 +02:00
bmp_layout.h
bzlib.h
circbuf.h
clps7111.h Big white-space cleanup. 2008-05-21 00:14:08 +02:00
command.h rename CFG_ macros to CONFIG_SYS 2008-10-18 21:54:03 +02:00
common.h IOMUX: Add console multiplexing support. 2008-12-07 01:23:35 +01:00
commproc.h rename CFG_ macros to CONFIG_SYS 2008-10-18 21:54:03 +02:00
config_cmd_all.h Add 'license' command to U-Boot command line 2008-08-18 23:21:49 +02:00
config_cmd_default.h Big white-space cleanup. 2008-05-21 00:14:08 +02:00
console.h
crc.h
da9030.h
dataflash.h rename CFG_ macros to CONFIG_SYS 2008-10-18 21:54:03 +02:00
ddr_spd.h Add proper SPD definitions for DDR1/2/3 2008-08-27 02:05:53 +02:00
devices.h device: make device_register() clone the device 2008-09-02 01:28:18 +02:00
div64.h Big white-space cleanup. 2008-05-21 00:14:08 +02:00
dm9161.h Big white-space cleanup. 2008-05-21 00:14:08 +02:00
dp83848.h [ARM] TI DaVinci support, hopefully final 2007-08-10 20:26:18 +02:00
dtt.h rename CFG_ macros to CONFIG_SYS 2008-10-18 21:54:03 +02:00
e500.h Reworked FSL Book-E TLB macros to be more readable 2008-01-09 16:25:03 -06:00
elf.h Big white-space cleanup. 2008-05-21 00:14:08 +02:00
environment.h rename CFG_ macros to CONFIG_SYS 2008-10-18 21:54:03 +02:00
exports.h UBI: Add basic UBI support to U-Boot (Part 6/8) 2008-11-19 20:34:39 +01:00
ext2fs.h
fat.h Remove non-ascii characters from fat code 2008-12-04 20:51:44 +01:00
fdc.h
fdt_support.h fdt: Added helper to set PCI dma-ranges property 2008-10-24 17:34:57 -05:00
fdt.h powerpc: Fix bootm to boot up again with a Ramdisk 2008-09-13 02:03:38 +02:00
fis.h ata: add the fis struct for SATA 2008-03-26 23:38:54 +01:00
flash.h cfi-mtd: Add cfi-mtd driver. 2008-11-24 11:05:25 +01:00
fpga.h rename CFG_ macros to CONFIG_SYS 2008-10-18 21:54:03 +02:00
hush.h hush: add showvar command for hush shell. 2008-10-18 21:54:02 +02:00
i2c.h rename CFG_ macros to CONFIG_SYS 2008-10-18 21:54:03 +02:00
i8042.h rename CFG_ macros to CONFIG_SYS 2008-10-18 21:54:03 +02:00
ide.h rename CFG_ macros to CONFIG_SYS 2008-10-18 21:54:03 +02:00
image.h bootm: Add subcommands 2008-10-29 00:59:50 +01:00
iomux.h IOMUX: Add console multiplexing support. 2008-12-07 01:23:35 +01:00
ioports.h Stop using immap_t for cpm offset on 85xx 2007-12-11 22:34:19 -06:00
keyboard.h
kgdb.h
lcd.h lcd: Let the board code show board-specific info 2008-10-27 09:53:58 +01:00
lcdvideo.h
lh7a40x.h rename CFG_ macros to CONFIG_SYS 2008-10-18 21:54:03 +02:00
lh7a400.h
lh7a404.h
libata.h ata: update the libata.h from ata.h of linux kernel 2008-04-13 23:20:16 -07:00
libfdt_env.h FDT: don't use private kernel header files 2008-10-21 21:35:44 +02:00
libfdt.h libfdt: Fix error in documentation for fdt_get_alias_namelen() 2008-10-04 07:56:06 -04:00
linux_logo.h
lmb.h Fix LMB type issues 2008-07-10 00:39:28 +02:00
logbuff.h Avoid initrd and logbuffer area overlaps 2008-06-03 19:34:19 +02:00
lpd7a400_cpld.h
lxt971a.h Remove duplicate definitions in include/lxt971a.h. 2008-07-06 23:44:34 -07:00
lynxkdi.h
malloc.h
mb862xx.h Add Fujitsu CoralP/Lime video driver 2008-01-11 16:05:36 +01:00
MCD_dma.h ColdFire: Add MCF547x_8x dma code and header files 2008-01-17 14:59:42 -06:00
MCD_progCheck.h ColdFire: Add MCF547x_8x dma code and header files 2008-01-17 14:59:42 -06:00
MCD_tasksInit.h ColdFire: Add MCF547x_8x dma code and header files 2008-01-17 14:59:42 -06:00
mii_phy.h
miiphy.h rename CFG_ macros to CONFIG_SYS 2008-10-18 21:54:03 +02:00
mk48t59.h rename CFG_ macros to CONFIG_SYS 2008-10-18 21:54:03 +02:00
mmc.h MMC: Consolidate MMC/SD command definitions 2008-06-28 22:40:15 +02:00
mpc5xx.h rename CFG_ macros to CONFIG_SYS 2008-10-18 21:54:03 +02:00
mpc5xxx_sdma.h Move MPC5xxx_FEC driver to drivers/net 2008-08-29 13:58:07 -06:00
mpc5xxx.h rename CFG_ macros to CONFIG_SYS 2008-10-18 21:54:03 +02:00
mpc8xx_irq.h rename CFG_ macros to CONFIG_SYS 2008-10-18 21:54:03 +02:00
mpc8xx.h
mpc83xx.h powerpc: 83xx: add missing TIMING_CFG1_CASLAT_* defines 2008-11-19 18:43:09 -06:00
mpc85xx.h 83xx/85xx: further localbus cleanups 2008-06-10 18:22:25 -05:00
mpc86xx.h rename CFG_ macros to CONFIG_SYS 2008-10-18 21:54:03 +02:00
mpc106.h rename CFG_ macros to CONFIG_SYS 2008-10-18 21:54:03 +02:00
mpc512x.h rename CFG_ macros to CONFIG_SYS 2008-10-18 21:54:03 +02:00
mpc824x.h rename CFG_ macros to CONFIG_SYS 2008-10-18 21:54:03 +02:00
mpc8220.h rename CFG_ macros to CONFIG_SYS 2008-10-18 21:54:03 +02:00
mpc8260_irq.h
mpc8260.h
nand.h rename CFG_ macros to CONFIG_SYS 2008-10-18 21:54:03 +02:00
net.h net: Define IP flag field values 2008-12-04 22:51:54 -08:00
netdev.h Moved initialization of PPC4xx EMAC to cpu_eth_init() 2008-11-09 21:38:05 -08:00
nios2-epcs.h Big white-space cleanup. 2008-05-21 00:14:08 +02:00
nios2-io.h Big white-space cleanup. 2008-05-21 00:14:08 +02:00
nios2.h
nios-io.h
nios.h
ns7520_eth.h Remove duplicate definitions in include/lxt971a.h. 2008-07-06 23:44:34 -07:00
ns9750_bbus.h Big white-space cleanup. 2008-05-21 00:14:08 +02:00
ns9750_eth.h Remove duplicate definitions in include/lxt971a.h. 2008-07-06 23:44:34 -07:00
ns9750_mem.h Big white-space cleanup. 2008-05-21 00:14:08 +02:00
ns9750_ser.h Big white-space cleanup. 2008-05-21 00:14:08 +02:00
ns9750_sys.h Big white-space cleanup. 2008-05-21 00:14:08 +02:00
ns16550.h rename CFG_ macros to CONFIG_SYS 2008-10-18 21:54:03 +02:00
ns87308.h rename CFG_ macros to CONFIG_SYS 2008-10-18 21:54:03 +02:00
onenand_uboot.h onenand_uboot: fix warning: 'struct mtd_oob_ops' declared inside parameter list 2008-09-09 02:16:50 +02:00
part.h Add support for CONFIG_EFI_PARTITION (GUID Partition Table) 2008-10-18 21:54:01 +02:00
pc_keyb.h Big white-space cleanup. 2008-05-21 00:14:08 +02:00
pci_ids.h mpc85xx: Add support for the MPC8536 2008-08-27 11:43:54 -05:00
pci.h pci: Allow for PCI addresses to be 64-bit 2008-10-24 17:32:49 -05:00
pcmcia.h rename CFG_ macros to CONFIG_SYS 2008-10-18 21:54:03 +02:00
post.h rename CFG_ macros to CONFIG_SYS 2008-10-18 21:54:03 +02:00
ppc4xx_enet.h rename CFG_ macros to CONFIG_SYS 2008-10-18 21:54:03 +02:00
ppc4xx.h ppc4xx: Add routine to retrieve CPU number 2008-10-21 17:34:56 +02:00
ppc405.h rename CFG_ macros to CONFIG_SYS 2008-10-18 21:54:03 +02:00
ppc440.h ppc4xx: Added ppc4xx-isram.h for internal SRAM and L2 cache DCRs 2008-11-21 10:52:33 +01:00
ppc_asm.tmpl e500 needs ppc_asm.tmp MCK_EXCEPTION 2007-08-14 01:21:22 -05:00
ppc_defs.h
ps2mult.h rename CFG_ macros to CONFIG_SYS 2008-10-18 21:54:03 +02:00
radeon.h rename CFG_ macros to CONFIG_SYS 2008-10-18 21:54:03 +02:00
reiserfs.h
rtc.h rtc: allow rtc_set to return an error and use it in cmd_date 2008-09-07 00:56:36 +02:00
s3c24x0.h
s3c64x0.h ARM: Add arm1176 core with S3C6400 SoC 2008-08-31 00:39:46 +02:00
s3c2400.h
s3c2410.h Fix compiler warning in include/s3c2410.h 2007-08-29 02:05:53 +02:00
s3c6400.h ARM: Add arm1176 core with S3C6400 SoC 2008-08-31 00:39:46 +02:00
s_record.h Big white-space cleanup. 2008-05-21 00:14:08 +02:00
sa1100.h
SA-1100.h Big white-space cleanup. 2008-05-21 00:14:08 +02:00
sata.h drivers: code clean up 2008-04-13 14:57:46 -07:00
scsi.h Big white-space cleanup. 2008-05-21 00:14:08 +02:00
sed156x.h
sed13806.h Big white-space cleanup. 2008-05-21 00:14:08 +02:00
serial.h rename CFG_ macros to CONFIG_SYS 2008-10-18 21:54:03 +02:00
sha1.h Add support for calculating hashes with watchdog triggering 2008-04-25 00:01:06 +02:00
sha256.h include/sha256.h: fix file permissions. 2008-07-06 01:21:46 +02:00
sm501.h
smiLynxEM.h
spartan2.h Big white-space cleanup. 2008-05-21 00:14:08 +02:00
spartan3.h Fix Spartan-3 definitions. 2008-09-22 22:07:20 +02:00
spd_sdram.h
spd.h
spi_flash.h SPI Flash subsystem 2008-06-03 20:31:34 +02:00
spi.h Move conditional compilation of MPC8XXX SPI driver to Makefile 2008-07-01 21:02:11 +02:00
status_led.h rename CFG_ macros to CONFIG_SYS 2008-10-18 21:54:03 +02:00
stratixII.h Altera Stratix II support 2008-04-13 14:52:48 -07:00
sym53c8xx.h Big white-space cleanup. 2008-05-21 00:14:08 +02:00
systemace.h
timestamp.h Update U-Boot's build timestamp on every compile 2008-12-06 23:36:43 +01:00
tsec.h net: tsec: Fix Marvell 88E1121R phy init 2008-12-04 22:51:54 -08:00
tsi108.h
ubi_uboot.h UBI: Add basic UBI support to U-Boot (Part 6/8) 2008-11-19 20:34:39 +01:00
universe.h
usb_cdc_acm.h
usb_defs.h
usb.h USB: descriptor handling 2008-12-09 21:26:45 +01:00
usbdcore_ep0.h
usbdcore_mpc8xx.h Big white-space cleanup. 2008-05-21 00:14:08 +02:00
usbdcore_omap1510.h usbtty/omap: update to current API 2008-12-09 21:12:41 +01:00
usbdcore.h Consolidate MAX/MIN definitions 2008-11-02 16:23:46 +01:00
usbdescriptors.h
version.h Makefile: fix "error: version_autogenerated.h: No such file or directory" 2008-05-13 23:15:52 +02:00
vfd_logo.h
video_ad7176.h
video_ad7177.h
video_ad7179.h
video_easylogo.h Big white-space cleanup. 2008-05-21 00:14:08 +02:00
video_fb.h
video_font.h
video_logo.h Big white-space cleanup. 2008-05-21 00:14:08 +02:00
video.h
virtex2.h Big white-space cleanup. 2008-05-21 00:14:08 +02:00
vsc7385.h Cleanup coding style, update CHANGELOG 2008-03-26 11:48:46 +01:00
vxworks.h vxworks.h: Fix build problem introduced by commits 29a4c24d/e9084b23 2008-12-09 00:24:30 +01:00
w83c553f.h rename CFG_ macros to CONFIG_SYS 2008-10-18 21:54:03 +02:00
watchdog.h
xilinx.h rename CFG_ macros to CONFIG_SYS 2008-10-18 21:54:03 +02:00
xyzModem.h
zlib.h