The illustration below shows the memory map of the boot loader.ROM boot code resides in the top 128 K address space. The boot code uses the top 16 K of OCRAM for MMU first level page table. The lowest 60 K of OCRAM is used for loading application data. The 42 KB of OCRAM region called “ROM Data” is used for data by ROM code.If a system uses external memory, then a boot image may be created which first loads a small SDRAM initialization program into OCRAM. The program will set up the SDRAM,and then the rest of the boot image may continue to load, overwriting the initialization program in OCRAM。
General Boot Procedure
During ROM startup, the boot mode is sampled by boot pins, and then the ROM loader will take control. The ROM loader first calls an initialization function for the selected boot driver, which initializes the hardware port and external device corresponding to the boot mode. After that, the loader requests for the stream of boot image data from the driver. The boot image contains a stream of boot commands, such as LOAD, LOAD DCD, SKIP, HAB JUMP and HAB CALL commands. The loader implemented in ROM code will interpret these commands and load the boot image into memory and execute HAB JUMP or HAB CALL command. In the case of HAB JUMP, the ROM will pass control to the boot image and will leave the ROM context.
USB Boot Driver
The USB Boot Driver is implemented as a USB HID class and is referred to as the Recovery HID, or RHID. The RHID serves as a fail-safe mechanism for downloading and communicating with application-specific code.The system is based on two HID Application collections: the Boot Loader Transfer Controller (BLTC) and the Plug-in Transfer Controller (PITC). Each collection has its own set of HID reports.