2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2024-12-26 22:24:09 +08:00
linux-next/drivers/usb/musb/blackfin.h
Sonic Zhang daf5822f05 USB: musb: add notes for Blackfin anomalies
Add some helpful notes about how the driver works around different
anomalies that exist in the on-chip host controller.

Signed-off-by: Sonic Zhang <sonic.zhang@analog.com>
Signed-off-by: Cliff Cai <cliff.cai@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Anand Gadiyar <gadiyar@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-12-11 11:55:24 -08:00

80 lines
2.3 KiB
C

/*
* Copyright (C) 2007 by Analog Devices, Inc.
*
* The Inventra Controller Driver for Linux is free software; you
* can redistribute it and/or modify it under the terms of the GNU
* General Public License version 2 as published by the Free Software
* Foundation.
*/
#ifndef __MUSB_BLACKFIN_H__
#define __MUSB_BLACKFIN_H__
/*
* Blackfin specific definitions
*/
/* Anomalies notes:
*
* 05000450 - USB DMA Mode 1 Short Packet Data Corruption:
* MUSB driver is designed to transfer buffer of N * maxpacket size
* in DMA mode 1 and leave the rest of the data to the next
* transfer in DMA mode 0, so we never transmit a short packet in
* DMA mode 1.
*
* 05000463 - This anomaly doesn't affect this driver since it
* never uses L1 or L2 memory as data destination.
*
* 05000464 - This anomaly doesn't affect this driver since it
* never uses L1 or L2 memory as data source.
*
* 05000465 - The anomaly can be seen when SCLK is over 100 MHz, and there is
* no way to workaround for bulk endpoints. Since the wMaxPackSize
* of bulk is less than or equal to 512, while the fifo size of
* endpoint 5, 6, 7 is 1024, the double buffer mode is enabled
* automatically when these endpoints are used for bulk OUT.
*
* 05000466 - This anomaly doesn't affect this driver since it never mixes
* concurrent DMA and core accesses to the TX endpoint FIFOs.
*
* 05000467 - The workaround for this anomaly will introduce another
* anomaly - 05000465.
*/
#undef DUMP_FIFO_DATA
#ifdef DUMP_FIFO_DATA
static void dump_fifo_data(u8 *buf, u16 len)
{
u8 *tmp = buf;
int i;
for (i = 0; i < len; i++) {
if (!(i % 16) && i)
pr_debug("\n");
pr_debug("%02x ", *tmp++);
}
pr_debug("\n");
}
#else
#define dump_fifo_data(buf, len) do {} while (0)
#endif
#ifdef CONFIG_BF52x
#define USB_DMA_BASE USB_DMA_INTERRUPT
#define USB_DMAx_CTRL 0x04
#define USB_DMAx_ADDR_LOW 0x08
#define USB_DMAx_ADDR_HIGH 0x0C
#define USB_DMAx_COUNT_LOW 0x10
#define USB_DMAx_COUNT_HIGH 0x14
#define USB_DMA_REG(ep, reg) (USB_DMA_BASE + 0x20 * ep + reg)
#endif
/* Almost 1 second */
#define TIMER_DELAY (1 * HZ)
static struct timer_list musb_conn_timer;
#endif /* __MUSB_BLACKFIN_H__ */