Skip to content

gm: the GM8128 that reads 0x812622 - #307

Merged
openipc-ai merged 1 commit into
masterfrom
gm8128-mp1
Dec 3, 2026
Merged

openipc-ai merged 1 commit into
masterfrom
gm8128-mp1

Conversation

@openipc-ai

Copy link
Copy Markdown
Contributor

Follow-up to #306, for #305.

ipctool from #306 reports GM812x on the reporter's real GM8128 (comment). That chip's pmuver is 8463906, which is 0x812622. #306's table came from a 2013 vendor kernel I disassembled, and that kernel only knows 0x812621. The public 2.6.28 vendor tree has both IDs:

  • platform-GM8126/pmu.h defines GM8128_MP_CHIP_ID 0x812621 and GM8128_MP1_CHIP_ID 0x812622, and its pmu.c prints IC: GM8128 MP for either (fedya/aircam-openwrt).
  • OpenIPC's u-boot-grainmedia include/configs/gm8126.h lists 0x81262100 and 0x81262200 as the two 1080p IDs.
  • The reporter's kernel prints IC: GM8128 MP with this ID.

This PR maps 0x812622 to GM8128 too.

Tested

In qemu-bench's gm8126 machine, with -global gm-sys8126.chip-id=0x81262200: the 2013 kernel prints IC: Uknown!!!!!! 812622, pmuver reads 8463906, and ipctool reports gm8128.

The reporter's GM8128 reads PMU ID 0x812622, not the 0x812621 the vendor
kernel in the dump used for testing knows. The vendor 2.6.28 tree's pmu.h
has both, GM8128_MP_CHIP_ID and GM8128_MP1_CHIP_ID, and its own kernel
prints "IC: GM8128 MP" for either.
@qodo-free-for-open-source-projects

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

Copy link
Copy Markdown

PR Summary by Qodo

gm: map PMU ID 0x812622 to GM8128

🐞 Bug fix 🕐 Less than 5 minutes

Grey Divider

AI Description

• Recognizes PMU ID 0x812622 as GM8128, so real GM8128 chips are no longer reported as GM812x.
• Updates the explanatory comment to list 0x812621 and 0x812622 as GM8128 MP IDs, citing the vendor
 pmu.h constants.
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 PMU mapping produces chip_name in the Faraday detector, which the shared detection flow returns to callers and uses for the tool's system identity and model reporting.
  • These are one end-to-end identification/reporting behavior rather than separate technical capabilities.
Sources

src/hal/gm.c[97-100]

    switch (gm_pmuver()) {
    case 0x812621:
    case 0x812622:
        strcpy(chip_name, "GM8128");
Behavioral complexity 🟢 Low 🧩 Straightforward

  • Before, the existing switch recognized two specific PMU IDs as GM8128 and treated 0x812622 as GM812x.
  • After, 0x812622 joins the existing GM8128 case.
  • The new correctness condition is a direct value-to-name mapping with no new state, ordering, compatibility, or coordinated invariant; the existing detector and reporting pipeline are reused unchanged.
Sources

src/hal/gm.c[97-100]

    switch (gm_pmuver()) {
    case 0x812621:
    case 0x812622:
        strcpy(chip_name, "GM8128");
Potential damage 🟢 Low 🩹 Cosmetic

  • If this identification behavior regresses, an affected camera could be labeled GM812x rather than GM8128 in detection output and derived reports.
  • No evidence shows the name selecting hardware operations or changing device state.
  • The displayed or generated identification can be corrected by rerunning the tool or regenerating metadata; previously emitted reports or backup metadata require regeneration rather than code revert alone.
Sources

src/hal/gm.c[97-100]

    switch (gm_pmuver()) {
    case 0x812621:
    case 0x812622:
        strcpy(chip_name, "GM8128");
Assessed commit bfc7e3c
Diagram

graph TD
  A["PMU ID 0x812622"] --> B["gm_pmuver()"] --> C["switch in gm_faraday_detect_cpu"] --> D["chip_name = GM8128"]
Loading
High-Level Assessment

Adding the ID as a second case label in the existing switch is the simplest correct fix. The vendor kernel prints the chip name only at boot, so it cannot be read from userspace. A runtime check of a boot-line string would be more fragile. Matching the vendor pmu.h constants keeps the table traceable to its source. Keeping the mapping in the switch is the right choice.

Files changed (1) +5 / -3

Bug fix (1) +5 / -3
gm.cAdd 0x812622 case mapping to GM8128 and update PMU ID comment +5/-3

Add 0x812622 case mapping to GM8128 and update PMU ID comment

• Adds a second case label, 0x812622, so gm_faraday_detect_cpu() reports GM8128 for that PMU ID alongside 0x812621. The block comment now lists both IDs as GM8128 MP and notes that they come from the vendor pmu.h constants.

src/hal/gm.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 move or hide resolved findings to focus on what still needs action

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

@openipc-ai
openipc-ai merged commit 041eaa4 into master Dec 3, 2026
5 checks passed
@openipc-ai
openipc-ai deleted the gm8128-mp1 branch December 3, 2026 09:26
This was referenced Dec 3, 2026
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