Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -174,8 +174,8 @@ Backends: `spi_flash.c` (fmc100), `spi_flash_hisfc350.c` (V1-era parts),
env, rest ubi), whose mtdparts/bootcmd/bootargs come from the U-Boot default
env; `NAND_LAYOUT` is the legacy split layout for other chips. The
`NOR_SPLIT_SOCS` (gk7205v200 family, hi3516cv6xx, hi3519dv500,
hi3516cv300/ev100, hi3516ev200/hi3518ev300/hi3516dv200 but not
hi3516ev300; keyed by
hi3516cv300/ev100, the hi3516ev200 family -- hi3516ev300 split-only;
keyed by
Comment thread
qodo-free-for-open-source-projects[bot] marked this conversation as resolved.
package board, `FIRMWARE_PACKAGE_BOARD` maps cv608/cv610/cv613 to
`hi3516cv6xx` and hi3516dv500 to `hi3519dv500`) install the split NOR
package: one `firmware.bin.<board>` where the boot area ends (0x50000;
Expand Down
11 changes: 7 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ Flash a complete OpenIPC release (U-Boot + kernel + rootfs) in one command:

```bash
defib install -c hi3516ev300 \
--firmware openipc.hi3516ev300-nor-lite.tgz \
--firmware openipc.hi3516ev300-nor-lite-split.tgz \
-p /dev/uart-IVG85HG50PYA-S \
--power-cycle --nor-size 8
```
Expand All @@ -69,15 +69,18 @@ The install command orchestrates the entire process:
3. Reaches an OpenIPC U-Boot shell through boot ROM or a registered stock-U-Boot bootstrap
4. Detects the flash and selects the standard OpenIPC layout
5. Starts a multi-file TFTP server and configures U-Boot networking
6. Flashes each partition (U-Boot, kernel, rootfs) with CRC32 verification
6. Flashes U-Boot and the firmware with CRC32 verification: the kernel and
rootfs into fixed slots, or, from a `-split.tgz` package, one `firmware.bin`
where the boot area ends (0x50000), which the kernel divides at boot
7. Saves the boot environment and resets

Requires root for TFTP port 69 and NIC IP assignment. Standard 8/16/32 MiB
NOR layouts are selected from U-Boot flash detection; `--nor-size` remains an
explicit override.

hi3516ev200, hi3516ev300, hi3518ev300, hi3516dv200 and gk7205v500/v510/v530
take their U-Boot from OpenIPC/u-boot-xmedia, published once per flash type as
hi3516ev200, hi3516ev300, hi3518ev300, hi3516dv200, gk7205v500/v510/v530, the
gk7205v200 family and hi3516cv300/ev100 take their U-Boot from OpenIPC/u-boot,
published once per flash type as
`u-boot-<chip>-nor.bin` and `u-boot-<chip>-nand.bin`. `install` picks the build
from `--nand`; `burn` loads the NOR build unless `--nand` is given. On NAND
these SoCs use a UBI-only layout:
Expand Down
5 changes: 3 additions & 2 deletions src/defib/firmware.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,10 @@
"gk7202v300", "gk7205v200", "gk7205v300", "gk7605v100",
"hi3516cv6xx", "hi3519dv500",
"hi3516cv300", "hi3516ev100",
# Not hi3516ev300: its kernel fills the 2 MiB slot, so its firmware
# ships fixed slots only.
"hi3516ev200", "hi3518ev300", "hi3516dv200",
# Split-only, like hi3516cv6xx: its kernel fills the 2 MiB slot, so no
# fixed-slot package can ship beside the split one.
"hi3516ev300",
})

# NOR boot area -- (boot partition size, env partition size) -- where it is
Expand Down
7 changes: 4 additions & 3 deletions tests/test_install_nor_split.py
Original file line number Diff line number Diff line change
Expand Up @@ -288,13 +288,13 @@ async def test_split_image_too_big_for_the_chip(monkeypatch, tmp_path):

@pytest.mark.asyncio
@pytest.mark.parametrize("kwargs, code", [
({"chip": "hi3516ev300"}, 2),
({"chip": "hi3518ev200"}, 2),
# NAND here is the UBI layout, whose package loader names the mistake.
({"nand": True}, 1),
({"wipe_rootfs_data": True, "stages": ("rootfs-data",)}, 2),
])
async def test_split_install_refusals(monkeypatch, tmp_path, capsys, kwargs, code):
board = "hi3516ev300" if kwargs.get("chip") == "hi3516ev300" else "gk7205v200"
board = "hi3518ev200" if kwargs.get("chip") == "hi3518ev200" else "gk7205v200"
firmware = _split_package(tmp_path / "fw.tgz", board=board)
with pytest.raises(typer.Exit) as exc:
await _install(monkeypatch, tmp_path, firmware, **kwargs)
Expand Down Expand Up @@ -357,7 +357,8 @@ def test_package_board_and_boot_area_are_data():
"hi3516ev200", "hi3518ev300", "hi3516dv200"):
assert supports_nor_split(chip), chip
assert nor_boot_area("hi3516cv300") == (0x40000, 0x10000)
assert not supports_nor_split("hi3516ev300")
assert supports_nor_split("hi3516ev300")
assert not supports_nor_split("hi3516cv500")

assert nor_boot_area("hi3516cv610") == (0x40000, 0x10000)
assert nor_boot_area("hi3516dv500") == (0x80000, 0x40000)
Expand Down
Loading