Changes

Jump to: navigation, search

XELK-AN-007: Migrating u-boot to SPL

757 bytes added, 14:18, 8 October 2020
no edit summary
{{AppliesToAxelEsatta}}
{{AppliesToAxelLite}}
{{AppliesToAXEL Lite AN}}
{{InfoBoxBottom}}
Starting from [[Axel_Embedded_Linux_Kit_(XELK)#XELK_3.5.0|XELK 3.5.0]] binary version, u-boot supports the [https://en.wikipedia.org/wiki/Booting#SPL SPL] first-stage bootloader and second-stage bootloader (the proper u-boot complete binary).
It is then required to update the u-boot con on AXEL LITE SoM using some new u-boot environment variables: those vars will be present and ready to be used on the new SPL default environment.
Here below, you can find a '''step-by-step''' user's guide for updating u-boot to the new SPL version.
=== update u-boot on NAND flash ===
The SPL and u-boot image, must be flashed on NAND using the NXP <code>kobs-ng</code> utility. This tool is required for writing correct information needed by bootrom to identify the NAND as a boot device.
 
'''N.B.''' for programming the second stage, the <code>nandwrite</code> command has to identify a proper mtd part witch correct size. For this reason, the ''mtdparts'' variable has to be modified for writing the complete u-boot image.
The following steps are therefore necessary:
# execute '''kobs-ng''' passing the parameters for flashing the SPL on NAND
# execute '''nandwrite''' to flash uboot image on NAND
 
* configure the ''mtdparts''
<pre class="board-terminal">
=> setenv mtdparts 'mtdparts=gpmi-nand:2M(nand-SPL),6M(nand-uboot),1M(nand-env1),1M(nand-env2),1M(nand-fdt),1M(nand-spare),8M(nand-kernel),4M(nand-splash),-(nand-ubi)'
</pre>
* configure u-boot vars for booting from NFS
mtd: We write one page for save guard. *
root@imx6qxelk:~# </pre>
 
* erase the mtd part with <code>flash_erase</code>
<pre class="board-terminal">
root@imx6qxelk:~# flash_erase /dev/mtd1 0 0
</pre>
* execute <code>nandwrite</code> for second stage programming
U-Boot 2016.03-xelk-3.5.0-rc5 (Feb 25 Apr 19 2019 - 1623:1637:57 42 +01000200), Build: jenkins-XELK-u-boot-6062
CPU: Freescale i.MX6DL rev1.3 at 792MHz
CPU: Industrial temperature grade (-40C to 105C) at 53C56C
Reset cause: POR
Environment: NAND
I2C: ready
DRAM: 1 GiB
Relocating to 4ff310004ff30000, new gd at 4df30eb84df2feb8, sp at 4df30e904df2fe90
PMIC: PFUZE100 ID=0x10
NAND: 1024 MiB
MMC: FSL_SDHC: 0
NAND read from offset 800000 failed -74
*** Warning - some problems detected reading environment; recovered successfully
WARNING: CB ConfigID on block 0 is UNLOCKED
Display: LDB-AM-800480STMQW-TA1-SBCX-REVB (800x480)
Fastboot: unsupported boot devices
Net: FEC [PRIME]
Warning: FEC (eth0) using random MAC address - 62a6:1b1d:e761:8882:e7c9:4b0f
Normal Boot
=>
</pre>
 
As you can see, the SPL code recognizes the NAND flash and properly loads the correct u-boot second-stage for its execution:
 
U-Boot SPL 2016.03-xelk-3.5.0 (Apr 19 2019 - 23:37:42)
SOM ConfigID#: 00000001
Trying to boot from NAND
NAND : 1024 MiB
8,184
edits

Navigation menu