/* Get the end address of the specified DMC chip.  */
uint32_t EXMC_DMC_GetChipEndAddr(uint32_t u32Chip)
/* Get the end address of the specified DMC chip.  */
uint32_t EXMC_DMC_GetChipEndAddr(uint32_t u32Chip)
{
    uint32_t u32Mask;
    uint32_t u32Match;
    __IO uint32_t *DMC_CSCRx;
    DDL_ASSERT(IS_EXMC_DMC_CHIP(u32Chip));
    DMC_CSCRx = EXMC_DMC_CSCRx(u32Chip);
    u32Mask = (READ_REG32_BIT(*DMC_CSCRx, DMC_CSCR_ADDMSK) >> DMC_CSCR_ADDMSK_POS);
    u32Match = (READ_REG32_BIT(*DMC_CSCRx, DMC_CSCR_ADDMAT) >> DMC_CSCR_ADDMAT_POS);
    return EXMC_DMC_MAP_ADDR(u32Match, u32Mask);
}