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
|-
|-
Line 837:
Line 836:
|-
|-
| 0xE2
| 0xE2
−
| Failed to verify boot1 RSA-2048 signature padding?
+
| boot1 ancast header u16 (0x1A0) was not 0
|-
|-
| 0xE3
| 0xE3
−
| boot1 verification failed (TODO: specifics)
+
| boot1 ancast header u8s (0x1A2, 0x1A3) were not 0
|-
|-
| 0xE4
| 0xE4
−
| boot1 verification failed (TODO: specifics)
+
| boot1 ancast header padding (0x1C8) was not 0
|-
|-
| 0xE5
| 0xE5
Line 849:
Line 848:
|-
|-
| 0xE6
| 0xE6
−
| boot1 verification failed (TODO: specifics)
+
| boot1 ancast header version does not match SEEPROM (anti-rollback, NAND)
|-
|-
| 0xE7
| 0xE7
Line 855:
Line 854:
|-
|-
| 0xE8
| 0xE8
−
| boot1 verification failed (TODO: specifics)
+
| boot1 ancast body size is not page-aligned, or is too small (<0x1000 bytes)
+
|-
+
| 0xE9
+
| boot1 ancast body hash does not match header
|}
|}