Repository navigation
novatek: NA51055 and NA51084 tables, the primary LCD, and 0x5021's name - #240
Conversation
The three things #239 left open. NA51055 (NT9852x) and NA51084 (NT98528/NT98529). The NA51089 SDK carries the na51055 driver too: same TOP layout without the DSI group, more S, L and D pads, and one driver for both dies that branches on nvt_get_chip_id(). The generator now runs a driver per family and each family once per die, with the chip-ID call answered by a constant, and writes one table per die. NA51084 alone has I2C4/5, SPI4/5 and RGMII. Their top.h annotations disagree with their code in ten places -- MISC copied from NA51089, PWM8..11's HSI location commented out ("52x compatible") -- so the errata are now per driver; NA51089's PICNT2 erratum is exactly wrong on NA51055. The LCD. pinmux_select_primary_lcd() is run as every LCD type with every set of feature flags, its local copies of REG2 and the L and DSI gates turned into the globals every other function writes. That needed one rule more: a field an enclosing block wrote and a nested block overwrote before the gate write takes the nested value (LCD_TYPE is reset at the top and set in a switch). And options are read only from `& PIN_...` tests and case labels, so a range test cannot name a pad. TV and HDMI have no pads on these dies: pinmux_set_host() answers E_ID for them. Two resolver fixes the new tables exposed. Of two claims with alike conditions the gated one now wins, and set() of an ungated claim writes the gate to GPIO as the vendor does: CCIR8 data and CCIR8 sync both hold under SENSOR2=2. The replay now reports a refinement that changes nothing instead of passing over it silently. 0x5021 was named NT98562. It is NA51084: u-boot's NA51084 clock code drives the _528_ registers and allows 1200 MHz only on an NT98529. It now reports NT98528. NT98562 and NT98566 share 0x7021 and are told apart only by an eFuse word the SDK decodes in a binary. Not done, and why: NA51090 and NA51103 have no pinmux driver in this SDK or anywhere public that was found (NA51090's registers are also above 4 GB); NA51068 is a per-pad selector part with no chip ID here. reginfo_test sweeps all three dies and sets every function from every claim's state (3201, 2118 and 2342 sets, none refused). ipcinfo is byte-identical on arm32; ipctool grows 20 KB (6.5 KB after UPX).
PR Summary by QodoAdd NA51055/NA51084 padmux tables and primary LCD support
AI Description
Diagram
High-Level Assessment
Files changed (15)
|
Code Review by Qodo
1.
|
From review of #240. The LCD flags (TE, DE, HVLD/VVLD, FIELD, NO_HVSYNC) are spelt `0x01 << 23` in top.h, which the enum parser read as no value, so they were taken for LCD types: the harness never ran a type with DE, every colour claim required DE off, and LCD_DE_ENABLE required LCD_TYPE = GPIO. A real panel with DE read as unclaimed and set(LCD_DE_ENABLE) would have turned it off. Enumerator values are now evaluated for shifts and ors, and an LCD enum with no readable flags is fatal. That exposed a second bug: a state no source names inherited the name of any annotated state whose conditions are a subset of its own, across groups. NA51055's RMII claims L_GPIO0..10 with no condition at all, so every LCD claim there was named TXD0, CRS_DV and so on. Inheritance is now within one group. Also: - bonded_pads() skips a missing count macro only for the DSI group; any other missing one is a renamed macro and is fatal again. - NA51055 is named by its die when the device tree has no model, so a board without one is still detected. - novatek_open_i2c_fd() tests NA51103 by chip ID: the ID path names it NT98332G, so the "NA51103" name test never matched and its sensor bus was never 1. - nvt_get_chip_id() names through one strcpy; ipcinfo stays byte-identical. reginfo_test: a DE panel reads as the LCD on both the colour and the DE pin, and setting DE keeps the panel type. Every-state sets: 4363, 4038 and 4347, none refused. The selftest covers shifted enum values and cross-group inheritance, and fails with either fix reverted.
|
Review findings, all three fixed in eadf8c4:
Every-state sets are now 4363 (NA51089), 4038 (NA51055) and 4347 (NA51084), with none refused. NA51089's non-LCD claims are unchanged. |
Follow-up to #239: the three items it left open.
NA51055 and NA51084
NA51055 is the NT9852x die; NA51084 is NT98528/NT98529. The NA51089 SDK already carries their pinmux driver,
na51055. It is one driver for both dies and branches onnvt_get_chip_id(). Compared with NA51089 the TOP layout is the same, the DSI pad group is gone, and there are more S, L and D pads.The generator now runs each driver once per die, answering the chip-ID call with a constant, and writes a separate table for each die. Differences between the two dies:
On NA51055, top.h disagrees with the driver in ten places, and the errata are now per driver because of it:
P_GPIO14here, which is exactly where the NA51089 erratum says it is not.The primary LCD
pinmux_select_primary_lcd()is now run for every LCD type with every set of feature flags. Its local copies of REG2 and of the L and DSI gates are turned into the globals that every other function writes, so the same logging covers it.Two generator rules were added for it:
LCD_TYPEis reset at the top of the function and set inside aswitch.& PIN_...tests andcaselabels. A range test can no longer give its name to a pad.TV and HDMI have no pads on these dies:
pinmux_set_host()answersE_IDfor both.Resolver fixes the new tables exposed
set()of an ungated claim now writes the pad's gate to GPIO, as the vendor does.Both behaviour fixes come from one case on NA51055's
P_GPIO9..11: CCIR8 data and CCIR8 sync both hold there underSENSOR2=2.0x5021's name0x5021used to be reported as "NT98562". It is NA51084, and it now reports as NT98528. The evidence is u-boot's NA51084 clock code: it drives the_528_clock registers, and it allows 1200 MHz only on an NT98529, which is identified through OTP.NT98562 and NT98566 share
0x7021. They differ only in an eFuse word that the SDK decodes in a binary, so both still report as NT98566.Not done, and why
mem_reg()can reach.All four are documented in
docs/padmux.md.Verification
reginfo_test. It sweeps all three dies. For each die it also sets every function, starting from every claim's own state, and checks the result:It also has new checks for the LCD (including a DE panel), for the differences between the two dies, and for NA51055's GPIO pad counts.
Generator.
gen_novatek_padmux.py --verifyreproduces the header. NA51089's 388 existing claims are unchanged; every new one is an LCD claim.Selftest. It now covers the overwrite rule, the tie rule, shifted enum values and per-group naming. Reverting any of them makes it fail.
Other checks.
tools/test_pipeline.shpasses, and so doesgen_padmux_names.py --check. Builds pass in the configurationsIPCHW_PADMUX=none,IPCHW_VENDORS=ingenicandIPCHW_PADMUX=novatek;IPCHW_VENDORS=novatek. Cross builds pass on arm32, mips32 and arm64.Size, with CI's own arm32 toolchain.
ipcinfois byte-identical to master with bothallandnone.ipctoolgrows 28.7 KB, or 7.8 KB after UPX.Hardware. Not verified on any Novatek board.