/* SPDX-License-Identifier: LGPL-2.1-only OR BSD-3-Clause */
/******************************************************************************
 *
 * This file is provided under a dual license.  When you use or
 * distribute this software, you may choose to be licensed under
 * version 2.1 of the GNU Lesser General Public License
 * ("LGPLv2.1 License") or BSD License.
 *
 * LGPLv2.1 License
 *
 * Copyright(C) 2019 MediaTek Inc.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of version 2.1 of the GNU Lesser General Public
 * License as published by the Free Software Foundation.
 *
 * This program is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 * See https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html for more
 * details.
 *
 * BSD LICENSE
 *
 * Copyright(C) 2019 MediaTek Inc.
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 *
 *  * Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 *  * Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in
 *    the documentation and/or other materials provided with the
 *    distribution.
 *  * Neither the name of the copyright holder nor the names of its
 *    contributors may be used to endorse or promote products derived
 *    from this software without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
 * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 *
 *****************************************************************************/


#ifndef X_CHIP_ID_H
#define X_CHIP_ID_H

#include "x_typedef.h"

#define BIM_MTK_KEY_ADDR    0x3f00

#define TTS_3LANGS_OR_MORE  (0x0)
#define TTS_2LANGS          (0x1)
#define TTS_1LANG           (0x2)
#define TTS_DISABLE         (0x3)

#define APU_GSM_1MB         (0x0)
#define APU_GSM_512K        (0x1)
#define APU_GSM_0K          (0x2)
#define APU_GSM_DISABLE     (0x3)

EXTERN UINT32 GET_CHIPID(VOID);

EXTERN UINT32 Get_SupportAPU(VOID);
EXTERN UINT32 IS_SupportLocalDimming(VOID);
EXTERN UINT32 IS_SupportDolbyAtoms(VOID);

EXTERN UINT32 IS_SupportHEVC(VOID);
EXTERN UINT32 IS_SupportPlayRDY(VOID);
EXTERN UINT32 IS_SupportH264(VOID);
EXTERN UINT32 IS_SupportAndroid(VOID);
EXTERN UINT32 IS_SupportVP8EN(VOID);
EXTERN UINT32 IS_Support3D(VOID);
EXTERN UINT32 IS_SupportDimming(VOID);
EXTERN UINT32 IS_Support4K120(VOID);
EXTERN UINT32 IS_SupportTTS(VOID);
EXTERN UINT32 Get_SupportTTS(VOID);
EXTERN UINT32 IS_SupportIWediaOpenBrower(VOID);
EXTERN UINT32 IS_SupportIWediaBrower(VOID);
EXTERN UINT32 Get_SupportVDEC(VOID);
EXTERN UINT32 IS_SupportDVB(VOID);
EXTERN UINT32 IS_SupportBRAZIL(VOID);
EXTERN UINT32 IS_SupportATSC(VOID);
EXTERN UINT32 IS_SupportDMBT(VOID);
EXTERN UINT32 IS_SupportTCON(VOID);
EXTERN UINT32 IS_SupportVP9(VOID);
EXTERN UINT32 IS_SupportMHEGHD(VOID);
EXTERN UINT32 IS_SupportOPERAENGINE(VOID);
EXTERN UINT32 IS_SupportOPERA(VOID);
EXTERN UINT32 IS_SupportDRA(VOID);
EXTERN UINT32 IS_SupportATSC30(VOID);
EXTERN UINT32 IS_SupportARIB(VOID);
EXTERN UINT32 IS_SupportGINGA(VOID);
EXTERN UINT32 IS_SupportATSC30(VOID);
EXTERN UINT32 IS_SupportGINGATVTOS(VOID);
EXTERN UINT32 IS_SupportGINGAMOPA(VOID);
EXTERN UINT32 IS_SupportMHP(VOID);
EXTERN UINT32 IS_SupportHBBTV(VOID);
EXTERN UINT32 IS_SupportRM(VOID);
EXTERN UINT32 IS_SupportAVS(VOID);
EXTERN UINT32 IS_SupportVC1(VOID);
EXTERN UINT32 IS_SupportDivXHD(VOID);
EXTERN UINT32 IS_SupportMSS(VOID);
EXTERN UINT32 IS_Support3DGPU(VOID);
EXTERN UINT32 IS_SupportAV1(VOID);
EXTERN UINT32 IS_SupportGINGA(VOID);
EXTERN UINT32 IS_SupportDTS(VOID);
EXTERN UINT32 IS_SupportDOLBY(VOID);

