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

From Voipac Wiki
Jump to navigation Jump to search
Line 33: Line 33:
 
cd ~/workdir/imx6/bootloader/uboot-imx-v2015.04-rex
 
cd ~/workdir/imx6/bootloader/uboot-imx-v2015.04-rex
 
make distclean
 
make distclean
make mx6openrexultra_config
+
make mx6openrexbasic_config
 
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-openrexultra.imx
+
cp -av u-boot.imx /srv/tftp/imx6/u-boot-imx6-openrexbasic.imx
</syntaxhighlight>
 
 
 
==== Compile for SATA and Linux/Yocto ====
 
<syntaxhighlight lang="bash">
 
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
 
</syntaxhighlight>
 
 
 
==== Compile for SD3 and Android 7.x ====
 
<syntaxhighlight lang="bash">
 
cd ~/workdir/imx6/bootloader/uboot-imx-v2015.04-rex
 
make distclean
 
make mx6openrexultraandroid_config
 
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi-
 
cp -av u-boot.imx /srv/tftp/imx6/u-boot-imx6-openrexultraandroid.imx
 
 
</syntaxhighlight>
 
</syntaxhighlight>
  
Line 70: Line 52:
 
U-Boot 2015.04-gfd6325c-dirty (Mar 11 2017 - 23:09:03)
 
U-Boot 2015.04-gfd6325c-dirty (Mar 11 2017 - 23:09:03)
  
CPU:  Freescale i.MX6QP rev1.1 at 792 MHz
+
CPU:  Freescale i.MX6SOLO rev1.1 at 792 MHz
 
CPU:  Temperature 34 C
 
CPU:  Temperature 34 C
 
Reset cause: POR
 
Reset cause: POR
Board: MX6 OpenRex - ultra
+
Board: MX6 OpenRex - basic
 
I2C:  ready
 
I2C:  ready
 
DRAM:  512 MiB
 
DRAM:  512 MiB
Line 88: Line 70:
 
OpenRex U-Boot > setenv serverip 192.168.1.1
 
OpenRex U-Boot > setenv serverip 192.168.1.1
 
OpenRex U-Boot > mw.b 0x10800000 0xFF 0x80000
 
OpenRex U-Boot > mw.b 0x10800000 0xFF 0x80000
OpenRex U-Boot > tftp 0x10800000 imx6/u-boot-imx6-openrexultra.imx
+
OpenRex U-Boot > tftp 0x10800000 imx6/u-boot-imx6-openrexbasic.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-openrexultra.imx'.
+
Filename 'imx6/u-boot-imx6-openrexbasic.imx'.
 
Load address: 0x10800000
 
Load address: 0x10800000
 
Loading: #######################
 
Loading: #######################
Line 102: Line 84:
 
SF: 523264 bytes @ 0x400 Written: OK
 
SF: 523264 bytes @ 0x400 Written: OK
 
OpenRex U-Boot >  
 
OpenRex U-Boot >  
</syntaxhighlight>
 
 
==== Flash into SATA using U-Boot ====
 
<syntaxhighlight lang="bash">
 
setenv ipaddr 192.168.0.150
 
setenv serverip 192.168.0.1
 
mw.b 0x10800000 0xFF 0x80000
 
tftp 0x10800000 imx6/u-boot-imx6-openrex*sata.imx
 
if sata init; then sata write 0x10800000 0x2 0x3ff; fi
 
</syntaxhighlight>
 
 
Flashing log:
 
<syntaxhighlight lang="bash">
 
U-Boot 2015.04-g8efb1bd-dirty (Jul 28 2017 - 15:47:05)
 
 
CPU:  Freescale i.MX6QP rev1.0 at 792 MHz
 
CPU:  Temperature 37 C
 
Reset cause: WDOG
 
Board: MX6 OpenRex - ultra
 
I2C:  ready
 
DRAM:  3.8 GiB
 
WARNING: Caches not enabled
 
PMIC:  PFUZE100 ID=0x10
 
