Skip to content

media: gs201-csis, s5kgn1, MAINTAINERS: follow-ups to #63 - #103

Open
W4HO-ham wants to merge 18 commits into
derekross:omamobilefrom
W4HO-ham:tegu-camera-followup
Open

W4HO-ham wants to merge 18 commits into
derekross:omamobilefrom
W4HO-ham:tegu-camera-followup

Conversation

@W4HO-ham

Copy link
Copy Markdown
Contributor

This is on top of #63; its first 14 commits are #63's. It covers the small things from your review there:

  1. zumapro-csis-core.h now cites zuma-isp-event-info.dtsi for the LoCH interrupt registers' offsets, not only their bits.
  2. The S5KGN8 comment names rear_main_camera_power_seq in zuma-tegu-camera.dtsi, and that sequence answers the open question: ldo5 and ldo4 are the actuator's and OIS's AVDD and AF_VM, and the sensor's own supplies are ldo1 and vdig. Both stay required, since the module powers them first.
  3. ZP_STRIDE_ALIGN is gone.
  4. MAINTAINERS has a block for gs201-csis, the DC-PHY receiver, the two sensor drivers and their bindings. I put you as M and myself as R, since the drivers are yours; change it as you like.

On google,wdma-input: this series' binding has no such property, neither at #63's head nor in omamobile. The zumapro branch already sets the WDMA ones it has (wdma-context, csis-sysreg, ebuf) to false. If you meant one of those, it's there; if it's a property from your tree, tell me which and I'll add it.

checkpatch --strict on the three new commits is clean, and the W=1 build of gs201-csis and s5kgn1 with the whole stack on today's omamobile is clean.

The Tensor G4 (zumapro) camera front end has the same Samsung DC-PHY
receiver with nine slaves for its twelve CSIS links, the clock lane
first on each and one reset bit per slave. Add its compatible; the PHY
cell is the CSIS link.

Signed-off-by: W4HO <87742609+W4HO-ham@users.noreply.github.com>
zumapro's DC-PHY slaves sit at 0x1c100000 with the bias block at +0x1000
as on gs201, but every slave has its clock lane first and up to four data
lanes (three C-PHY trios) after it, and three slaves are a clock lane
only, which links 4 and 6 enable next to their own in four-lane D-PHY
mode. The layout comes from the Pixel 9a camera HAL's register table and
Google's GPL zuma DT; the reset bits are one per slave in the ISP-FE
system registers at +0x500.

Make the link layout per SoC with the reset bits and the partner clock
lane in it, and add zumapro's four-lane links (0, 1, 2, 4 and 6). The
data file format is unchanged.

On the Pixel 9a, link 1 (the ultrawide IMX712, four lanes at
1105.92 Mbps) powers on with settle 55, and the CSIS link receives about
30 frames a second with no SOT, CRC or ECC errors.

Signed-off-by: W4HO <87742609+W4HO-ham@users.noreply.github.com>
zumapro has the same CSIS link (version 0x08010000 against gs201's
0x05040000, the same register layout) with twelve link contexts, but a
different DMA path. Add its compatible with the link registers and the
link interrupt only.

Signed-off-by: W4HO <87742609+W4HO-ham@users.noreply.github.com>
zumapro's CSIS link has gs201's layout, but its frames reach memory
through the ISP front end's CSIS core, which this driver doesn't drive
yet. Add a zumapro match that maps the link only and always runs as
link_only does: PHY, link and sensor, counting frames, with no WDMA, no
routing and none of gs201's CSIS sysreg accesses (an unknown sysreg word
aborted gs201).

Signed-off-by: W4HO <87742609+W4HO-ham@users.noreply.github.com>
On zumapro a link's frames reach memory through the ISP front end's CSIS
core, one page shared by all links, with one interrupt for all of them.
Describe it as an optional second register range and interrupt of a
zumapro link, with the image logical channel the link writes through.

Signed-off-by: W4HO <87742609+W4HO-ham@users.noreply.github.com>
zumapro's CSIS core takes a link's data type on one virtual channel into
an image logical channel (LoCH) and writes it to memory through its Bayer
WDMA. The register layout and fields come from the Pixel 9a camera HAL's
register table and value packers and, for the interrupt bits, Google's
GPL zuma ISP event description.

