5 using the onboard nand flash, Using the onboard nand flash, U-boot usage am4140 u-boot bootloader – Kontron AM4140 U-Boot Bootloader User Manual

Page 42

Advertising
background image

U-Boot Usage

AM4140 U-Boot Bootloader

Page 42

ID 1052-0281, Rev. 1.0

P R E L I M I N A R Y

6.5

Using the Onboard NAND Flash

The onboard NAND Flash is supported with the “ubi” filesystem. The access is read only. Thus,
the filesystem and its contents must be prepared with Linux first.

As a prerequisite, the environment variables “mtdids” and “mtdparts” must be set correctly.

“mtdids” identifies the NAND chip to use while “mtdparts” defines the partitions.

Example:

This defines the first NAND chip (nand0) to be used with the name “chip1”. The chip contains
one partition “all” which occupies the whole chip.

The next command sets the partition “all” to be used with the “ubi” layer:

Now, an “ubi” volume can be mounted; in this example volume “boot”:

After the volume is mounted, its contents can be listed:

or a file loaded, in this case “kernel.bin” to address 0x100000:

setenv mtdids nand0=chip1

setenv mtdparts mtdparts=chip1:-(all)

ubi part all

ubifsmount boot

ubifsls

ubifsload 100000 kernel.bin

Advertising