summaryrefslogtreecommitdiff
path: root/firmware/target
diff options
context:
space:
mode:
authorJack Halpin <jack.halpin@gmail.com>2009-12-01 20:12:25 +0000
committerJack Halpin <jack.halpin@gmail.com>2009-12-01 20:12:25 +0000
commit5bd4ec0c87db5230d8637a5b3b1fda9b4d5484ea (patch)
treef50b9a57b38db83342f1ecfe7df8ee073038df34 /firmware/target
parent2c50f4222e466b41044094067890033096eb3493 (diff)
Sansa AMS: Force sd_enable(true) when using the Debug View HW info page so we can read the registers immediately.
Because we turn off the clocks to the SD controllers between disk accesses we were unable to read the MCI_CLOCK registers until there was a disk access. Now we can read them immediately. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23810 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/target')
-rw-r--r--firmware/target/arm/as3525/debug-as3525.c23
1 files changed, 14 insertions, 9 deletions
diff --git a/firmware/target/arm/as3525/debug-as3525.c b/firmware/target/arm/as3525/debug-as3525.c
index 2dda9e4283..0ed51e5898 100644
--- a/firmware/target/arm/as3525/debug-as3525.c
+++ b/firmware/target/arm/as3525/debug-as3525.c
@@ -30,6 +30,7 @@
#include "pl180.h"
#include "ascodec-target.h"
#include "adc.h"
+#include "storage.h"
#define ON "Enabled"
#define OFF "Disabled"
@@ -51,8 +52,8 @@
#define CLK_I2SI 8
#define CLK_I2SO 9
#define CLK_DBOP 10
-#define CLK_SD_MCLK_NAND 11
-#define CLK_SD_MCLK_MSD 12
+#define CLK_SD_MCLK_NAND 11
+#define CLK_SD_MCLK_MSD 12
#define CLK_USB 13
#define I2C2_CPSR0 *((volatile unsigned int *)(I2C_AUDIO_BASE + 0x1C))
@@ -289,18 +290,22 @@ bool __dbg_hw_info(void)
lcd_putsf(0, line++, "I2SO: %s %3dMHz", (CGU_AUDIO & (1<<11)) ?
"on " : "off", calc_freq(CLK_I2SO)/1000000);
- if(MCI_NAND)
- last_nand = MCI_NAND;
- /* MCLK == PCLK */
+
+ /* Enable SD cards to read the registers */
+ sd_enable(true);
+ last_nand = MCI_NAND;
+#ifdef HAVE_MULTIDRIVE
+ last_sd = MCI_SD;
+#endif
+ sd_enable(false);
+
lcd_putsf(0, line++, "SD :%3dMHz %3dMHz",
- ((last_nand ? (AS3525_PCLK_FREQ/ 1000000): 0) /
+ ((AS3525_PCLK_FREQ/ 1000000) /
((last_nand & MCI_CLOCK_BYPASS)? 1:(((last_nand & 0xff)+1) * 2))),
calc_freq(CLK_SD_MCLK_NAND)/1000000);
#ifdef HAVE_MULTIDRIVE
- if(MCI_SD)
- last_sd = MCI_SD;
lcd_putsf(0, line++, "uSD :%3dMHz %3dMHz",
- ((last_sd ? (AS3525_PCLK_FREQ/ 1000000): 0) /
+ ((AS3525_PCLK_FREQ/ 1000000) /
((last_sd & MCI_CLOCK_BYPASS) ? 1: (((last_sd & 0xff) + 1) * 2))),
calc_freq(CLK_SD_MCLK_MSD)/1000000);
#endif