mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-12-09 21:25:19 -05:00
Sansa AMS: Check if SD controllers are already enabled before attempting to enable in order to read the registers.
If the controllers were already enabled there was a chance we could try to read the MCI_CLOCK registers while the cards were buffering and then disable the controllers prematurely. I guess funman knows and sees all!! Thanks funman. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23811 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
5bd4ec0c87
commit
c67ce499f3
2 changed files with 10 additions and 6 deletions
|
|
@ -118,7 +118,7 @@ static const char sd_thread_name[] = "ata/sd";
|
||||||
static struct mutex sd_mtx;
|
static struct mutex sd_mtx;
|
||||||
static struct event_queue sd_queue;
|
static struct event_queue sd_queue;
|
||||||
#ifndef BOOTLOADER
|
#ifndef BOOTLOADER
|
||||||
static bool sd_enabled = false;
|
bool sd_enabled = false;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static struct wakeup transfer_completion_signal;
|
static struct wakeup transfer_completion_signal;
|
||||||
|
|
|
||||||
|
|
@ -61,6 +61,7 @@
|
||||||
#define MCI_NAND *((volatile unsigned long *)(NAND_FLASH_BASE + 0x04))
|
#define MCI_NAND *((volatile unsigned long *)(NAND_FLASH_BASE + 0x04))
|
||||||
#define MCI_SD *((volatile unsigned long *)(SD_MCI_BASE + 0x04))
|
#define MCI_SD *((volatile unsigned long *)(SD_MCI_BASE + 0x04))
|
||||||
|
|
||||||
|
extern bool sd_enabled;
|
||||||
|
|
||||||
/* FIXME: target tree is including ./debug-target.h rather than the one in
|
/* FIXME: target tree is including ./debug-target.h rather than the one in
|
||||||
* sansa-fuze/, even though deps contains the correct one
|
* sansa-fuze/, even though deps contains the correct one
|
||||||
|
|
@ -291,13 +292,16 @@ bool __dbg_hw_info(void)
|
||||||
lcd_putsf(0, line++, "I2SO: %s %3dMHz", (CGU_AUDIO & (1<<11)) ?
|
lcd_putsf(0, line++, "I2SO: %s %3dMHz", (CGU_AUDIO & (1<<11)) ?
|
||||||
"on " : "off", calc_freq(CLK_I2SO)/1000000);
|
"on " : "off", calc_freq(CLK_I2SO)/1000000);
|
||||||
|
|
||||||
/* Enable SD cards to read the registers */
|
/* If disabled, enable SD cards so we can read the registers */
|
||||||
sd_enable(true);
|
if(sd_enabled == false)
|
||||||
last_nand = MCI_NAND;
|
{
|
||||||
|
sd_enable(true);
|
||||||
|
last_nand = MCI_NAND;
|
||||||
#ifdef HAVE_MULTIDRIVE
|
#ifdef HAVE_MULTIDRIVE
|
||||||
last_sd = MCI_SD;
|
last_sd = MCI_SD;
|
||||||
#endif
|
#endif
|
||||||
sd_enable(false);
|
sd_enable(false);
|
||||||
|
}
|
||||||
|
|
||||||
lcd_putsf(0, line++, "SD :%3dMHz %3dMHz",
|
lcd_putsf(0, line++, "SD :%3dMHz %3dMHz",
|
||||||
((AS3525_PCLK_FREQ/ 1000000) /
|
((AS3525_PCLK_FREQ/ 1000000) /
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue