/* Note: The caller must provide a valid region index.  */
static void region_init(const uint32_t index, const struct pma_region *region_conf)
/* Note: The caller must provide a valid region index.  */
static void region_init(const uint32_t index, const struct pma_region *region_conf)
{
	unsigned long pmaaddr;
	uint8_t pmacfg;
	if (region_conf->size == 4) {
		pmaaddr = NA4_ENCODING(region_conf->start);
		pmacfg = region_conf->attr.pmacfg | PMACFG_ETYPE_NA4;
	} else {
		pmaaddr = NAPOT_ENCODING(region_conf->start, region_conf->size);
		pmacfg = region_conf->attr.pmacfg | PMACFG_ETYPE_NAPOT;
	}
	write_pmaaddr_csr(index, pmaaddr);
	write_pmacfg_entry(index, pmacfg);
}