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:
- MBR parition table [0...511]
- Unallocated space [512...(P1 - 1)].
- First parition [P1...(P2 - 1)]; usually holds the kernel image.
- 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?