software/libsdcard: keep SDCARD_DEBUG enabled for now, fix typos.
authorFlorent Kermarrec <florent@enjoy-digital.fr>
Wed, 3 Jun 2020 11:38:34 +0000 (13:38 +0200)
committerFlorent Kermarrec <florent@enjoy-digital.fr>
Wed, 3 Jun 2020 11:38:34 +0000 (13:38 +0200)
litex/soc/software/liblitesdcard/sdcard.c
litex/soc/software/liblitesdcard/sdcard.h

index b529b398846bfb89cbe31934d1a0dd6a8279d377..585c7a3332774e20834181a85992f53400ebf68f 100644 (file)
@@ -14,7 +14,7 @@
 
 #include "sdcard.h"
 
-//#define SDCARD_DEBUG
+#define SDCARD_DEBUG
 
 #ifdef CSR_SDCORE_BASE
 
@@ -154,7 +154,7 @@ int sdcard_wait_cmd_done(void) {
        unsigned int cmdevt;
        while (1) {
                cmdevt = sdcore_cmdevt_read();
-               busy_wait(1); /* FIXME */
+               busy_wait(5); /* FIXME */
 #ifdef SDCARD_DEBUG
                printf("cmdevt: %08x\n", cmdevt);
 #endif
@@ -180,7 +180,7 @@ int sdcard_wait_data_done(void) {
        unsigned int dataevt;
        while (1) {
                dataevt = sdcore_dataevt_read();
-               busy_wait(1); /* FIXME */
+               busy_wait(5); /* FIXME */
 #ifdef SDCARD_DEBUG
                printf("dataevt: %08x\n", dataevt);
 #endif
@@ -202,8 +202,7 @@ int sdcard_wait_response(void) {
 
        status = sdcard_wait_cmd_done();
 
-       csr_rd_buf_uint32(CSR_SDCORE_RESPONSE_ADDR,
-                         sdcard_response, SD_RESPONSE_SIZE/4);
+       csr_rd_buf_uint32(CSR_SDCORE_RESPONSE_ADDR, sdcard_response, SD_RESPONSE_SIZE/4);
 
 #ifdef SDCARD_DEBUG
        for(i = 0; i < SD_RESPONSE_SIZE/4; i++) {
index c17700c2751eb8e8af02825a794b63add86e0d49..57dbc6cbb070e600468fc383169f28e4e69e4f5b 100644 (file)
@@ -13,7 +13,7 @@
 #ifdef CSR_SDCORE_BASE
 
 #define SD_BLOCK_SIZE 512
-#define SD_RESPONSE_SIZE 128
+#define SD_RESPONSE_SIZE 16
 
 #define SD_OK         0
 #define SD_CRCERROR   1