Skip to content

hisi: name the GK7206 family from the eFuse model code (V11A confirmed, rest guessed) - #289

Merged
dimerr merged 3 commits into
masterfrom
gk7206-v11a-efuse
Nov 18, 2026
Merged

dimerr merged 3 commits into
masterfrom
gk7206-v11a-efuse

Conversation

@dimerr

@dimerr dimerr commented Nov 18, 2026 •

Copy link
Copy Markdown
Collaborator

GK7206V11 and V11A both report chip ID 0x72060110, so a V11A was shown as 7206V11. The variant is in the low byte of eFuse word 0x10090030 (high half 0x474B, "GK").

What the vendor modules show. xm_common accepts 0x474B00B7..BD, C7..CD, D7..DD. xm_vi and xm_venc sort the codes into capability classes (their limits are stored obfuscated as (x ^ 0xA64BD) - 11):

codes max frame line
B7 BC C7 CC 3840×2160 3840
CA D8–DB DD 3840×2160 4032
all other valid codes 3840×3840 4032

Nothing in the SDK (modules, libraries, U-Boot, kernel, docs) or in XM's stock firmware names the codes.

The table — only 0xCA is confirmed, the rest is guessed (and says so in the source): the high nibble taken as the DDR tier the SDK's load script gives each part (B = 64 MB: V10, V10B; C = 128 MB: V11, V11A, V11AT; D = 256 MB: V12A), the low nibble as the part within the tier (7 base, C the tier's other part, A the A part).

code model
0xB7 7206V10 (guessed)
0xBC 7206V10B (guessed)
0xC7 7206V11 (guessed)
0xCA 7206V11A (confirmed: IVG-K8, XM IPC_GK7206V11A)
0xCC 7206V11AT (guessed)
0xD8–0xDB, 0xDD 7206V12A (guessed)

The 3840×3840 class matches no SDK part and keeps the chip-ID name, as does any read without the "GK" marker. Applied to all three GK7206 chip IDs. The eFuse reads 0x2 while its clock (CRG 0x120101BC bit 1) is off; it is turned on for the read and back off if it was off.

Tested on the camera: model: 7206V11A, CRG 0x1BC 0x284 before and after. hal_hisi_test covers the confirmed code, each guessed tier, the fallback class, a gated read, and a clock already on.

Both report chip ID 0x72060110, so a GK7206V11A was shown as 7206V11.
What differs is the model code in the low byte of eFuse word 0x10090030,
whose high half is "GK" (0x474B): the vendor modules check it (xm_common
accepts only 0x474B00B7..0x474B00DD; xm_vi and xm_venc single out 0xCA
among other codes). Nothing in the SDK or in XM's firmware names the
codes -- XM's own image hard-codes its product name -- so only the code
read on a known part is listed: 0xCA on an IVG-K8 (XM IPC_GK7206V11A).
Any other code stays 7206V11 until one is confirmed.

The eFuse reads 0x2 while its clock (CRG 0x1BC bit 1) is off; it is
turned on for the read and back off if it was off.

On the camera: model 7206V11A, CRG 0x1BC 0x284 before and after.

Co-authored-by: OpenIPC AI team <ai@openipc.org>
@qodo-free-for-open-source-projects

qodo-free-for-open-source-projects Bot commented Nov 18, 2026 •

Copy link
Copy Markdown

PR Summary by Qodo

Identify GK7206V11A using its eFuse model code

🐞 Bug fix 🧪 Tests 🕐 10-20 Minutes

Grey Divider

AI Description

• Distinguishes GK7206V11A from V11 despite their shared chip ID, using a confirmed eFuse code.
• Temporarily enables the eFuse clock when needed, preserving its original state.
• Tests known and unknown codes, gated reads, and an already-enabled clock.
Merge Risk 🟡 Medium

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 lookup is invoked by hisi_detect_cpu for family ID 0x72060110 and its returned string becomes the global chip name used by getchipname/getchipfamily and reporting.
  • The eFuse access is an implementation step of this same identification behavior, not an independent capability.
Sources

src/hal/hisi/hal_hisi.c[1214-1217]

        return "7206V10";
    case 0x72060110:
        chip_generation = GOKE_7206;
        return gk7206_v11_variant();
Behavioral complexity 🔴 High 🧩 Coordinated invariants, State transitions

  • Before: family ID 0x72060110 unconditionally returned "7206V11" with no additional register state transition.
  • After: the path conditionally enables the OTP clock, reads the eFuse model, restores the original clock state only when this function enabled it, and maps one model-code subset to V11A while retaining a fallback.
  • New correctness condition: the temporary clock-enable/read/restore sequence must preserve pre-existing clock state and must not gate a clock that was already running, while all read/write failure branches must still return a safe identity.
  • These are newly interacting resource states and cleanup invariants; the string mapping itself is otherwise a straightforward rule.
Sources

src/hal/hisi/hal_hisi.c[1214-1217]

        return "7206V10";
    case 0x72060110:
        chip_generation = GOKE_7206;
        return gk7206_v11_variant();
