Installing Linux using U-Boot

Attention: Use at your own risk! Do not try if no JTAG debugger is available and/or nobody can use it.

Start the TQMa35 and then stop the bootloader U-Boot.

U-Boot 2010.06-00005-gb029844 (May 11 2011 - 15:34:02)

CPU:   Freescale i.MX35 at 532 MHz
Board: TQMa35 [2.0 [RST]
I2C:   ready
DRAM:  256 MiB
Flash: 32 MiB
In:    serial
Out:   serial
Err:   serial
MMC:   FSL_ESDHC: 0, FSL_ESDHC: 1
Net:   FEC0, smc911x-0
Hit any key to stop autoboot:  0
MX35 U-Boot >

The Linux kernel is downloaded over the network via TFTP. The memory address $loadaddr is set to 0x80800000 by default. There, the kernel is loaded. This address is in the RAM.

MX35 U-Boot > tftp ${loadaddr} uImage_2.6.34.9_tqma35.0101

Now you have to copy the kernel to the flash memory. Before the memory must be erased. The variable $kernel_addr contains the address of the kernel in the flash, the variable $filesize contains the size of the file accessed by the last TFTP command. The command erase erases as much of the flash memory as is required for the new kernel.

MX35 U-Boot > erase ${kernel_addr} +${filesize}

The kernel is copied to the intended location with the command cp.b.

MX35 U-Boot > cp.b ${loadaddr} ${kernel_addr} ${filesize}

The kernel image in the flash can be checked with the command imls:

MX35 U-Boot > imls
Legacy Image at A0080000:
   Image Name:   Linux-2.6.34.9-00023-gb0fc99a
   Created:      2011-05-04  12:02:23 UTC
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    2194392 Bytes = 2.1 MiB
   Load Address: 80008000
   Entry Point:  80008000
   Verifying Checksum ... OK

The rootfs is also loaded to $loadaddr via TFTP.

MX35 U-Boot > tftpboot ${loadaddr} rootfs.jffs2.0008

The flash memory is erased and the rootfs is written to address $ramdisk_addr.

MX35 U-Boot > erase
MX35 U-Boot > cp.b ${loadaddr} ${ramdisk_addr} ${filesize}

The appropriate MTD parameters have to be passed to the Linux kernel. These are saved in an U-Boot environment variable.

MX35 U-Boot > setenv mtdparts 'mtdparts=physmap-flash.0:256k(u-boot),256k(env),2560k(kernel),29M(jffs2),-(user)'
MX35 U-Boot > setenv jffsargs ${jffsargs} ${mtdparts}
MX35 U-Boot > saveenv

Now the boot method flash_jffs can be set as the standard boot method:

MX35 U-Boot > setenv bootcmd ${flash_jffs}
MX35 U-Boot > saveenv
  • Last modified: 2022/08/04 15:02