summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
bead088)
Testing on theadorable (Armada XP) has shown, that using this driver
results in many cache misaligned warning, such as:
CACHE: Misaligned operation at range [
7fabd8fc,
7fabd900]
This patch now uses the ALLOC_CACHE_ALIGN_BUFFER() macro to allocate the
buffers on a cache aligned boundary. This fixes all warnings seen on the
Armada XP platform.
Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Ted Chen <tedchen@realtek.com>
Cc: Joe Hershberger <joe.hershberger@ni.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
#include <dm.h>
#include <errno.h>
#include <malloc.h>
#include <dm.h>
#include <errno.h>
#include <malloc.h>
#include <usb.h>
#include <usb/lin_gadget_compat.h>
#include <linux/mii.h>
#include <usb.h>
#include <usb/lin_gadget_compat.h>
#include <linux/mii.h>
static
int get_registers(struct r8152 *tp, u16 value, u16 index, u16 size, void *data)
{
static
int get_registers(struct r8152 *tp, u16 value, u16 index, u16 size, void *data)
{
- return usb_control_msg(tp->udev, usb_rcvctrlpipe(tp->udev, 0),
- RTL8152_REQ_GET_REGS, RTL8152_REQT_READ,
- value, index, data, size, 500);
+ ALLOC_CACHE_ALIGN_BUFFER(void *, tmp, size);
+ int ret;
+
+ ret = usb_control_msg(tp->udev, usb_rcvctrlpipe(tp->udev, 0),
+ RTL8152_REQ_GET_REGS, RTL8152_REQT_READ,
+ value, index, tmp, size, 500);
+ memcpy(data, tmp, size);
+ return ret;
}
static
int set_registers(struct r8152 *tp, u16 value, u16 index, u16 size, void *data)
{
}
static
int set_registers(struct r8152 *tp, u16 value, u16 index, u16 size, void *data)
{
+ ALLOC_CACHE_ALIGN_BUFFER(void *, tmp, size);
+
+ memcpy(tmp, data, size);
return usb_control_msg(tp->udev, usb_sndctrlpipe(tp->udev, 0),
RTL8152_REQ_SET_REGS, RTL8152_REQT_WRITE,
return usb_control_msg(tp->udev, usb_sndctrlpipe(tp->udev, 0),
RTL8152_REQ_SET_REGS, RTL8152_REQT_WRITE,
- value, index, data, size, 500);
+ value, index, tmp, size, 500);
}
int generic_ocp_read(struct r8152 *tp, u16 index, u16 size,
}
int generic_ocp_read(struct r8152 *tp, u16 index, u16 size,
u32 opts1, opts2 = 0;
int err;
int actual_len;
u32 opts1, opts2 = 0;
int err;
int actual_len;
- unsigned char msg[PKTSIZE + sizeof(struct tx_desc)];
+ ALLOC_CACHE_ALIGN_BUFFER(uint8_t, msg,
+ PKTSIZE + sizeof(struct tx_desc));
struct tx_desc *tx_desc = (struct tx_desc *)msg;
debug("** %s(), len %d\n", __func__, length);
struct tx_desc *tx_desc = (struct tx_desc *)msg;
debug("** %s(), len %d\n", __func__, length);
{
struct ueth_data *dev = (struct ueth_data *)eth->priv;
{
struct ueth_data *dev = (struct ueth_data *)eth->priv;
- static unsigned char recv_buf[RTL8152_AGG_BUF_SZ];
+ ALLOC_CACHE_ALIGN_BUFFER(uint8_t, recv_buf, RTL8152_AGG_BUF_SZ);
unsigned char *pkt_ptr;
int err;
int actual_len;
unsigned char *pkt_ptr;
int err;
int actual_len;