Wiki Home » rex » uboot

uboot

Last modified by Administrator on 2018/03/18 15:55
U-boot is a bootloader responsible for hardware initialization, loading and booting linux kernel. It is also used for module flashing.

Build

Set toolchain

Export toolchain variables for every related terminal session.

Initial steps

Create working directory

mkdir -pv ~/workdir/imx6/bootloader/

Set shell variables

U-Boot v2015.04

Download & Extract source code

cd ~/workdir/imx6/bootloader/
git clone -b uboot-imx-v2015.04 --single-branch https://github.com/voipac/uboot-imx uboot-imx-v2015.04-rex
cd uboot-imx-v2015.04-rex

Compile

Output file is called u-boot.imx.

IMX6 Basic module (Production)

Linux/Yocto

cd ~/workdir/imx6/bootloader/uboot-imx-v2015.04-rex
make distclean
make mx6rexbasic_config
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi-
cp u-boot.imx /srv/tftp/imx6/u-boot-imx6-rexbasic.imx
cp u-boot.bin /srv/tftp/imx6/u-boot-imx6-rexbasic.bin

IMX6 Pro module (Production)

Linux/Yocto

cd ~/workdir/imx6/bootloader/uboot-imx-v2015.04-rex
make distclean
make mx6rexpro_config
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi-
cp u-boot.imx /srv/tftp/imx6/u-boot-imx6-rexpro.imx
cp u-boot.bin /srv/tftp/imx6/u-boot-imx6-rexpro.bin

Linux/Yocto - Version for SD card for usage in combination with iMX6DQ_SPI_to_uSDHC3.bin.

cd ~/workdir/imx6/bootloader/uboot-imx-v2015.04-rex
make distclean
make mx6rexprosd_config
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi-
cp u-boot.imx /srv/tftp/imx6/u-boot-imx6-rexprosd.imx
cp u-boot.bin /srv/tftp/imx6/u-boot-imx6-rexprosd.bin
cd ~/workdir/imx6/bootloader/uboot-imx-v2015.04-rex
make distclean
make mx6rexprosata_config
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi-
cp u-boot.imx /srv/tftp/imx6/u-boot-imx6-rexprosata.imx
cp u-boot.bin /srv/tftp/imx6/u-boot-imx6-rexprosata.bin

Android 7.x

cd ~/workdir/imx6/bootloader/uboot-imx-v2015.04-rex
make distclean
make mx6rexproandroid_config
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi-
cp u-boot.imx /srv/tftp/imx6/u-boot-imx6-rexproandroid.imx

IMX6 Ultra module (Production)

Linux/Yocto

cd ~/workdir/imx6/bootloader/uboot-imx-v2015.04-rex
make distclean
make mx6rexultra_config
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi-
cp u-boot.imx /srv/tftp/imx6/u-boot-imx6-rexultra.imx
cp u-boot.bin /srv/tftp/imx6/u-boot-imx6-rexultra.bin
cd ~/workdir/imx6/bootloader/uboot-imx-v2015.04-rex
make distclean
make mx6rexultrasata_config
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi-
cp u-boot.imx /srv/tftp/imx6/u-boot-imx6-rexultrasata.imx
cp u-boot.bin /srv/tftp/imx6/u-boot-imx6-rexultrasata.bin

Android 7.x

cd ~/workdir/imx6/bootloader/uboot-imx-v2015.04-rex
make distclean
make mx6rexultraandroid_config
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi-
cp u-boot.imx /srv/tftp/imx6/u-boot-imx6-rexultraandroid.imx

How to Flash new version

Steps

SPI - from U-boot

setenv ipaddr 192.168.0.150
setenv serverip 192.168.0.1
tftp 0x177ff400 imx6/u-boot-imx6-rex*.bin
go 0x17800000

setenv ipaddr 192.168.0.150
setenv serverip 192.168.0.1
mw.b 0x10800000 0xFF 0x80000
tftp 0x10800000 imx6/u-boot-imx6-rex*.imx
if sf probe 2:2; then sf erase 0x0 0x80000; sf write 0x10800000 0x400 0x7fc00; fi

SATA - from U-boot

setenv ipaddr 192.168.0.150
setenv serverip 192.168.0.1
tftp 0x177ff400 imx6/u-boot-imx6-rex*.bin
go 0x17800000

setenv ipaddr 192.168.0.150
setenv serverip 192.168.0.1
mw.b 0x10800000 0xFF 0x80000
tftp 0x10800000 imx6/u-boot-imx6-rex*sata.imx
if sata init; then sata write 0x10800000 0x2 0x3ff; fi

Log

U-Boot 2015.04-g3e8754e-dirty (May 08 2017 - 15:31:43)

