summaryrefslogtreecommitdiff
path: root/common/usb.c
diff options
context:
space:
mode:
authorWolfgang Denk <wd@denx.de>2012-05-20 20:51:41 (GMT)
committerWolfgang Denk <wd@denx.de>2012-05-20 20:51:41 (GMT)
commit2ab5be7af009b4a40efe2fa5471497c97e70ed28 (patch)
tree7c489b7db4927ef433d83d10a26fe48e2e9d1a4a /common/usb.c
parent8fa3d2b8161bb73b759c9db5c811c885ca5ec60c (diff)
parent5f0ffea4559abe3fc83a6023717658a50b22e66c (diff)
downloadu-boot-2ab5be7af009b4a40efe2fa5471497c97e70ed28.tar.xz
Merge branch 'master' of git://git.denx.de/u-boot-usb
* 'master' of git://git.denx.de/u-boot-usb: USB: S5P: Add ehci support usb:udc:samsung Add functions for storing private gadget data in UDC driver usb:gadget:composite: Support for composite at gadget.h usb:gadget:composite USB composite gadget support usb:udc:samsung:cleanup Replace DEBUG_* macros with debug_cond() calls usb:udc: Remove duplicated USB definitions from include/linux/usb/ch9.h file USB: Document the QH and qTD antics in EHCI-HCD USB: Drop cache flush bloat in EHCI-HCD USB: Drop ehci_alloc/ehci_free in ehci-hcd USB: Align buffers at cacheline usb: use noinline define
Diffstat (limited to 'common/usb.c')
-rw-r--r--common/usb.c25
1 files changed, 13 insertions, 12 deletions
diff --git a/common/usb.c b/common/usb.c
index 1ec30bc..c80155c 100644
--- a/common/usb.c
+++ b/common/usb.c
@@ -47,6 +47,7 @@
#include <common.h>
#include <command.h>
#include <asm/processor.h>
+#include <linux/compiler.h>
#include <linux/ctype.h>
#include <asm/byteorder.h>
#include <asm/unaligned.h>
@@ -169,7 +170,7 @@ int usb_control_msg(struct usb_device *dev, unsigned int pipe,
unsigned short value, unsigned short index,
void *data, unsigned short size, int timeout)
{
- struct devrequest setup_packet;
+ ALLOC_CACHE_ALIGN_BUFFER(struct devrequest, setup_packet, 1);
if ((timeout == 0) && (!asynch_allowed)) {
/* request for a asynch control pipe is not allowed */
@@ -177,17 +178,17 @@ int usb_control_msg(struct usb_device *dev, unsigned int pipe,
}
/* set setup command */
- setup_packet.requesttype = requesttype;
- setup_packet.request = request;
- setup_packet.value = cpu_to_le16(value);
- setup_packet.index = cpu_to_le16(index);
- setup_packet.length = cpu_to_le16(size);
+ setup_packet->requesttype = requesttype;
+ setup_packet->request = request;
+ setup_packet->value = cpu_to_le16(value);
+ setup_packet->index = cpu_to_le16(index);
+ setup_packet->length = cpu_to_le16(size);
USB_PRINTF("usb_control_msg: request: 0x%X, requesttype: 0x%X, " \
"value 0x%X index 0x%X length 0x%X\n",
request, requesttype, value, index, size);
dev->status = USB_ST_NOT_PROC; /*not yet processed */
- submit_control_msg(dev, pipe, data, size, &setup_packet);
+ submit_control_msg(dev, pipe, data, size, setup_packet);
if (timeout == 0)
return (int)size;
@@ -261,7 +262,7 @@ int usb_maxpacket(struct usb_device *dev, unsigned long pipe)
*
* NOTE: Similar behaviour was observed with GCC4.6 on ARMv5.
*/
-static void __attribute__((noinline))
+static void noinline
usb_set_maxpacket_ep(struct usb_device *dev, int if_idx, int ep_idx)
{
int b;
@@ -681,7 +682,7 @@ static int usb_string_sub(struct usb_device *dev, unsigned int langid,
*/
int usb_string(struct usb_device *dev, int index, char *buf, size_t size)
{
- unsigned char mybuf[USB_BUFSIZ];
+ ALLOC_CACHE_ALIGN_BUFFER(unsigned char, mybuf, USB_BUFSIZ);
unsigned char *tbuf;
int err;
unsigned int u, idx;
@@ -781,7 +782,7 @@ int usb_new_device(struct usb_device *dev)
{
int addr, err;
int tmp;
- unsigned char tmpbuf[USB_BUFSIZ];
+ ALLOC_CACHE_ALIGN_BUFFER(unsigned char, tmpbuf, USB_BUFSIZ);
/* We still haven't set the Address yet */
addr = dev->devnum;
@@ -908,8 +909,8 @@ int usb_new_device(struct usb_device *dev)
le16_to_cpus(&dev->descriptor.idProduct);
le16_to_cpus(&dev->descriptor.bcdDevice);
/* only support for one config for now */
- usb_get_configuration_no(dev, &tmpbuf[0], 0);
- usb_parse_config(dev, &tmpbuf[0], 0);
+ usb_get_configuration_no(dev, tmpbuf, 0);
+ usb_parse_config(dev, tmpbuf, 0);
usb_set_maxpacket(dev);
/* we set the default configuration here */
if (usb_set_configuration(dev, dev->config.desc.bConfigurationValue)) {