Line 439:
Line 439:
ahbMemFlush(0);
ahbMemFlush(0);
−
// Bit 15 in seeprom_1C_02 tells to ignore NAND errors
+
// Bit 15 in seeprom_1C_02 forces NAND to check ECC data
bool ignore_errors = ((seeprom_1C_02 >> 0x0F) & 0x01) ? true : false;
bool ignore_errors = ((seeprom_1C_02 >> 0x0F) & 0x01) ? true : false;
Line 616:
Line 616:
u32 sd_handle = *(u32 *)sd_handle_buf;
u32 sd_handle = *(u32 *)sd_handle_buf;
−
// It's possible to specify the clock and switch_func
+
// It's possible to specify the clock divider and 4-bit bus
−
// values for the SD card from flags in the SEEPROM
+
// option values for the SD card from flags in the SEEPROM
−
u32 sd_clk = 0;
+
u32 sd_clk_div = 0;
−
u32 sd_switch_func = 0;
+
u32 sd_use_4bit_bus = 0;
u8 seeprom_sd_flag1 = (u8)(seeprom_1C_02 << 0x14);
u8 seeprom_sd_flag1 = (u8)(seeprom_1C_02 << 0x14);
Line 626:
Line 626:
// Set the SD card's clock value
// Set the SD card's clock value
if (seeprom_sd_flag1 > 0)
if (seeprom_sd_flag1 > 0)
−
sd_clk = 0x01;
+
sd_clk_div = 0x01;
else
else
−
sd_clk = seeprom_sd_flag1 & 0xFF;
+
sd_clk_div = seeprom_1C_02 & 0xFF;
−
// Set the SD card's switch_func value
+
// Set the SD card's 4-bit bus option value
−
// This is passed to SD card CMD6 and can be
+
// This is passed to SD card CMD55+CMD6
−
// used to turn high speed on
+
sd_use_4bit_bus = seeprom_sd_flag2;
−
sd_switch_func = seeprom_sd_flag2;
// Setup the SD card
// Setup the SD card
−
result = sub_D41139C(host_id, reg_offset, sd_handle, sd_clk, sd_switch_func);
+
result = sub_D41139C(host_id, reg_offset, sd_handle, sd_clk_div, sd_use_4bit_bus);
// Failed to setup the SD card
// Failed to setup the SD card
Line 827:
Line 826:
| Ancast image size overflow (from SD card)
| Ancast image size overflow (from SD card)
|-
|-
−
| 0xD7
+
| 0xD9
| Failed to read boot1 image from SD card
| Failed to read boot1 image from SD card
|-
|-