/* Must be called with interrupts disabled. Exceptions will be unmasked on return.  */
static void avr32_pm_unmap_sram(void)
/* Must be called with interrupts disabled. Exceptions will be unmasked on return.  */
static void avr32_pm_unmap_sram(void)
{
	u32	mmucr;
	u32	tlbehi;
	u32	tlbarlo;
	mmucr = sysreg_read(MMUCR);
	tlbehi = sysreg_read(TLBEHI);
	sysreg_write(MMUCR, SYSREG_BFINS(DRP, 0, mmucr));
	tlbehi = SYSREG_BF(ASID, SYSREG_BFEXT(ASID, tlbehi));
	sysreg_write(TLBEHI, tlbehi);
	tlbarlo = sysreg_read(TLBARLO);
	sysreg_write(TLBARLO, tlbarlo | 0x80000000U);
	__builtin_tlbw();
	asm volatile("csrf	%0" : : "i"(SYSREG_EM_OFFSET) : "memory");
}