MMC:  FSL_SDHC: 0
 
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
 
*** Warning - bad CRC, using default environment
 
 
In:    serial
 
Out:  serial
 
Err:  serial
 
Net:  FEC [PRIME]
 
Normal Boot
 
Hit any key to stop autoboot:  0
 
OpenRex U-Boot > setenv ipaddr 192.168.0.150
 
OpenRex U-Boot > setenv serverip 192.168.0.1
 
OpenRex U-Boot > mw.b 0x10800000 0xFF 0x80000
 
OpenRex U-Boot > tftp 0x10800000 imx6/u-boot-imx6-openrexultrasata.imx
 
Using FEC device
 
TFTP from server 192.168.0.1; our IP address is 192.168.0.150
 
Filename 'imx6/u-boot-imx6-openrexultrasata.imx'.
 
Load address: 0x10800000
 
Loading: ########################
 
        2.6 MiB/s
 
done
 
Bytes transferred = 337968 (52830 hex)
 
OpenRex 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
 
OpenRex U-Boot >
 
</syntaxhighlight>
 
 
==== Flash into SATA using Linux ====
 
<syntaxhighlight lang="bash">
 
sudo dd if=u-boot-imx6-openrex*sata.imx of=/dev/sdx bs=512 seek=2 conv=fsync
 
 
</syntaxhighlight>
 
</syntaxhighlight>
  
Line 192: Line 107:
 
<syntaxhighlight lang="bash">
 
<syntaxhighlight lang="bash">
 
mw.l 0x020d8040 0x00002840; mw.l 0x020d8044 0x10000000; reset
 
mw.l 0x020d8040 0x00002840; mw.l 0x020d8044 0x10000000; reset
</syntaxhighlight>
 
 
==== Manually boot from SATA ====
 
<syntaxhighlight lang="bash">
 
mw.l 0x020d8040 0x00001020; mw.l 0x020d8044 0x10000000; reset
 
 
</syntaxhighlight>
 
</syntaxhighlight>

Revision as of 07:21, 2 April 2021

U-Boot is a bootloader responsible for hardware initialization, loading and booting Linux kernel. It is also used for SBC 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 mx6openrexbasic_config
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi-
cp -av u-boot.imx /srv/tftp/imx6/u-boot-imx6-openrexbasic.imx

How to Flash a new version

Flash into SPI Flash using U-Boot

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

Flashing log:

U-Boot 2015.04-gfd6325c-dirty (Mar 11 2017 - 23:09:03)

CPU:   Freescale i.MX6SOLO rev1.1 at 792 MHz
CPU:   Temperature 34 C
Reset cause: POR
Board: MX6 OpenRex - basic
I2C:   ready
DRAM:  512 MiB
PMIC:  PFUZE100 ID=0x10
MMC:   FSL_SDHC: 0
SF: Detected SST26VF032B 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 
OpenRex U-Boot > setenv ipaddr 192.168.1.150
OpenRex U-Boot > setenv serverip 192.168.1.1
OpenRex U-Boot > mw.b 0x10800000 0xFF 0x80000
OpenRex U-Boot > tftp 0x10800000 imx6/u-boot-imx6-openrexbasic.imx
Using FEC device
TFTP from server 192.168.1.1; our IP address is 192.168.1.150
Filename 'imx6/u-boot-imx6-openrexbasic.imx'.
Load address: 0x10800000
Loading: #######################
         2.8 MiB/s
done
Bytes transferred = 334848 (51c00 hex)
OpenRex U-Boot > sf probe 2:2;sf erase 0x0 0x80000;sf write 0x10800000 0x400 0x7fc00
SF: Detected SST26VF032B with page size 256 Bytes, erase size 4 KiB, total 4 MiB
SF: 524288 bytes @ 0x0 Erased: OK
SF: 523264 bytes @ 0x400 Written: OK
OpenRex U-Boot >

Configure

Manually erase configuration

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

Manual boot options

Manually boot from SPI3

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

Manually boot from SD2

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