arm: Add debug function to dump mmu state

* We don't change the data cache (and other) settings.
  Interesting to know their state on each platform.
* Not used by default as it needs called after
  serial-init in u-boot
This commit is contained in:
Alexander von Gluck IV
2015-04-19 20:13:23 -05:00
parent 62d30d9e49
commit f427a82d48
+38
View File
@@ -209,6 +209,44 @@ mmu_write_C1(uint32 value)
}
/*
* Dump current MMU Control Register state
* For debugging, can be added to loader temporarly post-serial-init
*/
void
mmu_dump_C1()
{
uint32 cpValue = mmu_read_C1();
dprintf("MMU CP15:c1 State:\n");
if ((cpValue & (1 << 0)) != 0)
dprintf(" - MMU Enabled\n");
else
dprintf(" - MMU Disabled\n");
if ((cpValue & (1 << 2)) != 0)
dprintf(" - Data Cache Enabled\n");
else
dprintf(" - Data Cache Disabled\n");
if ((cpValue & (1 << 3)) != 0)
dprintf(" - Write Buffer Enabled\n");
else
dprintf(" - Write Buffer Disabled\n");
if ((cpValue & (1 << 12)) != 0)
dprintf(" - Instruction Cache Enabled\n");
else
dprintf(" - Instruction Cache Disabled\n");
if ((cpValue & (1 << 13)) != 0)
dprintf(" - Vector Table @ 0xFFFF0000\n");
else
dprintf(" - Vector Table @ 0x00000000\n");
}
void
mmu_write_DACR(uint32 value)
{