Permalink
Browse files

[drivers] mmc.c increase timeouts

Signed-off-by: Christopher Hall <hsw@openmoko.com>
  • Loading branch information...
1 parent 2de4326 commit f469b93c1b200d2ce88e0a769218f9dff8e200a1 @hxw hxw committed Oct 7, 2009
Showing with 10 additions and 5 deletions.
  1. +10 −5 samo-lib/drivers/src/mmc.c
View
15 samo-lib/drivers/src/mmc.c
@@ -84,7 +84,7 @@ static inline BYTE spi_receive(void)
static BYTE wait_ready(void)
{
- int timeout = 500000;
+ int timeout = 2000000;
BYTE res = spi_receive();
while ((res != 0xff) && timeout--) {
@@ -297,16 +297,21 @@ DSTATUS disk_poll(BYTE drv)
DSTATUS mmc_disk_initialize(BYTE drv)
{
BYTE n, cmd, ty, ocr[4];
- DWORD timeout = 10000;
-
- cache_init();
+ DWORD timeout = 1000000;
if (drv) {
return STA_NOINIT; // Supports only single drive
}
+
+ if (chk_power()) {
+ turn_off_power(); // Power off
+ delay_us(25000);
+ }
+
+ cache_init();
+
// if (Stat & STA_NODISK) return Stat; // No card in the socket
- //REG_SPI_CTL1 = 0x03 | (7 << 10) | (0 << 4);
REG_SPI_CTL1 =
BPT_8_BITS |
//CPHA |

0 comments on commit f469b93

Please sign in to comment.