2010-06-21 Arnout Vandecappelle <arnout@mind.be>

PR 1576/misc
	* libchip/i2c/spi-sd-card.c: Enable CRC checks.
This commit is contained in:
Sebastian Huber
2010-06-21 15:25:04 +00:00
parent 07109c2040
commit 167c6ce11e
2 changed files with 10 additions and 1 deletions

View File

@@ -1,3 +1,8 @@
2010-06-21 Arnout Vandecappelle <arnout@mind.be>
PR 1576/misc
* libchip/i2c/spi-sd-card.c: Enable CRC checks.
2010-06-21 Arnout Vandecappelle <arnout@mind.be>
PR 1569/misc

View File

@@ -461,7 +461,8 @@ static int sd_card_send_register_command( sd_card_driver_entry *e, uint32_t comm
}
crc7 = sd_card_compute_crc7( e->response + e->response_index, 5);
if (crc7 != SD_CARD_COMMAND_GET_CRC7( e->response + e->response_index)) {
if (crc7 != SD_CARD_COMMAND_GET_CRC7( e->response + e->response_index) &&
SD_CARD_COMMAND_GET_CRC7( e->response + e->response_index) != 0x7f) {
RTEMS_SYSLOG_ERROR( "CRC check failed on register command\n");
return -RTEMS_IO_ERROR;
}
@@ -752,6 +753,9 @@ static rtems_status_code sd_card_init( sd_card_driver_entry *e)
cmd_arg = SD_CARD_FLAG_HCS;
}
/* Enable CRC */
sd_card_send_command( e, SD_CARD_CMD_CRC_ON_OFF, 1);
/* Initialize card */
while (true) {
if (assume_sd) {