From de30ec5a54ff103322becabd75607559e739f2a3 Mon Sep 17 00:00:00 2001 From: Dmitry Ermakov <7954832+dimerr@users.noreply.github.com> Date: Tue, 20 Oct 2026 22:21:29 +0000 Subject: [PATCH 1/2] ci: xm, NOR images only openipc-xm drops its SPI NAND images (xm/generic-recovery): no XM530/XM550 board with SPI NAND has turned up and the kernel has no driver for it. Build and smoke-test xm510, xm530 and xm550 NOR only, and drop the NAND lines from the README. --- .github/workflows/build-xm.yml | 39 +++++++--------------------------- README.md | 12 +---------- 2 files changed, 9 insertions(+), 42 deletions(-) diff --git a/.github/workflows/build-xm.yml b/.github/workflows/build-xm.yml index 77023fdfbf7f..0a0bddbf79ca 100644 --- a/.github/workflows/build-xm.yml +++ b/.github/workflows/build-xm.yml @@ -61,11 +61,8 @@ jobs: matrix: include: - { soc: xm510, kinds: "nor", files: "output/u-boot-xm510-*.bin" } - # SPI NAND images follow a guess at how the XM530 boots from NAND - # (see openipc-xm's CLAUDE.md); smoke-tested on qemu-hisilicon's - # NAND model, which implements the same guess. - - { soc: xm530, kinds: "nor nand", files: "output/u-boot-xm530-*.bin" } - - { soc: xm550, kinds: "nor nand", files: "output/u-boot-xm550-*.bin" } + - { soc: xm530, kinds: "nor", files: "output/u-boot-xm530-*.bin" } + - { soc: xm550, kinds: "nor", files: "output/u-boot-xm550-*.bin" } steps: - name: Checkout @@ -100,8 +97,8 @@ jobs: - name: Check partition fit run: | - # Boot partition sizes from this tree's mtdparts: NOR boot = 256 KiB - # (env at 0x40000), NAND/UBI boot = 768 KiB (0xc0000). An image + # Boot partition size from this tree's mtdparts: NOR boot = 256 KiB + # (env at 0x40000). An image # larger than its boot partition overflows into env and bricks the # device on upgrade. soc='${{ matrix.soc }}' @@ -128,9 +125,6 @@ jobs: [ "$found" = 1 ] || { echo "missing ${kind} image for ${soc} (${pattern})" >&2; rc=1; } } check_kind nor 256 "output/*${soc}*-nor.bin" - case "$kinds" in - *nand*) check_kind nand 768 "output/*${soc}*-nand.bin" ;; - esac exit $rc - name: Upload artifact @@ -188,8 +182,6 @@ jobs: - { soc: xm510, kind: nor } - { soc: xm530, kind: nor } - { soc: xm550, kind: nor } - - { soc: xm530, kind: nand } - - { soc: xm550, kind: nand } steps: - name: Download qemu-arm uses: actions/download-artifact@v4 @@ -222,25 +214,10 @@ jobs: UBOOT="u-boot-${soc}-${kind}.bin" test -f "$UBOOT" echo "booting $UBOOT" - if [ "$kind" = nor ]; then - # 8 MiB NOR, U-Boot at 0, the rest erased - dd if=/dev/zero bs=1M count=8 2>/dev/null | tr '\0' '\377' > /tmp/flash.bin - dd if="$UBOOT" of=/tmp/flash.bin bs=1 conv=notrunc 2>/dev/null - FLASH="-M ${soc},flash-file=/tmp/flash.bin -global xm-sfc.wps=on" - else - # 128 MiB SPI NAND, raw 2048+64-byte pages, U-Boot from page 0 - python3 - "$UBOOT" /tmp/nand.bin <<'PY' - import sys - D, S, PAGES = 2048, 64, 1024 * 64 - raw = bytearray(b'\xff' * (PAGES * (D + S))) - img = open(sys.argv[1], 'rb').read() - for i in range(0, len(img), D): - o = (i // D) * (D + S) - raw[o:o + len(img[i:i + D])] = img[i:i + D] - open(sys.argv[2], 'wb').write(raw) - PY - FLASH="-M ${soc} -global xm-sfc.nand-file=/tmp/nand.bin" - fi + # 8 MiB NOR, U-Boot at 0, the rest erased + dd if=/dev/zero bs=1M count=8 2>/dev/null | tr '\0' '\377' > /tmp/flash.bin + dd if="$UBOOT" of=/tmp/flash.bin bs=1 conv=notrunc 2>/dev/null + FLASH="-M ${soc},flash-file=/tmp/flash.bin -global xm-sfc.wps=on" chmod +x ./qemu-arm # Two boots: the first finds an erased environment and saves the # default one; the second must load it back. diff --git a/README.md b/README.md index 663b4ee0f6d4..22eee7d87126 100644 --- a/README.md +++ b/README.md @@ -72,13 +72,6 @@ U-Boot for Xiongmai's own camera SoCs, on the same mainline release **NOR:** `xm510`, `xm530`, `xm550` -**SPI NAND:** `xm530`, `xm550`. These images are **unverified on -silicon**: nothing documents how the XM530 boots from SPI NAND, and they -follow the vendor SDK's unused NAND configuration (U-Boot behind a 4 KiB -header in the controller window). They have only run on qemu-hisilicon's -NAND model, which implements the same assumption. The OpenIPC XM530 -kernel has no SPI NAND driver yet. - The boot ROM runs U-Boot in place from SPI NOR, and U-Boot brings up DDR itself, so the image is `u-boot.bin` as linked: `u-boot--nor.bin`, written at flash offset 0. The flash driver clears the per-block write @@ -93,8 +86,7 @@ bash build.sh # xm510 xm530 xm550 bash build.sh xm530 # a single SoC ``` -Images land in `output/` as `u-boot--nor.bin` and, for xm530/xm550, -`u-boot--nand.bin`. +Images land in `output/` as `u-boot--nor.bin`. The toolchain is `arm-linux-gnueabi-`, as for hisilicon. @@ -222,8 +214,6 @@ smoke-tested: - booted a second time, which must load the environment the first boot saved. -The NAND images get the same two boots on qemu-hisilicon's SPI NAND model. - Its `release` input fills this repository's [`Xiongmai` release](../../releases/tag/xiongmai); `publish` uploads to `OpenIPC/firmware` `latest`, where no other repository publishes From f8f609ac7ee4ae530cfaf771ade84584752ac31f Mon Sep 17 00:00:00 2001 From: Dmitry Ermakov <7954832+dimerr@users.noreply.github.com> Date: Tue, 20 Oct 2026 22:33:39 +0000 Subject: [PATCH 2/2] ci: xm, upload the NOR image by name; CLAUDE.md without NAND legs The artifact paths still matched u-boot--*.bin, so a revision that still built a -nand.bin would have uploaded and released it, now that nothing checks NAND images. Upload u-boot--nor.bin by name. And CLAUDE.md still described the NAND legs. Reported by Qodo on #43. --- .github/workflows/build-xm.yml | 6 +++--- CLAUDE.md | 8 ++------ 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/.github/workflows/build-xm.yml b/.github/workflows/build-xm.yml index 0a0bddbf79ca..1d7b31738bed 100644 --- a/.github/workflows/build-xm.yml +++ b/.github/workflows/build-xm.yml @@ -60,9 +60,9 @@ jobs: fail-fast: false matrix: include: - - { soc: xm510, kinds: "nor", files: "output/u-boot-xm510-*.bin" } - - { soc: xm530, kinds: "nor", files: "output/u-boot-xm530-*.bin" } - - { soc: xm550, kinds: "nor", files: "output/u-boot-xm550-*.bin" } + - { soc: xm510, kinds: "nor", files: "output/u-boot-xm510-nor.bin" } + - { soc: xm530, kinds: "nor", files: "output/u-boot-xm530-nor.bin" } + - { soc: xm550, kinds: "nor", files: "output/u-boot-xm550-nor.bin" } steps: - name: Checkout diff --git a/CLAUDE.md b/CLAUDE.md index e16f5f4daa34..3367bdd8dea7 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -63,12 +63,8 @@ The build logic lives here. Other branches call it: - `pull_request` runs only when the workflow file itself changes. - **No `hold`:** every SoC has a qemu-hisilicon machine, so every image is smoke-tested and released. -- **NAND legs:** xm530/xm550 build `kinds: "nor nand"`, and `qemu_smoke` - has a NAND leg for each. - - A NAND leg boots a raw 128 MiB image (2048+64-byte pages) through - `-global xm-sfc.nand-file=`, which needs qemu-hisilicon's NAND model. - - The NAND images rest on an unverified guess at the XM530 NAND boot - path; `openipc-xm`'s `CLAUDE.md` explains it. +- **NOR only:** every leg builds, uploads and smoke-tests + `u-boot--nor.bin` alone. openipc-xm has no SPI NAND images. - **Smoke test:** two boots of an 8 MiB flash image under `-global xm-sfc.wps=on`. - It passes on `Hit Ctrl-C`.