From: Florent Kermarrec Date: Thu, 25 Jun 2020 18:07:39 +0000 (+0200) Subject: liblitesdcard/sdcard: increase busy_wait and use common timeout. X-Git-Tag: 24jan2021_ls180~135 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=4094a6ec3a8f0c67cff34e55e9e62d5c7f884a82;p=litex.git liblitesdcard/sdcard: increase busy_wait and use common timeout. --- diff --git a/litex/soc/software/liblitesdcard/sdcard.c b/litex/soc/software/liblitesdcard/sdcard.c index 039c5f8b..0d5c5c76 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();