From 4094a6ec3a8f0c67cff34e55e9e62d5c7f884a82 Mon Sep 17 00:00:00 2001 From: Florent Kermarrec Date: Thu, 25 Jun 2020 20:07:39 +0200 Subject: [PATCH] liblitesdcard/sdcard: increase busy_wait and use common timeout. --- litex/soc/software/liblitesdcard/sdcard.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/litex/soc/software/liblitesdcard/sdcard.c b/litex/soc/software/liblitesdcard/sdcard.c index 039c5f8b0..0d5c5c768 100644 --- a/litex/soc/software/liblitesdcard/sdcard.c +++ b/litex/soc/software/liblitesdcard/sdcard.c @@ -42,7 +42,7 @@ int sdcard_wait_cmd_done(void) { while (1) { cmdevt = sdcore_cmdevt_read(); #ifdef SDCARD_WAIT_WORKAROUND - busy_wait_us(40); /* FIXME */ + busy_wait_us(100); /* FIXME */ #endif #ifdef SDCARD_DEBUG printf("cmdevt: %08x\n", cmdevt); @@ -70,7 +70,7 @@ int sdcard_wait_data_done(void) { while (1) { dataevt = sdcore_dataevt_read(); #ifdef SDCARD_WAIT_WORKAROUND - busy_wait_us(1); /* FIXME */ + busy_wait_us(100); /* FIXME */ #endif #ifdef SDCARD_DEBUG printf("dataevt: %08x\n", dataevt); @@ -420,8 +420,7 @@ int sdcard_init(void) { unsigned short rca; /* initialize SD driver parameters */ - sdcore_cmdtimeout_write(1<<19); - sdcore_datatimeout_write(1<<19); + sdcore_timeout_write(1<<19); /* reset card */ sdcard_go_idle();