Skip to content

ambarella-osdrv-s3l: release the sensor before looking for it - #2768

Merged
openipc-ai merged 1 commit into
masterfrom
ambarella-s3l-sensor-reset
Nov 6, 2026
Merged

openipc-ai merged 1 commit into
masterfrom
ambarella-s3l-sensor-reset

Conversation

@openipc-ai

@openipc-ai openipc-ai commented Nov 6, 2026 •

Copy link
Copy Markdown
Collaborator

Problem

On an S3L the sensor sits in reset until its driver loads, which drives the pin from vinrst-gpios, as measured on the IP4M-1026E (OpenIPC/qemu-bench#233). So load_ambarella can't probe to find out which driver to load: with no sensor value it reports no sensor. A board profile setting sensor= avoids that and stays the path to rely on. This PR covers images with no profile.

The pin is board data: GPIO 107 on the IP4M-1026E, GPIO 39 on a DS-2CD2423G0-I. So it can't be hardcoded.

Fix

load_ambarella reads /iav/vinc0/vinrst-gpios from the device tree, drives the pin out of reset through sysfs, probes, and frees the pin. iav.ko claims that pin when it loads, so the probe now comes before iav. A sensor value in the environment skips all of this.

  • Polarity: iav.ko resets with the flag as the level, so flag 0 means held low. Both boards use 0, as does the vendor's reference tree.
  • I2C expanders: the script compares the phandle with the SoC's GPIO node, so a pin on an expander is left alone.
  • Failures: if the pin can't be released, the script logs it and still probes. A failed direction write still unexports the pin, so iav.ko can claim it.

What detection depends on

Releasing the pin is not enough on its own. The sensor needs a clock to answer I2C, and of everything this script loads, only ov4689_mipi starts one. Detection therefore works only if U-Boot left the sensor PLL running:

  • IP4M-1026E: the Dahua U-Boot does, so detection works there as the board boots today.
  • Any other board: untested. If its U-Boot stops the PLL, detection finds nothing and the board needs sensor=.

Accepted for merge: on the IP4M-1026E the sensor gets about 74 MHz at this point. The OV4689 datasheet (v1.3, table 7-4) specifies EXTCLK as 6 to 64 MHz, 24 typical, so that is about 16% over the maximum. The clock isn't new, but the sensor used to sit in reset while it ran; now it is awake on that clock from the release until its driver sets the clock up. It's a timing specification, not listed under absolute maximum ratings, and the sensor answered fine, but every boot without sensor= would do this. The maintainer accepted that for this merge; a board that wants to avoid it can set sensor=.

A failed probe still costs about 72 s at boot (3 buses × 8 addresses × 3 s timeouts). That is not new in this PR.

Hardware tested on

Amcrest IP4M-1026E (S3L, OV4689, reset on GPIO 107), tested by DeathCamel58.

After, on this commit: a real cold boot with power removed and sensor unset, full output here. The sensor is found, ov4689_mipi loads, and the tester reports video streaming from that boot. release_sensor logged no failure.

$ fw_printenv sensor
## Error: "sensor" not defined

$ grep -E "iav|ov4689" /proc/modules
ov4689_mipi 34195 0 - Live 0x7f0cd000 (PO)
iav 392683 4 ov4689_mipi, Live 0x7f05b000 (PO)

$ dmesg
[    4.771456] ambarella-i2c e8003000.i2c: No ACK from address 0x20, 0:0!
[    4.840714] iav_drv_probe_status(308): IAV probe status [255], dsp mode [255].
[    4.854677] VIN: vin0: probed!
[    4.941933] VIN: OV4689 init(4-lane mipi), [vinc:vsrc]0:0
[    5.160542] VIN: 4 lane 4M
[    5.513658] iav_enable_preview(1550): preview enabled.
[    5.711554] iav_ioc_start_encode(2651): Wait 4 frames before encode for encode start delay.

The order is the script's: the probe, then iav, then the driver.

Before: the tester's earlier report has ipcinfo -s finding nothing before the release and ov4689 (chip ID 0x4688) after it, on the previous revision of release_sensor. It also covers the other path: with sensor= set nothing probes and ov4689_mipi releases the pin, across repeated boots. That report is a summary, not pasted output.

What this run does not cover:

  • Not a stock s3l_lite image. It's be057d787 plus the tester's bench copy of the s3l_lite_amcrest-ip4m1026e device profile, which isn't upstream yet: an initramfs, dev tools, and the unit's own microcode added locally, so os-release reads -gbe057d78-dirty. The tester states load_ambarella and the kernel modules are this branch's.
  • Device tree. The firmware ships no board device tree for s3l_lite, so the pin comes from whatever tree the boot supplies. Here that appears to be the profile's. A tree without vinrst-gpios logs the failed release and detects nothing.
  • Boot path. The image was netbooted through the Dahua U-Boot's TFTP recovery, and the flash still holds stock. A boot from an OpenIPC image on flash has not been tested.
  • Sensor clock. It was not measured on this run.
  • Serial log. The full log mentioned in the report did not attach.

ipcinfo -s returns nothing once the driver is up, which costs about 60 s of probing if anyone runs it then. Detection at boot is not affected, since it runs before the driver loads.

Tested without hardware

On this commit:

  • -M s3l from OpenIPC/qemu-bench, qemu-boot/test-s3l-boot.sh, with the real script and shipped modules: 0 failures in both cases. With no sensor value the script releases the pin from the device tree and ov4689_mipi loads. With sensor=ov4689 nothing probes. This used an ipctool built from current master.
  • release_sensor and find_sensor under busybox ash against a fake device tree and sysfs, plain and comment-stripped: 22 of 22 checks pass, covering each failed sysfs write, an expander phandle, and a short or missing property. These were scratch checks and are not in the tree.
  • test_shell_parse.sh and test_strip_shell_comments.sh with STRICT=1: pass.

CI gives no coverage here: s3l is in UNBUILT_FAMILIES, so no job builds s3l_lite.

The property values above were read from a real DS-2CD2423G0-I.

Scope

  • No kernel patches under general/package/all-patches/linux/
  • Nothing in the shared script hardcodes a value specific to a board
  • No LD_PRELOAD, and no binaries that cannot be rebuilt from source

@qodo-free-for-open-source-projects

Copy link
Copy Markdown

PR Summary by Qodo

Release S3L sensor reset before probing

🐞 Bug fix 🕐 20-40 Minutes

Grey Divider

AI Description

• Releases the device-tree-specified S3L sensor reset pin before probing, so reset does not hide the
 sensor.
• Probes before loading iav, which claims the pin; configured sensors bypass release and probing.
• Leaves GPIO-expander pins untouched and frees SoC GPIO pins after release.
Diagram

graph TD
  env["Sensor environment"] --> configured{"Sensor configured?"} -->|No| dt["Read reset GPIO"] --> soc{"SoC GPIO?"} -->|Yes| release["Release and free"] --> probe["Probe sensor"] --> iav["Load iav"] --> driver["Load sensor driver"]
  configured -->|Yes| iav
  soc -->|No| probe
Loading
High-Level Assessment

Reading board-specific reset data from the device tree and releasing the pin before iav claims it fits this script's responsibility without hardcoding board pins or patching the kernel. The environment override remains important until detection before the VIN clock starts is verified on physical hardware.

Files changed (1) +47 / -7

Bug fix (1) +47 / -7
load_ambarellaRelease the S3L sensor before detection and iav loading +47/-7

Release the S3L sensor before detection and iav loading

• Adds device-tree parsing and a SoC GPIO phandle check before releasing sensor reset through sysfs and unexporting the pin. Moves sensor selection ahead of iav loading; an explicit environment value skips release and probing, while an absent or unknown value triggers detection.

general/package/legacy/ambarella-osdrv-s3l/files/script/load_ambarella

@qodo-free-for-open-source-projects

qodo-free-for-open-source-projects Bot commented Nov 6, 2026 •

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (1) 📘 Rule violations (1) 📎 Requirement gaps (0) 🎨 UX issues (0) 🔗 Cross-repo conflicts (0) 📜 Skill insights (0)

Grey Divider


Remediation recommended

1. A driver reset gap is patched in a shell script 📘 Rule violation ⚙ Maintainability
Description
release_sensor in the shared load_ambarella script drives the sensor's reset GPIO through sysfs
because iav.ko only releases it once a VIN mode is set. The workaround runs on every board that
ships this package and hides the driver's behaviour from the repository that owns it, so a later
iav.ko change can silently conflict with it.
Code

general/package/legacy/ambarella-osdrv-s3l/files/script/load_ambarella[R47-50]

+# The pin in /iav/vinc0/vinrst-gpios, on the SoC's own GPIO. A vendor board may
+# put it on an I2C expander, which sysfs numbers differently: leave that alone.
+# iav.ko resets with flag bit 0 as the level, so flag 0 is held low.
+release_sensor() {
Evidence
The added comment and function state that iav.ko releases the sensor reset only when a VIN mode is
set. The firmware script compensates for that driver behaviour instead of the owning SDK or driver
being fixed, which matches the failure criterion for firmware-side workarounds of driver behaviour.
The PR description admits the real-hardware behaviour is untested, so this is flagged as a
recommendation rather than a hard requirement.

general/package/legacy/ambarella-osdrv-s3l/files/script/load_ambarella[47-53]
Best Practice: Repository guidelines

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The `release_sensor` function in `load_ambarella` releases the sensor reset GPIO from userspace because the Ambarella `iav.ko` driver only does so when a VIN mode is set. The driver behaviour is worked around in firmware rather than fixed where it lives.
## Fix Focus Areas
- general/package/legacy/ambarella-osdrv-s3l/files/script/load_ambarella[47-53]
## Recommended Fix
Open an issue or pull request against the owning Ambarella SDK or `iav` driver source so the sensor is released at driver load, and reference it in a comment above `release_sensor`. Keep the workaround only until that change lands, and state in the PR description that it is temporary and which upstream change will remove it.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


2. GPIO failures hide sensor startup errors 🐞 Bug ☼ Reliability
Description
release_sensor checks whether export succeeds but ignores failures when setting the GPIO direction
or unexporting it, then returns success. If the direction write fails, ipcinfo -s probes a sensor
that may still be in reset; if unexport fails, sysfs can retain the pin that iav needs, with
neither failure reported to find_sensor.
Code

general/package/legacy/ambarella-osdrv-s3l/files/script/load_ambarella[R71-73]

+		echo "$level" >"/sys/class/gpio/gpio$pin/direction"
+		echo "$pin" >/sys/class/gpio/unexport
+		return 0
Evidence
The new code guards export but unconditionally proceeds past both subsequent writes to return 0.
The caller discards that status and probes immediately; the script then loads iav, which the new
comments say claims the pin.

general/package/legacy/ambarella-osdrv-s3l/files/script/load_ambarella[70-74]
general/package/legacy/ambarella-osdrv-s3l/files/script/load_ambarella[78-85]
general/package/legacy/ambarella-osdrv-s3l/files/script/load_ambarella[133-143]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
`release_sensor` ignores direction and unexport write failures, and `find_sensor` ignores its return status. A failed write can therefore be mistaken for an undetected sensor or leave the GPIO unavailable to `iav`.
## Fix Focus Areas
- general/package/legacy/ambarella-osdrv-s3l/files/script/load_ambarella[70-74]
- general/package/legacy/ambarella-osdrv-s3l/files/script/load_ambarella[82-84]
## Recommended Fix
Check both writes, attempt to unexport after a direction failure, and propagate or log the specific failure in `find_sensor` before probing. Do not report a successful release when either write fails.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

Tip of the day
💡 Did you know, you can switch off images and animations for a plain-text comment

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

@DeathCamel58

Copy link
Copy Markdown
Contributor

Tested on an Amcrest IP4M-1026E (OV4689, reset on GPIO 107), using the PR's release_sensor verbatim.

What works:

  • Device-tree parsing: vinrst-gpios decodes to phandle 27, pin 107, flags 0. The phandle matches gpio@0, so the pin is released (driven high) and stays high after unexport.
  • Probe after release: before it, ipcinfo -s finds nothing. After it, it reports ov4689 and the chip ID reads 0x4688.
  • The sensor= env path: nothing probes, and ov4689_mipi releases the pin. This camera has booted that way repeatedly.

On the PR's open question, whether the sensor answers before the VIN clock is running:

  • No clock: with the PLL stopped the way the kernel stops it, the sensor does not answer after the release.
  • Who starts the clock: loading iav.ko doesn't; ov4689_mipi does. So the probe relies on whatever clock is running at boot.
  • What the boot clock is: I captured the sensor-clock registers from U-Boot on a cold boot. U-Boot leaves the sensor PLL locked, at about 148 MHz with post-divider 2, and the pad as input. The kernel's clock init then switches the pad to output (CONFIG_AMBARELLA_CALC_PLL).
  • The boot clock is enough: I recreated that state on the camera, which reads 74.18 MHz. The PR's release and probe found the sensor. So detection works on this board as it boots today.

Caveats:

  1. Depends on U-Boot: it works only because this Dahua U-Boot happens to leave the sensor PLL running. A board whose U-Boot leaves it off would detect nothing; that needs sensor=. The PR text should say so.
  2. Out of spec: the sensor is clocked at about 74 MHz while it's probed, above the OV4689's specified input-clock range (I think its maximum is 64 MHz). It answered fine here, but every boot without sensor= would do this.
  3. Not new in this PR: a failed probe still costs about 72 s at boot (3 buses × 8 addresses × 3 s timeouts).

Overall it works as intended on this hardware. I'd ask for the U-Boot dependency to be stated, and for sensor= to stay the recommended path.

On an S3L the sensor sits in reset until its driver loads, which drives
the pin, so load_ambarella found no sensor on the IP4M-1026E with no
sensor value set. Which pin it is differs by board: GPIO 107 there,
GPIO 39 on a DS-2CD2423G0-I.

The pin is in the device tree at /iav/vinc0/vinrst-gpios, so it is read
from there. It is released through sysfs and handed back, since iav.ko
claims it when it loads, which is why the probe now comes first. A pin
on an I2C expander, as on the vendor's reference board, is left alone.

Releasing the pin is not enough on its own. The sensor also needs a
clock, which only its driver starts, so detection depends on U-Boot
having left the sensor PLL running. sensor= stays the path to rely on.
@openipc-ai
openipc-ai force-pushed the ambarella-s3l-sensor-reset branch from 67ddf96 to be057d7 Compare November 6, 2026 16:11
@openipc-ai

Copy link
Copy Markdown
Collaborator Author

@DeathCamel58 thanks, that was exactly what this PR needed. Your U-Boot dependency is now stated in the script header and the PR description, and sensor= stays the recommended path. You were also right about the clock: the OV4689 datasheet gives 64 MHz as the EXTCLK maximum, so about 74 MHz is over it.

One more run would let this land. The review rules need pasted output from a whole image, and so far the release has only been tested on its own with the clock state recreated by hand. Could you do a real cold boot of s3l_lite built from this branch's current head, be057d787? It also has small changes since your test: it now checks the sysfs writes and logs a failed release.

On the camera, clear sensor and power-cycle it, so it's a true cold boot and not a reboot:

fw_printenv sensor     # note it if it's set, so you can restore it afterwards
fw_setenv sensor

After it comes back, please paste the raw output of:

cat /usr/lib/os-release
fw_printenv sensor
ipcinfo -s
grep -E 'iav|ov4689' /proc/modules
logread | grep -iE 'ambarella|sensor'
dmesg | grep -iE 'iav|ov4689|vin|sensor|i2c'

A full serial boot log would be even better if you have it to hand. If detection fails, please post that too, since that result is just as useful. Your earlier sensor= setup will restore with fw_setenv sensor ov4689.

Only do this on a camera where you still have serial recovery.

@DeathCamel58

Copy link
Copy Markdown
Contributor

Ran it: a real cold boot (power unplugged, ~10 s) of s3l_lite from be057d787, with sensor cleared. Detection works: the OV4689 is found and loaded, and the camera streams video from that cold boot.

How it was built and booted, so nothing is hidden:

  • Built from be057d787 with the s3l_lite_amcrest-ip4m1026e device profile copied in (not upstream yet, hence -gbe057d78-dirty in os-release).
  • It's my bench variant of that profile (BOARD=s3l_ip4m1026e_dev): the same packages plus an initramfs and dev tools. It's netbooted through the Dahua U-Boot's TFTP recovery, so the flash still holds stock, and the unit's own DSP microcode is added locally. load_ambarella and the kernel modules are the branch's.
  • sensor was cleared beforehand: fw_printenv sensor → ## Error: "sensor" not defined.

Notes on the output:

  • release_sensor logged nothing, i.e. no failed sysfs write.
  • The No ACK at 4.77 s (0x20 on bus 0) is the detection probing just before VIN: OV4689 init(4-lane mipi) at 4.94 s.
  • Every No ACK from 11 s on comes from ipcinfo -s in the list itself. It walks addresses on all three buses at ~3 s each and prints nothing for this sensor. That's an ipctool gap on S3L, unrelated to this PR.

Full serial boot log (U-Boot + kernel): attached.

Output
# uptime: 8.40
$ cat /usr/lib/os-release
NAME=Buildroot
VERSION=-gbe057d78-dirty
ID=buildroot
VERSION_ID=2024.02.10
PRETTY_NAME="Buildroot 2024.02.10"
OPENIPC_VERSION=2.6.11.06
GITHUB_VERSION="local+build, 2026-11-06"
BUILD_OPTION=lite
BUILD_ID=local-20261106-build
BUILD_SHA=build
BUILD_PLATFORM=s3l_lite
TIME_STAMP=1793988464

$ fw_printenv sensor
## Error: "sensor" not defined

$ ipcinfo -s

$ grep -E "iav|ov4689" /proc/modules
ov4689_mipi 34195 0 - Live 0x7f0cd000 (PO)
iav 392683 4 ov4689_mipi, Live 0x7f05b000 (PO)
hw_timer 7339 1 iav, Live 0x7f055000 (PO)
imgproc 36830 1 iav, Live 0x7f048000 (PO)
vout 52418 1 iav, Live 0x7f035000 (PO)
dsp 83360 3 iav,imgproc,vout, Live 0x7f017000 (PO)

$ logread | grep -iE "ambarella|sensor"
Nov  6 18:47:43 openipc-s3l kern.info kernel: [    0.000000] Machine: Ambarella S3L (Flattened Device Tree), model: Amcrest IP4M-1026E (Ambarella S3L)
Nov  6 18:47:43 openipc-s3l kern.info kernel: [    0.000000] Ambarella:      AHB = 0xe0000000[0xe0000000],0x01000000 0
Nov  6 18:47:43 openipc-s3l kern.info kernel: [    0.000000] Ambarella:      APB = 0xe8000000[0xe8000000],0x01000000 0
Nov  6 18:47:43 openipc-s3l kern.info kernel: [    0.000000] Ambarella:      PPM = 0x00000000[0xdfe00000],0x00200000 9
Nov  6 18:47:43 openipc-s3l kern.info kernel: [    0.000000] Ambarella:      AXI = 0xf0000000[0xf0000000],0x00030000 0
Nov  6 18:47:43 openipc-s3l kern.info kernel: [    0.000000] Ambarella:    DRAMC = 0xdffe0000[0xef000000],0x00020000 0
Nov  6 18:47:43 openipc-s3l kern.info kernel: [    0.000000] Ambarella:   DBGBUS = 0xec000000[0xec000000],0x00200000 0
Nov  6 18:47:43 openipc-s3l kern.info kernel: [    0.000000] Ambarella:  DBGFMEM = 0xee000000[0xee000000],0x01000000 0
Nov  6 18:47:43 openipc-s3l kern.info kernel: [    0.000000] Ambarella:   IAVMEM = 0x07800000[          ],0x18800000
Nov  6 18:47:43 openipc-s3l kern.info kernel: [    0.103014] Ambarella power management: Wed Aug 10 2016 
Nov  6 18:47:43 openipc-s3l kern.info kernel: [    0.121989] ambarella-pinctrl e8009000.pinctrl: Ambarella pinctrl driver registered
Nov  6 18:47:43 openipc-s3l kern.info kernel: [    0.129970] ambarella-gpio gpio.0: Ambarella GPIO driver registered
Nov  6 18:47:43 openipc-s3l kern.info kernel: [    0.144445] ambarella-dma e0005000.dma: Ambarella DMA Engine 
Nov  6 18:47:43 openipc-s3l kern.info kernel: [    0.155084] ambarella-i2c e8003000.i2c: Ambarella I2C adapter[0] probed!
Nov  6 18:47:43 openipc-s3l kern.info kernel: [    0.161955] ambarella-i2c e8001000.i2c: Ambarella I2C adapter[1] probed!
Nov  6 18:47:43 openipc-s3l kern.info kernel: [    0.168859] ambarella-i2c e8007000.i2c: Ambarella I2C adapter[2] probed!
Nov  6 18:47:43 openipc-s3l kern.info kernel: [    0.176204] Switching to clocksource ambarella-cs-timer
Nov  6 18:47:43 openipc-s3l kern.info kernel: [    0.314594] ambarella-adc e801d000.adc: Ambarella ADC driver init
Nov  6 18:47:43 openipc-s3l kern.info kernel: [    0.432987] ambarella-uart e0032000.uart: Serial[1] use txdma
Nov  6 18:47:43 openipc-s3l kern.info kernel: [    0.438716] ambarella-uart e0032000.uart: Serial[1] use rxdma
Nov  6 18:47:43 openipc-s3l kern.info kernel: [    0.621464] libphy: Ambarella MII Bus: probed
Nov  6 18:47:43 openipc-s3l kern.info kernel: [    0.627198] ambarella-eth e000e000.ethernet: Ethernet PHY[0]: 0x001cc816!
Nov  6 18:47:43 openipc-s3l kern.notice kernel: [    0.634430] ambarella-eth e000e000.ethernet: MAC Address[36:85:7f:3a:0c:1f].
Nov  6 18:47:43 openipc-s3l kern.info kernel: [    0.641907] ambarella-rtc e8015000.rtc: rtc core: registered rtc-ambarella as rtc0
Nov  6 18:47:43 openipc-s3l kern.notice kernel: [    0.653712] ambarella-wdt e800c000.wdt: Ambarella Watchdog Timer Probed.
Nov  6 18:47:43 openipc-s3l kern.info kernel: [    0.691001] ambarella-rtc e8015000.rtc: setting system clock to 2026-11-06 18:47:43 UTC (1793990863)
Nov  6 18:47:47 openipc-s3l kern.err kernel: [    4.771456] ambarella-i2c e8003000.i2c: No ACK from address 0x20, 0:0!
Nov  6 18:47:48 openipc-s3l kern.debug kernel: [    5.290822]     is_rgbir_sensor = 0
Nov  6 18:47:48 openipc-s3l kern.debug kernel: [    5.290948]     sensor_resolution = 0
Nov  6 18:47:48 openipc-s3l kern.debug kernel: [    5.290952]     sensor_bayer_pattern = 0
Nov  6 18:47:48 openipc-s3l kern.debug kernel: [    5.291014] dsp_cmd: SENSOR_INPUT_SETUP (0x9001002)
Nov  6 18:47:48 openipc-s3l kern.debug kernel: [    5.291018]     sensor_id = 127
Nov  6 18:47:48 openipc-s3l kern.debug kernel: [    5.291026]     sensor_resolution = 10
Nov  6 18:47:48 openipc-s3l kern.debug kernel: [    5.291029]     sensor_pattern = 1
Nov  6 18:47:48 openipc-s3l kern.debug kernel: [    5.291064]     sensor_readout_mode = 0
Nov  6 18:47:48 openipc-s3l kern.debug kernel: [    5.291141]     sensor_readout_mode = 0
Nov  6 18:47:54 openipc-s3l kern.err kernel: [   11.451456] ambarella-i2c e8003000.i2c: No ACK from address 0x20, 0:0!
Nov  6 18:47:57 openipc-s3l kern.err kernel: [   14.451456] ambarella-i2c e8003000.i2c: No ACK from address 0x34, 0:0!
Nov  6 18:48:00 openipc-s3l kern.err kernel: [   17.451456] ambarella-i2c e8003000.i2c: No ACK from address 0x34, 0:0!
Nov  6 18:48:03 openipc-s3l kern.err kernel: [   20.451459] ambarella-i2c e8003000.i2c: No ACK from address 0x34, 0:0!
Nov  6 18:48:06 openipc-s3l kern.err kernel: [   23.451460] ambarella-i2c e8001000.i2c: No ACK from address 0x20, 1:0!
Nov  6 18:48:09 openipc-s3l kern.err kernel: [   26.451462] ambarella-i2c e8001000.i2c: No ACK from address 0x6c, 1:0!
Nov  6 18:48:12 openipc-s3l kern.err kernel: [   29.451456] ambarella-i2c e8001000.i2c: No ACK from address 0x6c, 1:0!
Nov  6 18:48:15 openipc-s3l kern.err kernel: [   32.451460] ambarella-i2c e8001000.i2c: No ACK from address 0x6c, 1:0!
Nov  6 18:48:18 openipc-s3l kern.err kernel: [   35.451457] ambarella-i2c e8001000.i2c: No ACK from address 0x6c, 1:0!
Nov  6 18:48:21 openipc-s3l kern.err kernel: [   38.451461] ambarella-i2c e8001000.i2c: No ACK from address 0x34, 1:0!
Nov  6 18:48:24 openipc-s3l kern.err kernel: [   41.451459] ambarella-i2c e8001000.i2c: No ACK from address 0x34, 1:0!
Nov  6 18:48:27 openipc-s3l kern.err kernel: [   44.451465] ambarella-i2c e8001000.i2c: No ACK from address 0x34, 1:0!
Nov  6 18:48:30 openipc-s3l kern.err kernel: [   47.451457] ambarella-i2c e8007000.i2c: No ACK from address 0x20, 1:0!
Nov  6 18:48:33 openipc-s3l kern.err kernel: [   50.451458] ambarella-i2c e8007000.i2c: No ACK from address 0x6c, 1:0!
Nov  6 18:48:36 openipc-s3l kern.err kernel: [   53.451458] ambarella-i2c e8007000.i2c: No ACK from address 0x6c, 1:0!
Nov  6 18:48:39 openipc-s3l kern.err kernel: [   56.451459] ambarella-i2c e8007000.i2c: No ACK from address 0x6c, 1:0!
Nov  6 18:48:42 openipc-s3l kern.err kernel: [   59.451456] ambarella-i2c e8007000.i2c: No ACK from address 0x6c, 1:0!
Nov  6 18:48:45 openipc-s3l kern.err kernel: [   62.451459] ambarella-i2c e8007000.i2c: No ACK from address 0x34, 1:0!
Nov  6 18:48:48 openipc-s3l kern.err kernel: [   65.455653] ambarella-i2c e8007000.i2c: No ACK from address 0x34, 1:0!
Nov  6 18:48:51 openipc-s3l kern.err kernel: [   68.451460] ambarella-i2c e8007000.i2c: No ACK from address 0x34, 1:0!

$ dmesg | grep -iE "iav|ov4689|vin|sensor|i2c"
[    0.000000] Ambarella:   IAVMEM = 0x07800000[          ],0x18800000
[    0.155084] ambarella-i2c e8003000.i2c: Ambarella I2C adapter[0] probed!
[    0.161955] ambarella-i2c e8001000.i2c: Ambarella I2C adapter[1] probed!
[    0.168859] ambarella-i2c e8007000.i2c: Ambarella I2C adapter[2] probed!
[    0.649576] i2c /dev entries driver
[    4.771456] ambarella-i2c e8003000.i2c: No ACK from address 0x20, 0:0!
[    4.840714] iav_drv_probe_status(308): IAV probe status [255], dsp mode [255].
[    4.854677] VIN: vin0: probed!
[    4.854697] VIN: vin1(virtual): probed!
[    4.941933] VIN: OV4689 init(4-lane mipi), [vinc:vsrc]0:0
[    5.159678] iav_goto_idle(1675): Goto Idle from STATE_INIT.
[    5.160542] VIN: 4 lane 4M
[    5.160548] VIN: Linear mode
[    5.290302] iav_check_vout(1143): VOUT are all disabled.
[    5.290388] iav_check_idsp_perf(1771): IDSP Performace [0 MP/s].
[    5.290727]     hdr_preblend_from_vin = 0
[    5.290822]     is_rgbir_sensor = 0
[    5.290849]     vin_vcap_back_pressure_margin = 0
[    5.290928] dsp_cmd: SET_VIN_CONFIG (0x9001008)
[    5.290932]     vin_width = 2688
[    5.290936]     vin_height = 1512
[    5.290940]     vin_config_dram_addr = 0x0631ec40
[    5.290948]     sensor_resolution = 0
[    5.290952]     sensor_bayer_pattern = 0
[    5.290956]     skip_vin_config_dram_addr = 0x00000000
[    5.290960]     skip_vin_config_data_size = 0
[    5.290965] dsp_cmd: SET_VIN_GLOBAL_CLK (0x900100f)
[    5.290977] dsp_cmd: SET_VIN_MASTER_CLK (0x900100e)
[    5.291014] dsp_cmd: SENSOR_INPUT_SETUP (0x9001002)
[    5.291018]     sensor_id = 127
[    5.291026]     sensor_resolution = 10
[    5.291029]     sensor_pattern = 1
[    5.291064]     sensor_readout_mode = 0
[    5.291118]     num_vin_stats_buf = 12
[    5.291134]     vin_frame_rate = 0x00004e20
[    5.291141]     sensor_readout_mode = 0
[    5.291165]     vin_cap_win_per_expo_w = 2688
[    5.291169]     vin_cap_win_per_expo_h = 1512
[    5.291177]     always_enable_vin_stats = 1
[    5.291184]     vin_resolution = 1
[    5.512993]     vin_id = 0
[    5.513014]     vin_state = 0
[    5.513018]     vin_frame_rate = 20000
[    5.513658] iav_enable_preview(1550): preview enabled.
[    5.711554] iav_ioc_start_encode(2651): Wait 4 frames before encode for encode start delay.
[    5.711579] iav_check_encode_resource(1686): Check encode resource limit : system load 319200.
[    5.711624] iav_check_idsp_perf(1771): IDSP Performace [0 MP/s].
[    5.711638] iav_ioc_start_encode(2662): Init encoder when start encoding from preview state.
[   11.451456] ambarella-i2c e8003000.i2c: No ACK from address 0x20, 0:0!
[   14.451456] ambarella-i2c e8003000.i2c: No ACK from address 0x34, 0:0!
[   17.451456] ambarella-i2c e8003000.i2c: No ACK from address 0x34, 0:0!
[   20.451459] ambarella-i2c e8003000.i2c: No ACK from address 0x34, 0:0!
[   23.451460] ambarella-i2c e8001000.i2c: No ACK from address 0x20, 1:0!
[   26.451462] ambarella-i2c e8001000.i2c: No ACK from address 0x6c, 1:0!
[   29.451456] ambarella-i2c e8001000.i2c: No ACK from address 0x6c, 1:0!
[   32.451460] ambarella-i2c e8001000.i2c: No ACK from address 0x6c, 1:0!
[   35.451457] ambarella-i2c e8001000.i2c: No ACK from address 0x6c, 1:0!
[   38.451461] ambarella-i2c e8001000.i2c: No ACK from address 0x34, 1:0!
[   41.451459] ambarella-i2c e8001000.i2c: No ACK from address 0x34, 1:0!
[   44.451465] ambarella-i2c e8001000.i2c: No ACK from address 0x34, 1:0!
[   47.451457] ambarella-i2c e8007000.i2c: No ACK from address 0x20, 1:0!
[   50.451458] ambarella-i2c e8007000.i2c: No ACK from address 0x6c, 1:0!
[   53.451458] ambarella-i2c e8007000.i2c: No ACK from address 0x6c, 1:0!
[   56.451459] ambarella-i2c e8007000.i2c: No ACK from address 0x6c, 1:0!
[   59.451456] ambarella-i2c e8007000.i2c: No ACK from address 0x6c, 1:0!
[   62.451459] ambarella-i2c e8007000.i2c: No ACK from address 0x34, 1:0!
[   65.455653] ambarella-i2c e8007000.i2c: No ACK from address 0x34, 1:0!
[   68.451460] ambarella-i2c e8007000.i2c: No ACK from address 0x34, 1:0!

@openipc-ai

Copy link
Copy Markdown
Collaborator Author

@DeathCamel58 thank you, this is the run the PR needed. The ordering in your log matches the script (probe, then iav, then ov4689_mipi), and with sensor unset the driver could only have been chosen by the probe. I've put the key lines and your build details in the PR description, including the limits: bench profile, TFTP netboot, and a device tree that isn't in this repository.

Two small things:

  • The serial log didn't attach. There's no file on your comment, so please try again if it's easy. It isn't holding anything up, because the output you pasted is enough.
  • The ipcinfo -s result looks narrower than a general S3L gap. It must have identified the sensor at boot, or ov4689_mipi wouldn't have loaded. It only comes back empty once the driver is running. There's also no No ACK for 0x6c on bus 0 in that later run, so the sensor seems to answer without being identified. Agreed that it doesn't block this PR, but it probably deserves its own ipctool issue.

@openipc-ai
openipc-ai merged commit 2f510bf into master Nov 6, 2026
43 checks passed
@openipc-ai
openipc-ai deleted the ambarella-s3l-sensor-reset branch November 6, 2026 19:44
@openipc-ai openipc-ai mentioned this pull request Nov 7, 2026
7 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants