Difference between revisions of "iMX6 TinyRex Ultra U-Boot"

From Voipac Wiki
Jump to navigation Jump to search
 
(10 intermediate revisions by the same user not shown)
Line 1: Line 1:
[[Category:iMX6 TinyRex Development kit]]
+
[[Category:iMX6 TinyRex Development Kit]]
 
[[Category:iMX6 TinyRex Ultra]]
 
[[Category:iMX6 TinyRex Ultra]]
[[Category:U-boot]]
+
[[Category:U-Boot]]
 
<!-- -->
 
<!-- -->
 
<div style="float:right">__TOC__</div>
 
<div style="float:right">__TOC__</div>
U-boot is a bootloader responsible for hardware initialization, loading and booting linux kernel. It is also used for module flashing.
+
U-Boot is a bootloader responsible for hardware initialization, loading and booting Linux kernel. It is also used for module flashing.
  
 
== Build ==
 
== Build ==
Line 13: Line 13:
 
==== Initial steps ====
 
==== Initial steps ====
 
Create working directory
 
Create working directory
<pre>
+
<syntaxhighlight lang="bash">
 
mkdir -pv ~/workdir/imx6/bootloader/
 
mkdir -pv ~/workdir/imx6/bootloader/
</pre>
+
</syntaxhighlight>
  
 
== U-Boot v2015.04 ==
 
== U-Boot v2015.04 ==
  
=== Download & Extract source code ===
+
=== Download and extract source code ===
<pre>
+
<syntaxhighlight lang="bash">
 
cd ~/workdir/imx6/bootloader/
 
cd ~/workdir/imx6/bootloader/
 
git clone -b uboot-imx-v2015.04 --single-branch https://github.com/voipac/uboot-imx uboot-imx-v2015.04-rex
 
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
 
cd uboot-imx-v2015.04-rex
</pre>
+
</syntaxhighlight>
  
 
=== Compile ===
 
=== Compile ===
Output file is called u-boot.imx. All the compiled images are intended for production usage
+
Output file is called u-boot.imx. All the compiled images are intended for production usage.
  
 
==== Compile for SD3 and Linux/Yocto ====
 
==== Compile for SD3 and Linux/Yocto ====
Line 39: Line 39:
  
 
==== Compile for SD3 and Android 7.x ====
 
==== Compile for SD3 and Android 7.x ====
<syntaxhigh lang="bash">
+
<syntaxhighlight lang="bash">
 
cd ~/workdir/imx6/bootloader/uboot-imx-v2015.04-rex
 
cd ~/workdir/imx6/bootloader/uboot-imx-v2015.04-rex
 
make distclean
 
make distclean
Line 45: Line 45:
 
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi-
 
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi-
 
cp -av u-boot.imx /srv/tftp/imx6/u-boot-imx6-tinyrexultraandroid.imx
 
cp -av u-boot.imx /srv/tftp/imx6/u-boot-imx6-tinyrexultraandroid.imx
</syntaxhigh>
+
</syntaxhighlight>
  
 
==== Compile for SPI1 and Linux/Yocto ====
 
==== Compile for SPI1 and Linux/Yocto ====
<syntaxhighlight lang="bash" inline>
+
<syntaxhighlight lang="bash">
 
cd ~/workdir/imx6/bootloader/uboot-imx-v2015.04-rex
 
cd ~/workdir/imx6/bootloader/uboot-imx-v2015.04-rex
 
make distclean
 
make distclean
Line 57: Line 57:
  
 
==== Compile for SATA ====
 
==== Compile for SATA ====
<pre>
+
<syntaxhighlight lang="bash">
 
cd ~/workdir/imx6/bootloader/uboot-imx-v2015.04-rex
 
cd ~/workdir/imx6/bootloader/uboot-imx-v2015.04-rex
 
make distclean
 
make distclean
Line 63: Line 63:
 
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi-
 
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi-
 
cp -av u-boot.imx /srv/tftp/imx6/u-boot-imx6-tinyrexultrasata.imx
 
cp -av u-boot.imx /srv/tftp/imx6/u-boot-imx6-tinyrexultrasata.imx
</pre>
+
</syntaxhighlight>
  
=== How to Flash new version ===
+
=== How to Flash a new version ===
 
==== Flash Normal image into SD3 ====
 
==== Flash Normal image into SD3 ====
<pre>
+
<syntaxhighlight lang="bash">
 
sudo dd if=u-boot-imx6-tinyrex*.imx of=/dev/sdc bs=1k seek=1 skip=0 oflag=dsync
 
sudo dd if=u-boot-imx6-tinyrex*.imx of=/dev/sdc bs=1k seek=1 skip=0 oflag=dsync
</pre>
+
</syntaxhighlight>
  
 
==== Flash Recovery image into SPI1 ====
 
