On 21/07/2026 08:08, Varadarajan Narayanan wrote: > On Mon, Jul 20, 2026 at 02:25:37PM +0100, Casey Connolly wrote: >> Hi Varadarajan, >> >> On 7/14/26 10:52, Varadarajan Narayanan wrote: >>> - Add ipq5210 entry to the 'boards' table >>> - Add an argument to specify the SPL load address >>> - ipq5210's boot rom expects the SPL image size to be 4-byte aligned. To >>> support this add an argument to specify the image size alignment to >>> enable the mkmbn script to pad the image accordingly. >>> >>> Signed-off-by: Varadarajan Narayanan >>> <[email protected]> >>> --- >>> tools/qcom/mkmbn/mkmbn.py | 14 ++++++++++++++ >>> 1 file changed, 14 insertions(+) >>> >>> diff --git a/tools/qcom/mkmbn/mkmbn.py b/tools/qcom/mkmbn/mkmbn.py >>> index 8d2078acc30..46edbcafb32 100755 >>> --- a/tools/qcom/mkmbn/mkmbn.py >>> +++ b/tools/qcom/mkmbn/mkmbn.py >>> @@ -85,6 +85,7 @@ boards: dict[bytes, MbnData] = { >>> b"qcom,sm8550\0": MbnData(0xA7000000, 7, SwId.uefi), # C8550 >>> b"qcom,sm8650\0": MbnData(0xA7000000, 7, SwId.uefi), # SM8650 >>> b"qcom,qcs615\0": MbnData(0x9FC00000, 6, SwId.uefi), # Dragonwing IQ6 >>> + b"qcom,ipq5210\0": MbnData(0x87980000, 7, SwId.aboot), >>> b"qcom,ipq5424\0": MbnData(0x8a380000, 7, SwId.aboot), >>> b"qcom,ipq9574\0": MbnData(0x4A240000, 6, SwId.aboot), >>> @@ -100,9 +101,15 @@ parser = argparse.ArgumentParser( >>> """ >>> ) >>> parser.register("type", "hex", lambda s: int(s, 16)) >>> +parser.add_argument( >>> + "-l", "--load", type=lambda x: int(x, 0), default=0, help="Load >>> address" >>> +) >> >> How about we extend MbnData to support an optional SPL load address option? > > Would prefer to remove U-Boot proper's load address too from MbnData. Since > these are readily available in CONFIG_TEXT_BASE and CONFIG_SPL_TEXT_BASE, > they can be passed from board/qualcomm/config.mk. Why maintain in 2 places? > Please let me know. The idea here was to avoid tying these together, so a single u-boot binary could run on multiple platforms simply by appending a different DTB and the load address would be set as appropriate (since we build U-Boot with PIE already). But tbh I can appreciate that there isn't a strong usecase for that. The only other benefit is having the load addresses nicely described in one place, but that could probably be in doc/ if we really need it. Let's go forward with a load address, I don't think we can nicely support both mechanisms here so please just remove the address from the MbnData and update all of the appropriate defconfigs. You might need to add some new defconfigs as well? For sm8550/sm8650 it would be enough I think to document that they can both use the same defconfig, just that the dtb needs to be set appropriately (a config fragment just to set the dtb to sm8550-hdk would be a good solution I think). > >> Then just have a flag to indicate that we're building an SPL image (since >> presumably you need to add an SPL specific build target for >> u-boot-spl.mbn?). > > Ok. > >>> parser.add_argument( >>> "-o", "--output", type=Path, default="u-boot.mbn", help="Output file" >>> ) >>> +parser.add_argument( >>> + "-s", "--szalign", type=int, default=0, help="Size alignment" >>> +) >> >> Pretty sure it's safe to align all the images...... we really don't need to >> be adding bogus flags for this kinda stuff. > > Agree. But wondered if the alignment requirements change in future to 16 or > 64 then this would be handy. Anyway will remove and align everyone to 4. Why not just 4k align everything now? I don't think this would cause any issues on existing platforms, just also make sure it matches the alignment property in the segment info. This is probably the more correct thing to do regardless. You can probably go to 64k even although then you should give it a test on db410c. > > Thanks > Varada > >>> parser.add_argument( >>> "-v", dest="verbose", action="store_true", default=False, >>> help="Verbose" >>> ) >>> @@ -149,8 +156,15 @@ if not mbn: >>> args.output.unlink(missing_ok=True) >>> exit(1) >>> +if args.load != 0: >>> + print("Using load address from command line: %s" % hex(args.load)) >>> + mbn.loadaddr = args.load >>> + >>> log(f"Detected board {match.decode('UTF-8')} with load address >>> {mbn.loadaddr:#x}") >>> +if args.szalign != 0: >>> + data += b'\x00' * (-len(data) % args.szalign) >>> + >>> elf.phdrs.append(Phdr.from_bin(data, mbn.loadaddr)) >>> elf.ehdr.e_entry = mbn.loadaddr >>> elf.update() -- // Casey (she/her)
