diff --git a/CLAUDE.md b/CLAUDE.md index a98e333..761fab3 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -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 package board, `FIRMWARE_PACKAGE_BOARD` maps cv608/cv610/cv613 to `hi3516cv6xx` and hi3516dv500 to `hi3519dv500`) install the split NOR package: one `firmware.bin.` where the boot area ends (0x50000; diff --git a/README.md b/README.md index fdf63e7..19af811 100644 --- a/README.md +++ b/README.md @@ -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 ``` @@ -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--nor.bin` and `u-boot--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: diff --git a/src/defib/firmware.py b/src/defib/firmware.py index 319ebeb..2f89717 100644 --- a/src/defib/firmware.py +++ b/src/defib/firmware.py @@ -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 diff --git a/tests/test_install_nor_split.py b/tests/test_install_nor_split.py index e37a2ec..c690fa6 100644 --- a/tests/test_install_nor_split.py +++ b/tests/test_install_nor_split.py @@ -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) @@ -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)