General Actions:
Log-in
Register
Home
▼
:
Wiki Index
Document Index
User Index
»
Space:
vmx53
▼
:
Document Index
»
Page:
barebox
Search
Page Actions:
Export
▼
:
Export as PDF
Export as RTF
Export as HTML
More actions
▼
:
Print preview
View Source
Wiki Home
»
vmx53
»
barebox
Wiki source code of
barebox
Last modified by
Administrator
on 2018/10/21 17:36
Content
·
Comments
(0)
·
Attachments
(0)
·
History
·
Information
Hide line numbers
1: {{box cssClass="floatinginfobox" title="**Contents**"}} 2: {{toc/}} 3: {{/box}} 4: 5: {{info}} 6: Barebox is a bootloader responsible for hardware initialization, loading and booting linux kernel. It is also used for module flashing. 7: {{/info}} 8: 9: = Build = 10: 11: == Set toolchain == 12: 13: {{info}} 14: Binary files build with Codesourcery toolchain are known to work correctly. 15: {{/info}} 16: 17: Export [[toolchain variables>>vmx25.toolchain]] for every related terminal session. 18: 19: == Initial steps == 20: 21: Create working directory 22: 23: {{code language="bash"}} 24: mkdir -pv ~/workdir/vmx53/barebox/ 25: {{/code}} 26: 27: == Set shell variables == 28: 29: {{code language="bash"}} 30: BB_VERSION=2014.03.0 31: SW_VERSION=20150308 32: {{/code}} 33: 34: == Download & Extract source code == 35: 36: {{code language="bash"}} 37: cd ~/workdir/vmx53/barebox/ 38: wget http://barebox.org/download/barebox-${BB_VERSION}.tar.bz2 39: tar xvjf barebox-${BB_VERSION}.tar.bz2 40: mv barebox-${BB_VERSION} barebox-${BB_VERSION}.orig 41: cp -rv barebox-${BB_VERSION}.orig barebox-${BB_VERSION}.work 42: {{/code}} 43: 44: == Patch == 45: 46: {{code language="bash"}} 47: cd ~/workdir/vmx53/barebox/ 48: wget https://www.voipac.com/downloads/imx/53/src/barebox-${BB_VERSION}_vmx53_${SW_VERSION}.cfg 49: wget https://www.voipac.com/downloads/imx/53/src/barebox-${BB_VERSION}_vmx53_${SW_VERSION}.patch 50: cd ~/workdir/vmx53/barebox/barebox-${BB_VERSION}.work 51: patch -p1 < ../barebox-${BB_VERSION}_vmx53_${SW_VERSION}.patch 52: cp ../barebox-${BB_VERSION}_vmx53_${SW_VERSION}.cfg .config 53: {{/code}} 54: 55: == Compile == 56: 57: {{code language="bash"}} 58: cd ~/workdir/vmx53/barebox/barebox-${BB_VERSION}.work 59: #make ARCH=arm menuconfig 60: make -j4 61: {{/code}} 62: 63: {{info}} 64: Output file is called arch/arm/pbl/zbarebox.bin 65: {{/info}} 66: 67: = Configure = 68: 69: == Edit boot options == 70: 71: By default the barebox has predefined 4 boot configurations: 72: 73: * nand-legacy-ubi 74: ** Load kernel (nand - kernel) 75: ** Attach rootfs (nand - rootfs) 76: * nand-dtb-ubi 77: ** Load kernel (nand - kernel) 78: ** Load device tree (nand - bareboxenv) 79: ** Attach rootfs (nand - rootfs) 80: * net-legacy 81: ** Load kernel (tftp) 82: ** Attach rootfs (nfs) 83: * net-dtb 84: ** Load kernel (tftp) 85: ** Load device tree (tftp) 86: ** Attach rootfs (nfs) 87: 88: The boot configuration files include option such as kernel and rootfs name and paths (can be edited) 89: 90: {{code language="bash"}} 91: barebox@Voipac VMX53:/ edit /env/boot/net-dtb 92: {{/code}} 93: 94: {{code language="bash"}} 95: barebox@Voipac VMX53:/ edit /env/config 96: 97: # list of boot entries. These are executed in order until one 98: # succeeds. An entry can be: 99: # - a filename in /env/boot/ 100: # - a full path to a directory. All files in this directory are 101: # treated as boot files and executed in alphabetical order 102: global.boot.default=nand-dtb-ubi 103: {{/code}} 104: 105: == Set correct DTB file based on module configuration == 106: 107: This is important when booting with Device Tree. 108: 109: {{code language="bash"}} 110: barebox@Voipac VMX53:/ edit /env/config 111: ... 112: # BASIC=557, PRO=668, MAX=779 113: #global.vmxmodel=557 114: global.vmxmodel=668 115: #global.vmxmodel=779 116: ... 117: barebox@Voipac VMX53:/ saveenv 118: barebox@Voipac VMX53:/ reset 119: {{/code}}
Quick Links
vmx25
vmx53
imx6 rex
imx6 tinyrex
imx6 openrex