summaryrefslogtreecommitdiffstats
path: root/firmware
diff options
context:
space:
mode:
authorRafaël Carré <rafael.carre@gmail.com>2010-05-24 15:07:15 +0000
committerRafaël Carré <rafael.carre@gmail.com>2010-05-24 15:07:15 +0000
commit13f159df57386b076b39ea331bc07583404be68a (patch)
treef0f722fa6fc475422cc27d0ebbc73acf95bfe0d5 /firmware
parent8d1ec38a1d8721330798dbfc55be456ecd964bdf (diff)
downloadrockbox-13f159df57386b076b39ea331bc07583404be68a.tar.gz
rockbox-13f159df57386b076b39ea331bc07583404be68a.tar.bz2
rockbox-13f159df57386b076b39ea331bc07583404be68a.zip
as3525*: sd_wait_for_state() is only used for waiting to SD_TRAN state
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26251 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware')
-rw-r--r--firmware/target/arm/as3525/sd-as3525.c12
-rw-r--r--firmware/target/arm/as3525/sd-as3525v2.c12
2 files changed, 12 insertions, 12 deletions
diff --git a/firmware/target/arm/as3525/sd-as3525.c b/firmware/target/arm/as3525/sd-as3525.c
index 81dc637617..fb1ec959e3 100644
--- a/firmware/target/arm/as3525/sd-as3525.c
+++ b/firmware/target/arm/as3525/sd-as3525.c
@@ -100,7 +100,7 @@ static const int pl180_base[NUM_DRIVES] = {
#endif
};
-static int sd_wait_for_state(const int drive, unsigned int state);
+static int sd_wait_for_tran_state(const int drive);
static int sd_select_bank(signed char bank);
static int sd_init_card(const int drive);
static void init_pl180_controller(const int drive);
@@ -321,7 +321,7 @@ static int sd_init_card(const int drive)
return -5;
mci_delay();
- if(sd_wait_for_state(drive, SD_TRAN))
+ if(sd_wait_for_tran_state(drive))
return -6;
/* CMD6 */
if(!send_cmd(drive, SD_SWITCH_FUNC, 0x80fffff1, MCI_ARG, NULL))
@@ -570,7 +570,7 @@ bool sd_present(IF_MD_NONVOID(int drive))
}
#endif /* HAVE_HOTSWAP */
-static int sd_wait_for_state(const int drive, unsigned int state)
+static int sd_wait_for_tran_state(const int drive)
{
unsigned long response = 0;
unsigned int timeout = current_tick + HZ;
@@ -581,7 +581,7 @@ static int sd_wait_for_state(const int drive, unsigned int state)
MCI_RESP|MCI_ARG, &response))
return -1;
- if (((response >> 9) & 0xf) == state)
+ if (((response >> 9) & 0xf) == SD_TRAN)
return 0;
if(TIME_AFTER(current_tick, timeout))
@@ -605,7 +605,7 @@ static int sd_select_bank(signed char bank)
panicf("SD bank %d error : 0x%x", bank,
transfer_error[INTERNAL_AS3525]);
- ret = sd_wait_for_state(INTERNAL_AS3525, SD_TRAN);
+ ret = sd_wait_for_tran_state(INTERNAL_AS3525);
if (ret < 0)
return ret - 2;
@@ -746,7 +746,7 @@ static int sd_transfer_sectors(IF_MD2(int drive,) unsigned long start,
if(write)
memcpy(uncached_buffer, buf, transfer * SD_BLOCK_SIZE);
- ret = sd_wait_for_state(drive, SD_TRAN);
+ ret = sd_wait_for_tran_state(drive);
if (ret < 0)
{
ret -= 2*20;
diff --git a/firmware/target/arm/as3525/sd-as3525v2.c b/firmware/target/arm/as3525/sd-as3525v2.c
index ee2a09ac0a..8ad219625c 100644
--- a/firmware/target/arm/as3525/sd-as3525v2.c
+++ b/firmware/target/arm/as3525/sd-as3525v2.c
@@ -328,7 +328,7 @@ static unsigned char aligned_buffer[UNALIGNED_NUM_SECTORS* SD_BLOCK_SIZE] __attr
static unsigned char *uncached_buffer = AS3525_UNCACHED_ADDR(&aligned_buffer[0]);
static void init_controller(void);
-static int sd_wait_for_state(const int drive, unsigned int state);
+static int sd_wait_for_tran_state(const int drive);
static tCardInfo card_info[NUM_DRIVES];
@@ -512,7 +512,7 @@ static int sd_init_card(const int drive)
if(!send_cmd(drive, SD_SELECT_CARD, card_info[drive].rca, MCI_NO_RESP, NULL))
return -7;
- if(sd_wait_for_state(drive, SD_TRAN))
+ if(sd_wait_for_tran_state(drive))
return -8;
/* CMD6 */
@@ -544,7 +544,7 @@ static int sd_init_card(const int drive)
#ifndef BOOTLOADER
/* Switch to to 4 bit widebus mode */
- if(sd_wait_for_state(drive, SD_TRAN) < 0)
+ if(sd_wait_for_tran_state(drive) < 0)
return -13;
/* CMD55 */ /* Response is requested due to timing issue */
if(!send_cmd(drive, SD_APP_CMD, card_info[drive].rca, MCI_RESP, &response))
@@ -756,7 +756,7 @@ int sd_init(void)
return 0;
}
-static int sd_wait_for_state(const int drive, unsigned int state)
+static int sd_wait_for_tran_state(const int drive)
{
unsigned long response;
unsigned int timeout = 100; /* ticks */
@@ -768,7 +768,7 @@ static int sd_wait_for_state(const int drive, unsigned int state)
while(!(send_cmd(drive, SD_SEND_STATUS, card_info[drive].rca, MCI_RESP, &response)));
- if (((response >> 9) & 0xf) == state)
+ if (((response >> 9) & 0xf) == SD_TRAN)
return 0;
if(TIME_AFTER(current_tick, t + timeout))
@@ -846,7 +846,7 @@ static int sd_transfer_sectors(IF_MD2(int drive,) unsigned long start,
MCI_BYTCNT = transfer * SD_BLOCK_SIZE;
- ret = sd_wait_for_state(drive, SD_TRAN);
+ ret = sd_wait_for_tran_state(drive);
if (ret < 0)
{
static const char *st[9] = {