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:
parent
c4b326c215
commit
212f18f9ea
1 changed files with 8 additions and 9 deletions
|
|
@ -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)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue