MX6DL eMMC Boot Details

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

MX6DL eMMC Boot Details

2,833 次查看
leoschwab
Contributor III

I was recently tasked with getting our prototype to boot from the on-board eMMC, rather than an SD card.  We don't speak Windows here, so we can't use the Manufacturing Tool to setup our prototype (plus I'm still getting all the IOMux and driver support in place).  Shorter Story: This post proved to be very valuable for getting the eMMC boot partition setup, and I have successfully booted the prototype into U-Boot.  Sadly, it's not loading the kernel from the same partition; I think I need to do more work to get U-Boot to talk to the eMMC properly.

Anyway:  All the code I can find, both in Yocto and scattered around forum posts, lays out boot partitions as follows:

  1. MBR parition table [0...511]
  2. Unallocated space [512...(P1 - 1)].
  3. First parition [P1...(P2 - 1)]; usually holds the kernel image.
  4. Subsequent partition [P2... ] (if present): Holds the root filesystem.

All the code I've seen leaves byte offsets 512 to (P1 - 1) (where P1 is the first block of the first partition) unallocated and unmentioned in the MBR.  The first 1024 (2 blocks) of both the U-Boot image and the block device are skipped, and the remainder blindly copied to the block device.  My question is:  Where does this placement requirement come from?  Is this 2-block/1024-byte offset a Magic Number required by the boot ROM?  Is a valid MBR required to be in place for the boot ROM to find the boot code?  If a valid MBR isn't required or present, do the offsets change?  (Can I use a GPT instead of an MBR?)

In short: What is the boot ROM actually looking for?

标签 (4)
0 项奖励
回复
4 回复数

1,652 次查看
JackyAtFreescal
Senior Contributor II

Once u-boot is up, it got all the controls and responsible for loading and jumping to the kernel. By convention, the kernel should be written at 1MB (1,048,576 = 0x800 * 512) from the beginning of the eMMC. So u-boot can load and jumps to the kernel by below commands:

mmc dev 3; mmc read ${loadaddr} 0x800 0x2000; bootm

Regards,

Jacky

0 项奖励
回复

1,652 次查看
leoschwab
Contributor III

Thanks for your note.  What I was wondering was how the boot ROM found U-Boot in the first place.

Funny, though...  I have a distinct memory of posting a followup message here saying that I'd found what appeared to be The Answer in section 8.6.1 in the MX6DL Processor Reference Manual, which describes what the boot ROM will do with various types of boot media.  In the case of eMMC, it goes to offset 0x400, reads 4KiB, and interprets the Image Vector Table it finds there to work out how to load the rest of the boot image.  But that message appears to be gone...


What this suggests to me is that the boot ROM completely ignores everything on eMMC boot media from 0x000 - 0x400, and I can put anything there I want.

1,652 次查看
YixingKong
Senior Contributor IV

Leo, please click Correct Answer/Helpful Answer, if your question has been answered.

Thanks,

Yixing

0 项奖励
回复

1,652 次查看
JackyAtFreescal
Senior Contributor II

That's correct, Byte 0 ~ 0x3FF are ignored by the ROM. However the first sector (512 byte) should be filled with the partition table, so that the kernel can mount the eMMC device.

Regards,

Jacky