Skip to content

hisi: name the Hi3521A, Hi3535 and Hi3536 V100 DVR/NVR dies - #301

Merged
dimerr merged 2 commits into
masterfrom
hisilicon/nvr-ids
Dec 1, 2026
Merged

dimerr merged 2 commits into
masterfrom
hisilicon/nvr-ids

Conversation

@dimerr

@dimerr dimerr commented Dec 1, 2026

Copy link
Copy Markdown
Collaborator

Adds the SC_SYSID values of the DVR/NVR dies OpenIPC is adding U-Boot and firmware for (u-boot #240/#242/#250, firmware #3020/#3021/#3024): 0x3521A100 → 3521AV100 (also Hi3520DV300, same die and ID), 0x35350100 → 3535V100, 0x35360100 → 3536V100. Values are from the vendor SDKs' U-Boot (_HI3521A_V100, _HI3535_V100, _HI3536_V100). No chip_generation, as for 3520DV200: no pad/sensor/ISP tables exist for them.

Hi3521DV100/3520DV400 (0xBDA9D100) and 3521V100 were already present. NA51068 (NT98321/NT98323) needs nothing: its kernel has no nvt_pinmux chip_id, and the device-tree model "Novatek NA51068" names it. RK3588/RK3568 come from the device tree too.

Built on the host, unit tests pass; not run on a camera.

OpenIPC now builds U-Boot and firmware for these dies, and ipcinfo on them
prints "Got unexpected ID ... for HiSilicon". Their SC_SYSID values are
the vendor U-Boot's: _HI3521A_V100 0x3521A100, _HI3535_V100 0x35350100 and
_HI3536_V100 0x35360100 (Hi3521A, Hi3535 and Hi3536 SDKs). The Hi3520DV300
reads as the Hi3521A: same die, same ID, told apart only by which vendor
build is flashed. Like 3520DV200, none sets a chip_generation: there are
no pad, sensor or ISP tables for them. Their UART0 bases (0x12080000,
0x20080000) already route to the right SC_CTRL.

The Hi3521DV100, Hi3520DV400 and Hi3521V100 were already named. The
Hi3520AV100 is left out: its vendor define (HI3520A_V100 0x3520A0100) has
a digit too many, so its real value is unknown.

Built on the host; cYAML_test, reginfo_test, sstar_test and anyka_test
pass. Not run on a camera.
@qodo-free-for-open-source-projects

qodo-free-for-open-source-projects Bot commented Dec 1, 2026 •

Copy link
Copy Markdown

PR Summary by Qodo

hisi: name the Hi3521A, Hi3535 and Hi3536 V100 DVR/NVR dies

✨ Enhancement 🕐 Less than 10 minutes

Grey Divider

AI Description

• Maps SC_SYSID values 0x3521A100, 0x35350100 and 0x35360100 to 3521AV100, 3535V100 and 3536V100.
• Stops ipcinfo printing "Got unexpected ID" on these DVR/NVR dies, which OpenIPC now builds
 firmware for.
• Adds no chip_generation, since no pad, sensor or ISP tables exist for these dies.
Merge Risk 🟢 Low

Blast radius 🟢 Low 💥 1 capability

  • 1 affected end-to-end capability after fault-specific containment; implementation boundaries do not widen its functional scope.
  • The changed switch cases and their caller form one bounded end-to-end behavior: reading the HiSilicon family ID and exposing the resulting model through chip_name.
  • No separate sensor, pad, ISP, or configuration capability is enabled because these cases do not assign chip_generation.
Sources

src/hal/hisi/hal_hisi.c[1283-1295]

    /* The DVR/NVR dies below have no chip_generation: ipctool has no pad,
     * sensor or ISP tables for them, so only the name is reported. The IDs
     * are the vendor U-Boot's (_HI3521A_V100, _HI3535_V100, _HI3536_V100 in
     * the Hi3521A, Hi3535 and Hi3536 SDKs). */
    case 0x3521A100:
        /* Hi3520DV300 is the same die with the same ID: the vendor tells
         * the two apart by build, not at run time. */
        return "3521AV100";
    case 0x35350100:
        return "3535V100";
    case 0x35360100:
        /* Hi3536 V100, not the Hi3536DV100 (0x3536D100) or CV100. */
        return "3536V100";
Behavioral complexity 🟢 Low 🧩 Straightforward

  • Before, these family IDs fell through to the unexpected-ID default and returned unknown.
  • After, each ID selects a literal model string.
  • The new correctness condition is only exact family-ID-to-name matching; no new branches interact with state, compatibility, ordering, persistence, or downstream control flow.
Sources

src/hal/hisi/hal_hisi.c[1283-1295]

    /* The DVR/NVR dies below have no chip_generation: ipctool has no pad,
     * sensor or ISP tables for them, so only the name is reported. The IDs
     * are the vendor U-Boot's (_HI3521A_V100, _HI3535_V100, _HI3536_V100 in
     * the Hi3521A, Hi3535 and Hi3536 SDKs). */
    case 0x3521A100:
        /* Hi3520DV300 is the same die with the same ID: the vendor tells
         * the two apart by build, not at run time. */
        return "3521AV100";
    case 0x35350100:
        return "3535V100";
    case 0x35360100:
        /* Hi3536 V100, not the Hi3536DV100 (0x3536D100) or CV100. */
        return "3536V100";
Potential damage 🟢 Low 🩹 Cosmetic

  • If a mapping regresses, the affected outcome is an incorrect or unknown displayed/API chip model.
  • The source explicitly leaves chip_generation unset for these IDs, limiting the changed behavior to naming; no persistent state or external transaction is involved.
  • Re-running detection after correcting or reverting the code restores the model string; no stored data repair or external compensation is required.
Sources

src/hal/hisi/hal_hisi.c[1283-1295]

    /* The DVR/NVR dies below have no chip_generation: ipctool has no pad,
     * sensor or ISP tables for them, so only the name is reported. The IDs
     * are the vendor U-Boot's (_HI3521A_V100, _HI3535_V100, _HI3536_V100 in
     * the Hi3521A, Hi3535 and Hi3536 SDKs). */
    case 0x3521A100:
        /* Hi3520DV300 is the same die with the same ID: the vendor tells
         * the two apart by build, not at run time. */
        return "3521AV100";
    case 0x35350100:
        return "3535V100";
    case 0x35360100:
        /* Hi3536 V100, not the Hi3536DV100 (0x3536D100) or CV100. */
        return "3536V100";
Assessed commit 293b22f
Diagram

graph TD
    A["SC_SYSID read"] --> B["get_hisi_chip_id"] --> C["Chip name string"]
    B -.-> D["New cases: 3521A, 3535, 3536"]
Loading
High-Level Assessment

Extending the existing switch in get_hisi_chip_id matches how every other die is named, so the PR follows the established pattern. A separate lookup table or deriving names from the family ID would add structure without benefit for three constant mappings. The PR also correctly leaves out 0x3520A100, whose vendor define has a digit too many, rather than guessing its value.

Files changed (1) +13 / -0

Enhancement (1) +13 / -0
hal_hisi.cAdd chip name cases for three Hisilicon DVR/NVR die IDs +13/-0

Add chip name cases for three Hisilicon DVR/NVR die IDs

• Adds switch cases in get_hisi_chip_id for SC_SYSID 0x3521A100 (3521AV100), 0x35350100 (3535V100) and 0x35360100 (3536V100). The comments note that the Hi3520DV300 shares the 3521A ID, and that 0x3536D100 and CV100 are distinct dies. No chip_generation is set, since no pad, sensor or ISP tables exist for these dies.

src/hal/hisi/hal_hisi.c

@qodo-free-for-open-source-projects

qodo-free-for-open-source-projects Bot commented Dec 1, 2026 •

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0) 🎨 UX issues (0) 🔗 Cross-repo conflicts (0) 📜 Skill insights (0)

Grey Divider


Informational

1. New DVR/NVR die IDs have no regression test ✓ Resolved Bug Maintainability
Description
get_hisi_chip_id gains three new case arms (0x3521A100, 0x35350100, 0x35360100) but
hal_hisi_test.c gets no matching assertions, even though the existing test already checks other
IDs against this function. A later edit that mistypes or drops one of these constants would pass the
test suite unnoticed.

Grey Divider

Tip of the day
💡 Did you know, you can pick a display mode instead of tweaking every Display option by hand

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

The three IDs added in the previous commit, checked next to the GK7206
ones, so that a mistyped constant fails the unit test (Qodo, #301).

hal_hisi_test passes on the host.
@dimerr

dimerr commented Dec 1, 2026

Copy link
Copy Markdown
Collaborator Author

Qodo #1 (no regression test for the new IDs): fixed in 293b22f. hal_hisi_test now checks all three names.

@dimerr
dimerr merged commit 2bbac0e into master Dec 1, 2026
5 checks passed
@dimerr
dimerr deleted the hisilicon/nvr-ids branch December 1, 2026 04:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant