/* 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: chi.yu $
 * $Date: 2015/06/11 $
 * $RCSfile: dmx_pcr_reg.h,v $
 * $Revision: #1 $
 *
 *---------------------------------------------------------------------------*/

/** @file dmx_pcr_reg.h
 *  This header file declares register map of dmx pcr.
 */


#ifndef _DMX_PCR_REG_H_
#define _DMX_PCR_REG_H_

/*
hd and sd share the register defines from 0 to 0x60
*/

#define DMX_HD_BASE 0x0
#define DMX_SD_BASE 0x50

#define DMX_PCRCR (0x208)
    #define PWM_FORMAT Fld(4,28,AC_MSKB3)//[31:28]
    #define PWM_BITS Fld(4,24,AC_MSKB3)//[27:24]
    #define PWM_SHIFT Fld(8,16,AC_FULLB2)//[23:16]
    #define YN_SHIFT Fld(8,8,AC_FULLB1)//[15:8]
    #define PP_INT_EN Fld(1,3,AC_MSKB0)//[3:3]
    #define PC_INTDIS Fld(1,2,AC_MSKB0)//[2:2]
    #define NEW_PCR Fld(1,1,AC_MSKB0)//[1:1]
    #define AUTO_LD Fld(1,0,AC_MSKB0)//[0:0]
#define DMX_PCRETR (0x20c)
#define DMX_PCRFCR1 (0x210)
#define DMX_PCRFCR2 (0x214)
#define DMX_PCRFCR3 (0x218)
#define DMX_PCRFCR4 (0x21c)
#define DMX_PCRBSER (0x220)
    #define PCR_BSH Fld(1,31,AC_MSKB3)//[31:31]
    #define PCR_EXT Fld(8,0,AC_FULLB0)//[7:0]
#define DMX_PCRBSR (0x224)
#define DMX_STCBSER (0x228)
    #define STC_BSH Fld(1,31,AC_MSKB3)//[31:31]
    #define STC_EXT Fld(8,0,AC_FULLB0)//[7:0]
#define DMX_STCBSR (0x22c)
#define DMX_PMSER1 (0x230)
#define DMX_PMSER2 (0x234)
#define DMX_SSTCR1 (0x238)
#define DMX_SSTCR2 (0x23c)
#define DMX_PCRXN1R (0x240)
#define DMX_PCRYN1R (0x244)
#define DMX_PCRYN2R (0x248)
#define DMX_PCRESR (0x2d0)
#define DMX_PCRNER1 (0x2d4)
#define DMX_PCRNER2 (0x2d8)
#define DMX_PCR1ESR (0x2f8)
#define DMX_PCR1NER1 (0x2fc)
#define DMX_PCR1NER2 (0x300)

#define PARSER_HD_BASE 0x0
#define PARSER_SD_BASE 0x69000

#define AUD_STCA (0x1c4)
#define AUD_STCCTL (0x1f4)
    #define HDSPW Fld(1,3,AC_MSKB0)//[3:3]
    #define HSTCA Fld(1,1,AC_MSKB0)//[1:1]
    #define HSTC Fld(1,0,AC_MSKB0)//[0:0]
#endif /*_DMX_PCR_REG_H_*/