1 /****************************************************************************
2 * (C) Copyright 2008 Samsung Electronics Co., Ltd., All rights reserved
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
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.
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.
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.
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 ****************************************************************************/
30 #ifndef _CONST_TYPE_DEF_H_
31 #define _CONST_TYPE_DEF_H_
34 // ----------------------------------------------------------------------------
35 // Include files : None.
36 // ----------------------------------------------------------------------------
39 #include "s3c-otg-common-common.h"
41 //#include "s3c-otg-common-regdef.h"
49 * @def OTG_PORT_NUMBER
51 * @brief write~ description
55 #define OTG_PORT_NUMBER 0
59 //Defines Stages of Control Transfer
62 #define STATUS_STAGE 3
63 #define COMPLETE_STAGE 4
66 //Defines Direction of Endpoint
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
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
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
87 #define BULK_TIMEOUT 300
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
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
126 //define the threshold value to retransmit USB Transfer
127 #define RETRANSMIT_THRESHOLD 2
129 //define the maximum size of data to be tranferred through channel.
130 #define MAX_CH_TRANSFER_SIZE 65536//65535
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
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;
153 #define USB_TRANS_FLAG_NOT_SHORT URB_SHORT_NOT_OK
154 #define USB_TRANS_FLAG_ISO_ASYNCH URB_ISO_ASAP
157 #define HFNUM_MAX_FRNUM 0x3FFF
158 #define SCHEDULE_SLOT 10