Route the link's channel 0 into a LoCH, write packed RAW10 (or RAW8) at
the stride the video node set, and program the batch slot at each start
of frame only: a configuration written during a frame is a late config
and stops the LoCH, so frames with no queued buffer go to a scratch
buffer. A status queue page takes the LoCH's per-frame record.

The link differs from gs201 in three bits the zumapro HAL sets or clears:
pixel mode 3, CMN_CTRL bit 12, and DBG_OPTION_SUITE cleared. gs201 sets
DBG_OPTION_SUITE bit 23, and with it the link hands out unpacked 16-bit
words, which gs201's WDMA expects; zumapro's core reads them as packed
RAW10 and scrambles every pixel.

On the Pixel 9a the ultrawide's solid colour test pattern (R 1023, Gr 0,
B 341, Gb 682) reads back exactly in RAW10 and RAW16, and libcamera's
simple pipeline streams it at 30 fps.

Signed-off-by: W4HO <87742609+W4HO-ham@users.noreply.github.com>
The Pixel 9a main camera is a Samsung part with model ID 0x08e8 that
takes the GN1's register layout and data file, with a second auxiliary
supply and its digital supply switched by the board.

Signed-off-by: W4HO <87742609+W4HO-ham@users.noreply.github.com>
The Pixel 9a main camera (model 0x08e8) powers up as stock's module power
sequence has it: the interface supply, two 2.9 V auxiliary supplies, the
analog and the digital supply, reset released, then the clock and 10 ms.
Its soft reset goes through the direct page, its standard registers too,
and its horizontal addresses count pixels. Its initialisation and modes
come from the data file, as for the other parts.

On the Pixel 9a it identifies at 0x56 and streams 2000x1128 over three
C-PHY trios.

Signed-off-by: W4HO <87742609+W4HO-ham@users.noreply.github.com>
All zumapro links write through image LoCH 0, so a stream that stopped
with the LoCH in error (the main camera's first C-PHY attempts) left it
taking a few frames and then nothing for the next link. Disable, abort
and clear the LoCH before routing it. Count the core interrupts each link
handles in debugfs, with the last aggregate and processing sources.

Bring-up parameters for the link and the core (pixel and parallel mode,
CMN_CTRL bits, LoCH data type and memory format) stay for the C-PHY work.

Signed-off-by: W4HO <87742609+W4HO-ham@users.noreply.github.com>
zumapro's camera software never writes the link's PHY_CMN_CTRL: its PHY
lanes are enabled in the DC-PHY transaction. Write it on gs201 only. The
ultrawide and front cameras stream as before without it.

Signed-off-by: W4HO <87742609+W4HO-ham@users.noreply.github.com>
…ocks

A zumapro link takes the INT DVFS domain, the rail of the ISP front end's
NOC clock, and that clock, as "int" and "fe". gs201 keeps its "cam" and
"int" DVFS domains.

Signed-off-by: W4HO <87742609+W4HO-ham@users.noreply.github.com>
ABL leaves the ISP front end's NOC clock at a sixth of SHARED3 (111 MHz).
The Pixel 9a main camera's three C-PHY trios at 2740 Msps (18.8 Gbps)
overrun the front end at that rate: the link reports ERR_DESKEW_OVER and
the LoCH a size mismatch and stream error, with a few hundred bytes of
each frame in memory. At 332 MHz every frame lands whole.

Take the INT DVFS domain (the clock's rail, through ACPM) and the front
end clock as "int" and "fe", and raise both while a link streams, the
rail first, restoring them in reverse afterwards.

Signed-off-by: W4HO <87742609+W4HO-ham@users.noreply.github.com>
The Pixel 9a's ultrawide and front cameras are Sony IMX712s (model
0x0712), with the IMX386's register map and their own initialisation and
modes in the data file.

Signed-off-by: W4HO <87742609+W4HO-ham@users.noreply.github.com>
The Pixel 9a's ultrawide and front cameras answer with model 0x0712 at the
IMX386's chip ID register and take the same CCS-style register map. Take
the expected model ID from the compatible, for the probe's check and the
data file's header. Both cameras stream 4208x3072 RAW10 on four D-PHY
lanes on the palmtop with their data file from the 9a's camera HAL.

Signed-off-by: W4HO <87742609+W4HO-ham@users.noreply.github.com>
…used define

The LoCH interrupt registers' offsets are also in Google's GPL
zuma-isp-event-info.dtsi, not only their bits: say so. ZP_STRIDE_ALIGN
was never used (CSIS_STRIDE_ALIGN, 64, already covers it).

Signed-off-by: W4HO <87742609+W4HO-ham@users.noreply.github.com>
…roles

The GN8's power-up order is rear_main_camera_power_seq in Google's GPL
zuma-tegu-camera.dtsi, which also names ldo5 and ldo4 as the actuator's
and OIS's AVDD and AF_VM (the sensor's own being ldo1 and vdig). Replace
the open question with that; both stay required, as the module's
sequence powers them before the sensor.

