Memory layout: Difference between revisions
Line 1,244: | Line 1,244: | ||
= IRAM = | = IRAM = | ||
== | == BIT == | ||
During boot, the BootROM saves the BCT in IRAM at address 0x40000100. The preceding 0x100 bytes (IRAM memory range from 0x40000000 to 0x40000100) contain a structure called BIT (Boot Info Table) which encapsulates the BCT in IRAM and is initialized by the BootROM as follows: | |||
{| class="wikitable" border="1" | {| class="wikitable" border="1" | ||
Line 1,256: | Line 1,256: | ||
| 0x00 | | 0x00 | ||
| 0x04 | | 0x04 | ||
| | | br_version | ||
| | | Set to 0x00210001 (BOOTDATA_VERSION_T210). | ||
0x00210001 | |||
|- | |- | ||
| 0x04 | | 0x04 | ||
| 0x04 | | 0x04 | ||
| | | bd_version | ||
| | | Set to 0x00210001 (BOOTDATA_VERSION_T210). | ||
0x00210001 | |||
|- | |- | ||
| 0x08 | | 0x08 | ||
| 0x04 | | 0x04 | ||
| | | rcm_version | ||
| | | Set to 0x00210001 (BOOTDATA_VERSION_T210). | ||
0x00210001 | |||
|- | |- | ||
| 0x0C | | 0x0C | ||
Line 1,281: | Line 1,278: | ||
BOOT_TYPE_EXIT_RCM = 4 | BOOT_TYPE_EXIT_RCM = 4 | ||
|- | |- | ||
0x4C | | 0x10 | ||
| 0x04 | |||
| unk0 | |||
| Set to 0x05 on coldboot. | |||
|- | |||
| 0x14 | |||
| 0x04 | |||
| boot_device_type | |||
| | |||
|- | |||
| 0x18 | |||
| 0x04 | |||
| boot_start_time | |||
| Value from TIMERUS_CNTR_1US when the BootROM enters its main function. | |||
|- | |||
| 0x1C | |||
| 0x04 | |||
| unk1 | |||
| | |||
|- | |||
| 0x20 | |||
| 0x04 | |||
| boot_read_bct_time | |||
| Time spent reading the BCT. | |||
|- | |||
| 0x24 | |||
| 0x04 | |||
| boot_parse_bootloader_time | |||
| Time spent parsing the bootloader info from the BCT. | |||
|- | |||
| 0x28 | |||
| 0x04 | |||
| osc_freq | |||
| Value from CLK_RST_CONTROLLER_OSC_CTRL. | |||
|- | |||
| 0x2C | |||
| 0x01 | |||
| is_boot_device_loaded | |||
| Set to 1 after the boot device is initialized. | |||
|- | |||
| 0x2D | |||
| 0x01 | |||
| is_sdram_configured | |||
| Set to 1 after the SDRAM parameters are parsed. | |||
|- | |||
| 0x2E | |||
| 0x01 | |||
| is_forced_rcm_pmc | |||
| Set to 1 if bit 2 was set in APBDEV_PMC_SCRATCH0. | |||
|- | |||
| 0x2F | |||
| 0x01 | |||
| is_enable_fail_back_pmc | |||
| Set to 1 if bit 4 was set in APBDEV_PMC_SCRATCH0. | |||
|- | |||
| 0x30 | |||
| 0x02 | |||
| is_bootloader_version_mismatch | |||
| Set to 1 if the bootloaders have different versions in the BCT. | |||
|- | |||
| 0x32 | |||
| 0x02 | |||
| is_bct_valid | |||
| Set to 1 if the BCT was parsed successfully. | |||
|- | |||
| 0x34 | |||
| 0x04 | |||
| unk2 | |||
| | |||
|- | |||
| 0x38 | |||
| 0x04 | |||
| unk3 | |||
| | |||
|- | |||
| 0x3C | |||
| 0x04 | |||
| active_bootloader_idx | |||
| Value from 0 to 3 that represents which bootloader is active. | |||
|- | |||
| 0x40 | |||
| 0x04 | |||
| bct_start_block | |||
| Block number where the BCT was found. | |||
|- | |||
| 0x44 | |||
| 0x04 | |||
| bct_start_page | |||
| Page number where the BCT was found. | |||
|- | |||
| 0x48 | |||
| 0x04 | |||
| bct_size | |||
| Size of the BCT in IRAM (0x2800). | |||
|- | |||
| 0x4C | |||
| 0x04 | |||
| bct_ptr | |||
| Pointer to the BCT in IRAM (0x40000100). | |||
|- | |- | ||
| 0x50 | | 0x50 | ||
Line 1,295: | Line 1,390: | ||
| 0x00 | | 0x00 | ||
| 0x04 | | 0x04 | ||
| | | bootloader_idx | ||
|- | |- | ||
| 0x04 | | 0x04 | ||
| 0x04 | | 0x04 | ||
| | | bootloader_start_block | ||
|- | |- | ||
| 0x08 | | 0x08 | ||
| 0x04 | | 0x04 | ||
| | | bootloader_start_page | ||
|- | |- | ||
| 0x0C | | 0x0C | ||
| 0x04 | | 0x04 | ||
| | | bootloader_length | ||
|- | |- | ||
| 0x10 | | 0x10 | ||
| 0x04 | | 0x04 | ||
| | | bootloader_signed_start | ||
|- | |- | ||
| 0x14 | | 0x14 | ||
| 0x04 | | 0x04 | ||
| | | bootloader_signature | ||
|} | |} | ||
|- | |- | ||
| 0xB0 | | 0xB0 | ||
| 0x40 | | 0x40 | ||
| | | boot_device_info | ||
| | | Structure to hold boot device parameters. | ||
|- | |- | ||
| 0xF0 | | 0xF0 | ||
| 0x04 | | 0x04 | ||
| | | bct_end_ptr | ||
| | | Pointer to the end of the BCT in IRAM (0x40002900). | ||
|- | |- | ||
| 0xF4 | | 0xF4 | ||
| 0x0C | | 0x0C | ||
| | | padding | ||
| | | Must be empty. | ||
|} | |} | ||
= Notes = | = Notes = |