diff options
| author | Jens Arnold <amiconn@rockbox.org> | 2004-10-01 17:01:40 +0000 |
|---|---|---|
| committer | Jens Arnold <amiconn@rockbox.org> | 2004-10-01 17:01:40 +0000 |
| commit | 212f18f9ea28dce5a8142c6546453ada1c23b693 (patch) | |
| tree | ffae1caf6bdd9db456f7b73e00e6b964aaa48d6b | |
| parent | c4b326c215120acd0e28b311301ef748094b73e8 (diff) | |
| download | rockbox-212f18f9ea28dce5a8142c6546453ada1c23b693.zip rockbox-212f18f9ea28dce5a8142c6546453ada1c23b693.tar.gz rockbox-212f18f9ea28dce5a8142c6546453ada1c23b693.tar.bz2 rockbox-212f18f9ea28dce5a8142c6546453ada1c23b693.tar.xz | |
Fix: card initialization on card_select()
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@5142 a1c6a512-1295-4272-9138-f99709370657
| -rw-r--r-- | firmware/drivers/ata_mmc.c | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/firmware/drivers/ata_mmc.c b/firmware/drivers/ata_mmc.c index c114743..3525203 100644 --- a/firmware/drivers/ata_mmc.c +++ b/firmware/drivers/ata_mmc.c @@ -137,6 +137,11 @@ static int initialize_card(int card_no); static int select_card(int card_no) { + if (card_no == 0) /* internal */ + or_b(0x10, &PADRH); /* set clock gate PA12 CHECKME: mask? */ + else /* external */ + and_b(~0x10, &PADRH); /* clear clock gate PA12 CHECKME: mask?*/ + if (!card_info[card_no].initialized) { setup_sci1(7); /* Initial rate: 375 kbps (need <= 400 per mmc specs) */ @@ -144,16 +149,10 @@ static int select_card(int card_no) while (!(SSR1 & SCI_TEND)); } - if (card_no == 0) - { /* internal */ - or_b(0x10, &PADRH); /* set clock gate PA12 CHECKME: mask? */ + if (card_no == 0) /* internal */ and_b(~0x04, &PADRH); /* assert CS */ - } - else - { /* external */ - and_b(~0x10, &PADRH); /* clear clock gate PA12 CHECKME: mask?*/ + else /* external */ and_b(~0x02, &PADRH); /* assert CS */ - } if (card_info[card_no].initialized) { @@ -504,7 +503,7 @@ int ata_write_sectors(unsigned long start, deselect_card(); mutex_unlock(&ata_mtx); - + return ret; } |