Open main menu

DAVE Developer's Wiki β

Changes

Standalone boot (SDVX)

9,110 bytes added, 09:18, 26 September 2018
no edit summary
** In this configuration the whole system will boot without the need of a NOR flash storage, all images and the root file system will be fetched from NAND flash.
== Storing Program root file system into NAND flash (only Lite) ==
This is a common step for both booting options.
* Boot the system via SD or NFS as described in the e [[SDV04 Embedded Linux Kit (SDVX)#Quick_start_guide|Quick start guide]]
* By default, the NAND is already partitioned to allow booting from NAND-only (see next section) and, thus, some partitions are reserved for Uu-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@sdvx-lite:~# cat /proc/mtd
mtd4: 00100000 00020000 "nand-spare"
mtd5: 00800000 00020000 "nand-kernel"
mtd6: 00400000 00600000 00020000 "nand-splash"mtd7: 1e800000 3e600000 00020000 "nand-ubi"root@sdvx-lite:~#
</pre>
== Storing Program boot images ...==  {{ImportantMessage|text=Select the proper <code>u-boot</code>, <code>kernel</code> and <code>device tree</code> binary images according to the Axel Lite or Axel ULite SOM used}} 
==... into NOR flash ==
* Select the proper <code>u-boot</code>, <code>kernel</code> and <code>device tree</code> binary images according to the Axel Lite or Axel ULite SOM used. ===Uu-Boot===
Update to the latest u-boot version allows usage of u-boot environment variables available.
</pre>
===Linux kernel image and device tree===
We assume that the following environment variables are present in u-boot:
== ... into NAND flash ==
===Uu-Boot===u-boot on NAND flash must be programmed using NXP <code>kobs-ng</code> utility: this tool is required for writing the correct u-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 XELK)* copy the related u-boot imx image file on nfs /home/root (for example)* execute kobs-ng passing the parameters for flashing u-boot on NAND <pre class="board-terminal">root@imx6qxelk:~# kobs-ng -x -v -w sdvx-1.0.0_mx6dl_sfczg_nand_u-boot.imxMTD CONFIG: chip_0_device_path = "/dev/mtd0" chip_1_device_path = "(null)" search_exponent = 2 data_setup_time = 80 data_hold_time = 60 address_setup_time = 25 data_sample_time = 6 row_address_size = 3 column_address_size = 2 read_command_code1 = 0 read_command_code2 = 48 boot_stream_major_version = 1 boot_stream_minor_version = 0 boot_stream_sub_version = 0 ncb_version = 3 boot_stream_1_address = 0 boot_stream_2_address = 0 -- 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: use new bch layout raw access modemtd: 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 = 3670016mtd: boot_stream_size_in_bytes = 672812mtd: boot_stream_size_in_pages = 329mtd: #1 0x00100000 - 0x00480000 (0x001a442c)mtd: #2 0x00480000 - 0x00800000 (0x0052442c)FCB m_u32Checksum = 0x00000000 m_u32FingerPrint = 0x20424346 m_u32Version = 0x01000000 m_NANDTiming.m_u8DataSetup = 80 m_NANDTiming.m_u8DataHold = 60 m_NANDTiming.m_u8AddressSetup = 25 m_NANDTiming.m_u8DSAMPLE_TIME = 6 m_u32PageDataSize = 2048 m_u32TotalPageSize = 2112 m_u32SectorsPerBlock = 64 m_u32NumberOfNANDs = 0 m_u32TotalInternalDie = 0 m_u32CellType = 0 m_u32EccBlockNEccType = 1 m_u32EccBlock0Size = 512 m_u32EccBlockNSize = 512 m_u32EccBlock0EccType = 1 m_u32MetadataBytes = 10 m_u32NumEccBlocksPerPage = 3 m_u32EccBlockNEccLevelSDK = 0 m_u32EccBlock0SizeSDK = 0 m_u32EccBlockNSizeSDK = 0 m_u32EccBlock0EccLevelSDK = 0 m_u32NumEccBlocksPerPageSDK = 0 m_u32MetadataBytesSDK = 0 m_u32EraseThreshold = 0 m_u32Firmware1_startingPage = 512 m_u32Firmware2_startingPage = 2304 m_u32PagesInFirmware1 = 329 m_u32PagesInFirmware2 = 329 m_u32DBBTSearchAreaStartAddress = 256 m_u32BadBlockMarkerByte = 2028 m_u32BadBlockMarkerStartBit = 2 m_u32BBMarkerPhysicalOffset = 2048 m_u32BCHType = 0 m_NANDTMTiming.m_u32TMTiming2_ReadLatency = 0 m_NANDTMTiming.m_u32TMTiming2_PreambleDelay = 0 m_NANDTMTiming.m_u32TMTiming2_CEDelay = 0 m_NANDTMTiming.m_u32TMTiming2_PostambleDelay = 0 m_NANDTMTiming.m_u32TMTiming2_CmdAddPause = 0 m_NANDTMTiming.m_u32TMTiming2_DataPause = 0 m_NANDTMTiming.m_u32TMSpeed = 0 m_NANDTMTiming.m_u32TMTiming1_BusyTimeout = 0 m_u32DISBBM = 0 m_u32BBMarkerPhysicalOffsetInSpareData = 0DBBT m_u32Checksum = 0x00000000 m_u32FingerPrint = 0x54424244 m_u32Version = 0x01000000 m_u32DBBTNumOfPages = 0Firmware: image #0 @ 0x100000 size 0xa4800 - available 0x380000Firmware: image #1 @ 0x480000 size 0xa4800 - available 0x380000-------------- Start to write the [ FCB ] -----mtd: erasing @0:0x0-0x20000mtd: Writing FCB0 [ @0:0x0 ] (840) *mtd: erasing @0:0x20000-0x40000mtd: Writing FCB1 [ @0:0x20000 ] (840) *mtd: erasing @0:0x40000-0x60000mtd: Writing FCB2 [ @0:0x40000 ] (840) *mtd: erasing @0:0x60000-0x80000mtd: Writing FCB3 [ @0:0x60000 ] (840) *mtd_commit_bcb(FCB): status 0 -------------- Start to write the [ DBBT ] -----mtd: erasing @0:0x80000-0xa0000mtd: Writing DBBT0 [ @0:0x80000 ] (800) *mtd: erasing @0:0xa0000-0xc0000mtd: Writing DBBT1 [ @0:0xa0000 ] (800) *mtd: erasing @0:0xc0000-0xe0000mtd: Writing DBBT2 [ @0:0xc0000 ] (800) *mtd: erasing @0:0xe0000-0x100000mtd: Writing DBBT3 [ @0:0xe0000 ] (800) *mtd_commit_bcb(DBBT): status 0 ---------- Start to write the [ .tmp_kobs_ng ]----mtd: Writting .tmp_kobs_ng: #0 @0: 0x00100000 - 0x001a4800mtd: erasing @0:0x100000-0x120000mtd: erasing @0:0x120000-0x140000mtd: erasing @0:0x140000-0x160000mtd: erasing @0:0x160000-0x180000mtd: erasing @0:0x180000-0x1a0000mtd: erasing @0:0x1a0000-0x1c0000mtd: The last page is not full : 1068mtd: We write one page for save guard. *mtd: Writting .tmp_kobs_ng: #1 @0: 0x00480000 - 0x00524800mtd: erasing @0:0x480000-0x4a0000mtd: erasing @0:0x4a0000-0x4c0000mtd: erasing @0:0x4c0000-0x4e0000mtd: erasing @0:0x4e0000-0x500000mtd: erasing @0:0x500000-0x520000mtd: erasing @0:0x520000-0x540000mtd: The last page is not full : 1068mtd: We write one page for save guard. *root@imx6qxelk:~#</pre> ===Linux kernel image and device tree=== We assume that the following environment variables are present in u-boot: <pre>nand_updatek=nand erase.part nand-kernel; nand write ${loadaddr} nand-kernel ${filesize}nand_updatefdt=nand erase.part nand-fdt; nand write ${fdtaddr} nand-fdt ${filesize}nand_loadk=nand read ${loadaddr} nand-kernelnand_loadfdt=nand read ${fdtaddr} nand-fdtnand_nand=run nand_loadk nand_loadfdt nandargs addcons addmisc; if run configid_fixupfdt; then bootm ${loadaddr} - ${fdtaddr}; fi</pre> * Update the <code>bootfile</code> and <code>fdtfile</code> environment variables to fit the filename as found inside the TFTP server.* Program kernel and device tree on NAND flash with the following U-Boot command <pre class="board-terminal">run loadk nand_updatek loadfdt nand_updatefdt</pre> E.g.: <pre class="board-terminal">U-Boot > run loadk nand_updatek loadfdt nand_updatefdtUsing FEC deviceTFTP from server 192.168.0.13; our IP address is 192.168.0.98Filename 'sdvx/linux/sdvx-1.0.0_lite_uImage'.Load address: 0x12000000Loading: ################################################################# ################################################################# ################################################################# ################################################################# ################################################################# ################################################################# ################################################################# ################################################################# ################################################################# ################################################################# ################################################################# ################################################################# ################################################################# ################################################################# ################################################################# ################################################################# ################################################################# ################################################################# ################################################################# ####################### 1.4 MiB/sdoneBytes transferred = 6437016 (623898 hex) NAND erase.part: device 0 offset 0xc00000, size 0x800000Erasing at 0x13e0000 -- 100% complete.OK NAND write: device 0 offset 0xc00000, size 0x623898 6437016 bytes written: OKUsing FEC deviceTFTP from server 192.168.0.13; our IP address is 192.168.0.89Filename 'sdvx/linux/sdvx-1.0.0_lite_imx6dl-sfczg-cb0043.dtb'.Load address: 0x18000000Loading: ######### 525.4 KiB/sdoneBytes transferred = 42547 (a633 hex) NAND erase.part: device 0 offset 0xa00000, size 0x100000Erasing at 0xae0000 -- 100% complete.OK NAND write: device 0 offset 0xa00000, size 0xa633 42547 bytes written: OK=></pre> 
== ... into eMMC ==
===u-Boot===Update to the latest u-boot version allows usage of u-boot environment variables available. <pre class="board-terminal">=> run loadUsing FEC deviceTFTP from server 192.168.0.13; our IP address is 192.168.0.89Filename 'sdvx/u-boot/sdvx-1.0.0_mx6dl_sfczg_u-boot.imx'.Load address: 0x12000000Loading: ################################################################# ################################################################# ## 1.5 MiB/sdoneBytes transferred = 671788 (a402c hex)=> run mmc_updateswitch to partitions #0, OKmmc2(part 0) is current device (eMMC) MMC write: dev # 2, block # 2, count 1313 ... 1313 blocks written: OK=></pre> ===kernel image and device tree=== We assume that the following environment variables are present in u-boot:  
<pre>
mmc_loadfdtmmc_loadk=fatload mmc 0:1 ${fdtaddrloadaddr} ${bootfile} imx6ul-lynx.dtbmmc_loadkmmc_loadfdt=fatload mmc 0:1 ${loadaddrfdtaddr} ${fdtfile} uImage
mmc_loadsplash=fatload mmc ${mmcdev}:1 ${loadaddr} ${splashfile}; cp.b ${loadaddr} ${splashimage} ${filesize}
mmc_update=mmc dev; setexpr blocks ${filesize} / 0x200; setexpr blocks ${blocks} + 1; mmc write ${loadaddr} 2 ${blocks}
mmcargs=setenv bootargs root=${mmcroot}
mmcroot=/dev/mmcblk2p2 rootwait rw
</pre>
 
* Update the <code>bootfile</code> and <code>fdtfile</code> environment variables to fit the filename as found inside the TFTP server.
* Program kernel and device tree on the MMC with the following Uu-Boot command
<pre class="board-terminal">
</pre>
8,221
edits