/* 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.
 *
 *****************************************************************************/

/*-----------------------------------------------------------------------------
 *
 * $Author: shuo.ding $
 * $Date: 2015/08/19 $
 * $RCSfile: osd_hw.h,v $
 * $Revision: #7 $
 *
 *---------------------------------------------------------------------------*/

/** @file osd_hw.h
 *  This header file declares hardware register interface of OSD.
 */

#ifndef OSD_HW_H
#define OSD_HW_H

//-----------------------------------------------------------------------------
// Include files
//-----------------------------------------------------------------------------

#include "x_lint.h"
LINT_EXT_HEADER_BEGIN
#include "x_hal_io.h"
#include "x_hal_5381.h"
#include "x_hal_926.h"
LINT_EXT_HEADER_END

#include "osd_drvif.h"

//-----------------------------------------------------------------------------
// Inter-file functions
//-----------------------------------------------------------------------------

EXTERN void _OSD_AlwaysUpdateReg(BOOL fgEnable);
EXTERN void _OSD_UpdateReg(void);

//-----------------------------------------------------------------------------
// base register relative functions
//-----------------------------------------------------------------------------
EXTERN INT32 _OSD_BASE_InitRegs(void);
EXTERN INT32 _OSD_BASE_SwSetReg(void);
EXTERN INT32 _OSD_BASE_UpdateHwReg(void);

EXTERN INT32 _OSD_BASE_SetUpdate(UINT32 u4Value);
EXTERN INT32 _OSD_BASE_SetAlwaysUpdate(UINT32 u4Value);
EXTERN INT32 _OSD_BASE_SetResetFsm(UINT32 u4Value);
EXTERN INT32 _OSD_BASE_SetResetAll(UINT32 u4Value);
EXTERN INT32 _OSD_BASE_SetFrameReset(UINT32 u4Value);
EXTERN INT32 _OSD_BASE_SetHsEdge(UINT32 u4Value);
EXTERN INT32 _OSD_BASE_SetVsEdge(UINT32 u4Value);
EXTERN INT32 _OSD_BASE_SetFldPol(UINT32 u4Value);
EXTERN INT32 _OSD_BASE_SetPrgs(UINT32 u4Value);
EXTERN INT32 _OSD_BASE_SetIntTGen(UINT32 u4Value);
EXTERN INT32 _OSD_BASE_SetChecksumEn(UINT32 u4Value);
EXTERN INT32 _OSD_BASE_SetAutoPos(UINT32 u4Value);
EXTERN INT32 _OSD_BASE_SetYuvOut(UINT32 u4Value);
EXTERN INT32 _OSD_BASE_SetOSD12Ex(UINT32 u4Value);
EXTERN INT32 _OSD_BASE_SetSyncSrcSel(UINT32 u4Value);
EXTERN INT32 _OSD_BASE_SetABISTEn(UINT32 u4Value);
EXTERN INT32 _OSD_BASE_SetVsWidth(UINT32 u4Value);
EXTERN INT32 _OSD_BASE_SetOht(UINT32 u4Value);
EXTERN INT32 _OSD_BASE_SetOvt(UINT32 u4Value);
EXTERN INT32 _OSD_BASE_SetScrnHStartOsd2(UINT32 u4Value);
EXTERN INT32 _OSD_BASE_SetScrnHStartOsd1(UINT32 u4Value);
EXTERN INT32 _OSD_BASE_SetScrnVStart(UINT32 u4Value);
EXTERN INT32 _OSD_BASE_SetOsd1VStart(UINT32 u4Value);
EXTERN INT32 _OSD_BASE_SetOsd1HStart(UINT32 u4Value);
EXTERN INT32 _OSD_BASE_SetOsd2VStart(UINT32 u4Value);
EXTERN INT32 _OSD_BASE_SetOsd2HStart(UINT32 u4Value);
EXTERN INT32 _OSD_BASE_SetHsWidth(UINT32 u4Value);
EXTERN INT32 _OSD_BASE_SetDelayAdj(UINT32 u4Value);
EXTERN INT32 _OSD_BASE_SetOsd12Ex(UINT32 u4Value);
EXTERN INT32 _OSD_BASE_SetScrnHStartCSR(UINT32 u4Value);
EXTERN INT32 _OSD_BASE_SetScrnHStartOsd3(UINT32 u4Value);
EXTERN INT32 _OSD_BASE_SetOsd3VStart(UINT32 u4Value);
EXTERN INT32 _OSD_BASE_SetOsd3HStart(UINT32 u4Value);
EXTERN INT32 _OSD_BASE_SetCsrVStart(UINT32 u4Value);
EXTERN INT32 _OSD_BASE_SetCsrHStart(UINT32 u4Value);
#if defined(CC_MT5895)
EXTERN INT32 _OSD_BASE_SetSrcTimingSel(UINT32 u4Value);
#endif
#if defined(CC_MT5893) || defined(CC_MT5895)
EXTERN INT32 _OSD_R_BASE_SetOsd1HStart(UINT32 u4Value);
EXTERN INT32 _OSD_R_BASE_SetOsd2HStart(UINT32 u4Value);
EXTERN INT32 _OSD_R_BASE_SetOsd3HStart(UINT32 u4Value);
EXTERN INT32 _OSD_R_BASE_SetCsrHStart(UINT32 u4Value);
EXTERN INT32 _OSD_R_BASE_SetScrnHStartOsd2(UINT32 u4Value);
EXTERN INT32 _OSD_R_BASE_SetScrnHStartOsd1(UINT32 u4Value);
EXTERN INT32 _OSD_R_BASE_SetScrnHStartCSR(UINT32 u4Value);
EXTERN INT32 _OSD_R_BASE_SetScrnHStartOsd3(UINT32 u4Value);
#endif

