On 4/11/25 14:03, Jan Kiszka wrote:
From: Jan Kiszka <[email protected]>

Alignment rules apply the the individual partitions (user, boot, later
on also RPMB) and depend both on the size of the image and the type of
the device. Up to and including 2GB, the power-of-2 rule applies to the
user data area. For larger images, multiples of 512 sectors must be used
for eMMC and multiples of 512K for SD-cards. Fix the check accordingly
and also detect if the image is too small to even hold the boot
partitions.

Signed-off-by: Jan Kiszka <[email protected]>
---
CC: Warner Losh <[email protected]>
CC: Cédric Le Goater <[email protected]>
CC: Joel Stanley <[email protected]>
CC: Alistair Francis <[email protected]>
CC: Alexander Bulekov <[email protected]>
---
  hw/sd/sd.c | 69 +++++++++++++++++++++++++++++++++++++-----------------
  1 file changed, 48 insertions(+), 21 deletions(-)

Reviewed-by: Cédric Le Goater <[email protected]>
Reviewed-by: Philippe Mathieu-Daudé <[email protected]>


Reply via email to