summaryrefslogtreecommitdiffstats
path: root/drivers/usb/musb/blackfin_usb.h
blob: de994bf3361034921dc31788cae508a70b2689de (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
/*
 * Blackfin MUSB HCD (Host Controller Driver) for u-boot
 *
 * Copyright (c) 2008-2009 Analog Devices Inc.
 *
 * Licensed under the GPL-2 or later.
 */

#ifndef __BLACKFIN_USB_H__
#define __BLACKFIN_USB_H__

#include <linux/types.h>

/* Every register is 32bit aligned, but only 16bits in size */
#define ureg(name) u16 name; u16 __pad_##name;

#define musb_regs musb_regs
struct musb_regs {
	/* common registers */
	ureg(faddr)
	ureg(power)
	ureg(intrtx)
	ureg(intrrx)
	ureg(intrtxe)
	ureg(intrrxe)
	ureg(intrusb)
	ureg(intrusbe)
	ureg(frame)
	ureg(index)
	ureg(testmode)
	ureg(globintr)
	ureg(global_ctl)
	u32	reserved0[3];
	/* indexed registers */
	ureg(txmaxp)
	ureg(txcsr)
	ureg(rxmaxp)
	ureg(rxcsr)
	ureg(rxcount)
	ureg(txtype)
	ureg(txinterval)
	ureg(rxtype)
	ureg(rxinterval)
	u32	reserved1;
	ureg(txcount)
	u32	reserved2[5];
	/* fifo */
	u16	fifox[32];
	/* OTG, dynamic FIFO, version & vendor registers */
	u32	reserved3[16];
	ureg(devctl)
	ureg(vbus_irq)
	ureg(vbus_mask)
	u32 reserved4[15];
	ureg(linkinfo)
	ureg(vplen)
	ureg(hseof1)
	ureg(fseof1)
	ureg(lseof1)
	u32 reserved5[41];
	/* target address registers */
	struct musb_tar_regs {
		ureg(txmaxp)
		ureg(txcsr)
		ureg(rxmaxp)
		ureg(rxcsr)
		ureg(rxcount)
		ureg(txtype)
		ureg(txinternal)
		ureg(rxtype)
		ureg(rxinternal)
		u32	reserved6;
		ureg(txcount)
		u32 reserved7[5];
	} tar[8];
} __attribute__((packed));

struct bfin_musb_dma_regs {
	ureg(interrupt);
	ureg(control);
	ureg(addr_low);
	ureg(addr_high);
	ureg(count_low);
	ureg(count_high);
	u32 reserved0[2];
};

#undef ureg

/* EP5-EP7 are the only ones with 1024 byte FIFOs which BULK really needs */
#define MUSB_BULK_EP 5

/* Blackfin FIFO's are static */
#define MUSB_NO_DYNAMIC_FIFO

/* No HUB support :( */
#define MUSB_NO_MULTIPOINT

#endif
OpenPOWER on IntegriCloud