diff options
author | Bertrik Sikken <bertrik@sikken.nl> | 2011-03-26 21:12:16 +0000 |
---|---|---|
committer | Bertrik Sikken <bertrik@sikken.nl> | 2011-03-26 21:12:16 +0000 |
commit | 6512f0fb522144b121c38c53ea780c939b6e027c (patch) | |
tree | 3961ef08aa4ba6ca2e05ce1df148437c82bf70b3 | |
parent | 2543340bf4ee69f9005b14e5fb335187125a5e94 (diff) | |
download | rockbox-6512f0fb522144b121c38c53ea780c939b6e027c.tar.gz rockbox-6512f0fb522144b121c38c53ea780c939b6e027c.zip |
AMSv2 SD: reorganise code to select 4-bit mode data transfer mode a bit and add comments
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29648 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r-- | firmware/target/arm/as3525/sd-as3525v2.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/firmware/target/arm/as3525/sd-as3525v2.c b/firmware/target/arm/as3525/sd-as3525v2.c index 6d07bcca97..93dc7444c5 100644 --- a/firmware/target/arm/as3525/sd-as3525v2.c +++ b/firmware/target/arm/as3525/sd-as3525v2.c @@ -588,18 +588,19 @@ static int sd_init_card(const int drive) if(drive == INTERNAL_AS3525) /* The OF is stored in the first blocks */ card_info[INTERNAL_AS3525].numblocks -= AMS_OF_SIZE; +#ifndef BOOTLOADER + /* Switch to to 4 bit widebus mode */ + /* CMD7 w/rca: Select card to put it in TRAN state */ if(!send_cmd(drive, SD_SELECT_CARD, card_info[drive].rca, MCI_RESP, &response)) return -12; - -#ifndef BOOTLOADER - /* Switch to to 4 bit widebus mode */ if(sd_wait_for_tran_state(drive) < 0) return -13; - /* ACMD6 */ + + /* ACMD6: set bus width to 4-bit */ if(!send_cmd(drive, SD_SET_BUS_WIDTH, 2, MCI_ACMD|MCI_RESP, &response)) return -15; - /* ACMD42 */ + /* ACMD42: disconnect the pull-up resistor on CD/DAT3 */ if(!send_cmd(drive, SD_SET_CLR_CARD_DETECT, 0, MCI_ACMD|MCI_RESP, &response)) return -17; |