EXTERN INT32 _OSD_BASE_SetTransferCtl(UINT32 u4Value);
EXTERN INT32 _OSD_BASE_GetTransferCtl(UINT32 *pu4Value);
EXTERN INT32 _OSD_BASE_SetOSD2LvdsEn(UINT32 u4Value);
EXTERN INT32 _OSD_BASE_GetOSD2LvdsEn(UINT32 *pu4Value);
EXTERN INT32 _OSD_BASE_GetUpdate(UINT32 *pu4Value);
EXTERN INT32 _OSD_BASE_GetAlwaysUpdate(UINT32 *pu4Value);
EXTERN INT32 _OSD_BASE_GetResetFsm(UINT32 *pu4Value);
EXTERN INT32 _OSD_BASE_GetResetAll(UINT32 *pu4Value);
EXTERN INT32 _OSD_BASE_GetFrameReset(UINT32 *pu4Value);
EXTERN INT32 _OSD_BASE_GetHsEdge(UINT32 *pu4Value);
EXTERN INT32 _OSD_BASE_GetVsEdge(UINT32 *pu4Value);
EXTERN INT32 _OSD_BASE_GetFldPol(UINT32 *pu4Value);
EXTERN INT32 _OSD_BASE_GetPrgs(UINT32 *pu4Value);
EXTERN INT32 _OSD_BASE_GetIntTGen(UINT32 *pu4Value);
EXTERN INT32 _OSD_BASE_GetChecksumEn(UINT32 *pu4Value);
EXTERN INT32 _OSD_BASE_GetAutoPos(UINT32 *pu4Value);
EXTERN INT32 _OSD_BASE_GetYuvOut(UINT32 *pu4Value);
EXTERN INT32 _OSD_BASE_GetOSD12Ex(UINT32 *pu4Value);
EXTERN INT32 _OSD_BASE_GetVsyncSrcSel(UINT32 *pu4Value);
EXTERN INT32 _OSD_BASE_GetABISTEn(UINT32 *pu4Value);
EXTERN INT32 _OSD_BASE_GetVsWidth(UINT32 *pu4Value);
EXTERN INT32 _OSD_BASE_GetOht(UINT32 *pu4Value);
EXTERN INT32 _OSD_BASE_GetOvt(UINT32 *pu4Value);
EXTERN INT32 _OSD_BASE_GetScrnHStartOsd2(UINT32 *pu4Value);
EXTERN INT32 _OSD_BASE_GetScrnHStartOsd1(UINT32 *pu4Value);
EXTERN INT32 _OSD_BASE_GetScrnHStartOsd3(UINT32 *pu4Value);
EXTERN INT32 _OSD_BASE_GetScrnHStartCsr(UINT32 *pu4Value);
EXTERN INT32 _OSD_BASE_GetScrnVStart(UINT32 *pu4Value);
EXTERN INT32 _OSD_BASE_GetOsd1VStart(UINT32 *pu4Value);
EXTERN INT32 _OSD_BASE_GetOsd1HStart(UINT32 *pu4Value);
EXTERN INT32 _OSD_BASE_GetOsd2VStart(UINT32 *pu4Value);
EXTERN INT32 _OSD_BASE_GetOsd2HStart(UINT32 *pu4Value);
EXTERN INT32 _OSD_BASE_GetOsd3VStart(UINT32 *pu4Value);
EXTERN INT32 _OSD_BASE_GetOsd3HStart(UINT32 *pu4Value);
EXTERN INT32 _OSD_BASE_GetCsrVStart(UINT32 *pu4Value);
EXTERN INT32 _OSD_BASE_GetCsrHStart(UINT32 *pu4Value);
#if defined(CC_MT5895)
EXTERN INT32 _OSD_BASE_GetSrcTimingSel(UINT32 *pu4Value);
#endif
#if defined(CC_MT5893) || defined(CC_MT5895)
EXTERN INT32 _OSD_R_BASE_GetOsd1HStart(UINT32 *pu4Value);
EXTERN INT32 _OSD_R_BASE_GetOsd2HStart(UINT32 *pu4Value);
EXTERN INT32 _OSD_R_BASE_GetOsd3HStart(UINT32 *pu4Value);
EXTERN INT32 _OSD_R_BASE_GetCsrHStart(UINT32 *pu4Value);
EXTERN INT32 _OSD_R_BASE_GetScrnHStartOsd2(UINT32 *pu4Value);
EXTERN INT32 _OSD_R_BASE_GetScrnHStartOsd1(UINT32 *pu4Value);
EXTERN INT32 _OSD_R_BASE_GetScrnHStartCSR(UINT32 *pu4Value);
EXTERN INT32 _OSD_R_BASE_GetScrnHStartOsd3(UINT32 *pu4Value);
#endif

EXTERN INT32 _OSD_BASE_GetHsWidth(UINT32 *pu4Value);
EXTERN INT32 _OSD_BASE_GetDelayAdj(UINT32 *pu4Value);
EXTERN INT32 _OSD_BASE_GetOsd12Ex(UINT32 *pu4Value);
EXTERN INT32 _OSD_BASE_GetScmemCfg(UINT32 *pu4Value);
EXTERN INT32 _OSD_BASE_GetPreMulTarget(UINT32 *pu4Value);
EXTERN INT32 _OSD_BASE_GetPreMulVStart(UINT32 *pu4Value);
EXTERN INT32 _OSD_BASE_GetPreMulHStart(UINT32 *pu4Value);
EXTERN INT32 _OSD_BASE_GetPreMulVEnd(UINT32 *pu4Value);
EXTERN INT32 _OSD_BASE_GetPreMulHEnd(UINT32 *pu4Value);

EXTERN INT32 _OSD_BASE_SetOSD1Switch(UINT32 u4Value);
EXTERN INT32 _OSD_BASE_SetOSD2Switch(UINT32 u4Value);
EXTERN INT32 _OSD_BASE_SetOSD3Switch(UINT32 u4Value);

EXTERN INT32 _OSD_BASE_GetOSD1Switch(UINT32 *pu4Value);
EXTERN INT32 _OSD_BASE_GetOSD2Switch(UINT32 *pu4Value);
EXTERN INT32 _OSD_BASE_GetOSD3Switch(UINT32 *pu4Value);
#if defined(CC_MT5893) || defined(CC_MT5895)
EXTERN INT32 _OSD_BASE_SetOvlShareOsdScaler(UINT32 u4Value);
EXTERN INT32 _OSD_BASE_SetOvlOsd3FifoRem(UINT32 u4Value);
EXTERN INT32 _OSD_BASE_SetOvlOsd3FifoFullTh(UINT32 u4Value);
EXTERN INT32 _OSD_BASE_SetOvlOsd3FifoEmpTh(UINT32 u4Value);
EXTERN INT32 _OSD_BASE_GetOvlShareOsdScaler(UINT32 *pu4Value);
EXTERN INT32 _OSD_BASE_GetOvlOsd3FifoRem(UINT32 *pu4Value);
EXTERN INT32 _OSD_BASE_GetOvlOsd3FifoFullTh(UINT32 *pu4Value);
EXTERN INT32 _OSD_BASE_GetOvlOsd3FifoEmpTh(UINT32 *pu4Value);
#endif

EXTERN INT32 _OSD_3D_InitRegs(void);
EXTERN INT32 _OSD_3D_UpdateHwReg(void);

