/* dsp need to remap addresses for some addr. static struct vaddr_range_t addr_mapping = { {0x10000000, 0x1fffffff, 0x30000000}, {0x30000000, 0x3fffffff, 0x10000000}, };  */
static ptrdiff_t xlate_dsp2mpu(ptrdiff_t a)
/* dsp need to remap addresses for some addr. static struct vaddr_range_t addr_mapping = { {0x10000000, 0x1fffffff, 0x30000000}, {0x30000000, 0x3fffffff, 0x10000000}, };  */
static ptrdiff_t xlate_dsp2mpu(ptrdiff_t a)
{
	const ptrdiff_t BANKSIZE = 0x08000u;
	const ptrdiff_t CELLBASE = 0x10000u;
	const ptrdiff_t CELLSIZE = 16;
	const ptrdiff_t cellbank = (a - CELLBASE) / BANKSIZE;
	const ptrdiff_t cellrow = (a - CELLBASE) % BANKSIZE / CELLSIZE;
	const unsigned cellpos = (a % CELLSIZE);
	if (a < CELLBASE)
		return a;
	return CELLBASE +
			cellbank * BANKSIZE +
			CELLSIZE * ((cellrow % 2) ? (cellrow / 2) + (BANKSIZE / CELLSIZE / 2) : cellrow / 2) +
			cellpos;
}