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 | * md32_excep_hdlr.h |
| 41 | * |
| 42 | * Project: |
| 43 | * -------- |
| 44 | * UMOLY |
| 45 | * |
| 46 | * Description: |
| 47 | * ------------ |
| 48 | * This file provides typedefs and definiton for PS index trace. |
| 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 | *------------------------------------------------------------------------------ |
| 59 | * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!! |
| 60 | *============================================================================ |
| 61 | ****************************************************************************/ |
| 62 | |
| 63 | #ifndef __MD32_EXCEP_HDLR_H__ |
| 64 | #define __MD32_EXCEP_HDLR_H__ |
| 65 | |
| 66 | #if !defined(__OFFLINE_EX_LOG_PARSER__) |
| 67 | #include "md32_boot.h" |
| 68 | #include "kal_general_types.h" |
| 69 | #endif /*__OFFLINE_EX_LOG_PARSER__*/ |
| 70 | #include "ex_public.h" |
| 71 | |
| 72 | /******************************************************************************* |
| 73 | * Definition |
| 74 | *******************************************************************************/ |
| 75 | #define MD32_NUM_CORES 1 |
| 76 | #define MD32_EX_FILENAME_SIZE 64 |
| 77 | #define MD32_EX_CORE_NAME_SIZE 10 |
| 78 | #define MD32_EX_ASSERT_LINE_TYPE_NUMBER 0x1 |
| 79 | #define MD32_EX_ASSERT_EXT_TYPE_NUMBER 0x2 |
| 80 | #define MD32_EX_FATAL_ERROR_TYPE_NUMBER 0x3 |
| 81 | #define MD32_EX_FATAL_ERROR_EXT_TYPE_NUMBER 0x4 |
| 82 | #define MD32_EX_FILL_FINISH_PATTERN 0xFD32FD32 |
| 83 | #define MD32_EX_INIT_PATTERN 0x62935566 |
| 84 | //#define MD32_EXCEPTION_SYNC_TIME 0x100000 // please use EX_MD32_SYNC_TIME in cc_ex_item.h |
| 85 | #define MD32_EXCEPTION_FLOW_HANDSHAKE_SYNC_TIME 0x10000 |
| 86 | #define MD32_EXCEPTION_PCORE_WAIT_L1CORE_REPORT_TIME 0x100000 |
| 87 | #define MD32_MPU_MAX_REGION_SIZE 8 |
| 88 | #define MOS_EX_TRACE_BUFFER_SIZE 64 |
| 89 | |
| 90 | /******************************************************************************* |
| 91 | * CMIF Exception record structure for MD32 |
| 92 | *******************************************************************************/ |
| 93 | typedef enum{ |
| 94 | MD32_EX_NONE, |
| 95 | MD32_ASSERT_LINE = MD32_EX_ASSERT_LINE_TYPE_NUMBER, |
| 96 | MD32_ASSERT_EXT = MD32_EX_ASSERT_EXT_TYPE_NUMBER, |
| 97 | MD32_FATAL_ERROR = MD32_EX_FATAL_ERROR_TYPE_NUMBER, |
| 98 | MD32_CTI_EXCEPTION = MD32_EX_FATAL_ERROR_EXT_TYPE_NUMBER, |
| 99 | MD32_EX_END=0xff |
| 100 | }MD32_EX_TYPE; |
| 101 | |
| 102 | typedef struct{ |
| 103 | kal_uint32 line_num; |
| 104 | kal_uint32 para1; |
| 105 | kal_uint32 para2; |
| 106 | kal_uint32 para3; |
| 107 | char* filepath_ptr; |
| 108 | kal_char file_name[MD32_EX_FILENAME_SIZE]; |
| 109 | }MD32_EX_CMIF_AssertLog; |
| 110 | |
| 111 | typedef struct{ |
| 112 | kal_uint32 error_status; //is ex_code[0] |
| 113 | kal_uint32 error_pc; //is ex_code[1] |
| 114 | kal_uint32 error_lr; //is lr |
| 115 | kal_uint32 error_address; //is daabtad |
| 116 | kal_uint32 error_code1; //is ex_code[0] |
| 117 | kal_uint32 error_code2; //is ex_code[1] |
| 118 | kal_uint8 error_section; |
| 119 | }MD32_EX_CMIF_FatalErrorLog; |
| 120 | |
| 121 | typedef union{ |
| 122 | MD32_EX_CMIF_AssertLog assert; |
| 123 | MD32_EX_CMIF_FatalErrorLog fatal; |
| 124 | }MD32_EX_CMIF_AssertFatalErrorLog; |
| 125 | |
| 126 | typedef struct { |
| 127 | MD32_EX_TYPE except_type; //type |
| 128 | kal_uint32 except_stat; //exception flow's status |
| 129 | MD32_EX_CMIF_AssertFatalErrorLog except_content; //assert or exception log |
| 130 | }MD32_ExceptionLogCore_T; |
| 131 | |
| 132 | /** Causion: The total log size for 3* MD32s is 392 bytes. |
| 133 | It means there are 128 bytes for each MD32s core */ |
| 134 | typedef struct { |
| 135 | kal_uint32 core_num; |
| 136 | MD32_ExceptionLogCore_T core_error; |
| 137 | }MD32_ExceptionLog_T; |
| 138 | |
| 139 | typedef enum{ |
| 140 | MD32_BRP_FAIL_BIT_MASK = (1 << 0), |
| 141 | MD32_DFE_FAIL_BIT_MASK = (1 << 1), |
| 142 | MD32_DFE1_FAIL_BIT_MASK = (1 << 2), |
| 143 | MD32_RAKE_FAIL_BIT_MASK = (1 << 3) |
| 144 | }MD32_EX_CORE_BIT_MASK_TYPE; |
| 145 | |
| 146 | /*Below are md32_ex_hdlr_trace.c*/ |
| 147 | typedef struct{ |
| 148 | kal_uint32 finish_fill; |
| 149 | kal_uint32 boot_rdy; |
| 150 | kal_uint32 ex_flow_progress; |
| 151 | }MD32_EX_FLOW_TYPE; |
| 152 | |
| 153 | typedef enum{ |
| 154 | MD32_EX_ABNORMAL_RESET = 0x1, |
| 155 | MD32_EX_INSTRUCTION_ABORT = 0x10, |
| 156 | MD32_EX_UNDEFINED_INSTRUCTION_ABORT = 0x13, |
| 157 | MD32_EX_DATA_ABORT = 0x30, |
| 158 | MD32_EX_MPU_PERMISSION_ERROR = 0x32, |
| 159 | MD32_EX_UNALIGNED_MEMORY_ACCESS = 0x33, |
| 160 | MD32_EX_DIVIDED_BY_ZERO = 0x34, |
| 161 | MD32_EX_HARDWARE_LOOP_OVERFLOW = 0x35, |
| 162 | MD32_EX_PMU_EXCEPTION = 0xE0, |
| 163 | MD32_EX_CTI_EXCETPION = 0x120, |
| 164 | MD32_EX_MOS_INTERNAL_ERROR = 0x200, |
| 165 | MD32_EX_MOS_VIC_UNREGISTER_INTERRUPT = 0x201, |
| 166 | MD32_EX_MOS_CIRQ_UNREGISTER_INTERRUPT = 0x202, |
| 167 | MD32_EX_MOS_CHECK_STACK_GUARD_PATTERN_FAIL = 0x203, |
| 168 | MD32_EX_MOS_CMIF_UNREGISTER_INTERRUPT = 0x204, |
| 169 | MD32_EX_MOS_ERROR_ECT = 0x300 |
| 170 | }MD32_EX_ERROR_CODE_TYPE; |
| 171 | |
| 172 | |
| 173 | /******************************************************************************* |
| 174 | * Function delcation |
| 175 | *******************************************************************************/ |
| 176 | extern void INT_GetMD32ExceptionRecord(MD32_ExceptionLog_T *record); |
| 177 | extern void INT_GetMD32DumpMemoryInfo(kal_uint32 **info, unsigned short *count, kal_uint8* region_config); |
| 178 | extern kal_bool INT_SyncMD32ExceptionInfo(void); |
| 179 | extern void INT_EnableMD32MemoryDump(void); |
| 180 | extern void INT_DumpMD32ExceptionInfo(EX_TRACE_TYPE trace_type/*0=cadefa*/, kal_char* sys_info_str, kal_uint32 len); |
| 181 | extern kal_bool MD32_IsSyncFinished(void); |
| 182 | extern void MD32_SetSyncFinished(void); |
| 183 | extern void INT_GetMD32ExceptionHandshakeInit(void); |
| 184 | extern void INT_GetMD32BBMemoryInfo(void); |
| 185 | extern kal_char* INT_GetMD32CoreName(void); |
| 186 | |
| 187 | |
| 188 | #endif /* __MD32_EXCEP_HDLR_H__ */ |
| 189 | |