Link: https://android.googlesource.com/kernel/devices/google/tegu/+/6276884d9940694b25a6934671918ec8ac412ee8/dts/zuma-tegu-camera.dtsi
Signed-off-by: W4HO <87742609+W4HO-ham@users.noreply.github.com>
None of gs201-csis, the MIPI DC-PHY receiver or the S5KGN1 and IMX386
sensor drivers had an entry. Add one block for the four and their
bindings.

Signed-off-by: W4HO <87742609+W4HO-ham@users.noreply.github.com>
On the Pixel 9a the first capture after switching cameras came back
empty whenever the previous stream ran on a D-PHY link (the ultrawide
or the front camera) and worked: the new link received its frames,
but the LoCH raised no interrupt and wrote nothing. The next capture
on the same link worked.

The LoCH's EN_STATUS register (0x0a8, named in the camera HAL's
register table) shows why. After a stream that stopped cleanly it
still reads active with the old link in its low bits (0x106 after link
6, 0x101 after link 1), and every failing start began that way, every
good start with it clear. The abort at route time didn't clear it,
because the LoCH ignores an abort while it is disabled.

So when the LoCH is still active, enable it (its DMA is already off)
for the abort, and disable it afterwards. Nine captures in a row,
switching between all three cameras in every order, now all write
frames; before, about half of the switches failed.

Signed-off-by: W4HO <87742609+W4HO-ham@users.noreply.github.com>
@W4HO-ham

Copy link
Copy Markdown
Contributor Author

Added 9a0f19a: the camera-switch bug from #63 (the first capture after switching away from the ultrawide or front camera came back empty). The LoCH stays bound to its last link after a clean stop (EN_STATUS 0x0a8 reads 0x106 or 0x101), and it ignores an abort while disabled, so route now enables it for the abort when it's still active. Nine captures switching between all three cameras in every order all write frames on the palmtop.

@derekross

Copy link
Copy Markdown
Owner

Thank you for these follow-ups, and for the camera-switch fix on top. Each one is what I asked for: the event-info citation for the LoCH offsets, the S5KGN8 source with its ldo4/ldo5 roles, ZP_STRIDE_ALIGN gone, and the MAINTAINERS block (I'll decide on the names in it when I merge). As I said on #63, the google,wdma-input request was my mistake.

The branch merges cleanly onto today's omamobile, and the gate passes there (sign-offs, checkpatch with #63's two notes, W=1 on the four files, CI's dt_binding_check). Against #63's head, the four new commits change only gs201_csis_start_streaming in gs201-csis.o, where zp_core_route is inlined, and that's the zumapro branch. The S5KGN1 driver compiles to the same code. So the cheetah capture I'm doing for #63 covers this too.

One small thing about 9a0f19a4f369: the message says EN_STATUS (0x0a8) is "named in the camera HAL's register table", and the HAL isn't a source I can cite. If zuma-isp.dtsi, zuma-isp-event-info.dtsi or the LWIS headers name the register, please cite that. If not, say it was found by reading the block on the phone, which your 0x106/0x101 reads show anyway. That's a wording fix, and the reads stand either way.

Once #63 is merged, please rebase this onto omamobile (the rebase merge gives #63's commits new ids), and I'll merge it straight after.

W4HO-ham added a commit to W4HO-ham/linux-omarchy-mobile that referenced this pull request Nov 1, 2026
…s#63) into tegu-dt-cameras

Signed-off-by: W4HO <87742609+W4HO-ham@users.noreply.github.com>
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