Repository navigation
sensors: one catalogue for every machine, and the infinity3 boards' own sensors - #224
Conversation
…wn sensors A sensor is the same part on any SoC, but each family kept its own table of names, addresses and IDs, so a part existed only where someone had typed it in. hw/i2c/image-sensor.c is now the one catalogue: a machine calls image_sensor_create(bus, name) and takes any part in it. It replaces the tables in hisilicon, sigmastar, ingenic, fullhan, goke, grainmedia and novatek; xiongmai takes its names beside QOM types, and allwinner uses it for its GC2053. The sensor models build for every target. hisi-gc2053 goes: galaxycore-sensor is the same part. The image-sensor interface gives an ISP a sensor's exposure whatever its family, so the infinity3 ISP no longer draws only from SOI parts. hisi-f37 and its family, hisi-smartsens, hisi-imx307 and imx323 have it. The Ingenic ISPs keep their per-family calls. For the MSC313E and MSC316 boards, with IDs from the vendor drivers: * SC2310, SC2235, SC5035, SC5238, IMX323 (new model); hisi-imx307 reads back the two registers the MStar driver's ID table checks; sc2315e reads 0x20 at 0x3109, as that driver's table has it * SC2310's gain and half-row exposure, from pCus_GetAEGain and pCus_SetAEUSecs; the SC2336's decoder does not apply * rtc=ds1338: the DS1307-family RTC the Raysharp app reads at 0xD0 Firmware that rebooted or died under its watchdog did so for want of its sensor, or of its RAM (docs/sigmastar.md, Boards).
PR Summary by QodoShare image sensors across machines and support Infinity3 board sensors
AI Description
Diagram
High-Level Assessment
Files changed (21)
|
Code Review by Qodo
1.
|
…C bus galaxycore-sensor and ingenic-ov2735 take the image-sensor interface from the decoders they already had, so a GalaxyCore part picked on infinity3 gets a picture instead of grey statistics. They report no frame length or window: the ISP takes those as unset. rtc= on a sigmastar machine with no I2C bus (ssr621q, ssd202d, ssd201) was accepted and did nothing, even with a bad name: it is refused now, as sensor= is. setup.sh's repair loop selects DS1338 for an existing SIGMASTAR block too.
|
Thanks, all three reproduced and fixed in the latest commit on this branch.
Re-tested: all 20 device suites, plus ym200j, |
Summary
Sensors are the same parts on every SoC, but each family kept its own table of names, addresses and IDs. This replaces those tables with one catalogue, and uses it to get the MSC313E/MSC316 retail dumps running with their real sensors.
hw/i2c/image-sensor.c: one catalogue; machines callimage_sensor_create(bus, name). Replaces the tables in hisilicon, sigmastar, ingenic, fullhan, goke, grainmedia and novatek. Xiongmai takes catalogue names alongside QOM types. An unknown name lists the catalogue.setup.sh), sosensor=imx307works on a T31 andsensor=gc4653on a Hi3516EV300. Existing trees are migrated.image-sensorQOM interface: exposure from any sensor, so the infinity3 ISP is no longer limited to SOI parts. Implemented by the F37 family,hisi-smartsens,hisi-imx307,imx323,galaxycore-sensorandingenic-ov2735(the last two report rows and gain only). Not yet by the other Sony models,hisi-mis2006orhisi-sp2305, which have no exposure decode: on the infinity3 ISP they are detected but draw nothing. The Ingenic ISPs keep their per-family calls on purpose.hisi-gc2053removed:galaxycore-sensoranswers for the same part.Sensor_id_table; SC2310's gain and half-row exposure frompCus_GetAEGain/pCus_SetAEUSecs;rtc=ds1338on the sigmastar machines.Boards (
msc313e)sensor=imx307sensor=imx307sensor=sc2315esensor=sc2310,rtc=ds1338 -m 128Msensor=imx323 -m 128MThe reboots and resets were the firmware not finding its sensor. The MSC316 boards also need 128 MiB: at 64 MiB the kernel's CMA pool wraps onto low memory. Details are in
docs/sigmastar.md.Known gaps
0x301Ecomes from the init table, not the gain code. The app also still loops onP2PID_GET.sc2315efine gain: 1x =0x10comes from the driver'sgain_regdefaults; its decode was not traced in full. Same forsc5035/sc5238, which have IDs but the SC2336 gain decode.Test plan
rtc=tests intest-sigmastar.pysofia-isp-ci-test.sh: Sofia reachesISP Dev 0 runningwithsensor=sc2315eand the new0x3109valuetest-fullhan-boot(fh8852v200, fh8852v100),test-grainmedia-boot(gm8136, gm8135),test-novatek-boot(nt98566, nt98562, withsensor=sc401ai),test-ingenic-boot --mode kernel(t20, t23, t31, t40)ipcinfoon hi3516ev300: same detection as baseline forgc2053,sc2315e,imx307;gc4653newly detected;sc2335detected on hi3516ev200test-gk710x.pygc2053: not run; covered only bytest-allwinner-cam.py