EXTERN INT32 _OSD_3D_SetTgenLREn(UINT32 u4TgenLREn);
EXTERN INT32 _OSD_3D_SetOsd2LShiftEn(UINT32 u4Value);
EXTERN INT32 _OSD_3D_SetPlaneSwitchEn(UINT32 u4Value);
EXTERN INT32 _OSD_3D_SetPlaneSwitchInv(UINT32 u4Value);
EXTERN INT32 _OSD_3D_SetShutterShiftEn(UINT32 u4Value);
EXTERN INT32 _OSD_3D_SetOsd1LShiftEn(UINT32 u4Value);
EXTERN INT32 _OSD_3D_SetOsd3LShiftEn(UINT32 u4Value);
EXTERN INT32 _OSD_3D_SetCsrLShiftEn(UINT32 u4Value);
EXTERN INT32 _OSD_3D_SetOsd1ShiftValue(UINT32 u4Value);
EXTERN INT32 _OSD_3D_SetOsd2ShiftValue(UINT32 u4Value);
EXTERN INT32 _OSD_3D_SetOsd3ShiftValue(UINT32 u4Value);
EXTERN INT32 _OSD_3D_SetCsrShiftValue(UINT32 u4Value);
EXTERN INT32 _OSD_3D_GetCsrShiftValue(UINT32 *pu4Value);
EXTERN INT32 _OSD_3D_SetOsd2LShiftInv(UINT32 puOsd2LShiftInv);

EXTERN INT32 _OSD_3D_GetOsd2LShiftEn(UINT32 *pu4Value);
EXTERN INT32 _OSD_3D_GetPlaneSwitchEn(UINT32 *pu4Value);
EXTERN INT32 _OSD_3D_GetShutterShiftEn(UINT32 *pu4Value);
EXTERN INT32 _OSD_3D_GetOsd1LShiftEn(UINT32 *pu4Value);
EXTERN INT32 _OSD_3D_GetOsd3LShiftEn(UINT32 *pu4Value);
EXTERN INT32 _OSD_3D_GetCsrLShiftEn(UINT32 *pu4Value);
EXTERN INT32 _OSD_3D_GetOsd1ShiftValue(UINT32 *pu4Value);
EXTERN INT32 _OSD_3D_GetOsd2ShiftValue(UINT32 *pu4Value);
EXTERN INT32 _OSD_3D_GetOsd3ShiftValue(UINT32 *pu4Value);
EXTERN INT32 _OSD_3D_GetOsd2LShiftInv(UINT32 *puOsd2LShiftInv);


//-----------------------------------------------------------------------------
// plane register relative functions
//-----------------------------------------------------------------------------
// plane regitser get and set function
EXTERN INT32 _OSD_PLA_ResetCacheRegs(UINT32 u4Plane);
EXTERN INT32 _OSD_PLA_UpdateHwReg(UINT32 u4Plane);

// plane register set function
EXTERN INT32 _OSD_PLA_SetEnable(UINT32 u4Plane, UINT32 u4Value);
EXTERN INT32 _OSD_PLA_SetFakeHdr(UINT32 u4Plane, UINT32 u4Value);
EXTERN INT32 _OSD_PLA_SetPrngEn(UINT32 u4Plane, UINT32 u4Value);
//EXTERN INT32 _OSD_PLA_SetDecEn(UINT32 u4Plane, UINT32 u4Value);
//EXTERN INT32 _OSD_PLA_SetAlphaMod(UINT32 u4Plane, UINT32 u4Value);
EXTERN INT32 _OSD_PLA_SetHFilter(UINT32 u4Plane, UINT32 u4Value);
EXTERN INT32 _OSD_PLA_SetBlending(UINT32 u4Plane, UINT32 u4Value);
EXTERN INT32 _OSD_PLA_SetHeaderAddr(UINT32 u4Plane, UPTR upValue);
EXTERN INT32 _OSD_PLA_SetFading(UINT32 u4Plane, UINT32 u4Value);
EXTERN INT32 _OSD_PLA_SetLSB10Bit(UINT32 u4Plane, UINT32 u4Value);
EXTERN INT32 _OSD_PLA_SetContReqLmt(UINT32 u4Plane, UINT32 u4Value);
EXTERN INT32 _OSD_PLA_SetFifoSize(UINT32 u4Plane, UINT32 u4Value);
//EXTERN INT32 _OSD_PLA_SetVacTh16(UINT32 u4Plane, UINT32 u4Value);
//EXTERN INT32 _OSD_PLA_SetVacTh4(UINT32 u4Plane, UINT32 u4Value);
EXTERN INT32 _OSD_PLA_SetVacTh(UINT32 u4Plane, UINT32 u4Value);
EXTERN INT32 _OSD_PLA_SetPauseCnt(UINT32 u4Plane, UINT32 u4Value);
EXTERN INT32 _OSD_PLA_SetContReqLmt0(UINT32 u4Plane, UINT32 u4Value);
EXTERN INT32 _OSD_PLA_SetBurstDis(UINT32 u4Plane, UINT32 u4Value);
EXTERN INT32 _OSD_PLA_SetShutter(UINT32 u4Plane, UINT32 u4Value);
EXTERN INT32 _OSD_PLA_SetRightHeaderAddr(UINT32 u4Plane, UPTR upValue);
EXTERN INT32 _OSD_PLA_SetMatixEnable(UINT32 u4Plane, UINT32 u4Value);

// plane register get function
EXTERN INT32 _OSD_PLA_GetEnable(UINT32 u4Plane, UINT32 *pu4Value);
EXTERN INT32 _OSD_PLA_GetFakeHdr(UINT32 u4Plane, UINT32 *pu4Value);
EXTERN INT32 _OSD_PLA_GetPrngEn(UINT32 u4Plane, UINT32 *pu4Value);
//EXTERN INT32 _OSD_PLA_GetDecEn(UINT32 u4Plane, UINT32 *pu4Value);
//EXTERN INT32 _OSD_PLA_GetAlphaMod(UINT32 u4Plane, UINT32 *pu4Value);
EXTERN INT32 _OSD_PLA_GetHFilter(UINT32 u4Plane, UINT32 *pu4Value);
EXTERN INT32 _OSD_PLA_GetVFilter(UINT32 u4Plane, UINT32 *pu4Value);
EXTERN INT32 _OSD_PLA_GetBlending(UINT32 u4Plane, UINT32 *pu4Value);
EXTERN INT32 _OSD_PLA_GetHeaderAddr(UINT32 u4Plane, UPTR *pupValue);
EXTERN INT32 _OSD_PLA_GetFading(UINT32 u4Plane, UINT32 *pu4Value);
EXTERN INT32 _OSD_PLA_GetLSB10Bit(UINT32 u4Plane, UINT32 *pu4Value);
EXTERN INT32 _OSD_PLA_GetContReqLmt(UINT32 u4Plane, UINT32 *pu4Value);
EXTERN INT32 _OSD_PLA_GetFifoSize(UINT32 u4Plane, UINT32 *pu4Value);
//EXTERN INT32 _OSD_PLA_GetVacTh16(UINT32 u4Plane, UINT32 *pu4Value);
//EXTERN INT32 _OSD_PLA_GetVacTh4(UINT32 u4Plane, UINT32 *pu4Value);
EXTERN INT32 _OSD_PLA_GetVacTh(UINT32 u4Plane, UINT32 *pu4Value);
EXTERN INT32 _OSD_PLA_GetPauseCnt(UINT32 u4Plane, UINT32 *pu4Value);
EXTERN INT32 _OSD_PLA_GetContReqLmt0(UINT32 u4Plane, UINT32 *pu4Value);
EXTERN INT32 _OSD_PLA_GetBurstDis(UINT32 u4Plane, UINT32 *pu4Value);
EXTERN INT32 _OSD_PLA_GetShutter(UINT32 u4Plane, UINT32 *pu4Value);
EXTERN INT32 _OSD_PLA_GetRightHeaderAddr(UINT32 u4Plane, UPTR *pupValue);
EXTERN INT32 _OSD_PLA_SetFastMute(UINT32 u4Plane, UINT32  u4Value);
EXTERN INT32 _OSD_PLA_GetFastMute(UINT32 u4Plane, UINT32 *pu4Value);
EXTERN INT32 _OSD_PLA_GetMatixEnable(UINT32 u4Plane, UINT32 *pu4Value);

