]> xenbits.xensource.com Git - seabios.git/commitdiff
sdcard: Fill command bits according to spec
authorKevin O'Connor <kevin@koconnor.net>
Tue, 11 Aug 2015 03:40:50 +0000 (23:40 -0400)
committerKevin O'Connor <kevin@koconnor.net>
Mon, 17 Aug 2015 16:11:24 +0000 (12:11 -0400)
Set the proper command bits for each command according to the SDHCI
specification.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
src/hw/sdcard.c

index 556c7c25ddd68dc6a2698bb39eca78566d959877..287d3d84f2d7f4cf4a5dac146bdaa8f7c18a08c0 100644 (file)
@@ -56,17 +56,23 @@ struct sdhci_s {
 } PACKED;
 
 // SDHCI commands
-#define SC_GO_IDLE_STATE        ((0<<8) | 0x20)
-#define SC_ALL_SEND_CID         ((2<<8) | 0x21)
-#define SC_SEND_RELATIVE_ADDR   ((3<<8) | 0x22)
-#define SC_SELECT_DESELECT_CARD ((7<<8) | 0x23)
-#define SC_SEND_IF_COND         ((8<<8) | 0x22)
-#define SC_READ_SINGLE          ((17<<8) | 0x22)
-#define SC_READ_MULTIPLE        ((18<<8) | 0x22)
-#define SC_WRITE_SINGLE         ((24<<8) | 0x22)
-#define SC_WRITE_MULTIPLE       ((25<<8) | 0x22)
-#define SC_APP_CMD              ((55<<8) | 0x22)
-#define SC_APP_SEND_OP_COND ((41<<8) | 0x22)
+#define SCB_R0   0x00 // No response
+#define SCB_R48  0x1a // Response R1 (no data), R5, R6, R7
+#define SCB_R48d 0x3a // Response R1 (with data)
+#define SCB_R48b 0x1b // Response R1b, R5b
+#define SCB_R48o 0x02 // Response R3, R4
+#define SCB_R136 0x09 // Response R2
+#define SC_GO_IDLE_STATE        ((0<<8) | SCB_R0)
+#define SC_ALL_SEND_CID         ((2<<8) | SCB_R136)
+#define SC_SEND_RELATIVE_ADDR   ((3<<8) | SCB_R48)
+#define SC_SELECT_DESELECT_CARD ((7<<8) | SCB_R48b)
+#define SC_SEND_IF_COND         ((8<<8) | SCB_R48)
+#define SC_READ_SINGLE          ((17<<8) | SCB_R48d)
+#define SC_READ_MULTIPLE        ((18<<8) | SCB_R48d)
+#define SC_WRITE_SINGLE         ((24<<8) | SCB_R48d)
+#define SC_WRITE_MULTIPLE       ((25<<8) | SCB_R48d)
+#define SC_APP_CMD              ((55<<8) | SCB_R48)
+#define SC_APP_SEND_OP_COND ((41<<8) | SCB_R48o)
 
 // SDHCI irqs
 #define SI_CMD_COMPLETE (1<<0)