blob: c3caf85f5fbfdbe247c50cde9d052d332af52b06 [file] [log] [blame]
/*****************************************************************************
* Copyright Statement:
* --------------------
* This software is protected by Copyright and the information contained
* herein is confidential. The software may not be copied and the information
* contained herein may not be used or disclosed except with the written
* permission of MediaTek Inc. (C) 2012
*
* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
*
* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
*
* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
*
*****************************************************************************/
/****************************************************************************
* Filename:
* ---------
* @file dsp_logging.h
*
* Description:
* ------------
* @brief Interface of DSP logging handler.
*
* ==========================================================================
* $Log$
*
* 09 18 2020 guan-ren.chen
* [MOLY00327199] [Gen97/Gen98] Development
* DSP check register flag before filter update(SWRD).
*
* 09 14 2020 guan-ren.chen
* [MOLY00327199] [Gen97/Gen98] Development
* DSP check LS flag before update filter(SWRD).
*
* 04 09 2020 yen-hsuan.lin
* [MOLY00508510] [OK项目]PLS模式抓log需要和dump机制解耦
* decouple the logging and memory dump(SWRD)
*
* 03 31 2020 yen-hsuan.lin
* [MOLY00508510] [OK项目]PLS模式抓log需要和dump机制解耦
* 03 16 2020 kaijiun.yeo
* [MOLY00504503] Customer can adjust buffer allocation by customer filter
*
* 03 31 2020 kaijiun.yeo
* [MOLY00507931] Overwritable memorydump setting from AP (memory dump 2.0 phase 2)
* Add function prototype in dsp_logging.h
* decople log and memory dump(SW)
*
* 03 31 2020 kaijiun.yeo
* [MOLY00507931] Overwritable memorydump setting from AP (memory dump 2.0 phase 2)
* Add function prototype in dsp_logging.h
* [Customer can adjust buffer allocation by customer filter]
* Logging Buffer Reallocation - add function prototype in dsp_logging.h
*
* 01 17 2020 guan-ren.chen
* [MOLY00474969] [Logging] Round-Robin Exception Re-dump Log
* [Redump 2.0][SWRD] Round-Robin dump ULSP .
*
* 12 09 2019 yen-hsuan.lin
* [MOLY00327199] [Gen97] Development
* [MOLY00464641] Fix the dhl low power problem
*
* merger the Gen98 Fix into VMOLY trunk
*
* 11 21 2019 guan-ren.chen
* [MOLY00460317] [Petrus][blocking] trace lost before assert in two log - ALPS04883010, ALPS04883323
* Change trace name and fix wrong function prototype.
*
* 09 23 2019 yen-hsuan.lin
* [MOLY00327199] [Gen97] Development
* Fix the set dsp filter flow for rake
*
* 09 21 2019 guan-ren.chen
* [MOLY00327199] [Gen97] Development
* 1. ULSP DSP refactory SWRD.
* 2. Remove SW pull power when PB is not empty
* 3. Move DSP ST log definition file from HWRD to MPD
*
* 09 18 2019 guan-ren.chen
* [MOLY00327199] [Gen97] Development
* 1. ULSP DSP refactory SWRD.
* 2. Remove SW pull power when PB is not empty
* 3. Move DSP ST log definition file from HWRD to MPD
*
* 09 06 2019 yen-hsuan.lin
* [MOLY00437389] Porting Built in filter
*
* Add built in function
*
* 09 03 2019 guan-ren.chen
* [MOLY00327199] [Gen97] Development
* Fix pull DSP power when DSP first enter dormant.
*
* 08 19 2019 guan-ren.chen
* [MOLY00327199] [Gen97] Development
* ULSP DSP UT.
*
* 08 08 2019 guan-ren.chen
* [MOLY00427332] [MT6297][Apollo][Overnight][LegacyRAT][CHT][TPE][VMOLY][20190730]assert fail:dhl_ulsp.c
* LS abort fail SW workaround for SCQ16 (WHQA_00039659).
*
* 07 11 2019 guan-ren.chen
* [MOLY00327199] [Gen97] Development
* Fix DSP filter wrong size.
*
* 05 30 2019 mojo.lai
* [MOLY00401562] Decouple ICD from DHL on VMOLY trunk
*
* Save DSP filter to NVRAM
*
* 04 25 2019 yancy.chien
* [MOLY00401562] Decouple ICD from DHL on VMOLY trunk
*
* 1. Dynamic CCB.
* 2. Src Plug-in phase-in.
* 3. Fix build error on Gen95
*
* 04 16 2019 guan-ren.chen
* [MOLY00399588] [Gen97] Dormant flow
* Dormant flow. Struct access ULSP reg.
*
* 03 13 2019 guan-ren.chen
* [MOLY00391128] [Gen97] Develop for logging service
* Change print PS ex log location.
* Combine ULSP print ex log and print redump log function.
*
* 01 03 2019 mojo.lai
* [MOLY00376312] Save PB abort and flush status to CXIF
*
* .
*
* 10 31 2018 mojo.lai
* [MOLY00361962] Set DSP Filter
*
* .
*
****************************************************************************/
#ifndef _DSP_LOGGING_H
#define _DSP_LOGGING_H
#if defined(__MAUI_BASIC__)
#define Dsp_Logging_Init()
#else
#if defined(__MTK_TARGET__)
#include "dhl_def.h"
#include "kal_public_defs.h"
#include "kal_public_api.h"
#include "kal_internal_def.h"
#include "dhl_trace.h"
#include "dsp_header_define_cuif_inner_brp.h"
#include "dsp_header_define_cuif_fec_wbrp.h"
#include "dsp_header_define_cuif_speech.h"
#include "dsp_header_define_cmif.h"
#include "dhl_nvram_def.h"
#if (CUR_GEN >= MD_GEN97)
#include "dsp_header_define_csif_memory.h"
#endif
#include "dhl_dsp_def.h"
#if (CUR_GEN >= MD_GEN97)
#define DSP_LTE_CORE_COUNT (SCQ16_3 + 1)
#else
#define DSP_LTE_CORE_COUNT (SCQ16_1 + 1)
#endif
extern dhl_cmd_set_dsp_filter_struct dsp_filter[NVRAM_EF_DHL_DSP_FILTER_V2_TOTAL + 1]; // 1-based
/*---------------------------------------------------------------------------
Funtion prototype
---------------------------------------------------------------------------*/
void Dsp_Logging_Init();
void Dsp_Logging_Init_By_Core(kal_uint8 core);
void Dsp_set_filter_all_off();
void Dsp_Load_Builtin_Filters(kal_int8 scenario_id);
void Dsp_Set_Filter(dhl_cmd_set_dsp_filter_struct *dsp_filter_from_elt, kal_bool is_save_filter);
void Dsp_Set_Filter_Imp();
void Dsp_Set_RAKE_Filter();
void Dsp_Backup_Clear_All_Filter();
void Dsp_Restore_Filter();
kal_bool Dsp_is_dsp_filter_all_off();
void* Get_Cxif_Address(dsp_core_enum core);
void Save_Filter_To_Cxif(kal_uint8 core);
void Print_Filter_Setting(dhl_cmd_set_dsp_filter_struct *filter_setting);
void Dsp_Test_Filter(kal_uint8 core);
kal_uint8 Check_Dsp_Abort_Timeout();
void PrintDSPDebugTrace();
kal_bool Support_CXIF();
kal_uint8 Check_4G_Dsp_Abort_Timeout();
kal_uint8 Check_5G_Dsp_Abort_Timeout();
char* get_core_name(dsp_core_enum core);
kal_bool Get_Dsp_src_id(dsp_core_enum core_enum, kal_uint8* src_id);
kal_bool Get_Dsp_Core_Enum(dhl_dsp_filter_type filter_type, kal_uint8 src_id, dsp_core_enum* core_enum);
kal_bool Get_DSP_Core_NVRAM_Index(dsp_core_enum core_enum, kal_uint32* index);
void dsp_ut_set_ut_case(kal_uint32 dsp_core_bit_mask, ulsp_ut_case ut_case, kal_uint32 para);
void dsp_ut_wait_ut_case_finish(kal_uint32 dsp_core_bit_mask);
void dsp_ut_notify_dsp(kal_uint32 dsp_core_bit_mask);
void dhl_activate_dsp(kal_uint32 module_id, kal_bool first_activate);
void dhl_deactivate_dsp(kal_uint32 module_id);
void dsp_ut_init();
void dsp_backup_filter_update_flag();
void dsp_restore_filter_update_flag();
void dsp_set_filter_update_flag(dsp_core_enum core);
void dhl_ulsp_reset_vcore_l1(kal_uint32 ch_id);
void dhl_ulsp_reset_scq16_pb_l1(kal_uint32 ch_id);
#endif // __MTK_TARGET__
#endif // __MAUI_BASIC__
#endif // _DSP_LOGGING_H