Skip to content

ingenic: a T41NQ that reports the T40 family's SoC ID - #285

Merged
openipc-ai merged 2 commits into
masterfrom
t41nq-t40-id
Nov 16, 2026
Merged

openipc-ai merged 2 commits into
masterfrom
t41nq-t40-id

Conversation

@openipc-ai

Copy link
Copy Markdown
Contributor

An owner's T41NQ (OpenIPC/majestic#376) reads 0x10040003 at 0x1300002c, the T40 family's ID, with grade code 0xAAAA in the upper half of 0x13540250. get_cpu_id() therefore takes its T40 branch, which has no 0xAAAA, and the camera comes out as unknown.

0xAAAA under the T40 ID now maps to T41NQ, with the family set to t41. The four T40 grades (0x1111, 0x8888, 0x7777, 0x4444) are unchanged, and no T40 grade uses 0xAAAA. This is the mapping the owner had patched in locally, and it reported t41nq / t41 on their device.

Tested on the qemu-bench T41NQ twin, which now reports that measured SoC ID:

ipcinfo -c / -f   before: unknown / t40   after: t41nq / t41

An owner's T41NQ reads 0x10040003 at 0x1300002c, the T40 family's ID,
with grade code 0xAAAA at 0x13540250. The T40 branch had no name for
0xAAAA and the chip came out as unknown; it is a T41NQ (34), and the
family is T41. The four T40 grades are unchanged.

OpenIPC/majestic#376
@qodo-free-for-open-source-projects

Copy link
Copy Markdown

PR Summary by Qodo

Recognize T41NQ devices that report a T40 SoC ID

🐞 Bug fix 🕐 Less than 10 minutes

Grey Divider

AI Description

• Map grade 0xAAAA under the T40 SoC ID to T41NQ and the t41 family.
• Preserve all four existing T40 grade mappings.
• Confirm ipcinfo reports t41nq / t41 on the T41NQ test twin.
Diagram

graph TD
  ID["SoC ID"] --> FAMILY{"ID family?"} -->|T40| GRADE{"Grade code?"} -->|0xAAAA| T41NQ["T41NQ / t41"]
  GRADE -->|Existing grades| T40["T40 models"]
  FAMILY -->|T41| T41["T41 mapping"] -->|0xAAAA| T41NQ
Loading
High-Level Assessment

The targeted T40-branch mapping is appropriate: it recognizes the measured hardware ID and reuses the existing T41NQ chip code without changing other T40 grades. Consolidating T40 and T41 detection would add scope without a demonstrated need.

Files changed (1) +6 / -0

Bug fix (1) +6 / -0
ingenic.cIdentify T41NQ from a T40 ID and grade 0xAAAA +6/-0

Identify T41NQ from a T40 ID and grade 0xAAAA

• Adds a grade '0xAAAA' case to the T40 SoC-ID branch, returning the existing T41NQ chip code and setting the family to T41. The four existing T40 grade cases are unchanged.

src/hal/ingenic.c

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

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


Informational

1. T41NQ loses its T40 pad table, so pad lookups stop ✓ Resolved
Description
Setting chip_generation = 0x41 for the 0xAAAA case moves this SoC out of the T40 branch, so
ingenic_soc() in ingenic_padmux.c returns NULL for it because only T21, T23, T31 and T40 have
pad tables. Before this PR the same camera kept chip_generation = 0x40 and was given the T40 pad
table, so any pad lookups that used to resolve on this device now fall through to the generic path.

Grey Divider

Tip of the day
💡 Did you know, you can choose which labels appear on a finding, and whether they show icons or text

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

Review on #285: routing it to T41 takes away the T40 pad table it was
given while it came out unknown. That table describes a T40's pins; with
none, pad lookups refuse instead of muxing a T41 pin by a T40 function
name.
@openipc-ai

Copy link
Copy Markdown
Contributor Author

On the Qodo finding T41NQ loses its T40 pad table: this is right about the mechanism, but the T40 table was never this chip's to keep.

Before this PR, get_cpu_id() set chip_generation = 0x40, found no 0xAAAA, and returned -1. The camera came out unknown, but ingenic_soc() still handed pad lookups the T40 table. That table describes a T40's pins and their functions. Setting a pad by function name on this T41 would have muxed it from T40's function list.

As a T41 it now has no table, so ingenic_get() / ingenic_set() / the walk answer IPCHW_PADMUX_NO_TABLE and nothing gets written. That refusal is the safe outcome. The proper fix is a T41 pad table, which is separate work. ffe4816 puts this in a comment at the mapping, as the review suggested.

@openipc-ai
openipc-ai merged commit 8f8cfe4 into master Nov 16, 2026
5 checks passed
@openipc-ai
openipc-ai deleted the t41nq-t40-id branch November 16, 2026 18:27
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