EMAC Das-Uboot port |
|
|
|
Das-Uboot is an open source, platform independent bootloader.
At the time of this writing, however, MCF5282 support in the standard tree is somewhat lacking, requiring a preloader, not supporting internal flash, ethernet problems, etc...
The EMAC “Cold-Boot” build, fixes these issues and provides support for the EMAC SoM-5282EM.
When the board first powers up, Cold-Boot will take control and display some information
about the system over the first serial port.
It should look something like this:
Cold-Boot 1.0.3 (May 16 2005 - 12:30:01)
CPU: MOTOROLA Coldfire MCF5282
RESET: External
BOARD: SoM-5282EM
DRAM: 16 MB
FLASH: 4.5 MB
In: serial
Out: serial
Err: serial
Hit any key to stop autoboot:
After the initial display the board will begin counting
down to autoboot.
To skip the auto-boot and get a prompt, hit any key.
If your on a SoM-100ES, the board will be booting from external memory,
so you will get a prompt that looks like this:
U-Boot-X>
If the board was booting from internal flash, it would read:
U-Boot-I>
From here, users have access to a wide variety of uboot commands. Type
help at the prompt to see a list, or browse the U-Boot Documentation.
Some of the more useful ones are
bootm - boot a uboot package at a specified address
ex:
bootm ffc40000
setenv - this can be used to set an environmental variable, this is how the IP address is set, how autoboot and the delay is set, etc...
some common examples:
setenv ipaddr 10.0.2.3
setenv serverip 10.0.2.155
setenv bootcmd tftp 200000 EMAC-uClinux2.6R2 \; bootm 200000
notice the \ in the middle of the two commands, this is setting up an environment
to automatically to a tftp transfer a linux kernal image from ip 10.0.2.155 to address 200000(an empty DRAM location) then boot the image from RAM.
saveenv - save current environmental varialbles to flash, if this is not done the enviornment will
reset on the next boot(which won't work too well if your trying to autoboot.
tftp - use trivial file transfer protocol to retrieve a specified image from the ip given by the
serverip enviornmental variable. Typically you'll want to copy this to RAM, 200000 is usually a safe
RAM location.
ex:
tftp u-bootint4.bin 200000
imls - scan the flash for any uboot packages and display them.
erase - erase a chunk of flash.
ex:
erase ffe00000 ffffffff
cp - copy data from one location to another, this can be also be used to write to the flash if it has been erased. Note that copying can be done in byte, word or 32 bit wide mode. The third arguement is the length to copy, this is the number of bytes, words, or longs depending on the copy mode.
ex:
cp.b 200000 ffe00000 126386
To build Das_Uboot against a specific target, it must first be configured.
This is done using the Make command: Make BOARD_config, where BOARD is the board to be used.
ex:
make SOM5282EM_config
Then:
make clean
make
Will produce an elf-file, s record, and binary image.
Note that if your building for the SoM5282EM, there are 4 board configurations to choose from, which
must be manually set in the include/config/SOM5282EM.h file.
The FOURMEG option must be set if u-boot is being built for a 4M Flash board, and
BOOT_INTERNAL must be set to boot from the internal flash of the board.
Also, the base boot address must be set correctly in board/SoM-5282EM/config.mk.
The Coldfire 5282 processor can be configured to boot from external or internal flash. This is set
by the state of data line 18 upon reset. A SoM-5282EM in a SoM-100ES carrier, will default to external boot.
The bootloader must be flashed into the beginning of the flash that the board is configured to boot form, with a version that is compiled for that flash.
If the board does not already contain a bootloader, the only way to accomplish this is through the BDM port.Freescale offers a free Windows based tool for flashing the internal flash of a 5282, or for flashing a 2M external flash. Zachary Landeau has also created a Linux utility for flashing the internal flash with over the BDM, which can be downloaded in the community section in the SoM-5282 directory.
Memory Locations:
The SoM-5282EM uboot build sets up the following memory map
0 - 0xffffff 16M DRAM - FEC buffer in DRAM at 0x380000
0x20000000 - 0x2000ffff Internal RAM (potentially non-volatile)
0xf0000000 - f007ffff Internal FLASH
0xffe00000 - ffffffff 2M External FLASH
or
0xffc00000 - ffffffff 4M External FLASH
SoM-5282EM U-Boot version Shipping Dates:
before 05/16/05 - Rev0 External 2M flash only
05/16/05 - Rev 1, Installed in both Internal&External flash, 2 and 4M
after 05/16/05- Rev 1.0.3, Installed in both Internal&External flash, 2 and 4M
Notes:
During the intial start up (cpu/startup.S) the bootloader uses a small portion of internal RAM to
relocate itself, this section of RAM can therefore not be counted on to me non-volatile.
The uClinux cfnvram driver project takes this into account and doesn't use the first 1K of internal
RAM for non-volat