Open main menu

DAVE Developer's Wiki β

Changes

no edit summary
<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{{oldid|14241|2021/07/20}}| 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-MX6UL-L 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" |{{oldid|16326|2022/03/16}}| 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" |DESK-MX6UL-L 3.0.0release|-! style="border-left:solid 2px #73B2C7; border-right:solid 2px #73B2C7;border-top:solid 2px #73B2C7; border-bottom:solid 2px #73B2C7; background-color:#edf8fbededed; padding:5px; color:#000000"|Jul 20212023/05/04|! style="border-left:solid 2px #73B2C7; border-right:solid 2px #73B2C7;border-top:solid 2px #73B2C7; border-bottom:solid 2px #73B2C7; background-color:#edf8fbededed; padding:5px; color:#000000"|DESK -MX6UL-L 4.0.0 release
|-
|}
<section end="History" />
__FORCETOC__
<section begin="Body" />
==Booting from NAND flash==
 
{{ImportantMessage|text=The following procedure is only theoretical. Boot firmware (U-Boot and SPL) for NAND storage are not available from the DAVE Embedded Systems' mirrors.}}
With respect to the NOR flash memories, NAND devices are known to be quite challenging with regard to the reliability. This is especially true when the NAND flash is used as the boot device. Several techniques such as wear leveling and bad block management have to be implemented to achieve an acceptable reliability.
Even though the example shown here refers to an i.MX6 UltraLite board, the approach is substantially the same across all the i.MX6 family.
The test bed used in this example consists of an i.MX6 UltraLite board equipped with a 128MB 8-bit asynchronous 1-bit ECC SLC NAND memory which is connected to the EIM bus of the SoC. The boot firmware image is the U-Boot binary files (<code>desk-mx6ul-l-14.0.2_mx6uldesk_axelulite_nand_SPL0_mx6uldesk_axelulite_nand_SPL</code> and <code>desk-mx6ul-l-14.0.2_mx6uldesk_axelulite_nand_u0_mx6uldesk_axelulite_nand_u-boot.img</code>). Its size is about 535 44 kB and 592 kB. From the point of view of MTD partitions, the boot partition for SPL is <code>mtd0</code> is 2MB while the second stage partition <code>mtd1</code> is 6MB.
===Boot partition organization===
*The second copy of the firmware.
For more details about the bootrom e and the NAND boot process, please refer to the ''System Boot'' chapter of the Reference Manual of the specific i.MX6 Application Processor.
The following section will describe how to burn the boot partition in practice.
When the NAND flash is not burned yet, the product is usually configured in order to boot from a different device such as an SD card or through serial download mode. Once the Linux kernel is up and running, the <code>kobs-ng</code> can be run as shown in the following example:
<pre class="boardworkstation-terminal">root@desk-mx6ul-axelulite:~# kobs-ng -x -v -w desk-mx6ul-l-14.0.2_mx6uldesk_axelulite_nand_SPL0_mx6uldesk_axelulite_nand_SPL
MTD CONFIG:
chip_0_device_path = "/dev/mtd0"
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 = 524288
mtd: boot_stream_size_in_bytes = 5734445056mtd: boot_stream_size_in_pages = 2822mtd: #1 0x00100000 - 0x00180000 (0x0010e0000x0010b000)mtd: #2 0x00180000 - 0x00200000 (0x0018e0000x0018b000)
FCB
m_u32Checksum = 0x00000000
m_u32Firmware1_startingPage = 512
m_u32Firmware2_startingPage = 768
m_u32PagesInFirmware1 = 2822 m_u32PagesInFirmware2 = 2822
m_u32DBBTSearchAreaStartAddress = 256
m_u32BadBlockMarkerByte = 2028
m_u32Version = 0x01000000
m_u32DBBTNumOfPages = 0
Firmware: image #0 @ 0x100000 size 0xe000 0xb000 - available 0x80000Firmware: image #1 @ 0x180000 size 0xe000 0xb000 - available 0x80000
-------------- 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 - 0x0010e0000x0010b000
mtd: erasing @0:0x100000-0x120000
mtd: We write one page for save guard. *
mtd: Writting .tmp_kobs_ng: #1 @0: 0x00180000 - 0x0018e0000x0018b000
mtd: erasing @0:0x180000-0x1a0000
mtd: We write one page for save guard. *
root@desk-mx6ul-axelulite:~#
</pre>
then the second <code>mtd1</code> partition can be written using ''nandwrite'':
<pre class="boardworkstation-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-14.0.2_mx6uldesk_axelulite_nand_u0_mx6uldesk_axelulite_nand_u-boot.img
Writing data to block 0 at offset 0x0
Writing data to block 1 at offset 0x20000
Writing data to block 3 at offset 0x60000
Writing data to block 4 at offset 0x80000
root@desk-mx6ul-axelulite:~#
</pre>
8,226
edits