Add zynq-7010 toolkit flash module (tier-2 update, offset writes, BOOT.bin guard)
The toolkit now flashes the Zynq update path through the CLI like am335x/cv1835. - boards/zynq.rs: ZynqPlan::from_afw (validates the zynq-7010 .afw: armv7, preserve, the kernel/dtb/rootfs image set, zimage/fdt/cpio-gzip formats, size ceilings, rejects any bootloader/spl/BOOT.bin member and a non-zImage kernel), preflight (alkane source, root, flash tools, mtd0/mtd1, BOOT.bin-preserve guard), install (OFFSET-AWARE: nanddump/flash_erase/nandwrite --start at the device-relative slot offset - kernel 0x2200000, dtb 0x2700000 in /dev/mtd0, rootfs in /dev/mtd1 - with per-region backup + md5 readback), and a hard guard that refuses any /dev/mtd0 write below BOOTBIN_PRESERVE so BOOT.bin can never be clobbered. - alkane-artifacts: add the strict 'zimage' image format (magic 0x016f2818 at 0x24). - alkane-cli: route zynq-7010 through afw plan/preflight/install. - 6 module tests (good plan, non-zImage, oversize, bootloader member, wrong board/arch, every-mtd0-target-above-BOOT.bin). Full flash suite 47 green, artifacts green; the real bundle renders its plan through the CLI. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01B1W6qHxYpv7yf7Ah57g4rQ
This commit is contained in:
@@ -42,7 +42,7 @@ const AM335X_CEILINGS: &[(&str, u64, &str)] = &[
|
||||
];
|
||||
|
||||
const IMAGE_ROLES: &[&str] = &["kernel", "dtb", "rootfs", "bootloader", "boot", "component"];
|
||||
const IMAGE_FORMATS: &[&str] = &["fit", "arm64-image", "fdt", "cpio-gzip", "uimage", "raw"];
|
||||
const IMAGE_FORMATS: &[&str] = &["fit", "arm64-image", "zimage", "fdt", "cpio-gzip", "uimage", "raw"];
|
||||
|
||||
#[derive(Clone, Copy, Debug, Deserialize, Serialize, Eq, PartialEq)]
|
||||
#[serde(rename_all = "lowercase")]
|
||||
@@ -700,6 +700,7 @@ fn check_image_format(
|
||||
match image.format.as_str() {
|
||||
"fit" => "not a FIT or missing the board config",
|
||||
"arm64-image" => "not an arm64 Image",
|
||||
"zimage" => "not an ARM zImage",
|
||||
"fdt" => "not an FDT",
|
||||
"cpio-gzip" => "not gzip-compressed",
|
||||
"uimage" => "not a legacy uImage",
|
||||
@@ -732,6 +733,12 @@ fn check_image_format(
|
||||
return Err(fail());
|
||||
}
|
||||
}
|
||||
"zimage" => {
|
||||
// ARM zImage magic 0x016f2818 (little-endian) at offset 0x24.
|
||||
if data.len() < 0x28 || &data[0x24..0x28] != b"\x18\x28\x6f\x01" {
|
||||
return Err(fail());
|
||||
}
|
||||
}
|
||||
"cpio-gzip" => {
|
||||
if !data.starts_with(b"\x1f\x8b") {
|
||||
return Err(fail());
|
||||
|
||||
Reference in New Issue
Block a user