From cfe72ccdfeb842cce42a976f18e77279a6788b7b Mon Sep 17 00:00:00 2001 From: Dmitry Ilyin <6576495+widgetii@users.noreply.github.com> Date: Sat, 7 Nov 2026 08:28:21 +0300 Subject: [PATCH] sensors: detect the AR0230, the one S3L firmware sensor still unnamed OpenIPC's S3L firmware ships drivers for ar0230, ar0237, imx172, imx178, imx226, imx274, imx290, imx326, ov2718 and ov4689, and load_ambarella asks `ipcinfo -s` which one to load. All of them were already told apart but the AR0230 (CHIP_VERSION_REG 0x3000 = 0x0056) and the two Sony sensors below. Both byte orders are taken: the AR0237's 0x0950 arrives as 0x5009 through the reader the S3L HAL uses, and the AR0230's ID would arrive the same way. Not done: IMX172 and IMX326. Neither has an ID register, the vendor drivers check nothing at probe, and without a board or a datasheet to hand there is no reset default to tell them from the IMX226 that the `// IMX326 too?` branch already reports; a guessed one would risk misnaming sensors that are detected correctly today. A board with either can set sensor= in U-Boot. Tested: sensors_test passes against the golden list (two AR0230 rows added). On a Hikvision DS-2CD2423G0-I (S3Lm + AR0237) a static armhf ipcinfo still reports chip s3l, family s3l and sensor ar0237. No AR0230 here, so its rows are unproven on hardware. --- src/sensors.c | 8 ++++++++ src/sensors_golden.txt | 2 ++ 2 files changed, 10 insertions(+) diff --git a/src/sensors.c b/src/sensors.c index 5c85c6d..fe39b51 100644 --- a/src/sensors.c +++ b/src/sensors.c @@ -448,6 +448,14 @@ static int detect_onsemi_sensor(sensor_ctx_t *ctx, int fd, case 0x2402: sid = 0x0130; break; + /* AR0230 CHIP_VERSION_REG. The Ambarella S3L firmware drives one (its + * ar0230 module reads 0x3000 at probe); the second value is the same + * reading with the bytes swapped, as the AR0237's 0x0950 arrives as 0x5009 + * through the reader the S3L HAL uses. */ + case 0x0056: + case 0x5600: + sid = 0x0230; + break; case 0x256: sid = 0x0237; break; diff --git a/src/sensors_golden.txt b/src/sensors_golden.txt index ef39b9a..032b068 100644 --- a/src/sensors_golden.txt +++ b/src/sensors_golden.txt @@ -1098,11 +1098,13 @@ soi a0fc JXHfc soi a0fd JXHfd soi a0fe JXHfe soi a0ff JXHff +onsemi 0056 AR0230 onsemi 0256 AR0237 onsemi 2402 AR0130 onsemi 2602 AR0331 onsemi 2604 AR0330 onsemi 5009 AR0237 +onsemi 5600 AR0230 omni 2710 OV2710 omni 2715 OV2715 omni 2718 OV2718