hi3516ev200/sc2235: repeat DVP pad setup after stream start - #233
Conversation
Without this the Imou Cue 2 (IPC-C22EN, Hi3516EV200 + SC2235 on the DVP pads) gets no pixel clock and VI never counts a frame interrupt. The sequence is taken from the vendor (Dahua) firmware's init table, which writes 0x3d08/0x3640/0x3641 after the first 0x0100=0x01 and then starts streaming again. Only these writes are added; the rest of the table is unchanged for existing boards.
PR Summary by QodoRestore SC2235 DVP pixel clock on Imou Cue 2
AI Description
Diagram
High-Level Assessment
Files changed (1)
|
Code Review by Qodo🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)
Great, no issues found!Qodo reviewed your code and found no material issues that require reviewTip of the day💡 Did you know, you can turn on the rule miner and Qodo learns your standards from review history |
|
Thanks for tracking this down. The change itself looks fine, but one part of the description doesn't hold. This doesn't reach gk7205v200 boards. The description says
So a GK7205V200 board with an SC2235 on the DVP pads and the same missing pixel clock will still get no VI interrupts after this merges. The fix actually reaches hi3516ev200 boards only, and the two copies, which are byte-identical on Suggestion: unify the driver rather than patching both copies.
If you'd rather keep this PR small, applying the same change to Minor, not blocking:
|
…ile (#2446) An SC2235 wired to the DVP pads is not detected on this family: open_sys_config routes the pads from g_cmos_yuv_flag, and with the MIPI default the I2C controller is muxed to pads the sensor is not on, so every address NACKs and nothing is ever found. YUV_TYPE0 keeps its 0 default and only flips when a device profile sets sensor_dvp, so no existing board changes behaviour. The sensor config lands under files/sensor/config/, which the existing *.ini install rule already globs and which is selected at runtime by sensor name; the IQ profile is the first one this family has had for the SC2235 and gets the install line it needs. libsns_sc2235 is already in the hi3516ev200 sensor list, so there is a driver behind both files. This is inert until OpenIPC/openhisilicon#233 lands -- without it the sensor drives no pixel clock -- but nothing here touches an existing board, so it costs nothing to have the family support in place first. Originally submitted with a device profile, a shared-overlay rc.local, LED scripts, a customizer, an excludes list and a downstream patch against openhisilicon. Those went to OpenIPC/builder#160 and OpenIPC/openhisilicon#233 respectively, the latter reduced to the register delta rather than a replacement of the whole init table.
|
Retracting my main finding — it was wrong, and I am sorry for the noise. I claimed gk7205v200 has its own copy of this driver at Same inode. There is one file, and Please do not act on that suggestion. Adding a second copy of the file, or replacing the symlink with a directory, would create exactly the divergence I was worried about. Nothing here needs changing on that account. How I got it wrong is worth recording: I checked with Also withdrawing the What still stands, and it is the only thing: |
|
Withdrawing the last note too — the risk it describes has no target. I asked for a check on a second hi3516ev200 SC2235 board, on the grounds that
There is also no hi3516ev200 board in our lab to test on, so a second-board check was never going to come from this side regardless. So: nothing outstanding from me. Approving and merging. Sorry again for the detour on the gk7205v200 point — the symlink was there to be seen and I did not look properly. |
openipc-ai
left a comment
There was a problem hiding this comment.
Approving. The delta is the right shape — the stock sequence is left alone and the DVP pad setup is repeated after the sensor is streaming, which is what the camera needs and what its vendor firmware does. 35 checks green.
Both of my earlier findings are withdrawn above: libraries/sensor/gk7205v200 is a symlink to hi3516ev200, so this already reaches that family and the description was accurate; and no OpenIPC configuration selects SC2235 today, so the stronger pad drive cannot regress an existing board.
What
Four register writes added at the end of
sc2235_linear_1080p30_init()(hi3516ev200): after the existing stream start, repeat the DVP pad setup (0x3d08=0x01,0x3640=0x01,0x3641=0x02) and start streaming again (0x0100=0x01).Nothing else in the init table changes.
Why
On the Imou Cue 2 (IPC-C22EN: Hi3516EV200 + SC2235 on the DVP pads) the current sequence alone gives the SoC no pixel clock: the sensor answers on I2C and initialises, but
/proc/umap/vinever counts a frame interrupt.Where the sequence comes from
The camera's stock firmware (Dahua LiteOS). Its SC2235 init table (114
{u16 reg, u16 val}entries in the firmware blob) writes these three pad registers after the first0x0100=0x01and then writes0x0100=0x01a second time. There is no datasheet reasoning behind the exact values; they are the vendor's.This PR is only that delta, as asked in OpenIPC/firmware#2446. The first version of that PR replaced the whole table with the vendor one; that is dropped.
Testing
libsns_sc2235for hi3516ev200 is also used by gk7205v200 (HISILICON_OPENSDK_SENSORS_gk7205v200), so those boards get the extra writes too.Related: OpenIPC/firmware#2446, OpenIPC/builder#160.