EXTERN INT32 _OSD_PLA_SetNewFastMute(UINT32 u4Plane, UINT32 u4Value);
EXTERN INT32 _OSD_PLA_GetNewFastMute(UINT32 u4Plane, UINT32 *pu4Value);
EXTERN INT32 _OSD_PLA_SetEnHdrIrq(UINT32 u4Plane, UINT32 u4Value);
EXTERN INT32 _OSD_PLA_GetEnHdrIrq(UINT32 u4Plane, UINT32 *pu4Value);
EXTERN INT32 _OSD_PLA_SetClrHdrIrq(UINT32 u4Plane, UINT32 u4Value);
EXTERN INT32 _OSD_PLA_GetHdrIrqStatus(UINT32 u4Plane, UINT32 *pu4Value);

//-----------------------------------------------------------------------------
// scaler register relative functions
//-----------------------------------------------------------------------------
// scaler regitser get and set function
EXTERN INT32 _OSD_SC_ResetCacheRegs(UINT32 u4Scaler);
EXTERN INT32 _OSD_SC_UpdateHwReg(UINT32 u4Scaler);
// scaler register set function
EXTERN INT32 _OSD_SC_SetVuscEn(UINT32 u4Scaler, UINT32 u4Value);
EXTERN INT32 _OSD_SC_SetVdscEn(UINT32 u4Scaler, UINT32 u4Value);
EXTERN INT32 _OSD_SC_SetHuscEn(UINT32 u4Scaler, UINT32 u4Value);
EXTERN INT32 _OSD_SC_SetHdscEn(UINT32 u4Scaler, UINT32 u4Value);
EXTERN INT32 _OSD_SC_SetScLpfEn(UINT32 u4Scaler, UINT32 u4Value);
EXTERN INT32 _OSD_SC_SetScEn(UINT32 u4Scaler, UINT32 u4Value);
EXTERN INT32 _OSD_SC_SetScPtEn(UINT32 u4Scaler, UINT32 u4Value);
EXTERN INT32 _OSD_SC_SetSrcVSize(UINT32 u4Scaler, UINT32 u4Value);
EXTERN INT32 _OSD_SC_SetSrcHSize(UINT32 u4Scaler, UINT32 u4Value);
EXTERN INT32 _OSD_SC_SetDstVSize(UINT32 u4Scaler, UINT32 u4Value);
EXTERN INT32 _OSD_SC_SetDstHSize(UINT32 u4Scaler, UINT32 u4Value);
EXTERN INT32 _OSD_SC_SetVscHSize(UINT32 u4Scaler, UINT32 u4Value);
EXTERN INT32 _OSD_SC_SetHdscStep(UINT32 u4Scaler, UINT32 u4Value);
EXTERN INT32 _OSD_SC_SetHdscOfst(UINT32 u4Scaler, UINT32 u4Value);
EXTERN INT32 _OSD_SC_SetHuscStep(UINT32 u4Scaler, UINT32 u4Value);
EXTERN INT32 _OSD_SC_SetHuscOfst(UINT32 u4Scaler, UINT32 u4Value);
EXTERN INT32 _OSD_SC_SetVscOfstTop(UINT32 u4Scaler, UINT32 u4Value);
EXTERN INT32 _OSD_SC_SetVscOfstBot(UINT32 u4Scaler, UINT32 u4Value);
EXTERN INT32 _OSD_SC_SetVscStep(UINT32 u4Scaler, UINT32 u4Value);
EXTERN INT32 _OSD_SC_SetAlphaCountEn(UINT32 u4Scaler, UINT32 u4Value);
EXTERN INT32 _OSD_SC_SetScLpfC1(UINT32 u4Scaler, UINT32 u4Value);
EXTERN INT32 _OSD_SC_SetScLpfC2(UINT32 u4Scaler, UINT32 u4Value);
EXTERN INT32 _OSD_SC_SetScLpfC3(UINT32 u4Scaler, UINT32 u4Value);
EXTERN INT32 _OSD_SC_SetAEdgeDetTh(UINT32 u4Scaler, UINT32 u4Value);
EXTERN INT32 _OSD_SC_SetAEdgeDetEnNear(UINT32 u4Scaler, UINT32 u4Value);
EXTERN INT32 _OSD_SC_SetAEdgeDetEnSetRGB(UINT32 u4Scaler, UINT32 u4Value);

