Open main menu

DAVE Developer's Wiki β

Changes

DESK-MX6UL-L/Deployment/Standalone boot

137 bytes added, 12:03, 28 February 2022
Updating outputs for DESK-MX6UL-L 3.0.0
<section begin="History" />
{| style="border-collapse:collapse; "
!colspan="4" style="width:100%; text-align:left"; border-bottom:solid 2px #ededed"|History
|-
!style="border-left:solid 2px #73B2C7; border-right:solid 2px #73B2C7;border-top:solid 2px #73B2C7; border-bottom:solid 2px #73B2C7; background-color:#73B2C7; padding:5px; color:white"|Version!style="border-left:solid 2px #73B2C7; border-right:solid 2px #73B2C7;border-top:solid 2px #73B2C7; border-bottom:solid 2px #73B2C7; background-color:#73B2C7; padding:5px; color:white"|Issue Date!style="border-left:solid 2px #73B2C7; border-right:solid 2px #73B2C7;border-top:solid 2px #73B2C7; border-bottom:solid 2px #73B2C7; background-color:#73B2C7; padding:5px; color:white"|Notes
|-
|style="border-left:solid 2px #73B2C7; border-right:solid 2px #73B2C7;border-top:solid 2px #73B2C7; border-bottom:solid 2px #73B2C7; background-color:#edf8fb; padding:5px; color:#000000"|1.0.1|style="border-left:solid 2px #73B2C7; border-right:solid 2px #73B2C7;border-top:solid 2px #73B2C7; border-bottom:solid 2px #73B2C7; background-color:#edf8fb; padding:5px; color:#000000"|Jun 2021|style="border-left:solid 2px #73B2C7; border-right:solid 2px #73B2C7;border-top:solid 2px #73B2C7; border-bottom:solid 2px #73B2C7; background-color:#edf8fb; padding:5px; color:#000000"|First DESK release|-| style="border-left:solid 2px #73B2C7; border-right:solid 2px #73B2C7;border-top:solid 2px #73B2C7; border-bottom:solid 2px #73B2C7; background-color:#edf8fb; padding:5px; color:#000000" |3.0.0| style="border-left:solid 2px #73B2C7; border-right:solid 2px #73B2C7;border-top:solid 2px #73B2C7; border-bottom:solid 2px #73B2C7; background-color:#edf8fb; padding:5px; color:#000000" |Feb 2022| style="border-left:solid 2px #73B2C7; border-right:solid 2px #73B2C7;border-top:solid 2px #73B2C7; border-bottom:solid 2px #73B2C7; background-color:#edf8fb; padding:5px; color:#000000" |3.0.0 DESK release
|-
|}
<section end="History" /><section begin="Body" />
==Standalone boot==
We'll explain how to program and configure a <SOM> to boot in standalone mode, without the need of a system microSD card or an NFS server, with threee three options:
* booting with NOR and NAND internal storage
** in this configuration the primary boot images will be fetched from NOR flash storage, while the root file system will be fetched from NAND flash
=== Program boot images into NOR flash ===
====uU-Boot====
Update to the latest uU-boot Boot version allows usage of u-boot environment variables available.
<pre class="workstation-terminal">
=> run loadload_spl
Using FEC0 device
TFTP from server 192.168.04.125240; our IP address is 192.168.04.89157Filename 'desk-mx-llynx/desk-mx6ul-l-1.0.1_mx6uldesk_axelulite_spi_SPLSPL'.
Load address: 0x80800000
Loading: ############ 5431.9 KiB8 MiB/s
done
Bytes transferred = 56320 44032 (dc00 ac00 hex)
=> run spi_update_spl
SF: Detected is25lp128 is25lp256 with page size 256 Bytes, erase size 64 KiB, total 16 32 MiB
SF: 65536 bytes @ 0x0 Erased: OK
device 0 offset 0x400, size 0xdc000xac00SF: 56320 44032 bytes @ 0x400 Written: OK
=> run load_uboot
Using FEC0 device
TFTP from server 192.168.04.125240; our IP address is 192.168.04.89157Filename 'desk-mx-llynx/desk-mx6ul-l-1.0.1_mx6uldesk_axelulite_spi_uu-boot.img'.
Load address: 0x80800000
Loading: #################################################################
############################################## 584 KiB1.8 MiB/s
done
Bytes transferred = 512568 564844 (7d238 89e6c hex)
=> run spi_update_uboot
SF: Detected is25lp128 is25lp256 with page size 256 Bytes, erase size 64 KiB, total 16 32 MiBSF: 524288 589824 bytes @ 0x10000 Erased: OKdevice 0 offset 0x10000, size 0x7d2380x89e6cSF: 512568 564844 bytes @ 0x10000 Written: OK=>
</pre>
====kernel image and device tree====
We assume that the following environment variables are present in uU-bootBoot:
<pre>
<pre class="workstation-terminal">
=> sf probe; run loadk spi_updatek loadfdt spi_updatefdt
SF: Detected is25lp128 with page size 256 Bytes, erase size 64 KiB, total 16 MiB
Using FEC0 device
TFTP from server 192.168.04.125240; our IP address is 192.168.04.89183Filename 'desk-mx-llynx/desk-mx6ul-l-1.0.1_uImageuImage'.
Load address: 0x80800000
Loading: #################################################################
#################################################################
#################################################################
################################################################# 553################################################################# ################################################################# ######################################## 1.7 KiB9 MiB/s
done
Bytes transferred = 7056696 8189464 (6bad38 7cf618 hex)
SF: 8388608 bytes @ 0x200000 Erased: OK
device 0 offset 0x200000, size 0x6bad380x7cf618SF: 7056696 8189464 bytes @ 0x200000 Written: OK
Using FEC0 device
TFTP from server 192.168.04.125240; our IP address is 192.168.04.89183Filename 'desk-mx-llynx/desk-mx6ul-l-1.0.1_imx6ul-axeluliteimx6ul-cb003alynx.dtb'.
Load address: 0x83000000
Loading: #######
584 KiB1.5 MiB/s
done
Bytes transferred = 34095 32518 (852f 7f06 hex)
SF: 524288 bytes @ 0x180000 Erased: OK
device 0 offset 0x180000, size 0x852f0x7f06SF: 34095 32518 bytes @ 0x180000 Written: OK=>
</pre>
=== Program boot images into NAND flash ===
====uU-Boot==== {{ImportantMessage|text=Only flashing the NAND device was tested for '''DESK-MX6UL-L 3.0.0''' release as neither SDV04 nor SBC Lynx support NAND boot.}}
uU-boot Boot on NAND flash must be programmed using NXP <code>kobs-ng</code> utility: this tool is required for writing the correct uU-boot Boot image on NAND storing all information needed by bootrom to identify the NAND as a boot device.
Here below an example:
* boot the system via SD on NFS
* uses a rfs with <b>kobs-ng</b> utility available on it (e.g. DAVE's rfs provided with <KIT>)
* copy the related uU-boot imx Boot image file on nfs /home/root (for example)* execute kobs-ng passing the parameters for flashing uU-boot Boot on NAND
<pre class="workstation-terminal">
root@desk-mx6ul-axelulite:~# kobs-ng -x -v -w desk-mx6ul-l-13.0.2_mx6uldesk_axelulite_nand_SPL0_mx6uldesk_axelulite_devel_SPL
MTD CONFIG:
chip_0_device_path = "/dev/mtd0"
boot_stream_1_address = 0
boot_stream_2_address = 0
secondary_boot_stream_off_in_MB = 64 -- We add the 1k-padding to the uboot.
.tmp_kobs_ng: verifying using key '00000000000000000000000000000000'
.tmp_kobs_ng: is a valid bootstream for key '00000000000000000000000000000000'
mtd: opening: "/dev/mtd0"
NFC geometry :
ECC Strength : 2 Page Size in Bytes : 2071 Metadata size : 10 ECC Chunk Size in byte : 512 ECC Chunk count : 4 Block Mark Byte Offset : 2028 Block Mark Bit Offset : 2
====================================================
mtd: opened '/dev/mtd0' - '(null)'
mtd: max_boot_stream_size_in_bytes = 3670016524288mtd: boot_stream_size_in_bytes = 67281245056mtd: boot_stream_size_in_pages = 32922mtd: #1 0x00100000 - 0x00480000 0x00180000 (0x001a442c0x0010b000)mtd: #2 0x00480000 0x00180000 - 0x00800000 0x00200000 (0x0052442c0x0018b000)
FCB
m_u32Checksum = 0x00000000
m_u32EraseThreshold = 0
m_u32Firmware1_startingPage = 512
m_u32Firmware2_startingPage = 2304768 m_u32PagesInFirmware1 = 32922 m_u32PagesInFirmware2 = 32922
m_u32DBBTSearchAreaStartAddress = 256
m_u32BadBlockMarkerByte = 2028
m_u32DISBBM = 0
m_u32BBMarkerPhysicalOffsetInSpareData = 0
m_u32OnfiSyncEnable = 0
m_NANDONFITiming.m_u32ONFISpeed = 0
m_NANDONFITiming.m_u32ONFITiming_ReadLatency = 0
m_NANDONFITiming.m_u32ONFITiming_CEDelay = 0
m_NANDONFITiming.m_u32ONFITiming_PreambleDelay = 0
m_NANDONFITiming.m_u32ONFITiming_PostambleDelay = 0
m_NANDONFITiming.m_u32ONFITiming_CmdAddPause = 0
m_NANDONFITiming.m_u32ONFITiming_DataPause = 0
m_NANDONFITiming.m_u32ONFITiming_BusyTimeout = 0
m_u32DISBBSearch = 0
m_u32RandomizerEnable = 0
m_u32ReadRetryEnable = 0
m_u32ReadRetrySeqLength = 0
DBBT
m_u32Checksum = 0x00000000
m_u32Version = 0x01000000
m_u32DBBTNumOfPages = 0
Firmware: image #0 @ 0x100000 size 0xa4800 0xb000 - available 0x3800000x80000Firmware: image #1 @ 0x480000 0x180000 size 0xa4800 0xb000 - available 0x3800000x80000
-------------- Start to write the [ FCB ] -----
mtd: erasing @0:0x0-0x20000
---------- Start to write the [ .tmp_kobs_ng ]----
mtd: Writting .tmp_kobs_ng: #0 @0: 0x00100000 - 0x001a48000x0010b000
mtd: erasing @0:0x100000-0x120000
mtd: erasing @0:0x120000-0x140000We write one page for save guard. *mtd: erasing @0:0x140000-0x160000mtdWritting .tmp_kobs_ng: erasing #1 @0:0x1600000x00180000 -0x1800000x0018b000
mtd: erasing @0:0x180000-0x1a0000
mtd: erasing @0:0x1a0000-0x1c0000
mtd: The last page is not full : 1068
mtd: We write one page for save guard. *
mtd: Writting .tmp_kobs_ng: #1 @0: 0x00480000 - 0x00524800
mtd: erasing @0:0x480000-0x4a0000
mtd: erasing @0:0x4a0000-0x4c0000
mtd: erasing @0:0x4c0000-0x4e0000
mtd: erasing @0:0x4e0000-0x500000
mtd: erasing @0:0x500000-0x520000
mtd: erasing @0:0x520000-0x540000
mtd: The last page is not full : 1068
mtd: We write one page for save guard. *
&lt;/pre>
 
then the second <code>mtd1</code> partition can be written using ''nandwrite'':
 
<pre class="workstation-terminal">
root@desk-mx6ul-axelulite:~# flash_erase /dev/mtd1 0 0
Erasing 128 Kibyte @ 5e0000 -- 100 % completeroot@desk-mx6ul-axelulite:~# nandwrite -p /dev/mtd1 desk-mx6ul-l-13.0.2_mx6uldesk_axelulite_nand_u0_mx6uldesk_axelulite_devel_u-boot.img
Writing data to block 0 at offset 0x0
Writing data to block 1 at offset 0x20000
Writing data to block 2 at offset 0x40000
Writing data to block 3 at offset 0x60000
root@desk-mx6ul-axelulite:~#Writing data to block 4 at offset 0x80000
</pre>
=> run loadk nand_updatek loadfdt nand_updatefdt
Using FEC0 device
TFTP from server 192.168.04.125240; our IP address is 192.168.04.89183Filename 'desk-mx-llynx/desk-mx6ul-l-1.0.1_uImageuImage'.
Load address: 0x80800000
Loading: #################################################################
#################################################################
#################################################################
################################################################# 504################################################################# ################################################################# ######################################## 1.9 KiBMiB/s
done
Bytes transferred = 7056696 8189464 (6bad38 7cf618 hex)
NAND erase.part: device 0 offset 0xc00000, size 0x800000
OK
NAND write: device 0 offset 0xc00000, size 0x6bad380x7cf618 7056696 8189464 bytes written: OK
Using FEC0 device
TFTP from server 192.168.04.125240; our IP address is 192.168.04.89183Filename 'desk-mx-llynx/desk-mx6ul-l-1.0.1_imx6ul-axeluliteimx6ul-cb003alynx.dtb'.
Load address: 0x83000000
Loading: #######
165 KiB1.8 MiB/s
done
Bytes transferred = 34095 32518 (852f 7f06 hex)
NAND erase.part: device 0 offset 0xa00000, size 0x100000
OK
NAND write: device 0 offset 0xa00000, size 0x852f0x7f06 34095 32518 bytes written: OK=>
</pre>
* By default, the NAND is already partitioned to allow booting from NAND-only (see next section) and, thus, some partitions are reserved for u-boot and kernel images. Here we won't modify this default configuration. The [[Memory Tecnology Device (MTD)|MTD]] partitions can be dumped with <code>/proc/mtd</code> (the partition's name should be self-explanatory)
<pre class="workstation-terminal">
root@desk-mx6ul-axelulitelynx:~# cat /proc/mtd
dev: size erasesize name
mtd0: 00200000 00020000 "nand-SPL"
mtd6: 00800000 00020000 "nand-kernel"
mtd7: 00400000 00020000 "nand-splash"
mtd8: 06800000 3e800000 00020000 "nand-ubi"
mtd9: 00010000 00001000 "spi-SPL"
mtd10: 000f0000 00001000 "spi-uboot"
mtd14: 00800000 00001000 "spi-kernel"
mtd15: 00400000 00001000 "spi-splash"
mtd16: 00200000 01200000 00001000 "spi-free"root@desk-mx6ul-axelulite:~#
</pre>
<pre class="workstation-terminal">
root@desk-mx6ul-axelulitelynx:~# ubiformat /dev/mtd8ubiformat: mtd8 (nand), size 109051904 1048576000 bytes (1041000.0 MiB), 832 8000 eraseblocks of 131072 bytes (128.0 KiB), min. I/O size 2048 bytesli[ 52.440377] random: crng init done% complete[ 52.446177] random: 7 urandom warning(s) missed due to ratelimitinglibscan: scanning eraseblock 831 7999 -- 100 % complete ubiformat: 830 8000 eraseblocks have valid erase counter, mean value is 0ubiformat: warning!: 2 of 832 eraseblocks contain non-UBI dataubiformat: continue? (y/N) y16ubiformat: formatting eraseblock 831 7999 -- 100 % complete root@desk-mx6ul-axelulitelynx:~# ubiattach -m 8[ 68.203880] ubi0: attaching mtd8[ 69.488529] ubi0: scanning is finished[ 69.526881] ubi0: attached mtd8 (name "nand-ubi", size 104 MiB)[ 69.545319] ubi0: PEB size: 131072 bytes (128 KiB), LEB size: 126976 bytes[ 69.552230] ubi0: min./max. I/O unit sizes: 2048/2048, sub-page size 2048[ 69.576138] ubi0: VID header offset: 2048 (aligned 2048), data offset: 4096[ 69.587298] ubi0: good PEBs: 832, bad PEBs: 0, corrupted PEBs: 0[ 69.594040] ubi0: user volume: 0, internal volumes: 1, max. volumes count: 128[ 69.601292] ubi0: max/mean erase counter: 2/1, WL threshold: 4096, image sequence number: 1623728395[ 69.613873] ubi0: available PEBs: 808, total reserved PEBs: 24, PEBs reserved for bad PEB handling: 20[ 69.623519] ubi0: background thread "ubi_bgt0d" started, PID 264UBI device number 0, total 832 8000 LEBs (105644032 1015808000 bytes, 100968.7 MiB), available 808 7836 LEBs (102596608 994983936 bytes, 97948.8 MiB), LEB size 126976 bytes (124.0 KiB)root@desk-mx6ul-axelulitelynx:~# ubimkvol /dev/ubi0 -N rootfs -mSet volume size to 102596608994983936Volume ID 0, size 808 7836 LEBs (102596608 994983936 bytes, 97948.8 MiB), LEB size 126976 bytes (124.0 KiB), dynamic, name "rootfs", alignment 1root@desk-mx6ul-axelulite:~#
</pre>
<pre class="workstation-terminal">
root@desk-mx6ul-axelulitelynx:~# mkdir -p /mnt/nandroot@desk-mx6ul-axelulitelynx:~# mount -t ubifs ubi0_0 /mnt/nand/root@desk-mx6ul-lynx:~# dmesg | tail -n 7[ 104201.646929602548] UBIFS (ubi0:0): default file-system createdMounting in unauthenticated mode[ 104201.656524602935] UBIFS (ubi0:0): background thread "ubifs_bgt0_0" started, PID 271293[ 104201.795980634481] UBIFS (ubi0:0): UBIFS: mounted UBI device 0, volume 0, name "rootfs"[ 104201.803631634523] UBIFS (ubi0:0): LEB size: 126976 bytes (124 KiB), min./max. I/O unit sizes: 2048 bytes/2048 bytes[ 104201.817174634550] UBIFS (ubi0:0): FS size: 101199872 992698368 bytes (96 946 MiB, 797 7818 LEBs), journal size 5079040 33521664 bytes (4 31 MiB, 40 264 LEBs)[ 104201.829554634570] UBIFS (ubi0:0): reserved for root: 4779919 4952683 bytes (4667 4836 KiB)[ 104201.838248634596] UBIFS (ubi0:0): media format: w5/r0 (latest is w5/r0), UUID 0687F325CBE8807E-4ED16A37-488F400B-B6379B56-57FAEADE745EE12B4C034D9E, small LPT modelroot@desk-mx6ul-axelulite:~#
</pre>
<pre>
tar xvjf tar xjf davedesk-image-develqt5-desk-mx6ul-axelulitelynx.tar.bz2 -C /mnt/nand/
</pre>
<pre class="workstation-terminal">
root@desk-mx6ul-axelulitelynx:~# umount /mnt/nand/root@desk-mx6ul-lynx:~# ubidetach -m 8root@desk-mx6ul-lynx:~# dmesg | tail -n 4[ 12641154.460672988629] UBIFS (ubi0:0): un-mount UBI device 0[ 12641154.465626989082] UBIFS (ubi0:0): background thread "ubifs_bgt0_0" stopsroot@desk-mx6ul-axelulite:~# ubidetach -m 8[ 12701160.298143907410] ubi0: detaching mtd8[ 12701160.316092921595] ubi0: mtd8 is detachedroot@desk-mx6ul-axelulite:~#
</pre>
devwiki_user
120
edits