[PATCH 2/5] partitions: Start partitions at 8MiB offset

Sascha Hauer s.hauer at pengutronix.de
Tue Jun 3 00:46:45 PDT 2025


On Tue, Jun 03, 2025 at 12:16:33AM +0200, Marco Felsch wrote:
> Hi Sascha,
> 
> On 25-06-02, Sascha Hauer wrote:
> > There are many SoCs that store the bootloader on the raw eMMC/SD device
> > outside of partitions. Examples are all i.MX SoCs and Rockchip SoCs.
> > Until now the first partition starts at offset 1MiB and with this we
> > risk conflicting with the bootloader.
> > 
> > It's cumbersome to sort out all SoCs that have this problem. With
> > nowadays eMMC/SD card sizes it doesn't really matter anymore, so change
> > the 1MiB offset to 8MiB which is still only a small fraction of the
> > card size, but leaves enough space for putting the bootloader into.
> > 
> > Note the change in the GPT partition handling introduced with this
> > change. The layout previously was:
> > 
> > LBA0: MBR
> > LBA1: GPT header
> > LBA2-33: GPT partition entries
> > 
> > which now becomes:
> > 
> > LBA0: MBR
> > LBA1: GPT header
> > LBA16352-16383: GPT partition entries
> > 
> > This means the GPT partition entries moved from LBA2 to just below the
> > 8MiB boundary and LBA2-16351 are now free for the bootloader. This helps
> > with with older SoCs on which the bootloader overlaps with the normal
> > location of the GPT partition entries, like i.MX7 and earlier.
> 
> I know that eMMC became quite large these days but always 'wasting' 8MiB
> on systems which utilize the eMMC-boot partitions is not very user
> friendly.

That's 0.78% of 1GiB SD card, it's really not much. Anyway, I can add a
command line option for parted.

Sascha

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |



More information about the barebox mailing list