1 /* ==========================================================================
2 * Synopsys HS OTG Linux Software Driver and documentation (hereinafter,
3 * "Software") is an Unsupported proprietary work of Synopsys, Inc. unless
4 * otherwise expressly agreed to in writing between Synopsys and you.
6 * The Software IS NOT an item of Licensed Software or Licensed Product under
7 * any End User Software License Agreement or Agreement for Licensed Product
8 * with Synopsys or any supplement thereto. You are permitted to use and
9 * redistribute this Software in source and binary forms, with or without
10 * modification, provided that redistributions of source code must retain this
11 * notice. You may not view, use, disclose, copy or distribute this file or
12 * any information contained herein except pursuant to this license grant from
13 * Synopsys. If you do not agree with this notice, including the disclaimer
14 * below, then you are not authorized to use the Software.
16 * THIS SOFTWARE IS BEING DISTRIBUTED BY SYNOPSYS SOLELY ON AN "AS IS" BASIS
17 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 * ARE HEREBY DISCLAIMED. IN NO EVENT SHALL SYNOPSYS BE LIABLE FOR ANY DIRECT,
20 * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
22 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
23 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
27 * ========================================================================== */
29 #if !defined(__DWC_CFI_COMMON_H__)
30 #define __DWC_CFI_COMMON_H__
32 /* #include <linux/types.h> */
37 * This file contains the CFI specific common constants, interfaces
38 * (functions and macros) and structures for Linux. No PCD specific
39 * data structure or definition is to be included in this file.
43 /** This is a request for all Core Features */
44 #define VEN_CORE_GET_FEATURES 0xB1
46 /** This is a request to get the value of a specific Core Feature */
47 #define VEN_CORE_GET_FEATURE 0xB2
49 /** This command allows the host to set the value of a specific Core Feature */
50 #define VEN_CORE_SET_FEATURE 0xB3
52 /** This command allows the host to set the default values of
53 * either all or any specific Core Feature
55 #define VEN_CORE_RESET_FEATURES 0xB4
57 /** This command forces the PCD to write the deferred values of a Core Features */
58 #define VEN_CORE_ACTIVATE_FEATURES 0xB5
60 /** This request reads a DWORD value from a register at the specified offset */
61 #define VEN_CORE_READ_REGISTER 0xB6
63 /** This request writes a DWORD value into a register at the specified offset */
64 #define VEN_CORE_WRITE_REGISTER 0xB7
66 /** This structure is the header of the Core Features dataset returned to
69 struct cfi_all_features_header {
70 /** The features header structure length is */
71 #define CFI_ALL_FEATURES_HDR_LEN 8
73 * The total length of the features dataset returned to the Host
78 * CFI version number inBinary-Coded Decimal (i.e., 1.00 is 100H).
79 * This field identifies the version of the CFI Specification with which
80 * the device is compliant.
84 /** The ID of the Core */
86 #define CFI_CORE_ID_UDC 1
87 #define CFI_CORE_ID_OTG 2
88 #define CFI_CORE_ID_WUDEV 3
90 /** Number of features returned by VEN_CORE_GET_FEATURES request */
91 uint16_t wNumFeatures;
94 typedef struct cfi_all_features_header cfi_all_features_header_t;
96 /** This structure is a header of the Core Feature descriptor dataset returned to
97 * the Host after the VEN_CORE_GET_FEATURES request
99 struct cfi_feature_desc_header {
100 #define CFI_FEATURE_DESC_HDR_LEN 8
102 /** The feature ID */
105 /** Length of this feature descriptor in bytes - including the
106 * length of the feature name string
110 /** The data length of this feature in bytes */
111 uint16_t wDataLength;
114 * Attributes of this features
119 uint8_t bmAttributes;
120 #define CFI_FEATURE_ATTR_RO 1
121 #define CFI_FEATURE_ATTR_RW 0
123 /** Length of the feature name in bytes */
126 /** The feature name buffer */
130 typedef struct cfi_feature_desc_header cfi_feature_desc_header_t;
133 * This structure describes a NULL terminated string referenced by its id field.
134 * It is very similar to usb_string structure but has the id field type set to 16-bit.
140 typedef struct cfi_string cfi_string_t;