// scaler register get function
EXTERN INT32 _OSD_SC_GetVuscEn(UINT32 u4Scaler, UINT32 *pu4Value);
EXTERN INT32 _OSD_SC_GetVdscEn(UINT32 u4Scaler, UINT32 *pu4Value);
EXTERN INT32 _OSD_SC_GetHuscEn(UINT32 u4Scaler, UINT32 *pu4Value);
EXTERN INT32 _OSD_SC_GetHdscEn(UINT32 u4Scaler, UINT32 *pu4Value);
EXTERN INT32 _OSD_SC_GetScLpfEn(UINT32 u4Scaler, UINT32 *pu4Value);
EXTERN INT32 _OSD_SC_GetScEn(UINT32 u4Scaler, UINT32 *pu4Value);
EXTERN INT32 _OSD_SC_GetScPtEn(UINT32 u4Scaler, UINT32 *pu4Value);
EXTERN INT32 _OSD_SC_GetSrcVSize(UINT32 u4Scaler, UINT32 *pu4Value);
EXTERN INT32 _OSD_SC_GetSrcHSize(UINT32 u4Scaler, UINT32 *pu4Value);
EXTERN INT32 _OSD_SC_GetDstVSize(UINT32 u4Scaler, UINT32 *pu4Value);
EXTERN INT32 _OSD_SC_GetDstHSize(UINT32 u4Scaler, UINT32 *pu4Value);
EXTERN INT32 _OSD_SC_GetVscHSize(UINT32 u4Scaler, UINT32 *pu4Value);
EXTERN INT32 _OSD_SC_GetHdscStep(UINT32 u4Scaler, UINT32 *pu4Value);
EXTERN INT32 _OSD_SC_GetHdscOfst(UINT32 u4Scaler, UINT32 *pu4Value);
EXTERN INT32 _OSD_SC_GetHuscStep(UINT32 u4Scaler, UINT32 *pu4Value);
EXTERN INT32 _OSD_SC_GetHuscOfst(UINT32 u4Scaler, UINT32 *pu4Value);
EXTERN INT32 _OSD_SC_GetVscOfstTop(UINT32 u4Scaler, UINT32 *pu4Value);
EXTERN INT32 _OSD_SC_GetVscOfstBot(UINT32 u4Scaler, UINT32 *pu4Value);
EXTERN INT32 _OSD_SC_GetVscStep(UINT32 u4Scaler, UINT32 *pu4Value);
EXTERN INT32 _OSD_SC_GetScLpfC1(UINT32 u4Scaler, UINT32 *pu4Value);
EXTERN INT32 _OSD_SC_GetScLpfC2(UINT32 u4Scaler, UINT32 *pu4Value);
EXTERN INT32 _OSD_SC_GetScLpfC3(UINT32 u4Scaler, UINT32 *pu4Value);
EXTERN INT32 _OSD_SC_GetAEdgeDetTh(UINT32 u4Scaler, UINT32 *pu4Value);
EXTERN INT32 _OSD_SC_GetAEdgeDetEnNear(UINT32 u4Scaler, UINT32 *pu4Value);
EXTERN INT32 _OSD_SC_GetAEdgeDetEnSetRGB(UINT32 u4Scaler, UINT32 *pu4Value);


//-----------------------------------------------------------------------------
// cursor register relative functions
//-----------------------------------------------------------------------------
// cursor
#ifdef LEGACY_CURSOR_SUPPORT
EXTERN void _OSD_CSR_InitHwReg(void);
EXTERN INT32 _OSD_CSR_GetReg(UINT32 *pOsdCursorReg);
EXTERN INT32 _OSD_CSR_SetReg(const UINT32 *pOsdCursorReg);
EXTERN INT32 _OSD_CSR_UpdateHwReg(void);

EXTERN INT32 _OSD_CSR_SetVStart(UINT32 u4Value);
EXTERN INT32 _OSD_CSR_SetHStart(UINT32 u4Value);
EXTERN INT32 _OSD_CSR_SetV2x(UINT32 u4Value);
EXTERN INT32 _OSD_CSR_SetH2x(UINT32 u4Value);
EXTERN INT32 _OSD_CSR_SetV4Bit(UINT32 u4Value);
EXTERN INT32 _OSD_CSR_SetH4Bit(UINT32 u4Value);
EXTERN INT32 _OSD_CSR_SetEn(UINT32 u4Value);
EXTERN void _OSD_CSR_SetColor(UINT32 u4Index, UINT32 u4Value);

#ifdef OSD_CSR_H_ACTIVE_SUPPORT
EXTERN void _OSD_CSR_SetHActive(UINT32 u4Value);
#endif
EXTERN INT32 _OSD_CSR_GetVStart(UINT32 *pu4Value);
EXTERN INT32 _OSD_CSR_GetHStart(UINT32 *pu4Value);
EXTERN INT32 _OSD_CSR_GetV2x(UINT32 *pu4Value);
EXTERN INT32 _OSD_CSR_GetH2x(UINT32 *pu4Value);
EXTERN INT32 _OSD_CSR_GetEn(UINT32 *pu4Value);
EXTERN INT32 _OSD_CSR_GetH4Bit(UINT32 *pu4Value);
EXTERN INT32 _OSD_CSR_GetV4Bit(UINT32 *pu4Value);
EXTERN UINT32 _OSD_CSR_GetColor(UINT32 u4Index);
#endif

//-----------------------------------------------------------------------------
// region register relative functions
//-----------------------------------------------------------------------------
EXTERN void _OSD_RGN_InitApi(void);

// region register set function
EXTERN INT32 _OSD_RGN_SetNextRegion(UINT32 u4Region, UPTR upValue);
EXTERN INT32 _OSD_RGN_SetNextEnable(UINT32 u4Region, UINT32 u4Value);
EXTERN INT32 _OSD_RGN_SetColorMode(UINT32 u4Region, UINT32 u4Value);
EXTERN INT32 _OSD_RGN_SetDataAddr(UINT32 u4Region, UPTR u4Value);
EXTERN INT32 _OSD_RGN_SetAlpha(UINT32 u4Region, UINT32 u4Value);
EXTERN INT32 _OSD_RGN_SetHClip(UINT32 u4Region, UINT32 u4Value);
EXTERN INT32 _OSD_RGN_SetVClip(UINT32 u4Region, UINT32 u4Value);
EXTERN INT32 _OSD_RGN_SetVbSel(UINT32 u4Region, UINT32 u4Value);
EXTERN INT32 _OSD_RGN_SetUgSel(UINT32 u4Region, UINT32 u4Value);
EXTERN INT32 _OSD_RGN_SetYrSel(UINT32 u4Region, UINT32 u4Value);
EXTERN INT32 _OSD_RGN_SetASel(UINT32 u4Region, UINT32 u4Value);
EXTERN INT32 _OSD_RGN_SetOsd10BitEn(UINT32 u4Region, UINT32 u4Value);
EXTERN INT32 _OSD_RGN_SetPaletteAddr(UINT32 u4Region, UPTR u4Value);
EXTERN INT32 _OSD_RGN_SetPaletteLen(UINT32 u4Region, UINT32 u4Value);
EXTERN INT32 _OSD_RGN_SetLoadPalette(UINT32 u4Region, UINT32 u4Value);
EXTERN INT32 _OSD_RGN_SetInputWidth(UINT32 u4Region, UINT32 u4Value);
EXTERN INT32 _OSD_RGN_SetInputHeight(UINT32 u4Region, UINT32 u4Value);
EXTERN INT32 _OSD_RGN_SetLineSize(UINT32 u4Region, UINT32 u4Value);
EXTERN INT32 _OSD_RGN_SetHStep(UINT32 u4Region, UINT32 u4Value);
EXTERN INT32 _OSD_RGN_SetVStep(UINT32 u4Region, UINT32 u4Value);
EXTERN INT32 _OSD_RGN_SetOutputHeight(UINT32 u4Region, UINT32 u4Value);
EXTERN INT32 _OSD_RGN_SetOutputPosY(UINT32 u4Region, UINT32 u4Value);
EXTERN INT32 _OSD_RGN_SetOutputWidth(UINT32 u4Region, UINT32 u4Value);
EXTERN INT32 _OSD_RGN_SetOutputPosX(UINT32 u4Region, UINT32 u4Value);
EXTERN INT32 _OSD_RGN_SetColorKeyEnable(UINT32 u4Region, UINT32 u4Value);
EXTERN INT32 _OSD_RGN_SetColorKey(UINT32 u4Region, UINT32 u4Value);
EXTERN INT32 _OSD_RGN_SetFrameMode(UINT32 u4Region, UINT32 u4Value);
EXTERN INT32 _OSD_RGN_SetBlendMode(UINT32 u4Region, UINT32 u4Value);
EXTERN INT32 _OSD_RGN_SetHMirror(UINT32 u4Region, UINT32 u4Value);
EXTERN INT32 _OSD_RGN_SetVFlip(UINT32 u4Region, UINT32 u4Value);
EXTERN INT32 _OSD_RGN_SetDecMode(UINT32 u4Region, UINT32 u4Value);
EXTERN INT32 _OSD_RGN_SetDecLine(UINT32 u4Region, UINT32 u4Value);
EXTERN INT32 _OSD_RGN_SetDecEn(UINT32 u4Region, UINT32 u4Value);