EXTERN UINT32 IS_SupportACPU(VOID);
EXTERN UINT32 IS_SupportDolbyHDR(VOID);
EXTERN UINT32 IS_SupportGPUDFD(VOID);
EXTERN UINT32 IS_SupportGPUMC1(VOID);
EXTERN UINT32 IS_SupportGPUMC0(VOID);
EXTERN UINT32 IS_SupportDemura(VOID);
EXTERN UINT32 IS_SupportSSRS(VOID);
EXTERN UINT32 IS_SupportVP8En(VOID);
EXTERN UINT32 IS_SupportCPU3(VOID);
EXTERN UINT32 IS_SupportCPU2(VOID);
EXTERN UINT32 IS_SupportCPU1(VOID);
EXTERN UINT32 IS_SupportCPU0(VOID);
EXTERN UINT32 IS_SupportCPU_DFD(VOID);
EXTERN UINT32 IS_Support8KVideo(VOID);
EXTERN UINT32 IS_SupportSHVC(VOID);
EXTERN UINT32 IS_Support8KDD(VOID);
EXTERN UINT32 IS_SupportHighSpeedSPINor(VOID);
EXTERN UINT32 IS_SupportFoxxum(VOID);
EXTERN UINT32 IS_SupportSeraphicPB(VOID);
EXTERN UINT32 IS_SupportSeraphicHbbTV(VOID);
EXTERN UINT32 IS_SupportSeraphicOB(VOID);
EXTERN UINT32 IS_SupportDTMB(VOID);
EXTERN UINT32 IS_SupportDVBT2S2(VOID);
EXTERN UINT32 IS_SupportHDR10Plus(VOID);
EXTERN UINT32 IS_Support120MJC(VOID);
EXTERN UINT32 IS_Support60MJC(VOID);
EXTERN UINT32 IS_SupportTechnicolorHDR(VOID);
EXTERN UINT32 IS_SupportDBXTV(VOID);

EXTERN UINT32 IS_Support4KDisplay(VOID);
EXTERN UINT32 IS_Support4KDecode(VOID);
EXTERN UINT32 IS_Support4KDD(VOID);
EXTERN UINT32 IS_SupportHighSpeedSPINor(VOID);
EXTERN UINT32 IS_SupportAVS2(VOID);
EXTERN UINT32 IS_SupportTechnicolorHDR(VOID);

EXTERN UINT32 IS_SupportH264EN(VOID);
EXTERN UINT32 IS_SupportTsIn(VOID);
EXTERN UINT32 IS_SupportHDMI20(VOID);
EXTERN UINT32 IS_Support4K60Decode(VOID);
EXTERN UINT32 IS_Support120MJC(VOID);
EXTERN UINT32 IS_Support60MJC(VOID);
EXTERN UINT32 IS_SupportDimming(VOID);
EXTERN UINT32 IS_SupportCPUHiSpeed(VOID);
EXTERN UINT32 IS_SupportEAC3(VOID);
EXTERN UINT32 IS_SupportDivX(VOID);
EXTERN UINT32 IS_SupportAC3(VOID);
EXTERN UINT32 IS_SupportDDCO(VOID);
EXTERN UINT32 IS_SupportMS10(VOID);
EXTERN UINT32 IS_SupportCIPlus(VOID);
EXTERN UINT32 IS_MultiMediaSupport(VOID);
EXTERN UINT32 IS_MHEG5Support(VOID);
EXTERN UINT32 IS_SupportCHINATV(VOID);
EXTERN UINT32 IS_SupportCINEMA(VOID);
EXTERN UINT32 IS_SupportNETWORK(VOID);
EXTERN UINT32 IS_SupportVP8(VOID);
EXTERN UINT32 IS_SupportIPTV(VOID);
EXTERN UINT32 IS_SupportCPU1G(VOID);
EXTERN UINT32 IS_SupportJVM(VOID);
EXTERN UINT32 IS_SupportTTS(VOID);
EXTERN UINT32 IS_SupportVP8EN(VOID);
EXTERN UINT32 IS_Support3D(VOID);

EXTERN UINT32 IS_MHEG5Support(VOID);
EXTERN UINT32 IS_MultiMediaSupport(VOID);
EXTERN UINT32 _IS_RDES(VOID);
EXTERN UINT32 _IS_RDES_EX(VOID);
EXTERN UINT32 GET_EFUSE_HWBOND(VOID);
EXTERN UINT32 GET_EFUSE_CHIPID(VOID);
EXTERN UINT32 GET_EFUSE_CHIPID_EX(VOID);
EXTERN UINT32 IS_Support4K120(VOID);
EXTERN UINT32 IS_Support120MJC(VOID);
EXTERN UINT32 IS_SupportTechnicolorHDR(VOID);
EXTERN UINT32 IS_Support120HZ(VOID);
EXTERN UINT32 IS_SupportMCM(VOID);
EXTERN UINT32 IS_SupportIWediaOpenBrower(VOID);
EXTERN UINT32 IS_SupportIWediaBrower(VOID);
EXTERN UINT32 IS_SupportHBBTVWeb(VOID);
EXTERN UINT32 IS_SupportFOXXUMTVStore(VOID);
EXTERN UINT32 IS_SupportDemodStandby(VOID);
EXTERN UINT32 IS_SupportFVPWeb(VOID);


EXTERN INT32 BIM_GetDeviceData(BYTE *pu1DeviceID, BYTE u1Size); //128byte device id from rom code 0x0
EXTERN INT32 BIM_GetDeviceID(BYTE *pu1DeviceID, BYTE u1Size); // 8byte device id from efuse 0x868C
EXTERN INT32 BIM_GetSecureID(BYTE *pu1SecureID, BYTE u1Size); // 128bit random key from efuse 0x8678

#endif /* X_CHIP_ID_H */