CPU:   Freescale i.MX6Q rev1.2 at 792 MHz
CPU:   Temperature 42 C
Reset cause: WDOG
Board: MX6 Rex - pro
I2C:   ready
DRAM:  2 GiB
MMC:   FSL_SDHC: 0, FSL_SDHC: 1
SF: Detected SST25VF032B with page size 256 Bytes, erase size 4 KiB, total 4 MiB
In:    serial
Out:   serial
Err:   serial
Fastboot: Normal
flash target is MMC:0
Bad partition index:5 for partition:system
Bad partition index:4 for partition:data
Net:   FEC [PRIME]
Normal Boot
Hit any key to stop autoboot:  0
Rex U-Boot > setenv ipaddr 192.168.1.150
Rex U-Boot > setenv serverip 192.168.1.1
Rex U-Boot > mw.b 0x10800000 0xFF 0x80000
Rex U-Boot > tftp 0x10800000 imx6/u-boot-imx6-rexpro.imx            
Using FEC device
TFTP from server 192.168.1.1; our IP address is 192.168.1.150
Filename 'imx6/u-boot-imx6-rexpro.imx'.
Load address: 0x10800000
Loading: #######################
        2.9 MiB/s
done
Bytes transferred = 330752 (50c00 hex)
Rex U-Boot > sf probe 2:2;sf erase 0x0 0x80000;sf write 0x10800000 0x400 0x7fc00
SF: Detected SST25VF032B with page size 256 Bytes, erase size 4 KiB, total 4 MiB
SF: 524288 bytes @ 0x0 Erased: OK
SF: 523264 bytes @ 0x400 Written: OK
Rex U-Boot > 

U-Boot v2014.10

Download & Extract source code

cd ~/workdir/imx6/bootloader/
git clone -b uboot-imx-v2014.10 --single-branch https://github.com/voipac/uboot-imx uboot-imx-v2014.10-rex
cd uboot-imx-v2014.10-rex

Compile

Output file is called u-boot.imx.

IMX6 DualLite module (Prototype)

Linux/Yocto

cd ~/workdir/imx6/bootloader/uboot-imx-v2014.10-rex
make distclean
make mx6dlrex_config
make
cp u-boot.imx /srv/tftp/imx6/u-boot-imx6dl-rex.imx
cp u-boot.bin /srv/tftp/imx6/u-boot-imx6dl-rex.bin

IMX6 Basic module (Production)

Linux/Yocto

cd ~/workdir/imx6/bootloader/uboot-imx-v2014.10-rex
make distclean
make mx6rexbasic_config
make
cp u-boot.imx /srv/tftp/imx6/u-boot-imx6-rexbasic.imx
cp u-boot.bin /srv/tftp/imx6/u-boot-imx6-rexbasic.bin

IMX6 Pro module (Production)

Linux/Yocto

cd ~/workdir/imx6/bootloader/uboot-imx-v2014.10-rex
make distclean
make mx6rexpro_config
make
cp u-boot.imx /srv/tftp/imx6/u-boot-imx6-rexpro.imx
cp u-boot.bin /srv/tftp/imx6/u-boot-imx6-rexpro.bin

Linux/Yocto - Version for SD card for usage in combination with iMX6DQ_SPI_to_uSDHC3.bin.

cd ~/workdir/imx6/bootloader/uboot-imx-v2014.10-rex
make distclean
make mx6rexprosd_config
make
cp u-boot.imx /srv/tftp/imx6/u-boot-imx6-rexprosd.imx
cp u-boot.bin /srv/tftp/imx6/u-boot-imx6-rexprosd.bin

IMX6 Ultra module (Production)

Linux/Yocto

cd ~/workdir/imx6/bootloader/uboot-imx-v2014.10-rex
make distclean
make mx6rexultra_config
make
cp u-boot.imx /srv/tftp/imx6/u-boot-imx6-rexultra.imx
cp u-boot.bin /srv/tftp/imx6/u-boot-imx6-rexultra.bin

How to Flash new version

IMX6 DualLite module (Prototype)

setenv ipaddr 192.168.0.150
setenv serverip 192.168.0.1
tftp 0x177ff400 imx6/u-boot-imx6dl-rex.bin
go 0x17800000

setenv ipaddr 192.168.0.150
setenv serverip 192.168.0.1
mw.b 0x10800000 0xFF 0x80000
tftp 0x10800000 imx6/u-boot-imx6dl-rex.imx
sf probe 2:2;sf erase 0x0 0x80000;sf write 0x10800000 0x400 0x7fc00

IMX6 Basic module (Production)

setenv ipaddr 192.168.0.150
setenv serverip 192.168.0.1
tftp 0x177ff400 imx6/u-boot-imx6-rexbasic.imx
go 0x17800000

setenv ipaddr 192.168.0.150
setenv serverip 192.168.0.1
mw.b 0x10800000 0xFF 0x80000
tftp 0x10800000 imx6/u-boot-imx6-rexbasic.imx
sf probe 2:2;sf erase 0x0 0x80000;sf write 0x10800000 0x400 0x7fc00

