/**************************************************************** * 2008 Apr 25 * * Copyright 2008 QUANTA COMPUTER INC., INC. All rights reserved. * * File Name: boot_count_api.h * Abstract: header for boot count API * Description: * * Project Name: Aurora LSI * Software Component: Diagnostics * * Exported Functions: * * Notes: * * * History: * 2008/04/25 Jim Created * 2008/05/05 Jim Modified * *** END OF REVISION HISTORY ***********************************/ #ifndef __BOOT_COUNT_API_H__ #define __BOOT_COUNT_API_H__ #define NVSRAM_ADDRESS_BASE 0x00000000 #define NVSRAM_TOTAL_SIZE 0x00080000 //512kB #define DIAG_NVSRAM_BACKUP_TAIL 0x00300000 //3MB #define DIAG_NVSRAM_BACKUP_BASE (DIAG_NVSRAM_BACKUP_TAIL - NVSRAM_TOTAL_SIZE) /*** Boot Count ***/ #define BOOT_COUNT_OFFSET 0x00000000 #define BOOT_COUNT_COMPARE_OFFSET 0x00000001 #define DIAG_INDEX_OFFSET 0x00000002 #define BOOT_COUNT_LOCATION (gFpgaBar2VirtualP + BOOT_COUNT_OFFSET ) #define BOOT_COUNT_COMPARE_LOCATION (gFpgaBar2VirtualP + BOOT_COUNT_COMPARE_OFFSET) #define DIAG_INDEX_LOCATION (gFpgaBar2VirtualP + DIAG_INDEX_OFFSET) /*** Boot Syndrome ***/ #define BOOT_COUNT_ENCODED_BYTE_0_OFFSET 0x00000003 #define BOOT_COUNT_ENCODED_BYTE_1_OFFSET 0x00000004 #define BOOT_COUNT_ENCODED_BYTE_2_OFFSET 0x00000005 #define BOOT_COUNT_ENCODED_PATTERN_0 0x89 #define BOOT_COUNT_ENCODED_PATTERN_1 0x93 #define BOOT_COUNT_ENCODED_PATTERN_2 0x27 #define BOOT_COUNT_ENCODED_BYTE_0_LOCATION (gFpgaBar2VirtualP + BOOT_COUNT_ENCODED_BYTE_0_OFFSET) #define BOOT_COUNT_ENCODED_BYTE_1_LOCATION (gFpgaBar2VirtualP + BOOT_COUNT_ENCODED_BYTE_1_OFFSET) #define BOOT_COUNT_ENCODED_BYTE_2_LOCATION (gFpgaBar2VirtualP + BOOT_COUNT_ENCODED_BYTE_2_OFFSET) /*** Board Stress Reset Syndrome ***/ #define BOOT_COUNT_ENCODED_BS_BYTE_0_OFFSET 0x00000864 #define BOOT_COUNT_ENCODED_BS_BYTE_1_OFFSET 0x00000865 #define BOOT_COUNT_ENCODED_BS_STATUS_OFFSET 0x00000866 //2 bytes #define BOOT_COUNT_ENCODED_BS_PATTERN_0 0xA2 #define BOOT_COUNT_ENCODED_BS_PATTERN_1 0x6C #define BOOT_COUNT_ENCODED_BS_ROTATE_STATUS_1 0x0001 #define BOOT_COUNT_ENCODED_BS_BYTE_0_LOCATION (gFpgaBar2VirtualP + BOOT_COUNT_ENCODED_BS_BYTE_0_OFFSET) #define BOOT_COUNT_ENCODED_BS_BYTE_1_LOCATION (gFpgaBar2VirtualP + BOOT_COUNT_ENCODED_BS_BYTE_1_OFFSET) #define BOOT_COUNT_ENCODED_BS_STATUS_LOCATION (gFpgaBar2VirtualP + BOOT_COUNT_ENCODED_BS_STATUS_OFFSET) /*** Diag Result Table ***/ #define DIAG_RESULT_TABLE_BASE_OFFSET 0x00000010 #define DIAG_RESULT_TABLE_LOCATION (gFpgaBar2VirtualP + DIAG_RESULT_TABLE_BASE_OFFSET) /*** Diag Manual Drive Status ***/ #define DIAG_MANUAL_DRIVE_OFFSET 0x00000050 #define DIAG_MANUAL_DRIVE_LOCATION (gFpgaBar2VirtualP + DIAG_MANUAL_DRIVE_OFFSET) /*** Import Function ***/ /* EXTERN INT32 ImageProgram(UINT32 offset, UINT32 len, UINT8 *data); EXTERN INT32 EraseFlash(UINT32 flashadr, UINT32 len); */ /*** Export Function ***/ //boot count UINT8 controllerBootCountGet(VOID); VOID controllerBootCountIncrease(VOID); VOID controllerBootCountReset(VOID); UINT8 controllerBootCountCompareGet(VOID); VOID controllerBootCountCompareSet(VOID); //boot cerification VOID controllerFirstBootVerification(VOID); VOID controllerFirstBootStateSet(VOID); VOID controllerFirstBootStateClear(VOID); //Diag. Index VOID controllerDiagIndexGet(VOID); VOID controllerDiagIndexSet(UINT8 diagIndex); VOID controllerDiagIndexReset(VOID); //Diag. manual status VOID controllerDiagManualSet(INT32 manualStatus); VOID controllerDiagManualGet(VOID); //Diag. result backup VOID diagResultToNVSRAM(UINT32 itemNumber, INT32 errorState); VOID diagResultFromNVSRAM(UINT32 item_number); VOID diagResultInNVSRAMClean(VOID); VOID nvsramtoFlashBackup(VOID); VOID nvsramfromFlashRestore(VOID); VOID nvsramBackupVerify(VOID); #endif //__BOOT_COUNT_API_H__