Skip to content

hisi: report the Hi3536DV100 chip revision - #249

Merged
widgetii merged 1 commit into
masterfrom
hi3536dv100-revision
Oct 17, 2026
Merged

widgetii merged 1 commit into
masterfrom
hi3536dv100-revision

Conversation

@widgetii

Copy link
Copy Markdown
Member

On a Hi3536DV100, the chip: section now also reports the chip revision:

chip:
  vendor: HiSilicon
  model: 3536DV100
  revision: 2

Why

The value is SCSYSID0[31:24] (0x12050EE0). The Hi3536DV100 data sheet names that field "chipid: Chip version" and gives its value as TBD.

Revision 2 parts exist, and HiSilicon's V2.0.2.0 SDK cannot drive them:

  • Its vdec.ko and venc.ko read the revision back from 0x12060024.
  • In VDEC_AllocFrame, VDEC_SendPic, VDEC_GetImage, VencGetStream, VencSendPic and the H.264 encode path, they fail silently when the value is above 1.
  • On such a board the decoder parses the stream (the SCD interrupt keeps firing) but never outputs a picture. vfmw loops on FSP_AllocFrame failed, and the VDH interrupt stays at 0.
  • A later vendor-built vdec (Hi3536D_MPP_V1.0.0.0 B010, 2021) has a separate branch for value 2.

So the revision says which SDK a board needs, before anyone has to debug the decoder.

The model name stays 3536DV100, because the chip ID is unchanged and I couldn't confirm a part number for revision 2.

Tested

  • Native build: cYAML_test and reginfo_test pass.
  • Cross builds: arm32 (OpenIPC musleabi toolchain) and arm64 (Bootlin musl) build clean.
  • Narrowed library: libipchw builds with -DONLY_LIBRARY=ON -DIPCHW_HISI=v4, where the new code is compiled out.
  • Hardware: on a lab Hi3536DV100 NVR (OpenIPC hi3536dv100_lite, kernel 4.9.37), the arm32 build printed the section above.
    • devmem 0x12050ee0 on that board reads 0x02000000.
    • devmem 0x12060024 reads 0x00000002.

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

Copy link
Copy Markdown

PR Summary by Qodo

hisi: Report Hi3536DV100 chip revision

✨ Enhancement 🕐 10-20 Minutes

Grey Divider

AI Description

• Report the Hi3536DV100 chip revision to help identify boards requiring a compatible SDK.
• Leave the existing model name unchanged; omit revision when the register cannot be read.
Diagram

graph TD
  A["Chip report"] --> B["HiSilicon properties"] --> C{"3536D chip?"}
  C -->|Yes| D["Read SCSYSID0"] -->|Success| E["Numeric revision"]
Loading
High-Level Assessment

Reading the documented version field in the existing chip-properties callback is appropriately scoped. Keeping the model unchanged avoids asserting an unconfirmed part number, and omitting revision on read failure preserves existing reports.

Files changed (1) +25 / -0

Enhancement (1) +25 / -0
ispreg.cAdd Hi3536DV100 revision to chip properties +25/-0

Add Hi3536DV100 revision to chip properties

• Reads SCSYSID0 bits 31:24 for the Hi3536D generation and adds the result as a numeric revision when the read succeeds. Compile-time guards exclude the code from builds without Hi3536D support.

src/hal/hisi/ispreg.c

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

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)

Grey Divider

Great, no issues found!

Qodo reviewed your code and found no material issues that require review

Grey Divider

Tip of the day
💡 Did you know, you can see how risky a PR is at a glance with blast radius labels

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

widgetii added a commit that referenced this pull request Oct 17, 2026
… size (#251)

The budget compared stat -c %s of ipcinfo before and after. That file is
page-quantised: the RW segment's file offset has to equal its address
modulo 4096, so it jumps a whole page whenever the code in front of it
crosses a boundary. On master the code segment ends exactly where the data
segment begins (0xae68 both), so the slack is zero bytes. A change adding
12 bytes of code (#249) and one adding 24 (#250) each "grew" ipcinfo by
4096 and failed the 1024-byte budget.

Measure text + data + bss from size(1) instead: what the camera loads,
growing by the bytes the change adds. With the CI toolchain those two PRs
measure +12 and +24.
SCSYSID0[31:24] is "chip version" in the data sheet, left as TBD. A lab
NVR reads 2 there, and the HiSilicon V2.0.2.0 SDK's vdec and venc refuse
every frame on such a part: they read the revision back from 0x12060024
and fail allocation, send and get above 1, so the decoder parses the
stream and never outputs a picture. Later vendor builds carry a path for
revision 2. Print it under chip as `revision`, so a report says which
SDK a board needs before anyone debugs the decoder.
@widgetii
widgetii force-pushed the hi3536dv100-revision branch from 6910441 to 4a894a6 Compare October 17, 2026 11:04
@widgetii
widgetii merged commit c755c9e into master Oct 17, 2026
5 checks passed
@widgetii
widgetii deleted the hi3536dv100-revision branch October 17, 2026 11:23
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