Skip to content

Commit

Permalink
boot: Increase SD response timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
paulsc96 committed Jun 14, 2023
1 parent 58e75f3 commit 34d8388
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
8 changes: 4 additions & 4 deletions hw/bootrom/cheshire_bootrom.sv
Original file line number Diff line number Diff line change
Expand Up @@ -1006,8 +1006,8 @@ module cheshire_bootrom #(
974: data_o = 32'hf0eff83e /* 0x0f38 */;
975: data_o = 32'h2501e0bf /* 0x0f3c */;
976: data_o = 32'h842ad161 /* 0x0f40 */;
977: data_o = 32'h6489b771 /* 0x0f44 */;
978: data_o = 32'h71048493 /* 0x0f48 */;
977: data_o = 32'h64e1b771 /* 0x0f44 */;
978: data_o = 32'h6a048493 /* 0x0f48 */;
979: data_o = 32'h0a134b11 /* 0x0f4c */;
980: data_o = 32'h49850171 /* 0x0f50 */;
981: data_o = 32'hc49da029 /* 0x0f54 */;
Expand Down Expand Up @@ -1106,8 +1106,8 @@ module cheshire_bootrom #(
1074: data_o = 32'h089ce43e /* 0x10c8 */;
1075: data_o = 32'h0b3397e2 /* 0x10cc */;
1076: data_o = 32'h4c81418b /* 0x10d0 */;
1077: data_o = 32'h6709e83e /* 0x10d4 */;
1078: data_o = 32'h71070d93 /* 0x10d8 */;
1077: data_o = 32'h6761e83e /* 0x10d4 */;
1078: data_o = 32'h6a070d93 /* 0x10d8 */;
1079: data_o = 32'h09934a11 /* 0x10dc */;
1080: data_o = 32'h49050251 /* 0x10e0 */;
1081: data_o = 32'h0ff00a93 /* 0x10e4 */;
Expand Down
8 changes: 4 additions & 4 deletions sw/boot/flash.c
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,13 @@ int main() {
target, sector);
switch (target) {
case 1:
ret = flash_spi_sdcard(core_freq, rtc_freq, img_base, sector, len);
{ ret = flash_spi_sdcard(core_freq, rtc_freq, img_base, sector, len); break; }
case 2:
ret = flash_spi_s25fs512s(core_freq, rtc_freq, img_base, sector, len);
{ ret = flash_spi_s25fs512s(core_freq, rtc_freq, img_base, sector, len); break; }
case 3:
ret = flash_i2c_24fc1025(core_freq, img_base, sector, len);
{ ret = flash_i2c_24fc1025(core_freq, img_base, sector, len); break; }
default:
ret = -1;
{ ret = -1; break; }
}
if (ret)
printf("ERROR (%d)\r\n", ret);
Expand Down
4 changes: 2 additions & 2 deletions sw/include/hal/spi_sdcard.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ typedef struct {
static const uint64_t __spi_sdcard_init_clock = 200000;

// How many cycles to wait for a non-yielding R1b response
static const uint64_t __spi_sdcard_r1b_timeout = 10000;
static const uint64_t __spi_sdcard_r1b_timeout = 100000;

// How many cycles to wait for another data block
static const uint64_t __spi_sdcard_data_timeout = 10000;
static const uint64_t __spi_sdcard_data_timeout = 100000;

// Sets up only this device; other functions may be used with own setup if requirements are met.
// This assumes the power-up period of 1ms will be elapsed *before* issuing further commands.
Expand Down

0 comments on commit 34d8388

Please sign in to comment.