Skip to content
Snippets Groups Projects
Verified Commit ecf4f7c9 authored by Andreas Gnau's avatar Andreas Gnau :speech_balloon:
Browse files

airoha: an7581: Create FIP partition in software


The Airoha Boot ROM reads the FIP from 2 KB offset. The FIP goes until
512KB. Create a 510 KB partition in software only using the blkpg-part
utility, because this partition cannot be stored in the GPT. The reason
for this is that in GPT all partitions must start after the PGPT
entries, but the GPT entries (16 KB) cannot be put right after GPT
header at 1KB, because the boot ROM expects FIP to be at 2 KB.

Signed-off-by: default avatarAndreas Gnau <andreas.gnau@iopsys.eu>
parent 09171895
No related tags found
1 merge request!1369airoha: an7581: Create FIP partition in software
......@@ -9,6 +9,8 @@ CPU_TYPE:=cortex-a53
FEATURES+=squashfs nand ramdisk ubifs
KERNELNAME:=vmlinux
DEFAULT_PACKAGES+=blkpg-part
define Target/Description
Build firmware images for Airoha an7581 ARM based boards.
endef
......
# SPDX-License-Identifier: GPL-2.0-or-later
# Copyright (C) 2025 IOPSYS Software Solutions AB
FIP_PARTITION_NUMBER=64
FIP_PARTITION_LABEL=fip
if [ "$DEVTYPE" = disk ] && [ "$DEVICENAME" = mmcblk0 ]; then
case "$ACTION" in
add)
# The Airoha Boot ROM reads FIP from 2 KB offset. FIP goes until 512KB
# Create a 510 KB partition in software only, because this partition
# cannot be stored in the GPT. The reason for this is that in GPT all
# partitions must start after the PGPT entries, but the GPT entries (16 KB)
# cannot be put right after GPT header at 1KB, because the boot ROM
# expects FIP to be at 2 KB.
blkpg-part add -l "$FIP_PARTITION_LABEL" "/dev/$DEVICENAME" "$FIP_PARTITION_NUMBER" 2048 522240
# While the kernel UAPI has a field for the partition label and
# we set it, there exists no code in the kernel that makes use of it.
# Create a symlink as a workaround while kernel is lacking the functionality
ln -sf "/dev/${DEVICENAME}p${FIP_PARTITION_NUMBER}" "/dev/${DEVICENAME}pfip"
;;
remove)
rm "/dev/${DEVICENAME}pfip"
;;
esac
fi
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment