Skip to content

novatek: detect NA51023 (NT9851x) on mips -- chip ID 0x6E19 at 0xC00100F0 - #263

Merged
widgetii merged 1 commit into
masterfrom
novatek-na51023-mips
Nov 3, 2026
Merged

widgetii merged 1 commit into
masterfrom
novatek-na51023-mips

Conversation

@widgetii

@widgetii widgetii commented Nov 3, 2026

Copy link
Copy Markdown
Member

The Novatek row in manufacturers[] was compiled for ARM only, so an
NT98513 (NA51023, MIPS 24KEc, Linux 4.1) fell through as unrecognised
although /proc/cpuinfo's machine line names Novatek.

NA51023 carries NA51089's TOP block at 0xC0000000 instead of 0xF0000000.
The NA51023 BSP's uITRON firmware reads TOP+0xF0 and its drv_init()
aborts unless bits [31:16] are 0x6E19; the 4.1 kernel has no
/proc/nvt_info/nvt_pinmux, so read the register on mips and take only
that value. Without /dev/mem the device-tree model still names the die.

The ID covers NT96672 and the NT9851x parts alike, so the report says
NA51023 rather than guessing a part.

Refs #262

Verified locally: native build + cYAML/reginfo/longse/anyka tests, tools/test_pipeline.sh, clean arm32/mips32/arm64 cross builds. Not yet run on NA51023 hardware: the reporter in #262 has the only camera.

…00F0

The Novatek row in manufacturers[] was compiled for ARM only, so an
NT98513 (NA51023, MIPS 24KEc, Linux 4.1) fell through as unrecognised
although /proc/cpuinfo's machine line names Novatek.

NA51023 carries NA51089's TOP block at 0xC0000000 instead of 0xF0000000.
The NA51023 BSP's uITRON firmware reads TOP+0xF0 and its drv_init()
aborts unless bits [31:16] are 0x6E19; the 4.1 kernel has no
/proc/nvt_info/nvt_pinmux, so read the register on mips and take only
that value. Without /dev/mem the device-tree model still names the die.

The ID covers NT96672 and the NT9851x parts alike, so the report says
NA51023 rather than guessing a part.

Refs #262
@qodo-free-for-open-source-projects

Copy link
Copy Markdown

PR Summary by Qodo

Detect Novatek NA51023 on MIPS

🐞 Bug fix ✨ Enhancement 🕐 10-20 Minutes

Grey Divider

AI Description

• Recognize Novatek in MIPS CPU information so NA51023 devices reach the Novatek detector.
• Identify NA51023 from its TOP chip ID when the kernel lacks the Novatek proc entry.
• Preserve device-tree detection when the register cannot be read; report the die, not an uncertain
 part.
Diagram

graph TD
  C["CPU info"] --> N["Novatek detector"] --> P{"Proc chip ID?"}
  P -->|available| R["Chip name"] --> H["Novatek HAL"]
  P -->|missing on MIPS| M{"TOP ID 6E19?"}
  M -->|yes| R
  M -->|no or unreadable| D["Device tree model"] --> R
  P -->|missing elsewhere| D
Loading
High-Level Assessment

The layered approach is appropriate: keep the existing proc source first, restrict the hardware probe to MIPS and the documented ID, then retain device-tree fallback. Device-tree-only detection would miss cases where the chip ID is available, while relying on the register alone would require /dev/mem.

Files changed (3) +32 / -6

Enhancement (2) +26 / -5
novatek.cRecognize the NA51023 chip ID with a MIPS fallback +25/-5

Recognize the NA51023 chip ID with a MIPS fallback

• Keeps the proc chip-ID source, but when it is absent on MIPS, reads the TOP version register and accepts only ID 0x6E19. Names that ID NA51023; failed or unavailable reads continue to the existing device-tree model fallback.

src/hal/novatek.c

novatek.hDefine the NA51023 die ID +1/-0

Define the NA51023 die ID

• Adds the 0x6E19 chip-ID constant and documents its association with NT96672 and NT9851x parts.

src/hal/novatek.h

Bug fix (1) +6 / -1
chipid.cRoute MIPS Novatek systems to the Novatek detector +6/-1

Route MIPS Novatek systems to the Novatek detector

• Adds a Novatek manufacturer entry under the MIPS architecture guard so the CPU-info machine name can select Novatek detection and HAL setup. Also reformats the existing Rockchip entry without changing its behavior.

src/chipid.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 tweak Display settings with a live preview to see your comment before it ships

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

@widgetii
widgetii merged commit c3c5efb into master Nov 3, 2026
5 checks passed
@widgetii
widgetii deleted the novatek-na51023-mips branch November 3, 2026 08:53
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