Potential damage 🟡 Medium 🩹 Incorrect results

  • The direct consequence of a classification fault is an incorrect chip model string.
  • Within the repository, Goke 7206 generation selection remains GOKE_7206, so the demonstrated effect is identity/reporting misclassification rather than proven loss of a camera or sensor capability.
  • Reverting the code prevents future misclassification but does not correct an already emitted or externally stored identity; any external consumer that adopted "7206V11A" would need to be rerun or corrected.
  • Business importance uses the equal-importance baseline because no criticality declaration was supplied.
  • Recoverable by rerunning detection after correcting the code or hardware access.
  • No repository-supported automatic repair or external compensation path was found.
  • If a downstream system persisted or acted on the model string, repair depends on that consumer and is not established here.
Sources

src/hal/hisi/hal_hisi.c[1214-1217]

        return "7206V10";
    case 0x72060110:
        chip_generation = GOKE_7206;
        return gk7206_v11_variant();
Assessed commit d835207 > Snapshot assessment: the current PR revision could not be verified.
Diagram

graph TD
  A["GK7206 chip ID"] --> B{"Clock enabled?"}
  B -->|No| C["Enable clock"] --> D["Read eFuse"] --> E["Restore clock"] --> F{"Known model code?"} --> G["V11 or V11A"]
  B -->|Yes| D
  D -->|Originally enabled| F
Loading
High-Level Assessment

The targeted eFuse lookup is appropriate: the chip ID cannot distinguish these parts, and the available vendor evidence supports naming only the confirmed code. Preserving the clock state and retaining V11 as the fallback limits the change's hardware risk.

Files changed (2) +60 / -1

Bug fix (1) +38 / -1
hal_hisi.cDetect GK7206V11A from its confirmed eFuse code +38/-1

Detect GK7206V11A from its confirmed eFuse code

• For chip ID 0x72060110, reads the eFuse model word and returns 7206V11A only for the confirmed GK-prefixed 0xCA code. Enables the eFuse clock for the read if necessary, restores its prior state, and otherwise falls back to 7206V11.

src/hal/hisi/hal_hisi.c

Tests (1) +22 / -0
hal_hisi_test.cCover GK7206 variant detection and clock preservation +22/-0

Cover GK7206 variant detection and clock preservation

• Adds fake-register cases for the confirmed V11A code with the clock initially off or on. Checks restoration, absence of writes when already enabled, and V11 fallback for an unknown code or invalid eFuse word.

src/hal/hisi/hal_hisi_test.c

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

qodo-free-for-open-source-projects Bot commented Nov 18, 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


Remediation recommended

1. Concurrent clock changes get overwritten ✓ Resolved
Description
gk7206_v11_variant() writes the CRG value saved before the eFuse read back to the register without
checking its current value. If another component changes that register during the read, cleanup
overwrites its change, including an enablement of the OTP clock.

Grey Divider

Tip of the day
💡 Did you know, you can type 'qodo, fix this' on a finding and the fix lands right on your PR

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

Extends the V11A check to every GK7206 chip ID, with a table that is
guessed except for 0xCA.

xm_vi and xm_venc sort the valid codes into capability classes (their
limits are stored as (x ^ 0xA64BD) - 11): {B7, BC, C7, CC} 3840x2160 with
a 3840 line, {CA, D8..DB, DD} 3840x2160 with a 4032 line, everything else
3840x3840. Nothing names them. Taking the high nibble as the DDR tier the
SDK's load script gives each part (B 64 MB: V10, V10B; C 128 MB: V11,
V11A, V11AT; D 256 MB: V12A) and the low nibble as the part in the tier
(7 base, C the other, A the A part) fits both classes and the one known
code:

  B7 V10, BC V10B, C7 V11, CA V11A (confirmed), CC V11AT, D8..DB/DD V12A

The 3840x3840 class matches no SDK part and keeps the chip-ID name. The
source comment and each case say which are guessed.

Co-authored-by: OpenIPC AI team <ai@openipc.org>
@dimerr dimerr changed the title hisi: tell GK7206V11A from V11 by the eFuse model code hisi: name the GK7206 family from the eFuse model code (V11A confirmed, rest guessed) Nov 18, 2026
… word

Re-read CRG 0x1BC before turning the eFuse clock back off, and leave it
if it no longer holds the word written for the read: whoever changed it
in between owns it now, as sensor_crg_restore() does. (Qodo)

Co-authored-by: OpenIPC AI team <ai@openipc.org>
@dimerr

dimerr commented Nov 18, 2026

Copy link
Copy Markdown
Collaborator Author

Qodo's "Concurrent clock changes get overwritten": fixed in f3bce33. The probe re-reads CRG 0x1BC and turns the eFuse clock back off only if the register still holds the word it wrote, the same rule as sensor_crg_restore(). Not covered by hal_hisi_test: its register model has no way to change a register in the middle of a call, and adding one for this seemed out of proportion. Re-tested on the camera: 7206V11A, 0x1BC 0x284 before and after.

@dimerr
dimerr merged commit e2ebc24 into master Nov 18, 2026
5 checks passed
@dimerr
dimerr deleted the gk7206-v11a-efuse branch November 18, 2026 09:08
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