Repository navigation
ambarella: what a second S3L showed, on a Hikvision DS-2CD2423G0-I - #270
Conversation
Run on a lab DS-2CD2423G0-I (S3Lm, 256 MiB, NAND, AR0237) with its stock firmware. Detection worked, but the sensor was missing and media RAM was wrong. The sensor sits at 8-bit 0x30, not the SDK default 0x20, and its 0x3000 reads 0x0950, not the ID ipctool knew. The vendor driver reads that register without checking it, so the ID rests on the firmware driving this sensor with its ar0237 module, not on a datasheet. Media read 192M where the camera has 144M. Hikvision's kernel moves the split at boot and leaves /iavmem stale: it says 0x04000000 while Linux runs to 0x07000000. The end of the carve-out still holds, so total stays right, and media is now what lies above Linux's RAM in /proc/iomem. /proc/ambarella/iav names the part once iav.ko is loaded, so the report adds family: S3Lm. The model stays S3L, which ipcinfo and the firmware's hostname use.
PR Summary by QodoCorrect Ambarella S3L media RAM and detect Hikvision AR0237
AI Description
Diagram
High-Level Assessment
Files changed (6)
|
Code Review by Qodo
1.
|
…sured Review of #270. Only the first System RAM line was read, so a split layout overstated media. With /proc/iomem unusable it fell back to a size this PR had just shown to be stale, so it now leaves media out. And Linux ending exactly at the carve-out only came right through that fallback, so the arithmetic no longer depends on the start at all.
sscanf %llx skips leading space, so an indented line matching the format counted. ambarella_test caught it.
Refs #266. Tested on a lab Hikvision DS-2CD2423G0-I (S3Lm, 256 MiB, NAND, AR0237) with its stock firmware. It's a second, independent S3L: the #266 camera is a Dahua design with NOR and an OV4689.
masterAmbarella/S3Lfamily: S3Lmtotal: 256M,media: 192Mtotal: 256M,media: 144MAR0237, bus 0,0x300x30, not the SDK default0x20. The module'sbus_addrparameter reads 24, which is0x18.0x3000reads0x0950, the same with write-then-read andI2C_RDWR.0x3004and0x31FErespond too. ipctool reads 16-bit values little-endian here, so the table has0x5009. This is not datasheet-verified: the vendor driver reads the register without checking it, so the name rests on the firmware driving this sensor with itsar0237module./iavmemstale. The tree says0x04000000, 0x0c000000, while/proc/iomemhas Linux up to0x06ffffffand the boot log saysIAVMEM = 0x07000000, 0x09000000. The end agrees, so total was right. Media is now what lies above Linux's RAM. On SoC not recognised: Ambarella S3L (Amcrest IP4M-1026E / Dahua IPC-HFW1430SN) #266's numbers this still gives 392M./proc/ambarella/iavhasAMBARELLA_CHIP=S3Lmonceiav.kois loaded. The model staysS3L, becauseipcinfo -cand the firmware's hostname use it.Tested: all of the above on the camera itself, built with the published
toolchain.ambarella-s3l, plus the unit tests, withambarella_testcovering both boards' memory layouts.sensors_golden.txtgained the new ID.Not tested: the #266 camera with this PR. It has the same
iavfile per itsls, and its RAM figures are covered by the unit test only.