1 /* SPDX-License-Identifier: GPL-2.0+ */
2 /*
3  * Copyright (C) 2005-2013 Atmel Corporation
4  *			   Bo Shen <voice.shen@atmel.com>
5  */
6 
7 #ifndef __ATMEL_USBA_UDC_H__
8 #define __ATMEL_USBA_UDC_H__
9 
10 #include <linux/usb/atmel_usba_udc.h>
11 
12 #define EP(nam, idx, maxpkt, maxbk, dma, isoc)		\
13 	[idx] = {					\
14 		.name	= nam,				\
15 		.index	= idx,				\
16 		.fifo_size	= maxpkt,		\
17 		.nr_banks	= maxbk,		\
18 		.can_dma	= dma,			\
19 		.can_isoc	= isoc,			\
20 	}
21 
22 #if defined(CONFIG_AT91SAM9G45) || defined(CONFIG_AT91SAM9M10G45) || \
23 	defined(CONFIG_AT91SAM9X5)
24 static struct usba_ep_data usba_udc_ep[] = {
25 	EP("ep0", 0, 64, 1, 0, 0),
26 	EP("ep1", 1, 1024, 2, 1, 1),
27 	EP("ep2", 2, 1024, 2, 1, 1),
28 	EP("ep3", 3, 1024, 3, 1, 0),
29 	EP("ep4", 4, 1024, 3, 1, 0),
30 	EP("ep5", 5, 1024, 3, 1, 1),
31 	EP("ep6", 6, 1024, 3, 1, 1),
32 };
33 #elif defined(CONFIG_SAMA5D2) || defined(CONFIG_SAMA5D3) || \
34 	defined(CONFIG_SAMA5D4)
35 static struct usba_ep_data usba_udc_ep[] = {
36 	EP("ep0", 0, 64, 1, 0, 0),
37 	EP("ep1", 1, 1024, 3, 1, 0),
38 	EP("ep2", 2, 1024, 3, 1, 0),
39 	EP("ep3", 3, 1024, 2, 1, 0),
40 	EP("ep4", 4, 1024, 2, 1, 0),
41 	EP("ep5", 5, 1024, 2, 1, 0),
42 	EP("ep6", 6, 1024, 2, 1, 0),
43 	EP("ep7", 7, 1024, 2, 1, 0),
44 	EP("ep8", 8, 1024, 2, 0, 0),
45 	EP("ep9", 9, 1024, 2, 0, 0),
46 	EP("ep10", 10, 1024, 2, 0, 0),
47 	EP("ep11", 11, 1024, 2, 0, 0),
48 	EP("ep12", 12, 1024, 2, 0, 0),
49 	EP("ep13", 13, 1024, 2, 0, 0),
50 	EP("ep14", 14, 1024, 2, 0, 0),
51 	EP("ep15", 15, 1024, 2, 0, 0),
52 };
53 #else
54 # error "NO usba_udc_ep defined"
55 #endif
56 
57 #undef EP
58 
59 struct usba_platform_data pdata = {
60 	.num_ep	= ARRAY_SIZE(usba_udc_ep),
61 	.ep	= usba_udc_ep,
62 };
63 
64 #endif
65