Skip to content

Commit 26c0d4f

Browse files
widgetiiclaude
andauthored
image: assemble per-DDR-binning full NOR images for hi3516cv610/cv608 (#2208) (#2210)
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
1 parent e76e034 commit 26c0d4f

1 file changed

Lines changed: 54 additions & 0 deletions

File tree

.github/workflows/image.yml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,44 @@ jobs:
109109
echo -e "Created: $release\n"
110110
}
111111
112+
# create_hisi <uboot_artifact> <firmware_soc> <variant> <release_tag> <fw_off_kib>
113+
# HiSilicon V4/V5: u-boot is published per DDR binning (the
114+
# boot-ROM DDR init table is baked into each boot image), and the
115+
# firmware .tgz holds a single pre-packed kernel+rootfs blob
116+
# (firmware.bin.<soc>) flashed at the SoC's firmware-partition
117+
# offset. So assemble one full NOR image per DDR binning:
118+
# u-boot at 0, firmware.bin at <fw_off_kib>.
119+
create_hisi() {
120+
local uboot="$1" soc="$2" variant="$3" tag="$4" off="$5"
121+
local release="target/openipc-${tag}-nor-${variant}.bin"
122+
123+
mkdir -p output target
124+
if ! wget -nv "$UBOOT_URL/$uboot" -O "output/$uboot"; then
125+
echo -e "Download failed: $UBOOT_URL/$uboot\n"
126+
return 0
127+
fi
128+
129+
url=$(firmware_url "$soc" "$variant")
130+
if [ -z "$url" ]; then
131+
echo -e "Skip: no firmware in $BUILD_ID for ${soc}_${variant}\n"
132+
return 0
133+
fi
134+
if ! wget -nv "$url" -O "output/$soc.tgz"; then
135+
echo -e "Download failed: $url\n"
136+
return 0
137+
fi
138+
139+
tar -xf "output/$soc.tgz" -C output
140+
# 16 MiB NOR, erased (0xff); u-boot at 0, firmware.bin at its
141+
# partition offset (cv6xx MTDPARTS: firmware @ 0x50000 = 320 KiB).
142+
dd if=/dev/zero bs=1K count=16384 status=none | tr '\000' '\377' > "$release"
143+
dd if="output/$uboot" of="$release" bs=1K seek=0 conv=notrunc status=none
144+
dd if="output/firmware.bin.$soc" of="$release" bs=1K seek="$off" conv=notrunc status=none
145+
rm -rf output
146+
147+
echo -e "Created: $release\n"
148+
}
149+
112150
for soc in $SIGMASTAR $ALLWINNER; do
113151
create $soc $soc lite
114152
create $soc $soc ultimate
@@ -119,6 +157,22 @@ jobs:
119157
create $soc ${soc:0:3} ultimate
120158
done
121159
160+
# HiSilicon Hi3516CV610/CV608 (cv6xx family). The kernel+rootfs blob
161+
# is identical across DDR variants; only the per-binning u-boot (DDR
162+
# init table) differs, so emit one full image per DDR topology.
163+
# cv610 spans three topologies (DDR2-64M / DDR3-128M / DDR3-512M);
164+
# cv608 is a single DDR2-64M part. firmware partition @ 0x50000.
165+
# The 20s/00s u-boots are picked per DDR (their 20g/00g siblings
166+
# carry the same DDR table, differing only in the socmodel env tag).
167+
# Hi3519DV500 is intentionally omitted: its NOR boot path is not yet
168+
# wired in u-boot (empty MTDPARTS, bootcmd "bootm <ram>").
169+
for variant in ultimate; do
170+
create_hisi boot-hi3516cv610-10b-nor.bin hi3516cv6xx "$variant" hi3516cv610-ddr2-64m 320
171+
create_hisi boot-hi3516cv610-20s-nor.bin hi3516cv6xx "$variant" hi3516cv610-ddr3-128m 320
172+
create_hisi boot-hi3516cv610-00s-nor.bin hi3516cv6xx "$variant" hi3516cv610-ddr3-512m 320
173+
create_hisi boot-hi3516cv608-nor.bin hi3516cv6xx "$variant" hi3516cv608 320
174+
done
175+
122176
- name: Upload
123177
uses: softprops/action-gh-release@v2
124178
with:

0 commit comments

Comments
 (0)