// region register get function
EXTERN INT32 _OSD_RGN_GetNextRegion(UINT32 u4Region, UPTR *pupValue);
EXTERN INT32 _OSD_RGN_GetNextEnable(UINT32 u4Region, UINT32 *pu4Value);
EXTERN INT32 _OSD_RGN_GetColorMode(UINT32 u4Region, UINT32 *pu4Value);
EXTERN INT32 _OSD_RGN_GetDataAddr(UINT32 u4Region, UPTR *pupValue);
EXTERN INT32 _OSD_RGN_GetAlpha(UINT32 u4Region, UINT32 *pu4Value);
EXTERN INT32 _OSD_RGN_GetHClip(UINT32 u4Region, UINT32 *pu4Value);
EXTERN INT32 _OSD_RGN_GetVClip(UINT32 u4Region, UINT32 *pu4Value);
EXTERN INT32 _OSD_RGN_GetVbSel(UINT32 u4Region, UINT32 *pu4Value);
EXTERN INT32 _OSD_RGN_GetUgSel(UINT32 u4Region, UINT32 *pu4Value);
EXTERN INT32 _OSD_RGN_GetYrSel(UINT32 u4Region, UINT32 *pu4Value);
EXTERN INT32 _OSD_RGN_GetASel(UINT32 u4Region, UINT32 *pu4Value);
EXTERN INT32 _OSD_RGN_GetOsd10BitEn(UINT32 u4Region, UINT32 *pu4Value);
EXTERN INT32 _OSD_RGN_GetPaletteAddr(UINT32 u4Region, UPTR *pupValue);
EXTERN INT32 _OSD_RGN_GetPaletteLen(UINT32 u4Region, UINT32 *pu4Value);
EXTERN INT32 _OSD_RGN_GetLoadPalette(UINT32 u4Region, UINT32 *pu4Value);
EXTERN INT32 _OSD_RGN_GetInputWidth(UINT32 u4Region, UINT32 *pu4Value);
EXTERN INT32 _OSD_RGN_GetInputHeight(UINT32 u4Region, UINT32 *pu4Value);
EXTERN INT32 _OSD_RGN_GetLineSize(UINT32 u4Region, UINT32 *pu4Value);
EXTERN INT32 _OSD_RGN_GetHStep(UINT32 u4Region, UINT32 *pu4Value);
EXTERN INT32 _OSD_RGN_GetVStep(UINT32 u4Region, UINT32 *pu4Value);
EXTERN INT32 _OSD_RGN_GetOutputHeight(UINT32 u4Region, UINT32 *pu4Value);
EXTERN INT32 _OSD_RGN_GetOutputPosY(UINT32 u4Region, UINT32 *pu4Value);
EXTERN INT32 _OSD_RGN_GetOutputWidth(UINT32 u4Region, UINT32 *pu4Value);
EXTERN INT32 _OSD_RGN_GetOutputPosX(UINT32 u4Region, UINT32 *pu4Value);
EXTERN INT32 _OSD_RGN_GetColorKeyEnable(UINT32 u4Region, UINT32 *pu4Value);
EXTERN INT32 _OSD_RGN_GetColorKey(UINT32 u4Region, UINT32 *pu4Value);
EXTERN INT32 _OSD_RGN_GetFrameMode(UINT32 u4Region, UINT32 *pu4Value);
EXTERN INT32 _OSD_RGN_GetAutoMode(UINT32 u4Region, UINT32 *pu4Value);
EXTERN INT32 _OSD_RGN_GetTopField(UINT32 u4Region, UINT32 *pu4Value);
EXTERN INT32 _OSD_RGN_GetBlendMode(UINT32 u4Region, UINT32 *pu4Value);
EXTERN INT32 _OSD_RGN_GetHMirror(UINT32 u4Region, UINT32 *pu4Value);
EXTERN INT32 _OSD_RGN_GetVFlip(UINT32 u4Region, UINT32 *pu4Value);
EXTERN INT32 _OSD_RGN_GetDecMode(UINT32 u4Region, UINT32 *pu4Value);
EXTERN INT32 _OSD_RGN_GetDecLine(UINT32 u4Region, UINT32 *pu4Value);
EXTERN INT32 _OSD_RGN_GetDecEn(UINT32 u4Region, UINT32 *pu4Value);
// 539x
EXTERN INT32 _OSD_RGN_GetHpxExt(UINT32 u4Region, UINT32 *pu4Value);
EXTERN INT32 _OSD_RGN_GetVIntpMode(UINT32 u4Region, UINT32 *pu4Value);
EXTERN INT32 _OSD_RGN_GetEndian(UINT32 u4Region, UINT32 *pu4Value);
EXTERN INT32 _OSD_RGN_GetHIntMode(UINT32 u4Region, UINT32 *pu4Value);
EXTERN INT32 _OSD_RGN_GetVStepOffset(UINT32 u4Region, UINT32 *pu4Value);
EXTERN INT32 _OSD_RGN_GetHStepOffset(UINT32 u4Region, UINT32 *pu4Value);

