Skip to content

ingenic: take a T41LQ that reports the T40 SoC family as T41 - #300

Merged
openipc-ai merged 1 commit into
OpenIPC:masterfrom
echoechoechoechoechoechoechoecho:t41-under-t40-family
Nov 29, 2026
Merged

openipc-ai merged 1 commit into
OpenIPC:masterfrom
echoechoechoechoechoechoechoecho:t41-under-t40-family

Conversation

@echoechoechoechoechoechoechoecho

Copy link
Copy Markdown
Contributor

#299 A T41LQ on a VStarcam Q07 (stock SPL: "Board info: T41LQ") reads

0x1300002C = 0x10040003 SoC ID, family 0x40
0x13540250 = 0x99991111 subtype 0x9999

0x9999 is no T40 grade's code; it is the one the 0x41 branch gives the T41LQ. In the 0x40 branch it fell to "default: return -1": the chip came out "unknown", ipcinfo -f printed "t40", and OpenIPC's load_ingenic, which takes the SoC from there, ran "modprobe tx-isp-t40" -- no ISP, no video.

Handle it the way 0xAAAA (a T41NQ in the same position, OpenIPC/majestic#376) already is: chip_generation 0x41 and the T41LQ index. Now ipcinfo -c prints t41lq and -f t41 on that camera, and the ISP loads.

Only the measured code; the other T41-only subtypes may well show up under family 0x40 too, but nobody has read one there yet.

A T41LQ on a VStarcam Q07 (stock SPL: "Board info: T41LQ") reads

  0x1300002C = 0x10040003   SoC ID, family 0x40
  0x13540250 = 0x99991111   subtype 0x9999

0x9999 is no T40 grade's code; it is the one the 0x41 branch gives the
T41LQ. In the 0x40 branch it fell to "default: return -1": the chip came
out "unknown", ipcinfo -f printed "t40", and OpenIPC's load_ingenic, which
takes the SoC from there, ran "modprobe tx-isp-t40" -- no ISP, no video.

Handle it the way 0xAAAA (a T41NQ in the same position, OpenIPC/majestic#376)
already is: chip_generation 0x41 and the T41LQ index. Now ipcinfo -c
prints t41lq and -f t41 on that camera, and the ISP loads.

Only the measured code; the other T41-only subtypes may well show up under
family 0x40 too, but nobody has read one there yet.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@qodo-free-for-open-source-projects

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

Copy link
Copy Markdown

PR Summary by Qodo

Recognize T41LQ chips reporting a T40 family ID

🐞 Bug fix 🕐 Less than 10 minutes

Grey Divider

AI Description

• Recognize measured T41LQ hardware that reports a T40 family ID and subtype 0x9999.
• Report the T41LQ model and T41 family so OpenIPC selects the correct ISP driver.
Merge Risk 🟢 Low

Blast radius 🟢 Low 💥 0 capabilities

  • Fault-specific containment limits risk to the originating changed behavior.
Behavioral complexity 🟢 Low 🧩 Straightforward

  • Before, family 0x40 subtype 0x9999 fell through to unknown; after, one exact subtype maps to T41LQ and generation T41.
  • The new correctness condition is that this subtype uniquely identifies a T41LQ-compatible device.
  • Existing switch logic and downstream tables are reused without new state, ordering, transformation, or interacting branches.
Potential damage 🟡 Medium 🩹 Temporary loss

  • Conservative damage bound for the originating changed behavior; downstream capabilities remain contained.
  • If the new classification is wrong, chip-dependent camera setup can select incompatible T41 behavior and fail to provide the camera capability.
  • Reverting the code stops new misclassification; no persistent state or external compensation is evidenced.
  • A code revert restores the prior detection behavior.
  • Any device left with an incompatible runtime setup may require restarting or rerunning platform initialization; persistent repair is not indicated.
Assessed commit 135d562
Diagram

graph TD
    A["SoC registers"] --> B{"T40 family and 0x9999?"} -->|yes| C["T41LQ identity"] --> D["T41 family"] --> E["ISP selection"]
    D --> F["T41 pad table"]
Loading
High-Level Assessment

The narrow subtype mapping follows the existing T41NQ precedent and uses the established T41 model and generation paths. Broadening the mapping to unmeasured T41 subtypes would add unsupported hardware assumptions.

Files changed (1) +9 / -0

Bug fix (1) +9 / -0
ingenic.cIdentify T41LQ under a T40 family ID +9/-0

Identify T41LQ under a T40 family ID

• Adds subtype 0x9999 to the T40-family detection branch, returning the existing T41LQ model index and setting the generation to T41. This corrects the reported model and family for the measured VStarcam Q07 hardware.

src/hal/ingenic.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 switch off images and animations for a plain-text comment

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

@openipc-ai openipc-ai left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks right. Checked:

  • Index 31 is "T41LQ" in ingenic_cpu_name(), and 0x9999 is the code the 0x41 branch already gives the T41LQ.
  • chip_generation = 0x41 is what chipid.c maps to the t41 family, so ipcinfo -f gives t41 and load_ingenic picks tx-isp-t41; it also puts T41's pad table in front of the padmux lookups instead of T40's.
  • No T40 grade uses 0x9999 (they are 0x1111, 0x8888, 0x7777, 0x4444), so nothing that used to be detected changes.
  • Same shape and comment style as the 0xAAAA / T41NQ case (OpenIPC/majestic#376). The "The same for a T41LQ" comment leans on that case staying directly above it, which is fine.

Agree with adding only the measured code. For the record: of the other T41-only subtypes, 0x3333 (T41L), 0x5555 (T41ZL) and 0x6666 (T41ZX) would not collide with a T40 code if they ever turn up under family 0x40; 0x8888, 0x1111 and 0x7777 would, so those could not be told apart by subtype there anyway.

@openipc-ai
openipc-ai merged commit bae99d9 into OpenIPC:master Nov 29, 2026
5 checks passed
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.

2 participants