• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /******************************************************************************
2  *
3  *  Copyright (C) 2012-2013 Broadcom Corporation
4  *
5  *  Licensed under the Apache License, Version 2.0 (the "License");
6  *  you may not use this file except in compliance with the License.
7  *  You may obtain a copy of the License at:
8  *
9  *  http://www.apache.org/licenses/LICENSE-2.0
10  *
11  *  Unless required by applicable law or agreed to in writing, software
12  *  distributed under the License is distributed on an "AS IS" BASIS,
13  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  *  See the License for the specific language governing permissions and
15  *  limitations under the License.
16  *
17  ******************************************************************************/
18 
19 
20 /******************************************************************************
21  *
22  *  This file contains the Broadcom-specific defintions that are shared
23  *  between HAL, nfc stack, adaptation layer and applications.
24  *
25  ******************************************************************************/
26 
27 #ifndef NFC_BRCM_DEFS_H
28 #define NFC_BRCM_DEFS_H
29 
30 /*****************************************************************************
31 ** Broadcom-specific NCI definitions
32 *****************************************************************************/
33 
34 /**********************************************
35  * NCI Message Proprietary  Group       - F
36  **********************************************/
37 #define NCI_MSG_TAG_SET_MEM             0x00
38 #define NCI_MSG_TAG_GET_MEM             0x01
39 #define NCI_MSG_T1T_SET_HR              0x02
40 #define NCI_MSG_SET_CLF_REGISTERS       0x03
41 #define NCI_MSG_GET_BUILD_INFO          0x04
42 #define NCI_MSG_HCI_NETWK               0x05
43 #define NCI_MSG_SET_FWFSM               0x06
44 #define NCI_MSG_SET_UICCRDRF            0x07
45 #define NCI_MSG_POWER_LEVEL             0x08
46 #define NCI_MSG_FRAME_LOG               0x09
47 #define NCI_MSG_UICC_READER_ACTION      0x0A
48 #define NCI_MSG_SET_PPSE_RESPONSE       0x0B
49 #define NCI_MSG_PRBS_SET                0x0C
50 #define NCI_MSG_RESET_ALL_UICC_CFG      0x0D    /* reset HCI network/close all pipes (S,D) register */
51 #define NCI_MSG_GET_NFCEE_INFO          0x0E
52 #define NCI_MSG_DISABLE_INIT_CHECK      0x0F
53 #define NCI_MSG_ANTENNA_SELF_TEST       0x10
54 #define NCI_MSG_SET_MAX_PKT_SIZE        0x11
55 #define NCI_MSG_NCIP_CLK_REQ_OR_CAR_DET 0x12
56 #define NCI_MSG_NCIP_CONFIG_DBUART      0x13
57 #define NCI_MSG_NCIP_ENABLE_DVT_DRIVER  0x14
58 #define NCI_MSG_SET_ASWP                0x15
59 #define NCI_MSG_ENCAPSULATE_NCI         0x16
60 #define NCI_MSG_CONFIGURE_ARM_JTAG      0x17
61 #define NCI_MSG_STATISTICS              0x18
62 #define NCI_MSG_SET_DSP_TABLE           0x19
63 #define NCI_MSG_GET_DSP_TABLE           0x1a
64 #define NCI_MSG_READY_RX_CMD            0x1b
65 #define NCI_MSG_GET_VBAT                0x1c
66 #define NCI_MSG_GET_XTAL_INDEX_FROM_DH  0x1d
67 #define NCI_MSG_SWP_LOG                 0x1e
68 #define NCI_MSG_GET_PWRLEVEL            0x1f
69 #define NCI_MSG_SET_VBAT_MONITOR        0x20
70 #define NCI_MSG_SET_TINT_MODE           0x21
71 #define NCI_MSG_ACCESS_APP              0x22
72 #define NCI_MSG_SET_SECURE_MODE         0x23
73 #define NCI_MSG_GET_NV_DEVICE           0x24
74 #define NCI_MSG_LPTD                    0x25
75 #define NCI_MSG_SET_CE4_AS_SNOOZE       0x26
76 #define NCI_MSG_NFCC_SEND_HCI           0x27
77 #define NCI_MSG_CE4_PATCH_DOWNLOAD_DONE 0x28
78 #define NCI_MSG_EEPROM_RW               0x29
79 #define NCI_MSG_GET_CLF_REGISTERS       0x2A
80 #define NCI_MSG_RF_TEST                 0x2B
81 #define NCI_MSG_DEBUG_PRINT             0x2C
82 #define NCI_MSG_GET_PATCH_VERSION       0x2D
83 #define NCI_MSG_SECURE_PATCH_DOWNLOAD   0x2E
84 #define NCI_MSG_SPD_FORMAT_NVM          0x2F
85 #define NCI_MSG_SPD_READ_NVM            0x30
86 #define NCI_MSG_SWP_BIST                0x31
87 #define NCI_MSG_WLESS_DBG_MODE          0x32
88 #define NCI_MSG_I2C_REQ_POLARITY        0x33
89 
90 
91 /**********************************************
92  * Proprietary  NCI status codes
93  **********************************************/
94 #define NCI_STATUS_SPD_ERROR_ORDER          0xE0
95 #define NCI_STATUS_SPD_ERROR_DEST           0xE1
96 #define NCI_STATUS_SPD_ERROR_PROJECTID      0xE2
97 #define NCI_STATUS_SPD_ERROR_CHIPVER        0xE3
98 #define NCI_STATUS_SPD_ERROR_MAJORVER       0xE4
99 #define NCI_STATUS_SPD_ERROR_INVALID_PARAM  0xE5
100 #define NCI_STATUS_SPD_ERROR_INVALID_SIG    0xE6
101 #define NCI_STATUS_SPD_ERROR_NVM_CORRUPTED  0xE7
102 #define NCI_STATUS_SPD_ERROR_PWR_MODE       0xE8
103 #define NCI_STATUS_SPD_ERROR_MSG_LEN        0xE9
104 #define NCI_STATUS_SPD_ERROR_PATCHSIZE      0xEA
105 
106 
107 
108 #define NCI_NV_DEVICE_NONE              0x00
109 #define NCI_NV_DEVICE_EEPROM            0x08
110 #define NCI_NV_DEVICE_UICC1             0x10
111 
112 /* The events reported on tNFC_VS_CBACK */
113 /* The event is (NCI_NTF_BIT|oid) or (NCI_RSP_BIT|oid) */
114 #define NFC_VS_HCI_NETWK_EVT            (NCI_NTF_BIT|NCI_MSG_HCI_NETWK)
115 #define NFC_VS_HCI_NETWK_RSP            (NCI_RSP_BIT|NCI_MSG_HCI_NETWK)
116 #define NFC_VS_UICC_READER_ACTION_EVT   (NCI_NTF_BIT|NCI_MSG_UICC_READER_ACTION)
117 #define NFC_VS_POWER_LEVEL_RSP          (NCI_RSP_BIT|NCI_MSG_POWER_LEVEL)
118 #define NFC_VS_GET_NV_DEVICE_EVT        (NCI_RSP_BIT|NCI_MSG_GET_NV_DEVICE)
119 #define NFC_VS_LPTD_EVT                 (NCI_NTF_BIT|NCI_MSG_LPTD)
120 #define NFC_VS_GET_BUILD_INFO_EVT       (NCI_RSP_BIT|NCI_MSG_GET_BUILD_INFO)
121 #define NFC_VS_GET_PATCH_VERSION_EVT    (NCI_RSP_BIT|NCI_MSG_GET_PATCH_VERSION)
122 #define NFC_VS_SEC_PATCH_DOWNLOAD_EVT   (NCI_RSP_BIT|NCI_MSG_SECURE_PATCH_DOWNLOAD)
123 #define NFC_VS_SEC_PATCH_AUTH_EVT       (NCI_NTF_BIT|NCI_MSG_SECURE_PATCH_DOWNLOAD)
124 
125 #define NCI_GET_PATCH_VERSION_NVM_OFFSET    37
126 
127 
128 #define NCI_NFCC_PIPE_INFO_NV_SIZE      24  /* Static and dynamic pipe id and status for each pipe to uicc0 and uicc1. */
129 #define NCI_PERSONALITY_SLOT_SIZE       19
130 #define NCI_DYNAMIC_PIPE_SIZE           8
131 
132 #define NCI_SWP_INTERFACE_TYPE          0xFF    /* Type of TLV in NCI_MSG_HCI_NETWK */
133 #define NCI_HCI_GATE_TYPE               0xFE    /* Type of TLV in NCI_MSG_HCI_NETWK */
134 
135 /* Secure Patch Download definitions (patch type definitions) */
136 #define NCI_SPD_TYPE_HEADER             0x00
137 #define NCI_SPD_TYPE_SRAM               0x01
138 #define NCI_SPD_TYPE_AON                0x02
139 #define NCI_SPD_TYPE_PATCH_TABLE        0x03
140 #define NCI_SPD_TYPE_SECURE_CONFIG      0x04
141 #define NCI_SPD_TYPE_CONTROLLED_CONFIG  0x05
142 #define NCI_SPD_TYPE_SIGNATURE          0x06
143 #define NCI_SPD_TYPE_SIGCHEK            0x07
144 
145 /* Secure Patch Download definitions (NCI_SPD_TYPE_HEADER definitions) */
146 #define NCI_SPD_HEADER_OFFSET_CHIPVERLEN    0x18
147 #define NCI_SPD_HEADER_CHIPVER_LEN          16
148 
149 /* NVM Type (in GET_PATCH_VERSION RSP) */
150 #define NCI_SPD_NVM_TYPE_NONE           0x00
151 #define NCI_SPD_NVM_TYPE_EEPROM         0x01
152 #define NCI_SPD_NVM_TYPE_UICC           0x02
153 
154 /**********************************************
155  * NCI NFCC proprietary features in octet 3
156  **********************************************/
157 #define NCI_FEAT_SIGNED_PATCH           0x01000000
158 
159 /**********************************************
160  * NCI Interface Types
161  **********************************************/
162 #define NCI_INTERFACE_VS_CALYPSO_CE     0x81
163 #define NCI_INTERFACE_VS_T2T_CE         0x82    /* for Card Emulation side */
164 #define NCI_INTERFACE_VS_15693          0x83    /* for both Reader/Writer and Card Emulation side */
165 #define NCI_INTERFACE_VS_T1T_CE         0x84    /* for Card Emulation side */
166 
167 /**********************************************
168  * NCI Proprietary Parameter IDs
169  **********************************************/
170 #define NCI_PARAM_ID_LA_FSDI            0xA0
171 #define NCI_PARAM_ID_LB_FSDI            0xA1
172 #define NCI_PARAM_ID_HOST_LISTEN_MASK   0xA2
173 #define NCI_PARAM_ID_CHIP_TYPE          0xA3 /* NFCDEP */
174 #define NCI_PARAM_ID_PA_ANTICOLL        0xA4
175 #define NCI_PARAM_ID_CONTINUE_MODE      0xA5
176 #define NCI_PARAM_ID_LBP                0xA6
177 #define NCI_PARAM_ID_T1T_RDR_ONLY       0xA7
178 #define NCI_PARAM_ID_LA_SENS_RES        0xA8
179 #define NCI_PARAM_ID_PWR_SETTING_BITMAP 0xA9
180 #define NCI_PARAM_ID_WI_NTF_ENABLE      0xAA
181 #define NCI_PARAM_ID_LN_BITRATE         0xAB /* NFCDEP Listen Bitrate */
182 #define NCI_PARAM_ID_LF_BITRATE         0xAC /* FeliCa */
183 #define NCI_PARAM_ID_SWP_BITRATE_MASK   0xAD
184 #define NCI_PARAM_ID_KOVIO              0xAE
185 #define NCI_PARAM_ID_UICC_NTF_TO        0xAF
186 #define NCI_PARAM_ID_NFCDEP             0xB0
187 #define NCI_PARAM_ID_CLF_REGS_CFG       0xB1
188 #define NCI_PARAM_ID_NFCDEP_TRANS_TIME  0xB2
189 #define NCI_PARAM_ID_CREDIT_TIMER       0xB3
190 #define NCI_PARAM_ID_CORRUPT_RX         0xB4
191 #define NCI_PARAM_ID_ISODEP             0xB5
192 #define NCI_PARAM_ID_LF_CONFIG          0xB6
193 #define NCI_PARAM_ID_I93_DATARATE       0xB7
194 #define NCI_PARAM_ID_CREDITS_THRESHOLD  0xB8
195 #define NCI_PARAM_ID_TAGSNIFF_CFG       0xB9
196 #define NCI_PARAM_ID_PA_FSDI            0xBA /* ISODEP */
197 #define NCI_PARAM_ID_PB_FSDI            0xBB /* ISODEP */
198 #define NCI_PARAM_ID_FRAME_INTF_RETXN   0xBC
199 
200 #define NCI_PARAM_ID_UICC_RDR_PRIORITY  0xBD
201 #define NCI_PARAM_ID_GUARD_TIME         0xBE
202 #define NCI_PARAM_ID_STDCONFIG          0xBF /* dont not use this config item */
203 #define NCI_PARAM_ID_PROPCFG            0xC0 /* dont not use this config item  */
204 #define NCI_PARAM_ID_MAXTRY2ACTIVATE    0xC1
205 #define NCI_PARAM_ID_SWPCFG             0xC2
206 #define NCI_PARAM_ID_CLF_LPM_CFG        0xC3
207 #define NCI_PARAM_ID_DCLB               0xC4
208 #define NCI_PARAM_ID_ACT_ORDER          0xC5
209 #define NCI_PARAM_ID_DEP_DELAY_ACT      0xC6
210 #define NCI_PARAM_ID_DH_PARITY_CRC_CTL  0xC7
211 #define NCI_PARAM_ID_PREINIT_DSP_CFG    0xC8
212 #define NCI_PARAM_ID_FW_WORKAROUND      0xC9
213 #define NCI_PARAM_ID_RFU_CONFIG         0xCA
214 #define NCI_PARAM_ID_EMVCO_ENABLE       0xCB
215 #define NCI_PARAM_ID_ANTDRIVER_PARAM    0xCC
216 #define NCI_PARAM_ID_PLL325_CFG_PARAM   0xCD
217 #define NCI_PARAM_ID_OPNLP_ADPLL_ENABLE 0xCE
218 #define NCI_PARAM_ID_CONFORMANCE_MODE   0xCF
219 
220 #define NCI_PARAM_ID_LPO_ON_OFF_ENABLE  0xD0
221 #define NCI_PARAM_ID_FORCE_VANT         0xD1
222 #define NCI_PARAM_ID_COEX_CONFIG        0xD2
223 #define NCI_PARAM_ID_INTEL_MODE         0xD3
224 
225 #define NCI_PARAM_ID_AID                0xFF
226 
227 /**********************************************
228  * NCI Parameter ID Lens
229  **********************************************/
230 #define NCI_PARAM_LEN_PWR_SETTING_BITMAP    3
231 #define NCI_PARAM_LEN_HOST_LISTEN_MASK      2
232 #define NCI_PARAM_LEN_PLL325_CFG_PARAM      14
233 
234 /**********************************************
235  * Snooze Mode
236  **********************************************/
237 #define NFC_SNOOZE_MODE_NONE      0x00    /* Snooze mode disabled    */
238 #define NFC_SNOOZE_MODE_UART      0x01    /* Snooze mode for UART    */
239 #define NFC_SNOOZE_MODE_SPI_I2C   0x08    /* Snooze mode for SPI/I2C */
240 
241 #define NFC_SNOOZE_ACTIVE_LOW     0x00    /* high to low voltage is asserting */
242 #define NFC_SNOOZE_ACTIVE_HIGH    0x01    /* low to high voltage is asserting */
243 
244 #endif  /* NFC_BRCM_DEFS_H */
245