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 @@ -168,14 +168,14 @@ Backends: `spi_flash.c` (fmc100), `spi_flash_hisfc350.c` (V1-era parts),
`u-boot-<chip>-universal.bin`; the SoCs in `PER_FLASH_TYPE_UBOOT` (the
u-boot-xmedia ones: hi3516ev200/ev300, hi3518ev300, hi3516dv200,
gk7205v500/v510/v530; and the OpenIPC/u-boot gk7202v300, gk7205v200/v300,
gk7605v100, hi3516cv300, hi3516ev100 -- ev100 has no NAND build) publish `u-boot-<chip>-nor.bin` and `-nand.bin` instead, so
gk7605v100, gk7201v200, hi3516cv300, hi3516ev100 -- ev100 has no NAND build) publish `u-boot-<chip>-nor.bin` and `-nand.bin` instead, so
callers pass `flash_type` (NOR when unknown). On NAND those SoCs install the
UBI-only layout (`NAND_UBI_LAYOUT` in `install/layout.py`: 768k boot, 256k
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, the hi3516ev200 family -- hi3516ev300 split-only --
and the gk7205v500 family; keyed by package board, `FIRMWARE_PACKAGE_BOARD`
the gk7205v500 family and gk7201v200; keyed by package board, `FIRMWARE_PACKAGE_BOARD`
maps cv608/cv610/cv613 to `hi3516cv6xx`, hi3516dv500 to `hi3519dv500` and
gk7205v510/v530 to `gk7205v500`) install the split NOR
package: one `firmware.bin.<board>` where the boot area ends (0x50000;
Expand Down
4 changes: 2 additions & 2 deletions src/defib/firmware.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
"hi3516ev200", "hi3516ev300", "hi3518ev300", "hi3516dv200",
"gk7205v500", "gk7205v510", "gk7205v530",
"gk7202v300", "gk7205v200", "gk7205v300", "gk7605v100",
"gk7201v200",
"hi3516cv300", "hi3516ev100",
})

Expand Down Expand Up @@ -91,7 +92,7 @@
"hi3516cv6xx", "hi3519dv500",
"hi3516cv300", "hi3516ev100",
"hi3516ev200", "hi3518ev300", "hi3516dv200",
"gk7205v500",
"gk7205v500", "gk7201v200",
# Split-only, like hi3516cv6xx: its kernel fills the 2 MiB slot, so no
# fixed-slot package can ship beside the split one.
"hi3516ev300",
Expand Down Expand Up @@ -143,7 +144,6 @@
CHIP_TO_FIRMWARE: dict[str, str] = {
"hi3518ev201": "hi3518ev200",
"hi3516dv100": "hi3516dv100",
"gk7201v200": "gk7205v200",
Comment thread
widgetii marked this conversation as resolved.
"gk7201v300": "gk7205v200",
"gk7205v210": "gk7205v200",
}
Expand Down
4 changes: 2 additions & 2 deletions src/defib/install/layout.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
def ubi_nand_boards(chip: str) -> set[str]:
"""The ``rootfs.ubi.<board>`` suffixes a NAND package for ``chip`` may carry.

An aliased chip (gk7201v200, gk7205v210, ...) installs the U-Boot of the SoC
An aliased chip (gk7205v210, hi3518ev201, ...) installs the U-Boot of the SoC
it is published under, and that SoC's package with it.
"""
from defib.firmware import CHIP_TO_FIRMWARE
Expand All @@ -77,7 +77,7 @@ def ubi_nand_boards(chip: str) -> set[str]:
def split_boards(chip: str) -> set[str]:
"""The ``firmware.bin.<board>`` suffixes a split NOR package for ``chip`` may carry.

Aliased chips (gk7205v210, gk7201v200, ...) install the image of the SoC
Aliased chips (gk7205v210, hi3518ev201, ...) install the image of the SoC
they are published under, and a family built once (hi3516cv610 ->
hi3516cv6xx) the family's.
"""
Expand Down
2 changes: 1 addition & 1 deletion tests/test_firmware.py
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ class TestPerFlashTypeUBoot:
"hi3516ev200", "hi3516ev300", "hi3518ev300", "hi3516dv200",
"gk7205v500", "gk7205v510", "gk7205v530",
"gk7202v300", "gk7205v200", "gk7205v300", "gk7605v100",
"hi3516cv300",
"gk7201v200", "hi3516cv300",
)
NOR_ONLY = ("hi3516ev100",)

Expand Down
21 changes: 20 additions & 1 deletion tests/test_install_nor_split.py
Original file line number Diff line number Diff line change
Expand Up @@ -306,10 +306,29 @@ async def test_split_install_refusals(monkeypatch, tmp_path, capsys, kwargs, cod
def test_aliased_chip_accepts_the_nand_package_it_is_published_under():
from defib.install.layout import ubi_nand_boards

assert "gk7205v200" in ubi_nand_boards("gk7201v200")
assert "gk7205v200" in ubi_nand_boards("gk7205v210")
assert "gk7205v500" in ubi_nand_boards("gk7205v510")


def test_gk7201v200_installs_its_own_build():
"""gk7201v200 publishes its own U-Boot (nor and nand) and firmware, on the
gk7205v500 kernel tree with the split layout; it is no gk7205v200 alias."""
from defib.firmware import (
CHIP_TO_FIRMWARE, PER_FLASH_TYPE_UBOOT, asset_name, package_board,
supports_nor_split,
)
from defib.install.layout import split_boards, ubi_nand_boards

assert "gk7201v200" not in CHIP_TO_FIRMWARE
assert "gk7201v200" in PER_FLASH_TYPE_UBOOT
assert package_board("gk7201v200") == "gk7201v200"
assert supports_nor_split("gk7201v200")
assert split_boards("gk7201v200") == {"gk7201v200"}
assert ubi_nand_boards("gk7201v200") == {"gk7201v200"}
assert asset_name("gk7201v200", "nor") == "u-boot-gk7201v200-nor.bin"
assert asset_name("gk7201v200", "nand") == "u-boot-gk7201v200-nand.bin"


@pytest.mark.asyncio
async def test_split_erase_timeout_scales_with_the_chip(monkeypatch, tmp_path):
"""0x50000 to the end of a 32 MiB chip is 507 blocks, not one partition."""
Expand Down
Loading