summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Martitz <kugel@rockbox.org>2009-03-14 17:17:27 +0000
committerThomas Martitz <kugel@rockbox.org>2009-03-14 17:17:27 +0000
commit58764183439c0a7611aca2fcf344496a1589babf (patch)
treeb08ae5fbd0cf1d727d971356e9bb8ef51b24b65d
parentb642129be493309179ddc0a659301667613c188e (diff)
downloadrockbox-58764183439c0a7611aca2fcf344496a1589babf.zip
rockbox-58764183439c0a7611aca2fcf344496a1589babf.tar.gz
rockbox-58764183439c0a7611aca2fcf344496a1589babf.tar.bz2
rockbox-58764183439c0a7611aca2fcf344496a1589babf.tar.xz
SansaAMS: Add a comment to clarifing a bit that the dcache is inactive without mmu; Show the cp15 control register in the "View I/O Pots menu".
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20324 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--firmware/target/arm/as3525/debug-as3525.c20
-rw-r--r--firmware/target/arm/as3525/system-as3525.c3
2 files changed, 22 insertions, 1 deletions
diff --git a/firmware/target/arm/as3525/debug-as3525.c b/firmware/target/arm/as3525/debug-as3525.c
index 80f8702..a8a973b 100644
--- a/firmware/target/arm/as3525/debug-as3525.c
+++ b/firmware/target/arm/as3525/debug-as3525.c
@@ -31,6 +31,13 @@
#define _DEBUG_PRINTF(a,varargs...) \
snprintf(buf, sizeof(buf), (a), ##varargs); lcd_puts(0,line++,buf)
+#define ON "Enabled"
+#define OFF "Enabled"
+
+#define CP15_MMU (1<<0) /* mmu off/on */
+#define CP15_DC (1<<2) /* dcache off/on */
+#define CP15_IC (1<<12) /* icache off/on */
+
/* FIXME: target tree is including ./debug-target.h rather than the one in
* sansa-fuze/, even though deps contains the correct one
* if I put the below into a sansa-fuze/debug-target.h, it doesn't work*/
@@ -39,8 +46,16 @@
short button_dbop_data(void);
#endif
+static unsigned read_cp15 (void)
+{
+ unsigned value;
-/* TODO */
+ asm volatile (
+ "mrc p15, 0, %0, c1, c0, 0 @ read control reg\n":"=r"
+ (value)::"memory"
+ );
+ return (value);
+}
bool __dbg_hw_info(void)
{
@@ -68,6 +83,9 @@ bool __dbg_ports(void)
_DEBUG_PRINTF("[DBOP_DIN]");
_DEBUG_PRINTF("DBOP_DIN: %4x", button_dbop_data());
#endif
+ line++;
+ _DEBUG_PRINTF("[CP15]");
+ _DEBUG_PRINTF("CP15: 0x%8x", read_cp15());
lcd_update();
if (button_get_w_tmo(HZ/10) == (DEBUG_CANCEL|BUTTON_REL))
break;
diff --git a/firmware/target/arm/as3525/system-as3525.c b/firmware/target/arm/as3525/system-as3525.c
index 26c806e..7af38ff 100644
--- a/firmware/target/arm/as3525/system-as3525.c
+++ b/firmware/target/arm/as3525/system-as3525.c
@@ -236,6 +236,9 @@ void system_init(void)
CGU_PERI |= ((CLK_DIV(AS3525_PLLA_FREQ, AS3525_PCLK_FREQ) - 1) << 2)
| 1; /* clk_in = PLLA */
+
+ /* FIXME: dcache will not be active, since the mmu is not running
+ * See arm922t datasheet */
asm volatile(
"mov r0, #0 \n"
"mcr p15, 0, r0, c7, c7 \n" /* invalidate icache & dcache */