upload tizen1.0 source
[kernel/linux-2.6.36.git] / drivers / usb / host / s3c-otg / s3c-otg-common-const.h
1 /****************************************************************************
2  *  (C) Copyright 2008 Samsung Electronics Co., Ltd., All rights reserved
3  *
4  *  [File Name]   : s3c-otg-common-const.h
5  *  [Description] : The Header file defines constants to be used at sub-modules of S3C6400HCD.
6  *  [Author]      : Yang Soon Yeal { syatom.yang@samsung.com }
7  *  [Department]  : System LSI Division/System SW Lab
8  *  [Created Date]: 2008/06/03
9  *  [Revision History]
10  *      (1) 2008/06/03   by Yang Soon Yeal { syatom.yang@samsung.com }
11  *          - Created s3c-otg-common-const.h file and defines some constants.
12  *
13  ****************************************************************************/
14 /****************************************************************************
15  * This program is free software; you can redistribute it and/or modify
16  * it under the terms of the GNU General Public License as published by
17  * the Free Software Foundation; either version 2 of the License, or
18  * (at your option) any later version.
19  *
20  * This program is distributed in the hope that it will be useful,
21  * but WITHOUT ANY WARRANTY; without even the implied warranty of
22  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
23  * GNU General Public License for more details.
24  *
25  * You should have received a copy of the GNU General Public License
26  * along with this program; if not, write to the Free Software
27  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
28  ****************************************************************************/
29
30 #ifndef  _CONST_TYPE_DEF_H_
31 #define  _CONST_TYPE_DEF_H_
32
33 /*
34 // ----------------------------------------------------------------------------
35 // Include files : None.
36 // ----------------------------------------------------------------------------
37 */
38
39 #include "s3c-otg-common-common.h"
40
41 //#include "s3c-otg-common-regdef.h"
42
43 #ifdef __cplusplus
44 extern "C"
45 {
46 #endif
47
48 /**
49  * @def OTG_PORT_NUMBER
50  *
51  * @brief write~ description
52  *
53  * describe in detail
54  */
55 #define OTG_PORT_NUMBER 0
56
57
58
59 //Defines Stages of Control Transfer
60 #define         SETUP_STAGE             1
61 #define         DATA_STAGE              2
62 #define         STATUS_STAGE            3
63 #define         COMPLETE_STAGE  4
64
65
66 //Defines Direction of Endpoint
67 #define         EP_IN                                   1
68 #define         EP_OUT                                  0
69
70 //Define speed of USB Device
71 #define                 LOW_SPEED_OTG                           2
72 #define                 FULL_SPEED_OTG                          1
73 #define                 HIGH_SPEED_OTG                          0
74 #define                 SUPER_SPEED_OTG                         3
75
76 //Define multiple count of packet in periodic transfer.
77 #define         MULTI_COUNT_ZERO                0
78 #define         MULTI_COUNT_ONE                 1
79 #define         MULTI_COUNT_TWO                 2
80
81 //Define USB Transfer Types.
82 #define         CONTROL_TRANSFER                0
83 #define         ISOCH_TRANSFER          1
84 #define         BULK_TRANSFER                   2
85 #define         INT_TRANSFER                    3
86
87 #define         BULK_TIMEOUT                    300
88
89 //Defines PID
90 #define         DATA0                                   0
91 #define         DATA1                                   2
92 #define         DATA2                                   1
93 #define         MDATA                                   3
94 #define         SETUP                                   3
95
96 //Defines USB Transfer Request Size on USB2.0
97 #define USB_20_STAND_DEV_REQUEST_SIZE   8
98 //Define Max Channel Number
99 #define MAX_CH_NUMBER                   16
100 //Define Channel Number
101 #define CH_0    0
102 #define CH_1    1
103 #define CH_2    2
104 #define CH_3    3
105 #define CH_4    4
106 #define CH_5    5
107 #define CH_6    6
108 #define CH_7    7
109 #define CH_8    8
110 #define CH_9    9
111 #define CH_10   10
112 #define CH_11   11
113 #define CH_12   12
114 #define CH_13   13
115 #define CH_14   14
116 #define CH_15   15
117 #define CH_NONE 20
118
119
120 // define the Constant for result of processing the USB Transfer.
121 #define RE_TRANSMIT             1
122 #define RE_SCHEDULE             2
123 #define DE_ALLOCATE             3
124 #define NO_ACTION                       4
125
126 //define        the threshold value to retransmit USB Transfer
127 #define RETRANSMIT_THRESHOLD            2
128
129 //define the maximum size of data to be tranferred through channel.
130 #define MAX_CH_TRANSFER_SIZE            65536//65535
131
132 //define Max Frame Number which Synopsys OTG suppports.
133 #define MAX_FRAME_NUMBER                        0x3FFF
134 // Channel Interrupt Status
135 #define CH_STATUS_DataTglErr            (0x1<<10)
136 #define CH_STATUS_FrmOvrun              (0x1<<9)
137 #define CH_STATUS_BblErr                        (0x1<<8)
138 #define CH_STATUS_XactErr                       (0x1<<7)
139 #define CH_STATUS_NYET                  (0x1<<6)
140 #define CH_STATUS_ACK                           (0x1<<5)
141 #define CH_STATUS_NAK                           (0x1<<4)
142 #define CH_STATUS_STALL                 (0x1<<3)
143 #define CH_STATUS_AHBErr                        (0x1<<2)
144 #define CH_STATUS_ChHltd                        (0x1<<1)
145 #define CH_STATUS_XferCompl             (0x1<<0)
146 #define CH_STATUS_ALL                           0x7FF
147
148
149 //Define USB Transfer Flag..
150 //typedef       URB_SHORT_NOT_OK        USB_TRANS_FLAG_NOT_SHORT;
151 //typedef       URB_ISO_ASAP            USB_TRANS_FLAG_ISO_ASYNCH;
152
153 #define         USB_TRANS_FLAG_NOT_SHORT        URB_SHORT_NOT_OK
154 #define         USB_TRANS_FLAG_ISO_ASYNCH       URB_ISO_ASAP
155
156
157 #define HFNUM_MAX_FRNUM 0x3FFF
158 #define SCHEDULE_SLOT   10
159
160 #ifdef __cplusplus
161 }
162 #endif
163
164
165 #endif
166
167