diff options
Diffstat (limited to 'firmware')
-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 c114743d27..3525203840 100644 --- a/firmware/drivers/ata_mmc.c +++ b/firmware/drivers/ata_mmc.c | |||
@@ -137,6 +137,11 @@ static int initialize_card(int card_no); | |||
137 | 137 | ||
138 | static int select_card(int card_no) | 138 | static int select_card(int card_no) |
139 | { | 139 | { |
140 | if (card_no == 0) /* internal */ | ||
141 | or_b(0x10, &PADRH); /* set clock gate PA12 CHECKME: mask? */ | ||
142 | else /* external */ | ||
143 | and_b(~0x10, &PADRH); /* clear clock gate PA12 CHECKME: mask?*/ | ||
144 | |||
140 | if (!card_info[card_no].initialized) | 145 | if (!card_info[card_no].initialized) |
141 | { | 146 | { |
142 | setup_sci1(7); /* Initial rate: 375 kbps (need <= 400 per mmc specs) */ | 147 | setup_sci1(7); /* Initial rate: 375 kbps (need <= 400 per mmc specs) */ |
@@ -144,16 +149,10 @@ static int select_card(int card_no) | |||
144 | while (!(SSR1 & SCI_TEND)); | 149 | while (!(SSR1 & SCI_TEND)); |
145 | } | 150 | } |
146 | 151 | ||
147 | if (card_no == 0) | 152 | if (card_no == 0) /* internal */ |
148 | { /* internal */ | ||
149 | or_b(0x10, &PADRH); /* set clock gate PA12 CHECKME: mask? */ | ||
150 | and_b(~0x04, &PADRH); /* assert CS */ | 153 | and_b(~0x04, &PADRH); /* assert CS */ |
151 | } | 154 | else /* external */ |
152 | else | ||
153 | { /* external */ | ||
154 | and_b(~0x10, &PADRH); /* clear clock gate PA12 CHECKME: mask?*/ | ||
155 | and_b(~0x02, &PADRH); /* assert CS */ | 155 | and_b(~0x02, &PADRH); /* assert CS */ |
156 | } | ||
157 | 156 | ||
158 | if (card_info[card_no].initialized) | 157 | if (card_info[card_no].initialized) |
159 | { | 158 | { |
@@ -504,7 +503,7 @@ int ata_write_sectors(unsigned long start, | |||
504 | 503 | ||
505 | deselect_card(); | 504 | deselect_card(); |
506 | mutex_unlock(&ata_mtx); | 505 | mutex_unlock(&ata_mtx); |
507 | 506 | ||
508 | return ret; | 507 | return ret; |
509 | } | 508 | } |
510 | 509 | ||