blob: fb7c2a9ae6badc7b8b53d58165205b1591224a8c [file] [log] [blame]
b.liue9582032025-04-17 19:18:16 +08001#ifndef _GEU_INTERFACE_H_
2#define _GEU_INTERFACE_H_
3/******************************************************************************
4 *
5 * (C)Copyright 2005 - 2011 Marvell. All Rights Reserved.
6 *
7 * THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MARVELL.
8 * The copyright notice above does not evidence any actual or intended
9 * publication of such source code.
10 * This Module contains Proprietary Information of Marvell and should be
11 * treated as Confidential.
12 * The information in this file is provided for the exclusive use of the
13 * licensees of Marvell.
14 * Such users have the right to use, modify, and incorporate this code into
15 * products for purposes authorized by the license agreement provided they
16 * include this notice and the associated copyright notice with any such
17 * product.
18 * The information in this file is provided "AS IS" without warranty.
19
20 ******************************************************************************/
21
22// FUSE life cycles
23#define K_LIFECYCLE_STATE_VIRGIN 0
24#define K_LIFECYCLE_STATE_CM 1
25#define K_LIFECYCLE_STATE_DM 2
26#define K_LIFECYCLE_STATE_DD 3
27#define K_LIFECYCLE_STATE_FA 4
28#define K_MRB_JTAG_PERM_DIS 5
29
30#define LIFECYCLE_CM (K_LIFECYCLE_STATE_CM)
31#define LIFECYCLE_DM (K_LIFECYCLE_STATE_DM)
32#define LIFECYCLE_DD (K_LIFECYCLE_STATE_DD)
33#define LIFECYCLE_FA (K_LIFECYCLE_STATE_FA)
34#define LIFECYCLE_JPD (K_MRB_JTAG_PERM_DIS)
35
36// Fuse field sizes in bytes
37//FB0
38#define K_AP_CONFIG_FUSE_SIZE 10
39#define K_CP_CONFIG_FUSE_SIZE 2
40#define K_APCP_CONFIG_FUSE_SIZE 12
41#define K_MP0_FUSE_SIZE 12
42#define K_APCPMP0_ECC_FUSE_SIZE 3
43//FB1
44#define K_RKEK_FUSE_SIZE 32
45//FB2/FB3
46#define K_OEM_HASH_FUSE_SIZE 32
47//FB4
48#define K_TRANSIT_KEY_ECC_FUSE_SIZE 4
49#define K_DEVICE_PIN_ECC_SIZE 1
50#define K_DFT_PASSWORD_CHANGE_FUSE_SIZE 1
51#define K_OEM_KEY1_ECC_FUSE_SIZE 4
52#define K_JTAG_KEY1_ECC_FUSE_SIZE 4
53#define K_MP1_FUSE_SIZE 12
54//FB5/FB6
55#define K_JTAG_HASH_FUSE_SIZE 32
56//FB7
57#define K_SECURITY_CONFIG_FUSE_SIZE 4
58#define K_USBID_FUSE_SIZE 4
59#define K_SECURITY_USB_ECC_FUSE_SIZE 1
60#define K_OEM_KEY0_ECC_FUSE_SIZE 4
61#define K_JTAG_KEY0_ECC_FUSE_SIZE 4
62#define K_OEM_UNIQUE_ID_FUSE_SIZE 8
63#define K_OEM_UNIQUE_ID_ECC_FUSE_SIZE 1
64//FB8/FB9
65#define K_EC521_KEY_FUSE_SIZE 32
66//FB10
67#define K_TRANSIT_KEY_FUSE_SIZE 32
68//FB11
69#define K_DEVICE_PIN_FUSE_SIZE 8
70#define K_SW_VERSION_FUSE_SIZE 8
71#define K_WTM_SE_MGMT_FUSE_SIZE 14
72//misc
73#define K_FUSEBLOCK_SIZE 32
74#define K_SHA1_SIZE 20
75#define K_SHA256_SIZE 32
76#define K_SHA512_SIZE 64
77
78// Fuse field buffer sizes in bytes
79// Data is always returned as a multiple of 4 bytes
80#define K_AP_CONFIG_BUFFER_SIZE 12
81#define K_CP_CONFIG_BUFFER_SIZE 4
82#define K_MP0_BUFFER_SIZE 12
83#define K_USBID_BUFFER_SIZE 4
84#define K_SECURITY_CONFIG_BUFFER_SIZE 4
85#define K_OEM_HASH_BUFFER_SIZE 32
86#define K_JTAG_HASH_BUFFER_SIZE 32
87#define K_RKEK_BUFFER_SIZE 32
88#define K_FUSEBLOCK_BUFFER_SIZE 32
89#define K_OEM_UNIQUE_ID_BUFFER_SIZE 8
90#define K_OEM_UNIQUE_ID_ECC_BUFFER_SIZE 4
91#define K_SECURITY_USB_ECC_BUFFER_SIZE 4
92#define K_AP_CP_MP_ECC_BUFFER_SIZE 4
93
94// Fuse field sizes in bytes
95#define K_PIN_FUSE_SIZE 8
96#define K_OEM_UID_FUSE_SIZE 8
97
98// Fuse Block Numbers
99#define K_AP_CONFIG_FUSEBLOCK 0
100#define K_CP_CONFIG_FUSEBLOCK 0
101#define K_MP0_FUSEBLOCK 0
102#define K_APCPMP0_FUSEBLOCK 0
103#define K_ECC_FUSEBLOCK 0
104#define K_LIFECYCLE_CM_FUSEBLOCK 0
105#define K_LIFECYCLE_DM_FUSEBLOCK 0
106#define K_LIFECYCLE_FUSEBLOCK_CM_DM 0
107#define K_LIFECYCLE_DD_FUSEBLOCK 7
108#define K_LIFECYCLE_FA_FUSEBLOCK 7
109#define K_LIFECYCLE_FUSEBLOCK_DD_FA_JPD 7
110#define K_MRB_JTAG_PERM_DISABLE_FUSEBLOCK 7
111#define K_RKEK_FUSEBLOCK 1
112#define K_OEM_FUSEBLOCK 2
113#define K_SQU0_FUSEBLOCK 3 // Not Supported
114#define K_SQU1_FUSEBLOCK 4 // Not Supported
115#define K_SQU2_FUSEBLOCK 5 // Not Supported
116#define K_JTAG_FUSEBLOCK 6
117
118#define K_USBID_FUSEBLOCK 7
119#define K_SECURITYCONFIG_FUSEBLOCK 7
120#define K_FB7_FUSEBLOCK 7
121#define K_OEM_UID_FUSEBLOCK 7
122#define K_OEM_UID_ECC_FUSEBLOCK 7
123#define K_NO_FUSEBLOCK 0xF
124#define K_UNDEFINED_FUSEBLOCK K_NO_FUSEBLOCK
125
126// Burn/Status Bit Masks/bits - This is an arbitrary internal
127// status array that we use to determine which set we're burning
128// and pass status internally.
129#define K_AP_CONFIG_STATUS_BIT_MASK 0x00000001
130#define K_CP_CONFIG_STATUS_BIT_MASK 0x00000002
131#define K_MP0_STATUS_BIT_MASK 0x00000004
132#define K_APCPMP0_ECC_STATUS_BIT_MASK 0x00000008
133#define K_SOFTWARE_VERSION_STATUS_BIT_MASK 0x00000010 // Reserved
134#define K_RKEK_STATUS_BIT_MASK 0x00000020
135#define K_OEM_KEY0_STATUS_BIT_MASK 0x00000040
136#define K_JTAG_KEY0_STATUS_BIT_MASK 0x00000080
137#define K_OEM_KEY0_ECC_STATUS_BIT_MASK 0x00000100
138#define K_FUSEBLOCK_LOCK_STATUS_BIT_MASK 0x00000200
139#define K_LOCK_STATUS_BIT_MASK 0x00000400
140#define K_OEM_UID_STATUS_BIT_MASK 0x00000800
141#define K_OEM_UID_ECC_STATUS_BIT_MASK 0x00001000
142#define K_SECURITY_CONFIG_STATUS_BIT_MASK 0x00002000
143#define K_USBID_STATUS_BIT_MASK 0x00004000
144#define K_SECURITY_USBID_ECC_STATUS_BIT_MASK 0x00008000
145#define K_LIFECYCLE_CM_STATUS_BIT_MASK 0x00010000
146#define K_LIFECYCLE_DM_STATUS_BIT_MASK 0x00020000
147#define K_LIFECYCLE_DD_STATUS_BIT_MASK 0x00040000
148#define K_LIFECYCLE_FA_STATUS_BIT_MASK 0x00080000
149#define K_LIFECYCLE_STATUS_BIT_MASK 0x00100000
150#define K_MRB_JTAG_PERM_DISABLE_STATUS_BIT_MASK 0x00200000
151#define K_JTAG_KEY0_ECC_STATUS_BIT_MASK 0x00400000
152
153// DebugStatus bits
154#define K_FUSE_READY_TIMEOUT 0x10000000
155#define K_MULTIPLE_BURN_COUNT 0x20000000
156#define K_FUSE_BURN_TIMEOUT 0x40000000
157#define K_FUSE_WRONG_ACLK_SETTING 0x80000000
158
159
160// Lock Bit Masks
161#define K_FB0_FUSE_LOCK_BIT_MASK 0x01 //Bit 0/Block0
162#define K_RKEK_FUSE_LOCK_BIT_MASK 0x02 //Bit 1/Block1
163#define K_OEM_FUSE_LOCK_BIT_MASK 0x04 //Bit 2/block2
164#define K_SQU0_FUSE_LOCK_BIT_MASK 0x08 //Bit 3/block3
165#define K_SQU1_FUSE_LOCK_BIT_MASK 0x10 //Bit 4/block4
166#define K_SQU2_FUSE_LOCK_BIT_MASK 0x20 //Bit 5/block5
167#define K_JTAG_FUSE_LOCK_BIT_MASK 0x40 //Bit 6/Block6
168#define K_FB7_FUSE_LOCK_BIT_MASK 0x80 //Bit 7/Block7
169
170// LifeCycle/Software Version
171#define K_PHYSICAL_BITS_PER_LOGICAL_BIT 3
172
173#define K_LIFECYCLE_BITSIZE 16
174#define K_MAX_LIFECYCLE_LOGICAL_BITS K_LIFECYCLE_BITSIZE/K_PHYSICAL_BITS_PER_LOGICAL_BIT
175
176#define K_SOFTWARE_VERSION_BITSIZE 32
177#define K_MAX_SOFTWARE_VERSION_LOGICAL_BITS K_SOFTWARE_VERSION_BITSIZE/K_PHYSICAL_BITS_PER_LOGICAL_BIT
178
179// Fuse Burn Status
180typedef struct GEU_FuseBurnStatus
181{
182UINT_T FinalBurnStatus;
183UINT_T CorrectedBurnStatus;
184UINT_T RawBurnStatus;
185UINT_T SavedBurnRequest;
186//UINT_T LastUsedLogicalBitOffset;
187UINT_T Oem_EccStatus;
188UINT_T Jtag_EccStatus;
189UINT_T ApCpMp_EccStatus;
190UINT_T SecurityUSB_EccStatus;
191UINT_T OemUid_EccStatus;
192UINT_T DebugStatus;
193}GEU_FuseBurnStatus_t;
194
195#define TRUSTBOOT_BURN_EN 0x00000001
196
197// Note that All API's have UINT_T return values.
198// NoError or an error defined in errors.h
199
200/***********************************************************
201* Function:
202* GEU_SetActiveFuseBlock
203* Description:
204* Sets the active fuse block for a set of operations.
205* This restricts operations to the specifed fuseblock.
206* Operations not targeted to the active fuseblock will fail.
207* Notes:
208* 1. The specified fuseblock must not be locked.
209* 2. The sticky bit must not be set.
210* 3. The GlobalFuseData structure (*pActveFuseBlock) is initialized.
211* 4. The FuseBurnStatus structure (*pFuseBurnStatus) is initialized.
212* 5. The SQU0, SQU1, and SQU2 fuseblocks are not supported.
213* 6. Fuseblock numbers below are also supported
214* K_NO_FUSEBLOCK
215* K_UNDEFINED_FUSEBLOCK
216* to allow clearing the internal data structures without specifying
217* a legitimate fuseblock.
218* 7. The ActiveFuseBlockField is initialize to K_UNDEFINED_FUSEBLOCK_FIELD
219*
220* Input:
221* n - Fuse Block Number
222* K_AP_CONFIG_FUSEBLOCK
223* K_CP_CONFIG_FUSEBLOCK
224* K_USBID_FUSEBLOCK
225* K_APCPUSB_FUSEBLOCK
226* K_LIFECYCLE_FUSEBLOCK
227* K_SOFTWARE_VERSION_FUSEBLOCK
228* K_RKEK_FUSEBLOCK
229* K_OEM_FUSEBLOCK
230* K_JTAG_FUSEBLOCK
231* K_ECC_FUSEBLOCK
232* K_FB7_FUSEBLOCK
233* K_NO_FUSEBLOCK
234* K_UNDEFINED_FUSEBLOCK
235* Output:
236* none
237* Returns:
238* FUSE_FuseBlockLocked
239* FUSE_UnsupportedFuseBlock
240************************************************************/
241UINT_T GEU_SetActiveFuseBlock(UINT_T n);
242
243/***********************************************************
244* Function:
245* GEU_ReadActiveFuseBlockNumber
246* Description:
247* Returns the Active Fuse Block number
248* Input:
249* none
250* Output:
251* none
252* Returns:
253* Active Fuse Block Number
254************************************************************/// Reads back Active Fuse block number
255UINT_T GEU_ReadActiveFuseBlockNumber(void);
256
257/***********************************************************
258* Function:
259* GEU_GenerateRandomNumber
260* Description:
261* Generates a 32 bit random number.
262* Input:
263* Seed - 8 bit Seed number. Range 0-255. Larger number takes
264* less time to generate result.
265* Output:
266* none
267* Returns:
268* Returns 32 bit random number.
269************************************************************/
270UINT_T GEU_GenerateRandomNumber (UINT_T Seed);
271
272
273/***********************************************************
274* Function:
275* GEU_ReadxxxFuseBits
276*
277* Description:
278* Reads the specified (xxx) fuse bits.
279*
280* Input:
281* pBuffer - Pointer to buffer to write the requested data.
282* Size - Size of buffer in bytes must be larger than the
283* specified field (must be larger than K_xxx_FUSE_SIZE).
284* Output:
285* none
286* Returns:
287* NoError
288* FUSE_BufferTooSmall
289*
290************************************************************/
291// GEU Fuse Read APIs
292UINT_T GEU_ReadApConfigFuseBits(UINT_T* pBuffer, UINT_T Size);
293UINT_T GEU_ReadCpConfigFuseBits(UINT_T* pBuffer, UINT_T Size);
294UINT_T GEU_ReadUsbIdFuseBits(UINT_T* pBuffer, UINT_T Size);
295UINT_T GEU_ReadOemHashKeyFuseBits(UINT_T* pBuffer, UINT_T Size);
296UINT_T GEU_ReadOemJtagHashKeyFuseBits(UINT_T* pBuffer, UINT_T Size);
297
298/***********************************************************
299* Function:
300* GEU_ReadLifeCycle
301*
302*
303* Input:
304* none
305* Output:
306* none
307* Returns:
308* State value in the specified range.
309*
310************************************************************/
311UINT_T GEU_ReadLifeCycle(void);
312
313
314/***********************************************************
315* Function:
316* GEU_SetupApConfigFuseBits
317*
318* Description:
319* - Confirms the Active FuseBlock and FuseBlockField conform to the
320* ApCpMp fuseblock field.
321* - Copies the caller supplied AP Config data to
322* the appropriate offset in the GEU_FUSE_PROG_VALn register set.
323* - Sets the ApConfig Burn Request.
324*
325* Note: AP/CP/MP must all be done in the same fuse burn to burn ECC.
326* Input:
327* pBuffer - pointer to a buffer containing the 80 bits of AP Config data
328* Size - Size (in bytes) of the data to copy (Must be K_AP_CONFIG_FUSE_SIZE).
329*
330* Output:
331* none
332* Returns:
333* NoError
334* FUSE_FuseBlockNotActive
335* FUSE_FuseBlockFieldNotActive
336* FUSE_BufferTooSmall
337*
338************************************************************/
339UINT_T GEU_SetupApConfigFuseBits(UINT_T* pBuffer, UINT_T Size);
340
341/***********************************************************
342* Function:
343* GEU_SetupCpConfigFuseBits
344*
345* Description:
346* - Confirms the Active FuseBlock and FuseBlockField conform to the
347* ApCpMp fuseblock field.
348* - Copies the caller supplied CP Config data to
349* the appropriate offset in the GEU_FUSE_PROG_VALn register set.
350* - Sets the CpConfig Burn Request.
351*
352* Note: AP/CP/MP must all be done in the same fuse burn to burn ECC.
353* Input:
354* pBuffer - pointer to a buffer containing the 80 bits of AP Config data
355* Size - Size (in bytes) of the data to copy (Must be K_CP_CONFIG_FUSE_SIZE).
356*
357* Output:
358* none
359* Returns:
360* NoError
361* FUSE_FuseBlockNotActive
362* FUSE_FuseBlockFieldNotActive
363* FUSE_BufferTooSmall
364*
365************************************************************/
366UINT_T GEU_SetupCpConfigFuseBits(UINT_T* pBuffer, UINT_T Size);
367
368
369/***********************************************************
370* Function:
371* GEU_SetupUsbIdFuseBits
372*
373* Description:
374* - Confirms the Active FuseBlock and FuseBlockField conform to the
375* ApCpUsbId fuseblock field.
376* - Copies the caller supplied UsbId data to
377* the appropriate offset in the GEU_FUSE_PROG_VALn register set.
378* - Sets the UsbId Burn Request.
379*
380* Note: AP/CP/USBID must all be done in the same fuse burn to burn ECC.
381* Input:
382* pBuffer - pointer to a buffer containing the 80 bits of UsbId data
383* Size - Size (in bytes) of the data to copy (Must be K_USBID_FUSE_SIZE).
384*
385* Output:
386* none
387* Returns:
388* NoError
389* FUSE_FuseBlockNotActive
390* FUSE_FuseBlockFieldNotActive
391* FUSE_BufferTooSmall
392*
393************************************************************/
394UINT_T GEU_SetupUsbIdFuseBits(UINT_T* pBuffer, UINT_T Size);
395
396/***********************************************************
397* Function:
398* GEU_SetupOemHashKeyFuseBits
399*
400* Description:
401* - Confirms the Active FuseBlock and FuseBlockField conform to the
402* Block 7 fuseblock field.
403* - Copies the caller supplied OEM Hash Key data to
404* the appropriate offset in the GEU_FUSE_PROG_VALn register set.
405* - Sets the OEM Hash Key Burn Request.
406*
407* Input:
408* pBuffer - pointer to a buffer containing the 256 bits of OEM Hash key data
409* Size - Size (in bytes) of the data to copy (Must be K_OEM HASH_FUSE_SIZE).
410*
411* Output:
412* none
413* Returns:
414* NoError
415* FUSE_FuseBlockNotActive
416* FUSE_FuseBlockFieldNotActive
417* FUSE_BufferTooSmall
418*
419************************************************************/
420UINT_T GEU_SetupOemHashKeyFuseBits(UINT_T* pBuffer, UINT_T Size);
421
422
423
424/***********************************************************
425* Function:
426* GEU_SetupOemJtagHashKeyFuseBits
427*
428* Description:
429* - Confirms the Active FuseBlock and FuseBlockField conform to the
430* JTAG fuseblock field.
431* - Copies the caller supplied OEM JTAG Hash Key data to
432* the appropriate offset in the GEU_FUSE_PROG_VALn register set.
433* - Sets the JTAG Hash Key Burn Request.
434*
435* Input:
436* pBuffer - pointer to a buffer containing the 256 bits of JTAG Hash key data
437* Size - Size (in bytes) of the data to copy (Must be K_JTAG HASH_FUSE_SIZE).
438*
439* Output:
440* none
441* Returns:
442* NoError
443* FUSE_FuseBlockNotActive
444* FUSE_FuseBlockFieldNotActive
445* FUSE_BufferTooSmall
446*
447************************************************************/
448UINT_T GEU_SetupOemJtagHashKeyFuseBits(UINT_T* pBuffer, UINT_T Size);
449
450
451/***********************************************************
452* Function:
453* GEU_SetupRkekFuseBits
454*
455* Description:
456* - Confirms the Active FuseBlock and FuseBlockField conform to the
457* RKEK fuseblock field.
458* - Copies the caller supplied RKEK data to
459* the appropriate offset in the GEU_FUSE_PROG_VALn register set.
460* - Sets the RKEK Burn Request.
461*
462* Input:
463* pBuffer - pointer to a buffer containing the 256 bits of OEM Hash key data
464* Size - Size (in bytes) of the data to copy (Must be K_RKEK_FUSE_SIZE).
465*
466* Output:
467* none
468* Returns:
469* NoError
470* FUSE_FuseBlockNotActive
471* FUSE_FuseBlockFieldNotActive
472* FUSE_BufferTooSmall
473*
474************************************************************/
475UINT_T GEU_SetupRkekFuseBits(UINT_T* pBuffer, UINT_T Size);
476
477/***********************************************************
478* Function:
479* GEU_SetupLifeCycleFuseBits
480* GEU_SetupSoftwareVersionFuseBits
481*
482* Description:
483* Encodes the specified state to the specified data field
484* in a logical bitfield with the number of "1" bits
485* equal to the state value. Each logical bit is encoded
486* as a majority rule bitfield of 3 physical bits.
487* If two or three physical bits are set the logical bit is "1".
488* If zero or one physical bit is set the logical bit is "0".
489*
490* The LifeCycle state can range for 0 to 5.
491* The SoftwareVersion state can range from 0 to 21.
492*
493* Note that fuse failures can limit the maximum value that
494* can be programmed.
495*
496* Input:
497* n - desired state value. Must be greater or equal to the current value.
498*
499* Output:
500* none
501* Returns:
502* FUSE_FuseBlockNotActive
503* FUSE_FuseBlockFieldNotActive
504* FUSE_FuseBlockFieldOverflow (no more logical bits available to burn)
505* FUSE_InvalidState (new value < current value)
506*
507************************************************************/
508UINT_T GEU_SetupSoftwareVersionFuseBits(UINT_T value);
509UINT_T GEU_SetupLifeCycleFuseBits(UINT_T value);
510
511/**********************************************************
512* Function:
513* GEU_BurnFuseBlock_ApCpMp
514* Description:
515* Burns the ApCpMp field in Fuseblock 0. This may burn one
516* or more of the AP Config, CP Config, or MP subfields
517* in the ApCpMp field.
518*
519* - Confirms that a burn request exists for one or more of the
520* AP, CP, or Mp subfields.
521* - Saves LifeCycle and Software Version state (for post burn validation).
522* - Saves any of the the AP, CP, or Mp subfields that are not being burned.
523* - Burns the fuseblock
524* Validates burned subfields and retries if burn not successful.
525* - Validates all subfields that were not burned to ensure no changes from the burn.
526*
527* Input:
528* pUserFuseBurnStatus - pointer to a buffer containing a FuseBurnStatus structure
529*
530* Output:
531* none
532* Returns:
533* NoError
534* FUSE_BurnError
535*
536************************************************************/
537UINT_T GEU_BurnFuseBlock_ApCpMp(struct GEU_FuseBurnStatus * pFuseBurnStatus);
538//UINT_T GEU_BurnFuseBlock_ApCpUsb(struct GEU_FuseBurnStatus * pFuseBurnStatus);
539//UINT_T GEU_BurnFuseBlock_ApCp(struct GEU_FuseBurnStatus * pFuseBurnStatus);
540
541/**********************************************************
542* Function:
543* GEU_BurnFuseBlock_OemHashKey
544* GEU_BurnFuesBlock_JtagHashKey
545* GEU_BurnFuesBlock_Rkek
546* Description:
547* Burns the specified field in the corresponding Fuseblock.
548* - Confirms that a burn request exists for the specified field/fuseblock.
549* - Burns the fuseblock
550* Validates the burned field/fuseblock equals the setup data
551* Retries if compare fails
552* Input:
553* pUserFuseBurnStatus - pointer to a buffer containing a FuseBurnStatus structure
554* Output:
555* none
556* Returns:
557* NoError
558* FUSE_BurnError
559************************************************************/
560UINT_T GEU_BurnFuseBlock_OemHashKey(struct GEU_FuseBurnStatus * pUserFuseBurnStatus);
561UINT_T GEU_BurnFuseBlock_Rkek(struct GEU_FuseBurnStatus * pUserFuseBurnStatus);
562UINT_T GEU_BurnFuseBlock_OemJtagHashKey(struct GEU_FuseBurnStatus * pUserFuseBurnStatus);
563
564/**********************************************************
565* Function:
566* GEU_BurnFuseBlock_LifeCycle
567* Description:
568* Burns the LifeCycle field in Fuseblock 0.
569* - Confirms that a LifeCycle burn request exists
570* - Saves Software Version state (for post burn validation).
571* - Saves the AP, CP, and USB Id subfields (they are not being burned).
572* - Burns the fuseblock
573* Validates the burned LifeCycle state equals the requested state
574* Retries to setup, and burn with the requested value until
575* successful or available fuse bits are exhausted.
576* - Validates all subfields that were not burned to ensure no changes from the burn.
577* Input:
578* pUserFuseBurnStatus - pointer to a buffer containing a FuseBurnStatus structure
579* Output:
580* none
581* Returns:
582* NoError
583* FUSE_BurnError
584* Note: If a FUSE_BurnError occurs, one must check the FuseBurnStatus and verify that
585* LastUsedLogicalBit is not at maximum (5). If it is, and a call to GEU_READ_LIFECYCLE
586* does not return the desired value, then all available fuse bits have been used
587* and it will not be possible to burn the requested value.
588************************************************************/
589UINT_T GEU_BurnFuseBlock_LifeCycle(struct GEU_FuseBurnStatus * pUserFuseBurnStatus);
590/**********************************************************
591* Function:
592* GEU_BurnFuseBlock_SoftwareVersion
593* Description:
594* Burns the SoftwareVersion field in Fuseblock 0.
595* - Confirms that a SoftwareVersion burn request exists
596* - Saves LifeCycle state (for post burn validation).
597* - Saves the AP, CP, and USB Id subfields (they are not being burned).
598* - Burns the fuseblock
599* Validates the burned Software Version state equals the requested state
600* Retries to setup, and burn with the requested value until
601* successful or available fuse bits are exhausted.
602* - Validates all subfields that were not burned to ensure no changes from the burn.
603* Input:
604* pUserFuseBurnStatus - pointer to a buffer containing a FuseBurnStatus structure
605* Output:
606* none
607* Returns:
608* NoError
609* FUSE_BurnError
610* Note: If a FUSE_BurnError occurs, one must check the FuseBurnStatus and verify that
611* LastUsedLogicalBit is not at maximum (21). If it is, and a call to GEU_READ_LIFECYCLE
612* does not return the desired value, then all available fuse bits have been used
613* and it will not be possible to burn the requested value.
614************************************************************/
615UINT_T GEU_BurnFuseBlock_SoftwareVersion(struct GEU_FuseBurnStatus * pUserFuseBurnStatus);
616
617/**********************************************************
618* Function:
619* GEU_BurnEcc
620* Description:
621* This function burns an ECC value for an ECC protected field.
622* This function must be called immediately after burning the ECC protected field.
623*
624* This function first determines which ECC field must be burned based
625* on the saved burn request in the FuseData structure.
626*
627* - Clears GEU_FUSE_PROG_VAL1 and VAL2 register sets.
628* - Retrieves the saved ECC value from the last burn
629* - and stores the ECC value in the appropriate field.
630* - Burns the fuseblock
631* - Validates all ECC fields using GEU_ECC_STATUS and checking
632* for uncorrectable errors.
633* - Retries teh burn if compare fails
634* Input:
635* pUserFuseBurnStatus - pointer to a buffer containing a FuseBurnStatus structure
636* Output:
637* none
638* Returns:
639* NoError
640* FUSE_BurnError
641************************************************************/
642UINT_T GEU_BurnECC(struct GEU_FuseBurnStatus * pUserFuseBurnStatus);
643
644/**********************************************************
645* Function:
646* GEU_LockFuseBlock
647* Description:
648* Locks a Fuse Block to prevent further programming
649* FuseBlocks supported: 1(OEM), 2(RKEK), 6(JTAG), and 7(ECC) only
650* Fuse Blocks 0, 3, 4, and 5 cannot be locked with this API
651* Input:
652* n- Fuse block to be locked
653* pUserFuseBurnStatus - pointer to a buffer containing a FuseBurnStatus structure
654* Output:
655* none
656* Returns:
657* NoError
658* FUSE_BurnError
659* FUSE_UnsupportedFuseBlock
660************************************************************/
661UINT_T GEU_LockFuseBlock(UINT_T n, struct GEU_FuseBurnStatus * pUserFuseBurnStatus);
662
663/***********************************************************
664* Function:
665* GEU_SetFuseBlockStickyBit
666* GEU_ReadFuseBlockStickyBit
667* Description:
668* Sets (or Reads) the Sticky bit for fuse block zero.
669* Input:
670* none
671* Output:
672* none
673* Returns:
674* NoError
675************************************************************/// Fuse block sticky bit
676UINT_T GEU_SetFuseBlockStickyBit(UINT_T Reserved); // Reserved - StickyBit must be zero
677UINT_T GEU_ReadFuseBlockStickyBit(UINT_T Reserved); // Reserved - StickyBit must be zero
678
679
680/***********************************************************
681* Function:
682* GEU_ReadFuseBlockLockState
683* Description:
684* Reads the lock state of the eight fuse blocks.
685* Input:
686* pBuffer - Pointer to buffer to write the requested data.
687* Output:
688* Returns eight bits of valid data int the specified buffer.
689* 1 = Locked, 0 = Not Locked
690* Bit 0 - Block 0
691* Bit 1 - Block 1
692* Bit 2 - Block 2
693* Bit 3 - Block 3
694* Bit 4 - Block 4
695* Bit 5 - Block 5
696* Bit 6 - Block 6
697* Bit 7 - Block 7
698* Returns:
699* NoError
700************************************************************/
701UINT_T GEU_ReadFuseBlockLockState(UINT_T* pBuffer);
702
703
704/***********************************************************
705* Function:
706* GEU_SetJtagEnable
707* GEU_ReadJtagEnable
708* Description:
709* JTAG Control - Called by Trusted Boot Software to enable JTAG
710* functionality through GEU until next power cycle.
711* Sets bit 7 of GEU_CONFIG.
712* Read returns the state of the bit.
713* Input:
714* none
715* Output:
716* none
717* Returns:
718* NoError
719************************************************************/
720UINT_T GEU_SetJtagEnable(void);
721UINT_T GEU_ReadJtagEnable(void);
722
723/***********************************************************
724* Function:
725* GEU_ReadRegister
726* Description:
727* Generic function to read any register.
728* Input:
729* registerAddress - address of register to read.
730* pBuffer - address to store the register contents.
731* Output:
732* none
733* Returns:
734* NoError
735************************************************************/
736UINT_T GEU_ReadRegister(UINT_T registerAddress, UINT_T * pBuffer);
737UINT_T GEU_WriteRegister(UINT_T registerAddress, UINT_T value);
738
739/***********************************************************
740* Function:
741* GEU_EnableFuseBurnPower
742* Description:
743* Enable power supply for fuse programming
744* Input:
745* none
746* Output:
747* none
748* Returns:
749* NoError
750************************************************************/
751UINT_T GEU_EnableFuseBurnPower(void);
752
753
754/*
755 * API specified by Paul for newly added functions
756 */
757UINT_T GEU_ReadOemUidFuseBits(UINT_T* pBuffer, UINT_T Size);
758UINT_T GEU_ReadOemUidEcc(UINT_T* pBuffer, UINT_T Size);
759UINT_T GEU_SetupUidFuseBits(UINT_T* pBuffer, UINT_T Size);
760//UINT_T GEU_SetupUidEccFuseBits(void);
761UINT_T GEU_SetupUidEccFuseBits(void);
762UINT_T GEU_BurnFuseBlock_OemUid (struct GEU_FuseBurnStatus* pUserFuseBurnStatus);
763UINT_T GEU_BurnFuseBlock_OemUidEcc (struct GEU_FuseBurnStatus* pUserFuseBurnStatus);
764UINT_T GEU_BurnApCpMpEccFuseBits(struct GEU_FuseBurnStatus* pUserFuseBurnStatus);
765UINT_T GEU_BurnFuseBlock_SecurityUSBID(struct GEU_FuseBurnStatus * pUserFuseBurnStatus);
766UINT_T GEU_BurnFuseBlock_SecurityUSBIDECC(struct GEU_FuseBurnStatus * pUserFuseBurnStatus);
767//UINT_T GEU_ReadLifeCycle(void);
768UINT_T GEU_ReadManufacturingParameterBitsInFB0(UINT_T* pBuffer, UINT_T Size);
769UINT_T GEU_SetupMpFuseBits(UINT_T* pBuffer, UINT_T Size);
770UINT_T GEU_SetupSecurityConfigUsbIdEccFuseBits(void);
771UINT_T GEU_SetupApCpMpEccFuseBits(void);
772UINT_T GEU_SetupApCpUsbIdEccFuseBits(void);
773UINT_T GEU_BurnApCpUsbIDEccFuseBits (struct GEU_FuseBurnStatus* pUserFuseBurnStatus);
774UINT_T GEU_ReadManufacturingParameterBitsInFB0(UINT_T* pBuffer, UINT_T Size);
775UINT_T GEU_SetupSecurityConfigFuseBits(UINT_T* pBuffer, UINT_T Size);
776UINT_T GEU_ReadSecurityConfigFuseBits(UINT_T* pBuffer, UINT_T Size);
777
778UINT_T GEU_BurnApCpEccFuseBits(struct GEU_FuseBurnStatus* pUserFuseBurnStatus);
779
780
781#endif //_GEU_INTERFACE_H_