From e7e75c70c5d5d3365606c4a76adb7ff4822d2f75 Mon Sep 17 00:00:00 2001 From: Heiko Schocher Date: Wed, 12 Jun 2013 06:05:51 +0200 Subject: dfu: make data buffer size configurable Dfu transfer uses a buffer before writing data to the raw storage device. Make the size (in bytes) of this buffer configurable through environment variable "dfu_bufsiz". Defaut value is configurable through CONFIG_SYS_DFU_DATA_BUF_SIZE Signed-off-by: Heiko Schocher Cc: Pantelis Antoniou Cc: Tom Rini Cc: Lukasz Majewski Cc: Kyungmin Park Cc: Marek Vasut Cc: Wolfgang Denk Acked-by: Tom Rini --- include/dfu.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/dfu.h b/include/dfu.h index a107f4b..124653c 100644 --- a/include/dfu.h +++ b/include/dfu.h @@ -68,7 +68,9 @@ static inline unsigned int get_mmc_blk_size(int dev) #define DFU_NAME_SIZE 32 #define DFU_CMD_BUF_SIZE 128 -#define DFU_DATA_BUF_SIZE (1024*1024*8) /* 8 MiB */ +#ifndef CONFIG_SYS_DFU_DATA_BUF_SIZE +#define CONFIG_SYS_DFU_DATA_BUF_SIZE (1024*1024*8) /* 8 MiB */ +#endif #ifndef CONFIG_SYS_DFU_MAX_FILE_SIZE #define CONFIG_SYS_DFU_MAX_FILE_SIZE (4 << 20) /* 4 MiB */ #endif -- cgit v1.1 From c5398cc968793cb73752d98e69f2e8d3cc9d9e59 Mon Sep 17 00:00:00 2001 From: Heiko Schocher Date: Tue, 4 Jun 2013 11:19:50 +0200 Subject: usb, g_dnl: make possibility to fixup the device_desc board specific add a weak dummy function g_dnl_fixup to add the possibility to update the device_desc board specific. Used on the upcoming siemens board support, where idVendor and idProduct is stored in an eeprom. Signed-off-by: Heiko Schocher Cc: Marek Vasut Cc: Lukasz Majewski Cc: Kyungmin Park Reviewed-by: Lukasz Majewski --- include/g_dnl.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/g_dnl.h b/include/g_dnl.h index f47395f..f8affd8 100644 --- a/include/g_dnl.h +++ b/include/g_dnl.h @@ -23,7 +23,7 @@ #include #include - +int g_dnl_bind_fixup(struct usb_device_descriptor *); int g_dnl_register(const char *s); void g_dnl_unregister(void); -- cgit v1.1 From b37c4a2baabc61450bb9f8bd16b233a25315c816 Mon Sep 17 00:00:00 2001 From: Heiko Schocher Date: Thu, 27 Jun 2013 10:04:57 +0200 Subject: usb: fix unaligned access in device_qual() while playing with dfu, I tapped in an unaligned access when doing on the host side a "lsusb -d [vendornr]: -v" I get on the board: GADGET DRIVER: usb_dnl_dfu data abort MAYBE you should read doc/README.arm-unaligned-accesses pc : [<8ff71db8>] lr : [<8ff75aec>] sp : 8ef40d18 ip : 00000005 fp : 00000000 r10: 00000000 r9 : 47401410 r8 : 8ef40f38 r7 : 8ef4aae8 r6 : 0000000a r5 : 8ef4ab28 r4 : 8ef4ab80 r3 : 0000000a r2 : 00000006 r1 : 00000006 r0 : 8ef4aae8 Flags: Nzcv IRQs off FIQs on Mode SVC_32 Resetting CPU ... reason is that in the "struct usb_composite_dev" the "struct usb_device_descriptor desc;" is on an odd address, and this struct gets accessed in drivers/usb/gadget/composite.c device_qual() Fix it, by align this var "struct desc" fix to an aligned address. Signed-off-by: Heiko Schocher Cc: Marek Vasut Cc: Samuel Egli --- include/linux/usb/composite.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/linux/usb/composite.h b/include/linux/usb/composite.h index 53cb095..4f76f88 100644 --- a/include/linux/usb/composite.h +++ b/include/linux/usb/composite.h @@ -331,7 +331,7 @@ struct usb_composite_dev { /* private: */ /* internals */ unsigned int suspended:1; - struct usb_device_descriptor desc; + struct usb_device_descriptor __aligned(CONFIG_SYS_CACHELINE_SIZE) desc; struct list_head configs; struct usb_composite_driver *driver; u8 next_string_id; -- cgit v1.1