Information gathered from iaudio X5 OF disassembly
Preloader
General Info
This part of firmware resides from 0x00000000 to 0x00010000 and never changes.
It is a single-threaded program that handles the following tasks:
- Device initialization.
- USB HDD mode.
- Adapter/USB charge mode.
- Firmware upgrade.
- Executing the actual firmware (i.e., jmp 0x10000).
General Code Flow
- Initialization steps 1 & 2
- If USB and/or AC adapter is connected, go to Initialization step 3; otherwise, go to Initialization step 4.
Initialization, step 1
- Internal ColdFire registers: sp, vbr, cacr, acr0, acr1, mbar, mbar2, rambar0, rambar1
- Various registers on MBAR and MBAR2 (interrupts, timers, DMA, IIS_CONFIGs, EBU_CONFIGs)
- GPIO out/enable/function registers
| OUT | ENABLE | FUNCTION |
GPIO | 0x40200018 | 0x60A0E018 | 0x6FA1E179 |
GPIO1 | 0x4830 | 0x483C | 0x483C |
- DRAM controller
- PLL_CONFIG (to 0x11436059)
- Chip Select 0
- Copy rest of preloader to DRAM
Initialization, step 2
- UART0
- LCD
- I2C controller (interface 1 only)
- PCF50606
- CY7C68310
Initialization, step 3 (USB and/or AC adapter connected)
- Remote LCD detect & init
- Turn of backlight and display boot screen
- If USB is connected:
- ATA init & reset
- HDD identify & init
- Partition table & FAT32 init
- Set slow CPU freq (PLL_CONFIG = 0x10422035) and adjust UART divider (32)
- Enter ATA bridge mode
- If AC adapter is connected:
- ATA init & reset
- HDD identify & init
- Partition table & FAT32 init
Initialization, step 4 (neither USB nor AC adapter connected)
- ATA init & reset
- Jump to firmware (at 0x10000)
To be continued...
Firmware
General Info
This part of firmware resides from 0x00010000 to ~0x019D0000 and can be upgraded.
It has two parts:
- the first is composed of ~18 data and/or code segments, most of which are cached to IRAM/DRAM.
- the second contains read-only data (images, remote images, text strings, ...) and begins at 0x01700000. H3Mod changes things here.
To be continued...
Copyright © by the contributing authors.