// utility function for region list maintain
EXTERN INT32 _OSD_RGN_GetHandle(UPTR u4Addr, UINT32 *pu4OsdRegion);
EXTERN INT32 _OSD_RGN_GetAddress(UINT32 u4Region, UPTR *pupAddr);
EXTERN INT32 _OSD_RGN_AttachTail(UINT32 u4List, INT32 i4Attachment);
EXTERN INT32 _OSD_RGN_SetAlloc(UINT32 u4Region, UINT32 fgStatus);
EXTERN INT32 _OSD_RGN_GetAlloc(UINT32 u4Region, UINT32 *pfgStatus);
EXTERN INT32 _OSD_RGN_Alloc(UINT32 *pu4OsdRegion);
EXTERN INT32 _OSD_RGN_Reset(UINT32 u4Region);
EXTERN INT32 _OSD_RGN_Free(UINT32 u4Region);
EXTERN INT32 _OSD_RGN_FreeList(UINT32 u4List);

EXTERN INT32 _OSD_RGN_AllFlipMirrorMode(void);

EXTERN INT32 _OSD_RGN_Copy(UINT32 u4DstRgn, UINT32 u4SrcRgn);
EXTERN INT32 _OSD_InitFRCHeader(void);
EXTERN INT32 _OSD_COPY_FRCHeader(UPTR u4DstAddr);

EXTERN INT32 _OSD_FRCHeader_SetFormat(UINT32 u4Value);
EXTERN INT32 _OSD_FRCHeader_SetPixOrder(UINT32 u4Value);
EXTERN INT32 _OSD_FRCHeader_SetLRindex(UINT32 u4Value);
EXTERN INT32 _OSD_FRCHeader_SetBmpindex(UINT32 u4Value);
EXTERN INT32 _OSD_FRCHeader_SetFramenum(UINT32 u4Value);
EXTERN INT32 _OSD_FRCHeader_SetPrefix(UINT32 u4Value);
EXTERN INT32 _OSD_FRCHeader_SetBmpHeight(UINT32 u4Value);
EXTERN INT32 _OSD_FRCHeader_SetBmpWidth(UINT32 u4Value);
EXTERN INT32 _OSD_FRCHeader_SetGlobalAlpha(UINT32 u4Value);
EXTERN INT32 _OSD_FRCHeader_SetPixelAlphaEn(UINT32 u4Value);
EXTERN INT32 _OSD_FRCHeader_SetGlobalAlphaEn(UINT32 u4Value);
EXTERN INT32 _OSD_FRCHeader_SetOsdUpper(UINT32 u4Value);
EXTERN INT32 _OSD_FRCHeader_SetDispYOFF(UINT32 u4Value);
EXTERN INT32 _OSD_FRCHeader_SetDispXOFF(UINT32 u4Value);
EXTERN INT32 _OSD_FRCHeader_SetDispHeight(UINT32 u4Value);
EXTERN INT32 _OSD_FRCHeader_SetDispWidth(UINT32 u4Value);

EXTERN INT32 _OSD_FRCHeader_GetFormat(UINT32 *u4Value);
EXTERN INT32 _OSD_FRCHeader_GetPixOrder(UINT32 *u4Value);
EXTERN INT32 _OSD_FRCHeader_GetLRindex(UINT32 *u4Value);
EXTERN INT32 _OSD_FRCHeader_GetBmpindex(UINT32 *u4Value);
EXTERN INT32 _OSD_FRCHeader_GetFramenum(UINT32 *u4Value);
EXTERN INT32 _OSD_FRCHeader_GetPrefix(UINT32 *u4Value);
EXTERN INT32 _OSD_FRCHeader_GetBmpHeight(UINT32 *u4Value);
EXTERN INT32 _OSD_FRCHeader_GetBmpWidth(UINT32 *u4Value);
EXTERN INT32 _OSD_FRCHeader_GetGlobalAlpha(UINT32 *u4Value);
EXTERN INT32 _OSD_FRCHeader_GetPixelAlphaEn(UINT32 *u4Value);
EXTERN INT32 _OSD_FRCHeader_GetGlobalAlphaEn(UINT32 *u4Value);
EXTERN INT32 _OSD_FRCHeader_GetOsdUpper(UINT32 *u4Value);
EXTERN INT32 _OSD_FRCHeader_GetDispYOFF(UINT32 *u4Value);
EXTERN INT32 _OSD_FRCHeader_GetDispXOFF(UINT32 *u4Value);
EXTERN INT32 _OSD_FRCHeader_GetDispHeight(UINT32 *u4Value);
EXTERN INT32 _OSD_FRCHeader_GetDispWidth(UINT32 *u4Value);
EXTERN INT32 _OSD_PLA_SetPremulEn(UINT32 u4Plane, UINT32 u4Value);
EXTERN INT32 _OSD_PLA_GetPremulEn(UINT32 u4Plane, UINT32 *pu4Value);
EXTERN INT32 _OSD_PLA_SetEnHwRstDec(UINT32 u4Plane, UINT32 u4Value);
EXTERN INT32 _OSD_PLA_GetEnHwRstDec(UINT32 u4Plane, UINT32 *pu4Value);
EXTERN INT32 _OSD_PLA_SetFSMProtDis(UINT32 u4Plane, UINT32 u4Value);
EXTERN INT32 _OSD_PLA_GetFSMProtDis(UINT32 u4Plane, UINT32 *pu4Value);

#if defined(CC_MT5891) || defined(CC_MT5886) || defined(CC_MT5863) || defined(CC_MT5893) || defined(CC_MT5895)
EXTERN void _OSD_Base_Init_Reg(void);
EXTERN void _OSD_PLA_InitHwReg(void);
EXTERN void _OSD_SC_InitHwReg(void);
#if defined(CC_MT5886) || defined(CC_MT5863)
EXTERN void _OSD_MMU_Init_Reg(void);
#endif
#endif

