README for the Miniboot project. 17-May-2002
Miniboot is a small bootloader with flash-programming capabilities.
Important files:
README This file COPYING The GNU GENERAL PUBLIC LICENSE BUILDING Building instructions Changelog Changelog board/<your_board>/README Board-specific README
Brief description:
Miniboot will simply check the flash for an image and start it. Or it will provide a way to download new images to the board via the serial port.
Miniboot should touch as little hardware as possible and not initialize anything that cannot be re-initialized.
Please note that this is not supposed to be a another bootloader with network support, DHCP/TFTP, PCMCIA, IDE disks, filesystems etc. If you want that - take a look at the ppcboot project.
Or - do it the way it should be done: Use miniboot to start ppcboot! =)
- Features
-
- Interface via serial port. Up to 115200 bps operation possible. (with a 48MHz mpc860t and a fast FLASH)
- Scans for images on the flash (or any memory-mapped media) and checks CRC.
- Simple command mode is entered if space is received within one second.
- Images could be downloaded and burned to flash on-the-fly. This done through parsing S-Records that is uploaded to the board. S-Records is parsed at up to 115200 bps and directly burned to flash at abould 5KByte/s. (with a 48MHz mpc860t with 32bit databus to flashes)
- Miniboot uses the internal DPRAM of the mpc8xx-series for stack, etc.
- A not wanted image can be destroyed by writing 0 to image header.
Hardware setup:
Very little hardware is touched.
The write-one register SYPCR (great design Motorola ;( ) is not touched.
That means that the watchdog is on.
The MMU is turned off, so is data cache.
Instruction cache is turned on.
No external RAM setup is done.
Why?
If the code for the RAM setup is located in the image,
it is possible to update the it with Miniboot. (New DIMMS, etc).
Flash programming:
Miniboot lies in the first sector(s) of the flash.
Everyone that is familiar with the concept of linear flashes knows that the flash must be erased prior programming.
If the sectors where Miniboot lies are erased and if the the power fails before a new Miniboot is programmed you will be stuck with a board that is unable to boot unless you have some nifty rescue solution nearby.
You have to remove the flash chips (or module) and program them somewhere else. Or if possible, use a debugger port to download new code.
Anyhow, you do not want to be stuck with zillions of dead boards at different customers.
That's why Miniboot should do as little as possible and stay that way. There should be no need to update Miniboot!
Initial flash programming:
We start with a clean fresh flash, program Miniboot into the first sector(s). This could be done with a standalone flash programmer or with some ICP (In Circuit Programming) tool like the BDM port of an mpc8xx.
Optionally, an image could be programmed at this stage too.
Miniboot boot sequence:
After reset the cpu will start executing Miniboot.
Miniboot will display a version message on the console to say hello.
Then the code will wait for a space (0x20) character to arrive on the
console. If so, Miniboot will enter command mode (see below) otherwise
it will start scanning the flash for valid images.
A valid image has a header with correct cookies, length within the flash
and a correct checksum for the image.
Miniboot will boot the first valid image, scanning from address 0 and up.
If no valid image is found, command mode is entered.
Command mode:
When space is pressed or no valid image is found command mode is entered. Miniboot will display a prompt, "> ", and then take the following commands.
Command Parameter Description
? Displays a simple help function. C Checks if any valid images are found. B bps Will change the speed of the serial port to 'bps'. U Erase flash and burn data from S-Records to flash. Z addr Writes 0 to specified addr ( decimal, optional )
Flash programming, the Miniboot way:
Miniboot contains a primitive way to download images to flash. The code will erase all non-reserved sectors. Miniboot itself is reserved. After that it will prompt the user to start downloading the image. Miniboot accepts and programs S-records of the type S1, S2, S3, S7, S8, S9. Records of the type S5, S0 will be ignored. The code will check if the addresses are valid and accesses outside the flash or to the reserved sectors will be treated as errors.
Project home / Maintainer:
The latest version of Miniboot could be found at the opensource.se site:
http://opensource.se/projects/miniboot
Maintainer is Magnus Damm <damm@opensource.se>
See the Changelog for a list of authors.