==== Flash Recovery image into SPI1 ====
<pre>
+
<syntaxhighlight lang="bash">
 
setenv ipaddr 192.168.0.150
 
setenv ipaddr 192.168.0.150
 
setenv serverip 192.168.0.1
 
setenv serverip 192.168.0.1
Line 78: Line 78:
 
tftp 0x10800000 imx6/u-boot-imx6-tinyrex*recovery.imx
 
tftp 0x10800000 imx6/u-boot-imx6-tinyrex*recovery.imx
 
if sf probe 0:0; then sf erase 0x0 0x80000;sf write 0x10800000 0x400 0x7fc00; fi
 
if sf probe 0:0; then sf erase 0x0 0x80000;sf write 0x10800000 0x400 0x7fc00; fi
</pre>
+
</syntaxhighlight>
  
 
Flashing log:
 
Flashing log:
<pre>
+
<syntaxhighlight lang="bash">
 
U-Boot 2015.04-g9de6034-dirty (Jan 08 2017 - 18:27:05)
 
U-Boot 2015.04-g9de6034-dirty (Jan 08 2017 - 18:27:05)
  
Line 87: Line 87:
 
CPU:  Temperature 32 C
 
CPU:  Temperature 32 C
 
Reset cause: POR
 
Reset cause: POR
Board: MX6 TinyRex - pro
+
Board: MX6 TinyRex - ultra
 
I2C:  ready
 
I2C:  ready
 
DRAM:  1 GiB
 
DRAM:  1 GiB
Line 100: Line 100:
 
Net:  FEC [PRIME]
 
Net:  FEC [PRIME]
 
Boot from USB for mfgtools
 
Boot from USB for mfgtools
Use default environment for                             mfgtools
+
Use default environment for mfgtools
 
Run bootcmd_mfg: <NULL>
 
Run bootcmd_mfg: <NULL>
 
TinyRex U-Boot > setenv ipaddr 192.168.1.150
 
TinyRex U-Boot > setenv ipaddr 192.168.1.150
 
TinyRex U-Boot > setenv serverip 192.168.1.1
 
TinyRex U-Boot > setenv serverip 192.168.1.1
 
TinyRex U-Boot > mw.b 0x10800000 0xFF 0x80000
 
TinyRex U-Boot > mw.b 0x10800000 0xFF 0x80000
TinyRex U-Boot > tftp 0x10800000 imx6/u-boot-imx6-tinyrexprorecovery.imx
+
TinyRex U-Boot > tftp 0x10800000 imx6/u-boot-imx6-tinyrexultrarecovery.imx
 
Using FEC device
 
Using FEC device
 
TFTP from server 192.168.1.1; our IP address is 192.168.1.150
 
TFTP from server 192.168.1.1; our IP address is 192.168.1.150
Filename 'imx6/u-boot-imx6-tinyrexprorecovery.imx'.
+
Filename 'imx6/u-boot-imx6-tinyrexultrarecovery.imx'.
 
Load address: 0x10800000
 
Load address: 0x10800000
 
Loading: #######################
 
Loading: #######################
Line 119: Line 119:
 
SF: 523264 bytes @ 0x400 Written: OK
 
SF: 523264 bytes @ 0x400 Written: OK
 
TinyRex U-Boot >  
 
TinyRex U-Boot >  
</pre>
+
</syntaxhighlight>
  
 
==== Flash into SATA ====
 
==== Flash into SATA ====
<pre>
+
<syntaxhighlight lang="bash">
 
setenv ipaddr 192.168.0.150
 
setenv ipaddr 192.168.0.150
 
setenv serverip 192.168.0.1
 
setenv serverip 192.168.0.1
Line 128: Line 128:
 
tftp 0x10800000 imx6/u-boot-imx6-tinyrex*sata.imx
 
tftp 0x10800000 imx6/u-boot-imx6-tinyrex*sata.imx
 
if sata init; then sata write 0x10800000 0x2 0x3ff; fi
 
if sata init; then sata write 0x10800000 0x2 0x3ff; fi
</pre>
+
</syntaxhighlight>
  
 
Flashing log:
 
Flashing log:
<pre>
+
<syntaxhighlight lang="bash">
 
U-Boot 2015.04-g8efb1bd-dirty (Jul 28 2017 - 16:36:40)
 
U-Boot 2015.04-g8efb1bd-dirty (Jul 28 2017 - 16:36:40)
  
Line 171: Line 171:
 
SATA write: device 0 block # 2, count 1023 ... 1023 blocks written: OK
 
SATA write: device 0 block # 2, count 1023 ... 1023 blocks written: OK
 
TinyRex U-Boot >
 
TinyRex U-Boot >
</pre>
+
</syntaxhighlight>
  
 
== U-Boot v2014.10 ==
 
== U-Boot v2014.10 ==
  
 
=== Download & Extract source code ===
 
