Difference between revisions of "i.MX53 SODIMM PC Barebox"

From Voipac Wiki
Jump to navigation Jump to search
 
(4 intermediate revisions by the same user not shown)
Line 1: Line 1:
[[Category:i.MX53 SODIMM PC - Development kit]]
+
[[Category:i.MX53 SODIMM PC - Development Kit]]
 
[[Category:Barebox]]
 
[[Category:Barebox]]
 
<!-- -->
 
<!-- -->
 
<div style="float:right">__TOC__</div>
 
<div style="float:right">__TOC__</div>
  
i.MX53 SODIMM PC - Development kit uses Barebox as a bootloader. This page displays how to configure and build it.<br /><br />
+
i.MX53 SODIMM PC - Development Kit uses Barebox as a bootloader. This page displays how to configure and build it.<br /><br />
  
 
Barebox is a bootloader responsible for hardware initialization, loading and booting Linux kernel. It is also used for module flashing.
 
Barebox is a bootloader responsible for hardware initialization, loading and booting Linux kernel. It is also used for module flashing.
  
 
== Building images ==
 
== Building images ==
 
 
=== Set toolchain ===
 
=== Set toolchain ===
 
Export [[i.MX53_SODIMM_PC_Toolchain|toolchain variables]] for every related terminal session.
 
Export [[i.MX53_SODIMM_PC_Toolchain|toolchain variables]] for every related terminal session.
Line 32: Line 31:
 
<syntaxhighlight lang="bash">
 
<syntaxhighlight lang="bash">
 
cd ~/workdir/vmx53/barebox/
 
cd ~/workdir/vmx53/barebox/
wget http://downloads.voipac.com/files/i.MX53_SODIMM_PC-Development_kit/module/software/barebox/sources/barebox-2014.03.0_vmx53_20151129.cfg
+
wget http://downloads.voipac.com/files/i.MX53_SODIMM_PC-Development_Kit/module/software/barebox/sources/barebox-2014.03.0_vmx53_20151129.cfg
wget http://downloads.voipac.com/files/i.MX53_SODIMM_PC-Development_kit/module/software/barebox/sources/barebox-2014.03.0_vmx53_20151129.patch
+
wget http://downloads.voipac.com/files/i.MX53_SODIMM_PC-Development_Kit/module/software/barebox/sources/barebox-2014.03.0_vmx53_20151129.patch
 
cd ~/workdir/vmx53/barebox/barebox-${BB_VERSION}.work
 
cd ~/workdir/vmx53/barebox/barebox-${BB_VERSION}.work
 
patch -p1 < ../barebox-${BB_VERSION}_vmx53_${SW_VERSION}.patch
 
patch -p1 < ../barebox-${BB_VERSION}_vmx53_${SW_VERSION}.patch
Line 40: Line 39:
  
 
=== Compile ===
 
=== Compile ===
Output file is called arch/arm/pbl/zbarebox.bin:
+
Output file is stored in arch/arm/pbl/zbarebox.bin:
 
<syntaxhighlight lang="bash">
 
<syntaxhighlight lang="bash">
 
cd ~/workdir/vmx53/barebox/barebox-${BB_VERSION}.work
 
cd ~/workdir/vmx53/barebox/barebox-${BB_VERSION}.work
Line 47: Line 46:
 
</syntaxhighlight>
 
</syntaxhighlight>
  
== Configure ==
+
== Configuring bootloader environment ==
 
 
 
=== Edit boot options ===
 
=== Edit boot options ===
  
Line 67: Line 65:
 
** Attach rootfs (nfs)
 
** Attach rootfs (nfs)
 
<br />
 
<br />
Boot configuration files support options to define custom kernel and rootfs names or paths:
+
Boot configuration files support custom kernel definition. These settings also allow updating paths or names for binaries:
 
<syntaxhighlight lang="bash">
 
<syntaxhighlight lang="bash">
 