#ifdef CC_MT5886
EXTERN INT32 _OSD_MMU_GetIOMMUEnable(UINT32 *pu4Value);
EXTERN INT32 _OSD_MMU_SetIOMMUEnable(UINT32 u4Value);
EXTERN INT32 _OSD_MMU_GetTTB(UINT32 *pu4Value);
EXTERN INT32 _OSD_MMU_SetTTB(UINT32 u4Value);
EXTERN INT32 _OSD_MMU_GetA0MMUEnable(UINT32 *pu4Value);
EXTERN INT32 _OSD_MMU_SetA0MMUEnable(UINT32 u4Value);
EXTERN INT32 _OSD_MMU_GetA1MMUEnable(UINT32 *pu4Value);
EXTERN INT32 _OSD_MMU_SetA1MMUEnable(UINT32 u4Value);
EXTERN INT32 _OSD_MMU_GetA2MMUEnable(UINT32 *pu4Value);
EXTERN INT32 _OSD_MMU_SetA2MMUEnable(UINT32 u4Value);
EXTERN INT32 _OSD_MMU_GetA0MID(UINT32 *pu4Value);
EXTERN INT32 _OSD_MMU_SetA0MID(UINT32 u4Value);
EXTERN INT32 _OSD_MMU_GetA1MID(UINT32 *pu4Value);
EXTERN INT32 _OSD_MMU_SetA1MID(UINT32 u4Value);
EXTERN INT32 _OSD_MMU_GetA2MID(UINT32 *pu4Value);
EXTERN INT32 _OSD_MMU_SetA2MID(UINT32 u4Value);
EXTERN INT32 _OSD_MMU_GetA0Prefetch(UINT32 *pu4Value);
EXTERN INT32 _OSD_MMU_SetA0Prefetch(UINT32 u4Value);
EXTERN INT32 _OSD_MMU_GetA1Prefetch(UINT32 *pu4Value);
EXTERN INT32 _OSD_MMU_SetA1Prefetch(UINT32 u4Value);
EXTERN INT32 _OSD_MMU_GetA2Prefetch(UINT32 *pu4Value);
EXTERN INT32 _OSD_MMU_SetA2Prefetch(UINT32 u4Value);
EXTERN INT32 _OSD_MMU_GetA02DPrefetch(UINT32 *pu4Value);
EXTERN INT32 _OSD_MMU_SetA02DPrefetch(UINT32 u4Value);
EXTERN INT32 _OSD_MMU_GetA12DPrefetch(UINT32 *pu4Value);
EXTERN INT32 _OSD_MMU_SetA12DPrefetch(UINT32 u4Value);
EXTERN INT32 _OSD_MMU_GetA22DPrefetch(UINT32 *pu4Value);
EXTERN INT32 _OSD_MMU_SetA22DPrefetch(UINT32 u4Value);
EXTERN INT32 _OSD_MMU_GetA0PrefetchDir(UINT32 *pu4Value);
EXTERN INT32 _OSD_MMU_SetA0PrefetchDir(UINT32 u4Value);
EXTERN INT32 _OSD_MMU_GetA1PrefetchDir(UINT32 *pu4Value);
EXTERN INT32 _OSD_MMU_SetA1PrefetchDir(UINT32 u4Value);
EXTERN INT32 _OSD_MMU_GetA2PrefetchDir(UINT32 *pu4Value);
EXTERN INT32 _OSD_MMU_SetA2PrefetchDir(UINT32 u4Value);
EXTERN INT32 _OSD_MMU_Get1MTableIntEnable(UINT32 *pu4Value);
EXTERN INT32 _OSD_MMU_Set1MTableIntEnable(UINT32 u4Value);
EXTERN INT32 _OSD_MMU_Get4KTableIntEnable(UINT32 *pu4Value);
EXTERN INT32 _OSD_MMU_Set4KTableIntEnable(UINT32 u4Value);
EXTERN INT32 _OSD_MMU_Get1MTableIntClear(UINT32 *pu4Value);
EXTERN INT32 _OSD_MMU_Set1MTableIntClear(UINT32 u4Value);
EXTERN INT32 _OSD_MMU_Get4KTableIntClear(UINT32 *pu4Value);
EXTERN INT32 _OSD_MMU_Set4KTableIntClear(UINT32 u4Value);
#endif

#ifdef CC_MT5863
EXTERN INT32 _OSD_MMU_GetIOMMUEnable(UINT32 u4Plane, UINT32 *pu4Value);
EXTERN INT32 _OSD_MMU_SetIOMMUEnable(UINT32 u4Plane, UINT32 u4Value);
EXTERN INT32 _OSD_MMU_GetTTB(UINT32 u4Plane, UINT32 *pu4Value);
EXTERN INT32 _OSD_MMU_SetTTB(UINT32 u4Plane, UINT32 u4Value);
EXTERN INT32 _OSD_MMU_GetMMUMode(UINT32 u4Plane, UINT32 *pu4Value);
EXTERN INT32 _OSD_MMU_SetMMUMode(UINT32 u4Plane, UINT32 u4Value);
EXTERN INT32 _OSD_MMU_GetA0MMUEnable(UINT32 u4Plane, UINT32 *pu4Value);
EXTERN INT32 _OSD_MMU_SetA0MMUEnable(UINT32 u4Plane, UINT32 u4Value);
EXTERN INT32 _OSD_MMU_GetA0Prefetch(UINT32 u4Plane, UINT32 *pu4Value);
EXTERN INT32 _OSD_MMU_SetA0Prefetch(UINT32 u4Plane, UINT32 u4Value);
EXTERN INT32 _OSD_MMU_GetA02DPrefetch(UINT32 u4Plane, UINT32 *pu4Value);
EXTERN INT32 _OSD_MMU_SetA02DPrefetch(UINT32 u4Plane, UINT32 u4Value);
EXTERN INT32 _OSD_MMU_GetA0PrefetchDir(UINT32 u4Plane, UINT32 *pu4Value);
EXTERN INT32 _OSD_MMU_SetA0PrefetchDir(UINT32 u4Plane, UINT32 u4Value);
EXTERN INT32 _OSD_MMU_Get1GTableIntEnable(UINT32 u4Plane, UINT32 *pu4Value);
EXTERN INT32 _OSD_MMU_Set1GTableIntEnable(UINT32 u4Plane, UINT32 u4Value);
EXTERN INT32 _OSD_MMU_Get1MTableIntEnable(UINT32 u4Plane, UINT32 *pu4Value);
EXTERN INT32 _OSD_MMU_Set1MTableIntEnable(UINT32 u4Plane, UINT32 u4Value);
EXTERN INT32 _OSD_MMU_Get4KTableIntEnable(UINT32 u4Plane, UINT32 *pu4Value);
EXTERN INT32 _OSD_MMU_Set4KTableIntEnable(UINT32 u4Plane, UINT32 u4Value);
EXTERN INT32 _OSD_MMU_Get1GTableIntClear(UINT32 u4Plane, UINT32 *pu4Value);
EXTERN INT32 _OSD_MMU_Set1GTableIntClear(UINT32 u4Plane, UINT32 u4Value);
EXTERN INT32 _OSD_MMU_Get1MTableIntClear(UINT32 u4Plane, UINT32 *pu4Value);
EXTERN INT32 _OSD_MMU_Set1MTableIntClear(UINT32 u4Plane, UINT32 u4Value);
EXTERN INT32 _OSD_MMU_Get4KTableIntClear(UINT32 u4Plane, UINT32 *pu4Value);
EXTERN INT32 _OSD_MMU_Set4KTableIntClear(UINT32 u4Plane, UINT32 u4Value);
#endif

#endif //OSD_HW_H
