summaryrefslogtreecommitdiff
path: root/firmware
diff options
context:
space:
mode:
authorRafaël Carré <rafael.carre@gmail.com>2010-06-18 01:47:34 +0000
committerRafaël Carré <rafael.carre@gmail.com>2010-06-18 01:47:34 +0000
commit6470a9ffd132f0315e1c62cbf01e2a1963b874ab (patch)
treead9ce601414dedabd35d49b0fbc0bd5121d2dddb /firmware
parent48313f58e3f7fbc329e5dcb2d193802300d56556 (diff)
sd-as3525: enable writing, sd_enable() and card_get_info_target() in bootloader
They will be needed for USB git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26904 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware')
-rw-r--r--firmware/target/arm/as3525/sd-as3525.c23
1 files changed, 4 insertions, 19 deletions
diff --git a/firmware/target/arm/as3525/sd-as3525.c b/firmware/target/arm/as3525/sd-as3525.c
index a1625c047a..20ad241c02 100644
--- a/firmware/target/arm/as3525/sd-as3525.c
+++ b/firmware/target/arm/as3525/sd-as3525.c
@@ -123,9 +123,7 @@ static long sd_stack [(DEFAULT_STACK_SIZE*2 + 0x200)/sizeof(long)];
static const char sd_thread_name[] = "ata/sd";
static struct mutex sd_mtx;
static struct event_queue sd_queue;
-#ifndef BOOTLOADER
bool sd_enabled = false;
-#endif
#if defined(HAVE_MULTIDRIVE)
static bool hs_card = false;
@@ -557,10 +555,9 @@ int sd_init(void)
create_thread(sd_thread, sd_stack, sizeof(sd_stack), 0,
sd_thread_name IF_PRIO(, PRIORITY_USER_INTERFACE) IF_COP(, CPU));
-#ifndef BOOTLOADER
sd_enabled = true;
sd_enable(false);
-#endif
+
return 0;
}
@@ -674,8 +671,8 @@ static int sd_transfer_sectors(IF_MD2(int drive,) unsigned long start,
unsigned loops = 0;
mutex_lock(&sd_mtx);
-#ifndef BOOTLOADER
sd_enable(true);
+#ifndef BOOTLOADER
led(true);
#endif
@@ -829,8 +826,8 @@ sd_transfer_error_nodma:
#ifndef BOOTLOADER
led(false);
- sd_enable(false);
#endif
+ sd_enable(false);
if (ret) /* error */
card_info[drive].initialized = 0;
@@ -848,18 +845,7 @@ int sd_read_sectors(IF_MD2(int drive,) unsigned long start, int count,
int sd_write_sectors(IF_MD2(int drive,) unsigned long start, int count,
const void* buf)
{
-
-#ifdef BOOTLOADER /* we don't need write support in bootloader */
-#ifdef HAVE_MULTIDRIVE
- (void) drive;
-#endif
- (void) start;
- (void) count;
- (void) buf;
- return -1;
-#else
return sd_transfer_sectors(IF_MD2(drive,) start, count, (void*)buf, true);
-#endif
}
#ifndef BOOTLOADER
@@ -867,6 +853,7 @@ long sd_last_disk_activity(void)
{
return last_disk_activity;
}
+#endif /* !BOOTLOADER */
void sd_enable(bool on)
{
@@ -926,8 +913,6 @@ tCardInfo *card_get_info_target(int card_no)
return &card_info[card_no];
}
-#endif /* !BOOTLOADER */
-
#ifdef CONFIG_STORAGE_MULTI
int sd_num_drives(int first_drive)
{