/*****************************************************************************
 函 数 名  : drv_hifi_fill_mb_info
 功能描述  : 填充Hifi邮箱地址信息
 输入参数  : addr
 输出参数  : 无
 返 回 值  : void
 调用函数  :
 被调函数  :

 修改历史      :
  1.日    期   : 2012年8月29日
    作    者   : 刘慈红 lKF71598
    修改内容   : 新生成函数

*****************************************************************************/
void drv_hifi_fill_mb_info(unsigned int* addr)
{
    CARM_HIFI_DYN_ADDR_SHARE_STRU *mb_addr;
    BSP_DDR_SECT_QUERY  ddr_sec_query = {0};
    BSP_DDR_SECT_INFO   ddr_sec_info = {0};

    mb_addr = (CARM_HIFI_DYN_ADDR_SHARE_STRU*)(addr);

    mb_addr->uwProtectWord = HIFI_MB_ADDR_PROTECT;

    mb_addr->stCarmHifiMB.uwProtectWord         = HIFI_MB_ADDR_PROTECT;
    mb_addr->stCarmHifiMB.uwHifi2CarmMailBoxLen = (unsigned long)MAILBOX_QUEUE_SIZE(HIFI, CCPU, MSG);
    mb_addr->stCarmHifiMB.uwCarm2HifiMailBoxLen = (unsigned long)MAILBOX_QUEUE_SIZE(CCPU, HIFI, MSG);
    mb_addr->stCarmHifiMB.uwHifiCarmHeadAddr    = (unsigned long)MAILBOX_HEAD_ADDR(HIFI, CCPU, MSG);
    mb_addr->stCarmHifiMB.uwHifiCarmBodyAddr    = (unsigned long)MAILBOX_QUEUE_ADDR(HIFI, CCPU, MSG);
    mb_addr->stCarmHifiMB.uwCarmHifiHeadAddr    = (unsigned long)MAILBOX_HEAD_ADDR(CCPU, HIFI, MSG);
    mb_addr->stCarmHifiMB.uwCarmHifiBodyAddr    = (unsigned long)MAILBOX_QUEUE_ADDR(CCPU, HIFI, MSG);

    mb_addr->stAarmHifiMB.uwProtectWord         = HIFI_MB_ADDR_PROTECT;
    mb_addr->stAarmHifiMB.uwHifi2AarmMailBoxLen = (unsigned long)MAILBOX_QUEUE_SIZE(HIFI, ACPU, MSG);
    mb_addr->stAarmHifiMB.uwAarm2HifiMailBoxLen = (unsigned long)MAILBOX_QUEUE_SIZE(ACPU, HIFI, MSG);
    mb_addr->stAarmHifiMB.uwHifiAarmHeadAddr    = (unsigned long)MAILBOX_HEAD_ADDR(HIFI, ACPU, MSG);
    mb_addr->stAarmHifiMB.uwHifiAarmBodyAddr    = (unsigned long)MAILBOX_QUEUE_ADDR(HIFI, ACPU, MSG);
    mb_addr->stAarmHifiMB.uwAarmHifiHeadAddr    = (unsigned long)MAILBOX_HEAD_ADDR(ACPU, HIFI, MSG);
    mb_addr->stAarmHifiMB.uwAarmHifiBodyAddr    = (unsigned long)MAILBOX_QUEUE_ADDR(ACPU, HIFI, MSG);

    /*设置nv地址*/
    ddr_sec_query.enSectType = BSP_DDR_SECT_TYPE_NV;
    if (BSP_OK == BSP_DDR_GetSectInfo(&ddr_sec_query, &ddr_sec_info))
    {
        mb_addr->uwNvBaseAddrPhy = (char*)ddr_sec_info.pSectPhysAddr;
        mb_addr->uwNvBaseAddrVirt = (char*)ddr_sec_info.pSectVirtAddr;

        printk("drv_hifi_fill_nv_info:phy addr = %p, virt addr = %p.\n",mb_addr->uwNvBaseAddrPhy, mb_addr->uwNvBaseAddrVirt);
    }
}
};

