Letux 400 Hardware

UpdateUboot

Table of Content

Use a newer boot loader

Introduction

The factory U-Boot on the Letux 400 machine has some limitations: it doesn't support ram disks, compressed images larger than 8 MB, and the boot from SD card can't be automated.

It can be replaced with a newer one. Hopefully, at some point the Letux 400 support will land in mainline U-Boot.

Note that if the flashing goes wrong your laptop will not start anymore. It can be recovered with some basic soldering skills and a JTAG dongle or a Raspberry Pi though. Please make sure you read the whole document first and make sure you understand what is going and have a backup plan.

Build U-Boot

Fetch tne U-Boot patched with JZ4830 support:

$ git clone git://git.kernel.org/pub/scm/linux/kernel/git/lkundrak/u-boot.git u-boot-jz4730
$ cd u-boot-jz4730
$ git checkout lr/alpha400
$

Configure the tree:

$ make alpha400_nand_defconfig
...
#
# configuration written to .config
#
$

Build the image:

$ make CROSS_COMPILE=mips64-linux-gnu-
...
  CAT     u-boot-with-spl.bin
$

Flash U-Boot from Linux

Now that you have an U-Boot image, you can flash it. If you got Letux 400 Debian image installed on your SD card you can boot it up and use it to write the image.

It is generaly a good idea to start with backing up the old bootloader in case things go south:

# nanddump -o /dev/mtd0 >mtd0.backup
ECC failed: 0
ECC corrected: 0
Number of bad blocks: 0
Number of bbt blocks: 0
Block size 131072, page size 2048, OOB size 64
Dumping data starting at 0x00000000 and ending at 0x00100000...
#

Now you can go ahead and replace the boot loader with the new one:

# flash_eraseall /dev/mtd0
Erasing 128 Kibyte @ e0000 -- 87 % complete.
#
# nandwrite -p /dev/mtd0 u-boot-with-spl.bin
Writing data to block 0
Writing data to block 20000
Writing data to block 40000
Writing data to block 60000
Writing data to block 80000
#

Flash it from the old U-Boot

Alternatively, you can also flash from within U-Boot.

TODO: Steps to back up the old U-Boot.

Put the u-boot-with-spl.bin file to the first FAT partition on a SD card. Initialize the SD card support:

PMP # mmcinit
MMC card found
MMC card is ready
PMP #

Read the file from the card:

PMP # fatload mmc 0 0x80600000 u-boot-with-spl.bin
reading u-boot-with-spl.bin
filesize: 626887, got: 626887

626887 bytes read
PMP #

And write it to the flash:

PMP # setenv filesize 0xc0000
PMP # nand erase 0x0 ${filesize}

NAND erase: device 0 offset 0x0, size 0xc0000
Erasing at 0xa0000 -- 100% complete.
OK
PMP # nand write 0x80600000 0x0 ${filesize}

NAND write: device 0 offset 0x0, size 0xc0000
 786432 bytes written: OK
PMP #

You can now reset the board into new U-Boot

PMP # reset

Using the new U-Boot

TODO: Document how to create extlinux.conf or a boot script

What if the new U-Boot doesn't boot?

Plase make sure to let us know on the mailing list.

The documentation on recovering the backup you made above is here: JtagFlash.

Created: 4 years 6 months ago
by Lubomir Rintel