How to Install U-Boot on the MPC5125 Tower Board

The MPC5125 Tower Board comes pre-installed with U-Boot. However, you may wish to update U-Boot, or recover a bricked board. The following instructions detail how to load a new version of U-Boot on to the MPC5125 Tower Board.

Prerequisites

  • U-Boot Binary Files. These can be found in the bootloader directory of a Web factory build, or the build*/images/bootloader directory of a Desktop Factory build.
    • u-boot
    • u-boot-nand.bin
    • u-boot-second.bin
    • u-boot-spl-2k.bin
  • If updating from CodeWarrior:
    • Codewarrior for MobileGT, with MPC5125 patches applied
    • Freescale Codewarrior USB or Ethernet TAP
    • Target initialization file for MPC5125 TWR: 5125-TWR_init.cfg
  • TFTP server on your host machine

Installing using CodeWarrior

You will use CodeWarrior to run a RAM-based U-Boot on the board. You will then use the "Updating from U-Boot" instructions below to write the binary files to NAND.

NOTE: The following instructions are provided for convenience. Timesys does not support CodeWarrior. If you have difficulty with CodeWarrior, please contact Freescale support.

  1. Start CodeWarrior.
  2. Import the U-Boot file into CodeWarrior:
    • In the top menu, select File->Open. Select the u-boot file from Factory.
    • When prompted, select your debugger. This has been tested with the CodeWarrior USB TAP at Timesys.
    • When prompted about missing files, select Cancel. You will not need them for this procedure.
  3. Configure the debugger:
    • Select Edit->Default Project Settings...
    • In the Default Project Settings dialog, open the Debugger->EPPC Debugger Settings panel.
    • Select 5125 for the Target Processor.
    • Select Use Target Initialization File.
    • Browse for the file 5125-TWR_init.cfg. This is provided by Freescale in their Linux Binary release, but is reproduced here for convenience.
    • Click OK.
  4. Click the Debug button (it's a green arrow with a small bug below it). This will run U-Boot on your target board.
  5. Follow the instructions for Updating from U-Boot to store the bootloader in NAND.

Updating from U-Boot

If the board is already running U-Boot, you can update it without using CodeWarrior.

  1. Set up the networking on your board, if you haven't already.
    setenv serverip <IP address of TFTP server>
    setenv ipaddr <Unique IP address of Tower board
  2. Download the file u-boot-spl-2k.bin using tftp, erase the NAND flash, then write it to NAND.
    tftp 0x1000000 u-boot-spl-2k.bin
    nand_e 0x00 0x01
    nand_loader 0x1000000 0x00 0x800
  3. Download the first stage U-Boot file, u-boot-nand.bin using tftp, erase the NAND flash, then write it to NAND.
    tftp 0x1000000 u-boot-nand.bin
    nand_w 0x1000000 0x8 0x60000
    
  4. Download the second stage U-Boot file, u-boot-second.bin using tftp, erase the NAND flash, then write it to NAND.
    tftp 0x1000000 u-boot-second.bin
    nand_e 0x100 0x101
    nand_w 0x1000000 0x100 0x60000
    
  5. OPTIONAL To reset your environment to the defaults, you can run the following command:
    nand_e 0x200 0x203