BSP_MEMADDR_INFO g_stMemInfo[] = {
                {BSP_DDR_TYPE_DDR_GU,               GLOBAL_MEM_GU_RESERVED_ADDR,            GLOBAL_MEM_GU_RESERVED_SIZE},
                {BSP_DDR_TYPE_DDR_TLPHY_IMAGE,      GLOBAL_MEM_LT_IMAGE_ADDR,               GLOBAL_MEM_LT_IMAGE_SIZE},
                /*{BSP_DDR_TYPE_DDR_LPHY_SDR,       NO_USED,                                NO_USED},*/
                {BSP_DDR_TYPE_DDR_TLPHY_LCS,        GLOBAL_MEM_LCS_ADDR,                    GLOBAL_MEM_LCS_SIZE},
                {BSP_DDR_TYPE_DDR_TLPHY_BANDNV,     CORESHARE_MEM_TENCILICA_MULT_BAND_ADDR, CORESHARE_MEM_TENCILICA_MULT_BAND_SIZE},
                {BSP_DDR_TYPE_DDR_TPHY_TABLE,       GLOBAL_MEM_TDS_TABLE_ADDR,              GLOBAL_MEM_TDS_TABLE_SIZE},
                {BSP_DDR_TYPE_DDR_HIFI,             GLOBAL_MEM_HIFI_BASE_ADDR,              GLOBAL_MEM_HIFI_SIZE},
                {BSP_DDR_TYPE_SRAM_TLPHY,           MEMORY_AXI_TDL_ADDR,                    MEMORY_AXI_TDL_SIZE},
                {BSP_DDR_TYPE_SRAM_RTT_SLEEP_FLAG,  SRAM_RTT_SLEEP_FLAG_ADDR,               SRAM_RTT_SLEEP_FLAG_SIZE},
                {BSP_DDR_TYPE_SHM_TEMPERATURE,      MCU_HKADC_DDR_ADDR,                     MCU_HKADC_DDR_SIZE},
                {BSP_DDR_TYPE_SHM_BBE16_HIFI_HEAD,  MAILBOX_HEAD_ADDR(BBE16, HIFI, MSG),    MAILBOX_HEAD_LEN},
                {BSP_DDR_TYPE_SHM_HIFI_BBE16_HEAD,  MAILBOX_HEAD_ADDR(HIFI, BBE16, MSG),    MAILBOX_HEAD_LEN},
                {BSP_DDR_TYPE_SHM_BBE16_HIFI_QUEUE, MAILBOX_QUEUE_ADDR(BBE16, HIFI, MSG),   MAILBOX_QUEUE_SIZE(BBE16, HIFI, MSG)},
                {BSP_DDR_TYPE_SHM_HIFI_BBE16_QUEUE, MAILBOX_QUEUE_ADDR(HIFI, BBE16, MSG),   MAILBOX_QUEUE_SIZE(HIFI, BBE16, MSG)}
                /*{BSP_DDR_TYPE_SHM_TIMESTAMP,      NO_USED,                                NO_USED}*/
};

/* 全局变量,记录中断号 */
BSP_INT_NUM_INFO g_slIntNO[] = {
    {BSP_INT_TYPE_WDT,                      INT_VEC_WDT},
    {BSP_INT_TYPE_IPF_C,                    INT_VEC_IPF_C},
    {BSP_INT_TYPE_IPF_A,                    INT_VEC_IPF_A},
    {BSP_INT_TYPE_SOCP_A,                   INT_VEC_SOCP_A},
    {BSP_INT_TYPE_SOCP_C,                   INT_VEC_SOCP_C},
    {BSP_INT_TYPE_WBBP_BBPMST,              INT_VEC_WBBP_BBPMST_INTR},
    {BSP_INT_TYPE_GBBP,                     INT_VEC_GBBP_GSM1_NODRX_INTR},
    {BSP_INT_TYPE_GBBP_AWAKE,               INT_VEC_GBBP_GSM1_DRX_INTR},
    {BSP_INT_TYPE_WBBP_0MS,                 INT_VEC_WBBP_CARD1_0MS_INTR},
/*****************************************************************************
  2 全局变量定义
*****************************************************************************/

/* 数据表, 以索引号顺序存放各邮箱头及邮箱的首地址和长度, 格式为:
    邮箱0的邮箱头首地址,邮箱首地址,邮箱长度
    邮箱1的邮箱头首地址,邮箱首地址,邮箱长度
    ...
    邮箱n的邮箱头首地址,邮箱首地址,邮箱长度*/
#if (VOS_CPU_TYPE == VOS_HIFI)

VOS_UINT32 g_uwDrvMailboxAddrTbl[DRV_MAILBOX_ID_BUTT][DRV_MAILBOX_INFO_NO] =
{
    {MAILBOX_HEAD_ADDR(HIFI, CCPU, MSG),
     MAILBOX_QUEUE_ADDR(HIFI, CCPU, MSG),
     MAILBOX_QUEUE_SIZE(HIFI, CCPU, MSG)},                    /* HIFI2CCPU */
    {MAILBOX_HEAD_ADDR(CCPU, HIFI, MSG),
     MAILBOX_QUEUE_ADDR(CCPU, HIFI, MSG),
     MAILBOX_QUEUE_SIZE(CCPU, HIFI, MSG)},                    /* CCPU2HIFI */
    {MAILBOX_HEAD_ADDR(HIFI, ACPU, MSG),
     MAILBOX_QUEUE_ADDR(HIFI, ACPU, MSG),
     MAILBOX_QUEUE_SIZE(HIFI, ACPU, MSG)},                    /* HIFI2ACPU */
    {MAILBOX_HEAD_ADDR(ACPU, HIFI, MSG),
     MAILBOX_QUEUE_ADDR(ACPU, HIFI, MSG),
     MAILBOX_QUEUE_SIZE(ACPU, HIFI, MSG)},                    /* ACPU2HIFI */
    {MAILBOX_HEAD_ADDR(HIFI, BBE16, MSG),
     MAILBOX_QUEUE_ADDR(HIFI, BBE16, MSG),
     MAILBOX_QUEUE_SIZE(HIFI, BBE16, MSG)},                   /* HIFI 2 BBE16 */
    {MAILBOX_HEAD_ADDR(BBE16, HIFI, MSG),
     MAILBOX_QUEUE_ADDR(BBE16, HIFI, MSG),