1
0
Fork 0
forked from len0rd/rockbox

Fix: card initialization on card_select()

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@5142 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Jens Arnold 2004-10-01 17:01:40 +00:00
parent c4b326c215
commit 212f18f9ea

View file

@ -137,6 +137,11 @@ static int initialize_card(int card_no);
static int select_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) if (!card_info[card_no].initialized)
{ {
setup_sci1(7); /* Initial rate: 375 kbps (need <= 400 per mmc specs) */ 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)); while (!(SSR1 & SCI_TEND));
} }
if (card_no == 0) if (card_no == 0) /* internal */
{ /* internal */
or_b(0x10, &PADRH); /* set clock gate PA12 CHECKME: mask? */
and_b(~0x04, &PADRH); /* assert CS */ and_b(~0x04, &PADRH); /* assert CS */
} else /* external */
else
{ /* external */
and_b(~0x10, &PADRH); /* clear clock gate PA12 CHECKME: mask?*/
and_b(~0x02, &PADRH); /* assert CS */ and_b(~0x02, &PADRH); /* assert CS */
}
if (card_info[card_no].initialized) if (card_info[card_no].initialized)
{ {
@ -504,7 +503,7 @@ int ata_write_sectors(unsigned long start,
deselect_card(); deselect_card();
mutex_unlock(&ata_mtx); mutex_unlock(&ata_mtx);
return ret; return ret;
} }