This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

How does ROM code read from NAND and MMC?

Other Parts Discussed in Thread: AM3517

Hi,

As I know, there are 64k SRAM & 112 ROM in am3517 chip, and 256M SDRAM & 512M NAND out of am3517 chip, If boot from NAND, firstly rom code loads xloader from NAND to SRAM, and then xloader loads uboot and uImage from NAND to SDRAM while working.

what size and which address does ROM code read from NAND? Is it the same case when booting from MMC ?

 

Thanks,

Kevin

  • Kevin,

    The TRM (sprugr0b, Sec 24.4.7.2) states that the ROM code searches for the first 4 physical blocks of the NAND device (which is connected to CS0) for the executable image-header.

    The header might have a TOC (table of contents) if there are more than one sections - in which case the image named MLO is searched for. In case of the simplified header - there is only the Size,Destination and Image start  triplet. (Sec 24.4.8.1).

    Practically though we always write to and read from the starting address of the NAND device ( this is preferred too as with most NAND devices the first block is always guaranteed to be good).

    SD/MMCs can be used (Sec 24.4.7.6.2) in raw or file-system form. In raw form a procedure similar to the above is used while in the latter case - FAT file-system partition tables are used to get the contents of the file named MLO  in the root-directory.

    Hope this information is useful.

     

    regards

    Abhilash

  • Hi Abhilash,


    Just in case of the non-XIP, How does ROM code search for image?

    In my opinion, the format of MLO is:
    |--- size of the image (4byte) ---|--- load address (4byte) ---|----- the content of the image  -----|

    so rom code reads 8 bytes from NAND, and knows the size and load address of SRAM, after that, it continue to read bytes from NAND until the size of image, is that right?

    but in "24.4.7.4.2 Read Sector Procedure", it says "During the booting procedure, the ROM code reads 512-byte sectors from the NAND device.", why it reads 512 bytes?

     

    Thanks,

    Kevin

     

  • Kevin:

    NAND device drivers use a specific page size to read or write the NAND flash device.  They can handle different page sizes

    based on the mfg id and device id.   For the case you mentioned a 512-byte page size is used.  After reading a page from NAND

    the ROM code takes care of processing the header info.

    Regards,

    Michael T