diff options
Diffstat (limited to 'firmware/drivers/ata_mmc.c')
-rw-r--r-- | firmware/drivers/ata_mmc.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/firmware/drivers/ata_mmc.c b/firmware/drivers/ata_mmc.c index 7b3b8d1ea8..faa4c1f187 100644 --- a/firmware/drivers/ata_mmc.c +++ b/firmware/drivers/ata_mmc.c | |||
@@ -135,18 +135,21 @@ static void swapcopy_sector(const unsigned char *buf); | |||
135 | static int send_sector(const unsigned char *nextbuf, int timeout); | 135 | static int send_sector(const unsigned char *nextbuf, int timeout); |
136 | static int send_single_sector(const unsigned char *buf, int timeout); | 136 | static int send_single_sector(const unsigned char *buf, int timeout); |
137 | 137 | ||
138 | static bool mmc_detect(void); | ||
139 | static void mmc_tick(void); | 138 | static void mmc_tick(void); |
140 | 139 | ||
141 | /* implementation */ | 140 | /* implementation */ |
142 | 141 | ||
143 | static int select_card(int card_no) | 142 | void mmc_select_clock(int card_no) |
144 | { | 143 | { |
145 | if (card_no == 0) /* internal */ | 144 | if (card_no == 0) /* internal */ |
146 | or_b(0x10, &PADRH); /* set clock gate PA12 CHECKME: mask? */ | 145 | or_b(0x10, &PADRH); /* set clock gate PA12 CHECKME: mask? */ |
147 | else /* external */ | 146 | else /* external */ |
148 | and_b(~0x10, &PADRH); /* clear clock gate PA12 CHECKME: mask?*/ | 147 | and_b(~0x10, &PADRH); /* clear clock gate PA12 CHECKME: mask?*/ |
149 | 148 | } | |
149 | |||
150 | static int select_card(int card_no) | ||
151 | { | ||
152 | mmc_select_clock(card_no); | ||
150 | last_disk_activity = current_tick; | 153 | last_disk_activity = current_tick; |
151 | 154 | ||
152 | if (!card_info[card_no].initialized) | 155 | if (!card_info[card_no].initialized) |
@@ -760,7 +763,7 @@ void ata_spin(void) | |||
760 | { | 763 | { |
761 | } | 764 | } |
762 | 765 | ||
763 | static bool mmc_detect(void) | 766 | bool mmc_detect(void) |
764 | { | 767 | { |
765 | return adc_read(ADC_MMC_SWITCH) < 0x200 ? true : false; | 768 | return adc_read(ADC_MMC_SWITCH) < 0x200 ? true : false; |
766 | } | 769 | } |