IMX6 Pro module (Production)

setenv ipaddr 192.168.0.150
setenv serverip 192.168.0.1
tftp 0x177ff400 imx6/u-boot-imx6-rexpro.imx
go 0x17800000

setenv ipaddr 192.168.0.150
setenv serverip 192.168.0.1
mw.b 0x10800000 0xFF 0x80000
tftp 0x10800000 imx6/u-boot-imx6-rexpro.imx
sf probe 2:2;sf erase 0x0 0x80000;sf write 0x10800000 0x400 0x7fc00

Version for SD card for usage in combination with iMX6DQ_SPI_to_uSDHC3.bin.

Bootloader can be also stored directly into SD card using host system.

sudo dd if=u-boot-imx6-rexprosd.imx of=/dev/sdb bs=1k seek=1 skip=0 oflag=dsync
#setenv ipaddr 192.168.0.150
#setenv serverip 192.168.0.1
#tftp 0x177ff400 imx6/u-boot-imx6-rexpro.imx
#go 0x17800000

setenv ipaddr 192.168.0.150
setenv serverip 192.168.0.1
mw.b 0x10800000 0xFF 0x80000
tftp 0x10800000 imx6/u-boot-imx6-rexprosd.imx
mmc dev 0
setexpr fw_sz ${filesize} / 0x200
setexpr fw_sz ${fw_sz} + 1
mmc write 0x10800000 0x2 ${fw_sz}

IMX6 Ultra module (Production)

setenv ipaddr 192.168.0.150
setenv serverip 192.168.0.1
tftp 0x177ff400 imx6/u-boot-imx6-rexultra.imx
go 0x17800000

setenv ipaddr 192.168.0.150
setenv serverip 192.168.0.1
mw.b 0x10800000 0xFF 0x80000
tftp 0x10800000 imx6/u-boot-imx6-rexultra.imx
sf probe 2:2;sf erase 0x0 0x80000;sf write 0x10800000 0x400 0x7fc00

U-Boot v2009.08

Download & Extract source code

cd ~/workdir/imx6/bootloader/
git clone -b uboot-imx-v2009.08 --single-branch https://github.com/voipac/uboot-imx uboot-imx-v2009.08-rex
cd
cd 
uboot-imx-v2009.08-rex

Compile

IMX6 DualLite module (Prototype)

Linux/Yocto/Android 4.4.x

cd ~/workdir/imx6/bootloader/uboot-imx-v2009.08-rex
make distclean
make mx6dl_rex_config
make -j4
cp -av u-boot.bin /srv/tftp/imx6/u-boot-0x27800000_imx6dl_$(date "+%Y%m%d").bin

IMX6 Pro module (Production)

Linux/Yocto/Android 4.4.x

cd ~/workdir/imx6/bootloader/uboot-imx-v2009.08-rex
make distclean
make mx6q_rex_config
make -j4
cp -av u-boot.bin /srv/tftp/imx6/u-boot-0x27800000_imx6q_$(date "+%Y%m%d").bin
Output file is called u-boot.bin.

How to Flash new version

setenv ipaddr 192.168.0.150
setenv serverip 192.168.0.1

mw.b 0x10800000 0xFF 0x80000
tftp 0x10800000 imx6/u-boot-0x27800000_imx6q_20160410.bin
sf probe 3:2;sf erase 0x0 0x80000;sf write 0x10800000 0x0 0x80000

Configure

Manually erase configuration

Rex U-Boot > sf probe 2:2           
SF: Detected SST25VF032B with page size 256 Bytes, erase size 4 KiB, total 4 MiB
Rex U-Boot > sf erase 0x80000 0x2000
SF: 8192 bytes @ 0x80000 Erased: OK
Rex U-Boot > reset

Android 4.4.2 bootloader + Fedevel kernels

To boot kernels available at http://www.imx6rex.com/application/imx6-development-board/ the machid variable must be modified:

Rex U-Boot > setenv machid f8c
Rex U-Boot > saveenv

Running bootloader from SD card

Rex modules are configured to boot from SPI flash memory by efuses. This setting can be overwritten by running special firmware that must be stored into SPI flash memory. 

setenv ipaddr 192.168.0.150
setenv serverip 192.168.0.1
mw.b 0x10800000 0xFF 0x80000
tftp 0x10800000 imx6/iMX6DQ_SPI_to_uSDHC3.bin
sf probe 2:2
sf erase 0x0 0x80000
sf write 0x10800000 0x0 0x80000

Edit boot options

Manually boot from SATA

mw.l 0x020d8040 0x00001020; mw.l 0x020d8044 0x10000000; reset
Tags:
Created by Administrator on 2015/10/07 15:09

This wiki is licensed under a Creative Commons 2.0 license
XWiki Enterprise 6.1 - Documentation