=== Download & Extract source code ===
<pre>
+
<syntaxhighlight lang="bash">
 
cd ~/workdir/imx6/bootloader/
 
cd ~/workdir/imx6/bootloader/
 
git clone -b uboot-imx-v2014.10 --single-branch https://github.com/voipac/uboot-imx uboot-imx-v2014.10-rex
 
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
 
cd uboot-imx-v2014.10-rex
</pre>
+
</syntaxhighlight>
  
 
=== Compile ===
 
=== Compile ===
Output file is called u-boot.imx. The compiled image is intended for production usage
+
Output file is called u-boot.imx. The compiled image is intended for production usage.
  
 
==== Compile for Linux/Yocto ====
 
==== Compile for Linux/Yocto ====
<pre>
+
<syntaxhighlight lang="bash">
 
cd ~/workdir/imx6/bootloader/uboot-imx-v2014.10-rex
 
cd ~/workdir/imx6/bootloader/uboot-imx-v2014.10-rex
 
make distclean
 
make distclean
Line 192: Line 192:
 
make
 
make
 
cp -av u-boot.imx /srv/tftp/imx6/u-boot-imx6-tinyrexultra.imx
 
cp -av u-boot.imx /srv/tftp/imx6/u-boot-imx6-tinyrexultra.imx
</pre>
+
</syntaxhighlight>
  
=== How to Flash new version ===
+
=== How to Flash a new version ===
 
==== Flash Normal image into SD3 ====
 
==== Flash Normal image into SD3 ====
<pre>
+
<syntaxhighlight lang="bash">
 
sudo dd if=u-boot-imx6-tinyrex*.imx of=/dev/sdc bs=1k seek=1 skip=0 oflag=dsync
 
sudo dd if=u-boot-imx6-tinyrex*.imx of=/dev/sdc bs=1k seek=1 skip=0 oflag=dsync
</pre>
+
</syntaxhighlight>
  
 
== Configure ==
 
== Configure ==
  
 
==== Manually erase configuration ====
 
==== Manually erase configuration ====
<pre>
+
<syntaxhighlight lang="bash">
 
env default -f -a
 
env default -f -a
 
saveenv
 
saveenv
 
reset
 
reset
</pre>
+
</syntaxhighlight>
  
 
=== Manual boot options ===
 
=== Manual boot options ===
  
 
==== Manually boot from SD3 ====
 
==== Manually boot from SD3 ====
<pre>
+
<syntaxhighlight lang="bash">
 
mw.l 0x020d8040 0x00003040; mw.l 0x020d8044 0x10000000; reset
 
mw.l 0x020d8040 0x00003040; mw.l 0x020d8044 0x10000000; reset
</pre>
+
</syntaxhighlight>
  
 
==== Manually boot from SPI1 SS0 ====
 
==== Manually boot from SPI1 SS0 ====
<pre>
+
<syntaxhighlight lang="bash">
 
mw.l 0x020d8040 0x08000030; mw.l 0x020d8044 0x10000000; reset
 
mw.l 0x020d8040 0x08000030; mw.l 0x020d8044 0x10000000; reset
</pre>
+
</syntaxhighlight>
  
 
==== Manually boot from SD3 + recovery on SPI1 SS0 ====
 
==== Manually boot from SD3 + recovery on SPI1 SS0 ====
<pre>
+
<syntaxhighlight lang="bash">
 
mw.l 0x020d8040 0x48003040; mw.l 0x020d8044 0x10000000; reset
 
mw.l 0x020d8040 0x48003040; mw.l 0x020d8044 0x10000000; reset
</pre>
+
</syntaxhighlight>
  
 
==== Manually boot from SATA ====
 
==== Manually boot from SATA ====
<pre>
+
<syntaxhighlight lang="bash">
 
mw.l 0x020d8040 0x00001020; mw.l 0x020d8044 0x10000000; reset
 
mw.l 0x020d8040 0x00001020; mw.l 0x020d8044 0x10000000; reset
</pre>
+
</syntaxhighlight>
  
 
=== Change display resolution ===
 
=== Change display resolution ===
<pre>
+
<syntaxhighlight lang="bash">
 
setenv video "video=mxcfb0:dev=hdmi,1280x720M@60,if=RGB24,bpp=32"
 
setenv video "video=mxcfb0:dev=hdmi,1280x720M@60,if=RGB24,bpp=32"
 
saveenv
 
saveenv
</pre>
+
</syntaxhighlight>

Latest revision as of 23:27, 23 October 2021

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/

U-Boot v2015.04

Download and 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. All the compiled images are intended for production usage.

Compile for SD3 and Linux/Yocto

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

Compile for SD3 and Android 7.x

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

Compile for SPI1 and Linux/Yocto

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

Compile for SATA

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

How to Flash a new version

Flash Normal image into SD3