barebox@Voipac VMX53:/ edit /env/boot/net-dtb
 
barebox@Voipac VMX53:/ edit /env/boot/net-dtb
Line 83: Line 81:
 
</syntaxhighlight>
 
</syntaxhighlight>
  
=== Set correct DTB file based on module configuration ===
+
=== DTB file selection ===
Because each configuration uses an altered device tree, defining the correct board variant is important:
+
As different module configurations use altered device trees, defining the correct board variant is important:
 
<syntaxhighlight lang="bash">
 
<syntaxhighlight lang="bash">
 
barebox@Voipac VMX53:/ edit /env/config
 
barebox@Voipac VMX53:/ edit /env/config

Latest revision as of 22:50, 23 October 2021

i.MX53 SODIMM PC - Development Kit uses Barebox as a bootloader. This page displays how to configure and build it.

Barebox is a bootloader responsible for hardware initialization, loading and booting Linux kernel. It is also used for module flashing.

Building images

Set toolchain

Export toolchain variables for every related terminal session.

Set shell variables

BB_VERSION=2014.03.0
SW_VERSION=20150308

Download and extract source code

mkdir -pv ~/workdir/vmx53/barebox/
cd ~/workdir/vmx53/barebox/
wget http://barebox.org/download/barebox-${BB_VERSION}.tar.bz2
tar xvjf barebox-${BB_VERSION}.tar.bz2
mv barebox-${BB_VERSION} barebox-${BB_VERSION}.orig
cp -rv barebox-${BB_VERSION}.orig barebox-${BB_VERSION}.work

Download and apply Voipac patches

cd ~/workdir/vmx53/barebox/
wget http://downloads.voipac.com/files/i.MX53_SODIMM_PC-Development_Kit/module/software/barebox/sources/barebox-2014.03.0_vmx53_20151129.cfg
wget http://downloads.voipac.com/files/i.MX53_SODIMM_PC-Development_Kit/module/software/barebox/sources/barebox-2014.03.0_vmx53_20151129.patch
cd ~/workdir/vmx53/barebox/barebox-${BB_VERSION}.work
patch -p1 < ../barebox-${BB_VERSION}_vmx53_${SW_VERSION}.patch
cp ../barebox-${BB_VERSION}_vmx53_${SW_VERSION}.cfg .config

Compile

Output file is stored in arch/arm/pbl/zbarebox.bin:

cd ~/workdir/vmx53/barebox/barebox-${BB_VERSION}.work
#make ARCH=arm menuconfig
make -j4

Configuring bootloader environment

Edit boot options

Barebox provides 4 boot configurations by default:

  • nand-legacy-ubi
    • Load kernel (nand - kernel)
    • Attach rootfs (nand - rootfs)
  • nand-dtb-ubi
    • Load kernel (nand - kernel)
    • Load device tree (nand - bareboxenv)
    • Attach rootfs (nand - rootfs)
  • net-legacy
    • Load kernel (tftp)
    • Attach rootfs (nfs)
  • net-dtb
    • Load kernel (tftp)
    • Load device tree (tftp)
    • Attach rootfs (nfs)


Boot configuration files support custom kernel definition. These settings also allow updating paths or names for binaries:

barebox@Voipac VMX53:/ edit /env/boot/net-dtb
barebox@Voipac VMX53:/ edit /env/config

# list of boot entries. These are executed in order until one
# succeeds. An entry can be:
# - a filename in /env/boot/
# - a full path to a directory. All files in this directory are
#   treated as boot files and executed in alphabetical order
global.boot.default=nand-dtb-ubi

DTB file selection

As different module configurations use altered device trees, defining the correct board variant is important:

barebox@Voipac VMX53:/ edit /env/config
...
# BASIC=557, PRO=668, MAX=779
#global.vmxmodel=557
global.vmxmodel=668
#global.vmxmodel=779
...
barebox@Voipac VMX53:/ saveenv
barebox@Voipac VMX53:/ reset