1 // SPDX-License-Identifier: GPL-2.0
3 * Copyright (C) 2007 by Analog Devices, Inc.
6 #ifndef __MUSB_BLACKFIN_H__
7 #define __MUSB_BLACKFIN_H__
10 * Blackfin specific definitions
15 * 05000450 - USB DMA Mode 1 Short Packet Data Corruption:
16 * MUSB driver is designed to transfer buffer of N * maxpacket size
17 * in DMA mode 1 and leave the rest of the data to the next
18 * transfer in DMA mode 0, so we never transmit a short packet in
21 * 05000463 - This anomaly doesn't affect this driver since it
22 * never uses L1 or L2 memory as data destination.
24 * 05000464 - This anomaly doesn't affect this driver since it
25 * never uses L1 or L2 memory as data source.
27 * 05000465 - The anomaly can be seen when SCLK is over 100 MHz, and there is
28 * no way to workaround for bulk endpoints. Since the wMaxPackSize
29 * of bulk is less than or equal to 512, while the fifo size of
30 * endpoint 5, 6, 7 is 1024, the double buffer mode is enabled
31 * automatically when these endpoints are used for bulk OUT.
33 * 05000466 - This anomaly doesn't affect this driver since it never mixes
34 * concurrent DMA and core accesses to the TX endpoint FIFOs.
36 * 05000467 - The workaround for this anomaly will introduce another
40 /* The Mentor USB DMA engine on BF52x (silicon v0.0 and v0.1) seems to be
41 * unstable in host mode. This may be caused by Anomaly 05000380. After
42 * digging out the root cause, we will change this number accordingly.
43 * So, need to either use silicon v0.2+ or disable DMA mode in MUSB.
45 #if ANOMALY_05000380 && defined(CONFIG_BF52x) && \
46 !defined(CONFIG_MUSB_PIO_ONLY)
47 # error "Please use PIO mode in MUSB driver on bf52x chip v0.0 and v0.1"
52 static void dump_fifo_data(u8
*buf
, u16 len
)
57 for (i
= 0; i
< len
; i
++) {
60 pr_debug("%02x ", *tmp
++);
65 #define dump_fifo_data(buf, len) do {} while (0)
69 #define USB_DMA_BASE USB_DMA_INTERRUPT
70 #define USB_DMAx_CTRL 0x04
71 #define USB_DMAx_ADDR_LOW 0x08
72 #define USB_DMAx_ADDR_HIGH 0x0C
73 #define USB_DMAx_COUNT_LOW 0x10
74 #define USB_DMAx_COUNT_HIGH 0x14
76 #define USB_DMA_REG(ep, reg) (USB_DMA_BASE + 0x20 * ep + reg)
79 #define TIMER_DELAY (1 * HZ)
81 #endif /* __MUSB_BLACKFIN_H__ */