rjw | 6c1fd8f | 2022-11-30 14:33:01 +0800 | [diff] [blame] | 1 | /***************************************************************************** |
| 2 | * Copyright Statement: |
| 3 | * -------------------- |
| 4 | * This software is protected by Copyright and the information contained |
| 5 | * herein is confidential. The software may not be copied and the information |
| 6 | * contained herein may not be used or disclosed except with the written |
| 7 | * permission of MediaTek Inc. (C) 2005 |
| 8 | * |
| 9 | * BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES |
| 10 | * THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE") |
| 11 | * RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON |
| 12 | * AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES, |
| 13 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF |
| 14 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT. |
| 15 | * NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE |
| 16 | * SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR |
| 17 | * SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH |
| 18 | * THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO |
| 19 | * NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S |
| 20 | * SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM. |
| 21 | * |
| 22 | * BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE |
| 23 | * LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE, |
| 24 | * AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE, |
| 25 | * OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO |
| 26 | * MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE. |
| 27 | * |
| 28 | * THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE |
| 29 | * WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF |
| 30 | * LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND |
| 31 | * RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER |
| 32 | * THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC). |
| 33 | * |
| 34 | *****************************************************************************/ |
| 35 | |
| 36 | /***************************************************************************** |
| 37 | * |
| 38 | * Filename: |
| 39 | * --------- |
| 40 | * usbc_custom_def.h |
| 41 | * |
| 42 | * Project: |
| 43 | * -------- |
| 44 | * MOLY |
| 45 | * |
| 46 | * Description: |
| 47 | * ------------ |
| 48 | * This file declares usb customization definitions |
| 49 | * |
| 50 | * Author: |
| 51 | * ------- |
| 52 | * ------- |
| 53 | * |
| 54 | *============================================================================ |
| 55 | * HISTORY |
| 56 | * Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!! |
| 57 | *------------------------------------------------------------------------------ |
| 58 | * removed! |
| 59 | * removed! |
| 60 | * removed! |
| 61 | * |
| 62 | * removed! |
| 63 | * removed! |
| 64 | * removed! |
| 65 | * removed! |
| 66 | * |
| 67 | * removed! |
| 68 | * removed! |
| 69 | * removed! |
| 70 | * removed! |
| 71 | * |
| 72 | * removed! |
| 73 | * removed! |
| 74 | * removed! |
| 75 | * |
| 76 | * removed! |
| 77 | * removed! |
| 78 | * removed! |
| 79 | * |
| 80 | * removed! |
| 81 | * removed! |
| 82 | * removed! |
| 83 | * |
| 84 | * removed! |
| 85 | * removed! |
| 86 | * removed! |
| 87 | * |
| 88 | * removed! |
| 89 | * removed! |
| 90 | * removed! |
| 91 | * |
| 92 | * removed! |
| 93 | * removed! |
| 94 | * removed! |
| 95 | * |
| 96 | * removed! |
| 97 | * removed! |
| 98 | * removed! |
| 99 | * |
| 100 | * removed! |
| 101 | * removed! |
| 102 | * removed! |
| 103 | * |
| 104 | * removed! |
| 105 | * removed! |
| 106 | * removed! |
| 107 | * |
| 108 | * removed! |
| 109 | * removed! |
| 110 | * removed! |
| 111 | * |
| 112 | * removed! |
| 113 | * removed! |
| 114 | * removed! |
| 115 | * |
| 116 | * removed! |
| 117 | * removed! |
| 118 | * removed! |
| 119 | * removed! |
| 120 | * removed! |
| 121 | * removed! |
| 122 | * |
| 123 | * removed! |
| 124 | * removed! |
| 125 | * removed! |
| 126 | * |
| 127 | * removed! |
| 128 | * removed! |
| 129 | * removed! |
| 130 | * removed! |
| 131 | * removed! |
| 132 | * removed! |
| 133 | * removed! |
| 134 | * removed! |
| 135 | * |
| 136 | * removed! |
| 137 | * removed! |
| 138 | * removed! |
| 139 | * |
| 140 | * removed! |
| 141 | * removed! |
| 142 | * removed! |
| 143 | * |
| 144 | * |
| 145 | *------------------------------------------------------------------------------ |
| 146 | * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!! |
| 147 | *============================================================================ |
| 148 | ****************************************************************************/ |
| 149 | #ifndef _USBC_CUSTOM_DEF_H_ |
| 150 | #define _USBC_CUSTOM_DEF_H_ |
| 151 | |
| 152 | #define USB_UNIQUE_SERIAL_NUM_ENABLE (1) /* 1: Set IMEI as the serial number. 0: do not report serial number in device descriptor */ |
| 153 | #define U3_CONF_BMAXPOWER (896) /* the iMaxPower of USB 3.0 configuration descriptor */ |
| 154 | #define U3_CONF_BMAXPOWER_META (400) /* the iMaxPower of USB 3.0 configuration descriptor in META mode */ |
| 155 | |
| 156 | /* |
| 157 | * U2_TERM_VREF_DEF |
| 158 | * USBPHYACR1.BIT[10:8] |
| 159 | * 0 : 320mV |
| 160 | * 1 : 340mV |
| 161 | * 2 : 360mV |
| 162 | * 3 : 380mV |
| 163 | * 4 : 400mV |
| 164 | * 5 : 420mV |
| 165 | * 6 : 440mV |
| 166 | * 7 : 460mV |
| 167 | */ |
| 168 | #define U2_TERM_VREF_DEF (7) |
| 169 | |
| 170 | /* |
| 171 | * U2_VRT_VREF_DEF |
| 172 | * USBPHYACR1.BIT[14:12] |
| 173 | * 0 : 700mV |
| 174 | * 1 : 720mV |
| 175 | * 2 : 740mV |
| 176 | * 3 : 760mV |
| 177 | * 4 : 770mV |
| 178 | * 5 : 780mV |
| 179 | * 6 : 800mV |
| 180 | * 7 : 820mV |
| 181 | */ |
| 182 | #define U2_VRT_VREF_DEF (7) |
| 183 | |
| 184 | /* |
| 185 | * U2_ENHANCEMENT_STATE |
| 186 | * USBPHYACR6.BIT[31:30] : U2 eye enhancement |
| 187 | * 0 : low |
| 188 | * 1 : reserve |
| 189 | * 2 : reserve |
| 190 | * 3 : strongest |
| 191 | */ |
| 192 | #define U2_ENHANCEMENT_STATE (3) |
| 193 | |
| 194 | /* |
| 195 | * U2_SQ_THRESHOLD_DEF |
| 196 | * USBPHYACR6.BIT[3:0] |
| 197 | * 0 : 85mV |
| 198 | * 1 : 90mV |
| 199 | * 2 : 95mV |
| 200 | * 3 : 100mV |
| 201 | * 4 : 105mV |
| 202 | * 5 : 110mV |
| 203 | * 6 : 115mV |
| 204 | * 7 : 120mV |
| 205 | * 8 : 125mV |
| 206 | * 9 : 130mV |
| 207 | * 10 : 135mV |
| 208 | * 11 : 140mV |
| 209 | * 12 : 145mV |
| 210 | * 13 : 150mV |
| 211 | * 14 : 155mV |
| 212 | * 15 : 160mV |
| 213 | */ |
| 214 | #define U2_SQ_THRESHOLD_DEF (2) |
| 215 | |
| 216 | /* |
| 217 | * Not use |
| 218 | * U2_DISCONNECT_THRESHOLD_DEF |
| 219 | * * USBPHYACR6.BIT[7:4] |
| 220 | * 0 : 400mV |
| 221 | * 1 : 420mV |
| 222 | * 2 : 440mV |
| 223 | * 3 : 460mV |
| 224 | * 4 : 480mV |
| 225 | * 5 : 500mV |
| 226 | * 6 : 520mV |
| 227 | * 7 : 540mV |
| 228 | * 8 : 560mV |
| 229 | * 9 : 580mV |
| 230 | * 10 : 600mV |
| 231 | * 11 : 620mV |
| 232 | * 12 : 640mV |
| 233 | * 13 : 660mV |
| 234 | * 14 : 680mV |
| 235 | * 15 : 700mV |
| 236 | */ |
| 237 | #define U2_DISCONNECT_THRESHOLD_DEF (0) |
| 238 | |
| 239 | |
| 240 | |
| 241 | |
| 242 | |
| 243 | |
| 244 | |
| 245 | typedef enum { |
| 246 | USB_MODE_BTT_STANDALONE = 0, /* BTT standlone */ |
| 247 | USB_MODE_MSD_OSDRTY, |
| 248 | USB_MODE_META_DBG, |
| 249 | USB_MODE_1R3C, |
| 250 | USB_MODE_UFPM, /* USB fast path */ |
| 251 | USBMODE_KS_IODT_1R3C_ENUM, |
| 252 | USBMODE_1R5C_ENUM, |
| 253 | USBMODE_1R4C_ENUM, |
| 254 | USBMODE_RNDIS_DBG_COM_ENUM, |
| 255 | USB_MODE_NUM, |
| 256 | USB_MODE_MAX = 16 |
| 257 | } usb_mode_e; |
| 258 | |
| 259 | typedef enum{ |
| 260 | USB_MODE_NORMAL = 0, |
| 261 | USB_MODE_VENDER1, |
| 262 | USB_MODE_VENDER2, |
| 263 | USB_MODE_OWNER_NUM, |
| 264 | }usb_mode_owner_e; |
| 265 | |
| 266 | #define USB_MODE_DEFAULT USBMODE_1R5C_ENUM |
| 267 | |
| 268 | #if defined(__USB_MSD_SUPPORT__) |
| 269 | typedef enum |
| 270 | { |
| 271 | USBMS_DISK_MSDC1, |
| 272 | USBMS_DISK_MSDC2, |
| 273 | USBMS_DISK_NOR, |
| 274 | USBMS_DISK_NAND, |
| 275 | #if defined(__MTK_TARGET__) |
| 276 | USBMS_DISK_CDROM |
| 277 | #else |
| 278 | USBMS_DISK_CDROM, |
| 279 | USBMS_DISK_RAMDISK |
| 280 | #endif |
| 281 | } MS_DISK_CONFIG_TYPE;//config type for ms adapter |
| 282 | |
| 283 | /*from spec SCSI-4 (6.4.2)*/ |
| 284 | #define MS_INQURIY_VENDOR_MAX_SIZE 8 |
| 285 | #define MS_INQURIY_PRODUCT_MAX_SIZE 16 |
| 286 | #define MS_INQURIY_REVISION_MAX_SIZE 4 |
| 287 | #endif |
| 288 | |
| 289 | #endif /* _USBC_CUSTOM_DEF_H_ */ |