X-loader and how to write to NAND X-loader

Source: Internet
Author: User

X-loader is the primary boot loader. It is loaded through ROM boot loader into the internal RAM. X-loader is responsiblefor initializing the external memory and loading the u-boot from the selected boot device. X-loader supports boot from NAND, MMC/SD and Onenand.

The generated x-loader.bin needs to is signed before it can be used by the ROM bootloader.

X-loader is a primary bootloader, which is loaded into the internal ram,x-loader by the ROM boot loader to initialize the external memory and load U-boot,x-loader from the user-selected startup items from NAND, MMC/SD and Samsung's Onenand started.

The compiler-generated x-loader.bin need to be converted into X-loader.bin.ift to function rom bootloader.

The difference between this file and X-loader.bin is the addition of a 4-byte header. The header's content is the length of the 4-byte X-loader and the address (4 bytes) where the X-loader is to be load. determined by the internal ROM boot loader.

The X-loader is run in OMAP3 's internal RAM (OMAP3530 has 64K SRAM, 112K ROM) and is not copied to the external DDR, and when X-loader initializes memory controler, Load the formal bootloader:u-boot to further initialize the perimeter hardware and start the Linux kernel.

Boot order: Bootrom:rom boot loader (internal RAM)-> X-loader (internal RAM)-> Uboot (external DDR)->kernel (external DDR)


Question: How to write X-loaer to Nandflash.

X-loader is the stage boot loader and are primarily responsible for initializing the DRAM controller and a few  Essential hardware blocks. Because X-loader is loaded by the OMAP ROM boot loader, it has some special to the it is requirements.

The OMAP ROM boot loader expects to find X-loader in the ' the '.   If is detective, the OMAP ROM boot loader'll skip it and attempt to read X-loader.  If is defective, the third block'll be read, and if this is defective, the fourth block. If all four are defective, a very rare occurance, the boot wil fail.

Another OMAP ROM Boot loader requirement is the method of computing ECC. Hardware ECC is required for these 4 blocks.

These unique requirements can currently are met by using the U-boot to write X-loader to NAND.

The following instructions assume that your are using a bootable SD card prepared to the GNOME or console images availabl E on this site.

Power up or reset your OMAP board and break to U-boot by pressing a key on your serial console at:

Hit any key to stop autoboot:
Next have u-boot scan to find your bootable SD card and load the X-load binary from the FAT partition of the bootable SD C Ard. The X-loader binary is called MLO.

# MMC rescan 0
# fatload MMC 0 ${loadaddr} MLO reading MLO 22540
Read

At this point the X-loader binary has been copied to RAM. We now specify the use of HWECC and erase the 4 blocks of NAND:

# NANDECC HW
HW-ECC selected
# NAND erase 0 80000
NAND erase:device 0 offset 0x0, size 0x80000
erasing at 0x60000--100% complete.
Ok
And as the final step, we write the X-loader binary to each of the the the the 4 blocks in NAND:
# NAND Write ${loadaddr} 0 ${filesize}
NAND write:device 0 offset 0x0, size size 0x580c
 22540 bytes written:ok
  # NAND Write ${loadaddr} 20000 ${filesize}
NAND write:device 0 offset 0x20000, size size 0x580c
 22540 bytes Itten:ok
# NAND write ${loadaddr} 40000 ${filesize}
NAND write:device 0 offset 0x40000, size size 0x580c
 22540 bytes Written:ok
# NAND write ${LOADADDR} 60000 ${filesize}
NAND write:device 0 offset 0x60000, size siz E 0x580c
 22540 bytes Written:ok

Because X-loader is loaded by ROM boot loader, flash it requires some special conditions, TI's omap ROM boot loader look forward to finding Nandflash in the first block of X-loader (X-loader is very small , general more than 10 k), if not found in the first block, continue to find in the second block, until the fourth block, if still found, then the tag started failure, the code section above shows how to write to the Nandflash X-loader, where the premise is that The board can be started from SD.

If the data in the Nandfalsh is broken, and can not start from the SD card, do.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.