sudo dd if=u-boot-imx6-tinyrex*.imx of=/dev/sdc bs=1k seek=1 skip=0 oflag=dsync

Flash Recovery image into SPI1

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

Flashing log:

U-Boot 2015.04-g9de6034-dirty (Jan 08 2017 - 18:27:05)

CPU:   Freescale i.MX6D rev1.2 at 792 MHz
CPU:   Temperature 32 C
Reset cause: POR
Board: MX6 TinyRex - ultra
I2C:   ready
DRAM:  1 GiB
MMC:   FSL_SDHC: 0, FSL_SDHC: 1, FSL_SDHC: 2
Card did not respond to voltage select!
MMC init failed
Using default environment

In:    serial
Out:   serial
Err:   serial
Net:   FEC [PRIME]
Boot from USB for mfgtools
Use default environment for mfgtools
Run bootcmd_mfg: <NULL>
TinyRex U-Boot > setenv ipaddr 192.168.1.150
TinyRex U-Boot > setenv serverip 192.168.1.1
TinyRex U-Boot > mw.b 0x10800000 0xFF 0x80000
TinyRex U-Boot > tftp 0x10800000 imx6/u-boot-imx6-tinyrexultrarecovery.imx
Using FEC device
TFTP from server 192.168.1.1; our IP address is 192.168.1.150
Filename 'imx6/u-boot-imx6-tinyrexultrarecovery.imx'.
Load address: 0x10800000
Loading: #######################
         3.5 MiB/s
done
Bytes transferred = 334848 (51c00 hex)
TinyRex U-Boot > sf probe 0:0;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
TinyRex U-Boot >

Flash into SATA

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

Flashing log:

U-Boot 2015.04-g8efb1bd-dirty (Jul 28 2017 - 16:36:40)

CPU:   Freescale i.MX6QP rev1.0 at 792 MHz
CPU:   Temperature 36 C
Reset cause: WDOG
Board: MX6 TinyRex - ultra
I2C:   ready
DRAM:  3.8 GiB
MMC:   FSL_SDHC: 0, FSL_SDHC: 1, FSL_SDHC: 2
SF: Detected SST25VF032B with page size 256 Bytes, erase size 4 KiB, total 4 MiB
In:    serial
Out:   serial
Err:   serial
Net:   FEC [PRIME]
Normal Boot
Hit any key to stop autoboot:  0 
TinyRex U-Boot > setenv ipaddr 192.168.0.150
TinyRex U-Boot > setenv serverip 192.168.0.1
TinyRex U-Boot > mw.b 0x10800000 0xFF 0x80000
TinyRex U-Boot > tftp 0x10800000 imx6/u-boot-imx6-tinyrexultrasata.imx
Using FEC device
TFTP from server 192.168.0.1; our IP address is 192.168.0.150
Filename 'imx6/u-boot-imx6-tinyrexultrasata.imx'.
Load address: 0x10800000
Loading: ########################
         9.5 MiB/s
done
Bytes transferred = 337968 (52830 hex)
TinyRex U-Boot > if sata init; then sata write 0x10800000 0x2 0x3ff; fi
AHCI 0001.0300 32 slots 1 ports 3 Gbps 0x1 impl SATA mode
flags: ncq stag pm led clo only pmp pio slum part 
SATA Device Info:
S/N: E0117219300000000116
Product model number: 8GB SATA Flash Drive
Firmware version: SFDK003A
Capacity: 15649200 sectors

SATA write: device 0 block # 2, count 1023 ... 1023 blocks written: OK
TinyRex 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. The compiled image is intended for production usage.

Compile for Linux/Yocto

cd ~/workdir/imx6/bootloader/uboot-imx-v2014.10-rex
make distclean
make mx6tinyrexultra_config
make
cp -av u-boot.imx /srv/tftp/imx6/u-boot-imx6-tinyrexultra.imx

How to Flash a new version

Flash Normal image into SD3

sudo dd if=u-boot-imx6-tinyrex*.imx of=/dev/sdc bs=1k seek=1 skip=0 oflag=dsync

Configure

Manually erase configuration

env default -f -a
saveenv
reset

Manual boot options

Manually boot from SD3

mw.l 0x020d8040 0x00003040; mw.l 0x020d8044 0x10000000; reset

Manually boot from SPI1 SS0

mw.l 0x020d8040 0x08000030; mw.l 0x020d8044 0x10000000; reset

Manually boot from SD3 + recovery on SPI1 SS0

mw.l 0x020d8040 0x48003040; mw.l 0x020d8044 0x10000000; reset

Manually boot from SATA

mw.l 0x020d8040 0x00001020; mw.l 0x020d8044 0x10000000; reset

Change display resolution

setenv video "video=mxcfb0:dev=hdmi,1280x720M@60,if=RGB24,bpp=32"
saveenv