/* Get the end address of the specified SMC chip.  */
uint32_t EXMC_SMC_GetChipEndAddr(uint32_t u32Chip)
/* Get the end address of the specified SMC chip.  */
uint32_t EXMC_SMC_GetChipEndAddr(uint32_t u32Chip)
{
    uint32_t u32Mask;
    uint32_t u32Match;
    DDL_ASSERT(IS_EXMC_SMC_CHIP(u32Chip));
    u32Mask = (READ_REG32_BIT(CM_SMC->CSCR0, SMC_CSCR0_ADDMSKx(u32Chip)) >> SMC_CSCR0_ADDMSKx_POS(u32Chip));
    u32Match = (READ_REG32_BIT(CM_SMC->CSCR1, SMC_CSCR1_ADDMATx(u32Chip)) >> SMC_CSCR1_ADDMATx_POS(u32Chip));
    return (~((u32Match ^ u32Mask) << 24U));
}