Changes

Jump to: navigation, search

Booting from NAND flash on i.MX6-based platforms

1,318 bytes added, 12:52, 30 August 2019
no edit summary
{{InfoBoxTop}}
{{AppliesToAxel}}
{{AppliesToAxelLite}}
{{AppliesToAxelEsatta}}
{{AppliesToSBCX}}
{{AppliesToAXELULite}}
{{AppliesToSBCLynx}}
{{InfoBoxBottom}}
 
==Introduction==
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.
This document describes some details provides information about the NAND devicemanagement, in order to handle it properly when it is used as the boot device on NXP i.MX6-based products.
Even though the examples example shown here refers to an i.MX6SoloX board, the approach is substantially the same across all the i.MX6 family.
==Test bed==
The test bed used in this example consists of an i.MX6SoloX-board equipped with a 512MB 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 bootloaderbinary file (<code>mx6sx_board_nand_u-boot.imx</code>). Its size is about 400 kB. From the point of view of MTD partitions, the boot partition is <code>mtd0</code> which is 8MB.
==Boot partition organization==
***The second (redundant) copy of the firmware to load
*The DBBT
***The first copy of the firmware***The second copy of the firmware. For more details about the bootrom e 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.
==How to burn the boot partition==
The burning of the {{WarningMessage|text=This application note was validated before '''XELK 4''' kit version which is using u-boot partition is typically performed by the SPL. Instruction ha to be modified according to [[https://github.com/NXPmicro/imx-kobs <code>kobs-ng</code> toolStandalone_boot_(XELK)#NAND_flash | Standalone boot from NAND]]page.}}
It deals with several thingsThe burning of the boot partition is performed by the [https://github.com/NXPmicro/imx-kobs <code>kobs-ng</code> tool].
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="board-terminal">
./kobs-ng-5.4 init -x -v -w --chip_0_device_path=/dev/mtd0 mx6sx_board_nand_u-boot.imx
mtd: We write one page for save guard. *
</pre>
In this case, the boot partition–<code>/dev/mtd0</code>, indicated as a parameter of the command line–is 8MB. For this reason, the secondary firmware image is stored at the address 0x480000, that is at the half of the available space after the first MB ( (0x800000-0x100000)/2 ).
8,154
edits

Navigation menu