create part info for the sd card version of u-boot

The partition size in partition_sd.xml is not used
when generating the sd image, but some of this
information will be used later in u-boot.

Signed-off-by: carbon <carbon@milkv.io>
This commit is contained in:
carbon
2024-06-25 22:08:36 +08:00
parent 472f2f301a
commit ff2f5f9161

View File

@ -137,7 +137,6 @@ def gen_cvipart_h(output, parser):
if p["label"] == "ROOTFS": if p["label"] == "ROOTFS":
of.write('#define ROOTFS_DEV "/dev/mmcblk0p%d"\n' % (i+1)) of.write('#define ROOTFS_DEV "/dev/mmcblk0p%d"\n' % (i+1))
break break
of.write('#define PARTS_OFFSET ""\n')
elif parser.getStorage() == "none": elif parser.getStorage() == "none":
of.write('#define PART_LAYOUT ""\n') of.write('#define PART_LAYOUT ""\n')
@ -160,10 +159,10 @@ def gen_cvipart_h(output, parser):
) )
# Generintg PART_ENV # Generintg PART_ENV
if parser.getStorage() == "emmc": if parser.getStorage() == "emmc" or parser.getStorage() == "sd":
LBA_SIZE = 512 LBA_SIZE = 512
if parser.getStorage() != "none" and parser.getStorage() != "sd": if parser.getStorage() != "none":
of.write("#define PARTS_OFFSET \\\n") of.write("#define PARTS_OFFSET \\\n")
for i, p in enumerate(parts): for i, p in enumerate(parts):
of.write('"%s_PART_OFFSET=0x%x\\0" \\\n' % (p["label"], int(p["offset"] / LBA_SIZE))) of.write('"%s_PART_OFFSET=0x%x\\0" \\\n' % (p["label"], int(p["offset"] / LBA_SIZE)))