From 744308711aae5b2b8f8b8a9d8993d690518f77f2 Mon Sep 17 00:00:00 2001 From: Dmitry Ermakov <7954832+dimerr@users.noreply.github.com> Date: Tue, 1 Dec 2026 03:24:29 +0000 Subject: [PATCH 1/2] hisi: name the Hi3521A, Hi3535 and Hi3536 V100 DVR/NVR dies 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. --- src/hal/hisi/hal_hisi.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/hal/hisi/hal_hisi.c b/src/hal/hisi/hal_hisi.c index 94a5a27..d3744bf 100644 --- a/src/hal/hisi/hal_hisi.c +++ b/src/hal/hisi/hal_hisi.c @@ -1280,6 +1280,19 @@ static const char *get_hisi_chip_id(uint32_t family_id, uint8_t scsysid0) { return "3520DV200"; case 0x35210100: return "3521V100"; + /* 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"; case 0x3559A100: return "3559AV100"; case 0xBDA9D100: From 293b22f14ae205ab87076f5bcde60b1835224e20 Mon Sep 17 00:00:00 2001 From: Dmitry Ermakov <7954832+dimerr@users.noreply.github.com> Date: Tue, 1 Dec 2026 03:34:51 +0000 Subject: [PATCH 2/2] hal_hisi_test: the Hi3521A, Hi3535 and Hi3536 V100 names 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. --- src/hal/hisi/hal_hisi_test.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/hal/hisi/hal_hisi_test.c b/src/hal/hisi/hal_hisi_test.c index e44149e..16cf384 100644 --- a/src/hal/hisi/hal_hisi_test.c +++ b/src/hal/hisi/hal_hisi_test.c @@ -560,6 +560,11 @@ int main(void) { CHECK(peek(GK7206_CRG_OTP) == 0x286); CHECK(writes == 0); + /* The DVR/NVR dies named without a generation: no register is read. */ + CHECK(strcmp(get_hisi_chip_id(0x3521A100, 0), "3521AV100") == 0); + CHECK(strcmp(get_hisi_chip_id(0x35350100, 0), "3535V100") == 0); + CHECK(strcmp(get_hisi_chip_id(0x35360100, 0), "3536V100") == 0); + static const struct { uint32_t chip_id, efuse; const char *model;