Commit graph

74 commits

Author SHA1 Message Date
Kellerman Rivero
404ab21fe4 hv/trace_isp.py: add ISP tracer
Image Signal Processor is a co-processor in charge of Facetime camera
in Apple laptops. This tracer is based on ISP found in M1 processor.

The ISP in M1 SoC exposes seven inter-process communication channels.
Using those channels Application Processor (AP) can perform a variety of
task in the ISP and viceversa. All channels seems to be bidirectional, with
unique exception of TERMINAL channel.

DART translation is used often to translate control structures passed
over IPC channels to IO virtual addresses.

How those channels are used is still unclear but tracer should allow us
to dive deep on high-level protocol to communicate with Facetime camera.
ISP exposes also some I2C peripheral and SPMI registers but I haven't
dive into their working or purpose.

Signed-off-by: Kellerman Rivero <krsloco@gmail.com>
2022-11-04 12:30:59 +09:00
Hector Martin
0fb9bf6c40 hv/trace_wlan.py: More WLAN tracer stuff
Signed-off-by: Hector Martin <marcan@marcan.st>
2022-10-23 17:22:14 +09:00
Sven Peter
ded7e58e90 trace_dcp: Add dcpdptx-hdcp-auth-session tracer
Signed-off-by: Sven Peter <sven@svenpeter.dev>
2022-09-28 01:21:23 +09:00
Sven Peter
c1e84bf79c trace_dcp: Add dcpav-controller-epic tracer
Signed-off-by: Sven Peter <sven@svenpeter.dev>
2022-09-28 01:21:23 +09:00
Sven Peter
c8d606e270 trace_dcp: Add dcpdp-device-epic tracer
Signed-off-by: Sven Peter <sven@svenpeter.dev>
2022-09-28 01:21:23 +09:00
Sven Peter
3e112460cd trace_dcp: Add dcpav-audio-interface-epic tracer
Signed-off-by: Sven Peter <sven@svenpeter.dev>
2022-09-28 01:21:23 +09:00
Sven Peter
f072434647 trace_dcp: Add dcpdptx-port-epic tracer
Signed-off-by: Sven Peter <sven@svenpeter.dev>
2022-09-28 01:21:23 +09:00
Sven Peter
da8a691023 trace_dcp: Rename EPIC endpoints
Signed-off-by: Sven Peter <sven@svenpeter.dev>
2022-09-28 01:21:23 +09:00
Sven Peter
f5ed6f89b0 trace_dcp: Add SilentEp to shut individual tracers up
Signed-off-by: Sven Peter <sven@svenpeter.dev>
2022-09-28 01:21:23 +09:00
Sven Peter
b5e16b2a67 trace_dcp: Add EPICServiceTracer
Signed-off-by: Sven Peter <sven@svenpeter.dev>
2022-09-28 01:21:23 +09:00
Sven Peter
e1ad6e7e90 trace_dcp: Allow to switch to dcpext
Signed-off-by: Sven Peter <sven@svenpeter.dev>
2022-09-28 01:21:23 +09:00
Asahi Lina
88603e153c hv/trace_agx_defer.py: Add another tracer variant
This one configures it to stop tracing after init, good for
self-contained tests

Signed-off-by: Asahi Lina <lina@asahilina.net>
2022-09-27 06:02:28 +09:00
Hector Martin
50f02bb58a hv/trace_wlan.py: Add WLAN tracer
Signed-off-by: Hector Martin <marcan@marcan.st>
2022-09-19 19:24:15 +09:00
Hector Martin
ddb3497794 hv/trace_codecs.py: Disable time stealing
Signed-off-by: Hector Martin <marcan@marcan.st>
2022-09-14 11:55:35 +09:00
Sven Peter
44781f2b72 proxyclient/trace_atc: Add dwc3 PIPEHANDLER regs
Signed-off-by: Sven Peter <sven@svenpeter.dev>
2022-08-30 22:31:36 +09:00
Sven Peter
236e01808e proxyclient/trace_atc: Change default settings
Trace async because we don't care about DMA buffers yet and disable
dwc3 tracing by default since that's relatively boring.

Signed-off-by: Sven Peter <sven@svenpeter.dev>
2022-08-30 22:31:36 +09:00
Sven Peter
0aa91e5b98 proxyclient/trace_atc: Add more ATCPHY registers
Signed-off-by: Sven Peter <sven@svenpeter.dev>
2022-08-30 22:31:36 +09:00
Sven Peter
443194a8cd proxyclient/trace_atc: Split register definitions from trace_atc.py
Signed-off-by: Sven Peter <sven@svenpeter.dev>
2022-08-30 22:31:36 +09:00
Asahi Lina
6a99f397de hv/trace_agx.py: Automatically set version
Signed-off-by: Asahi Lina <lina@asahilina.net>
2022-08-17 15:00:00 +09:00
Asahi Lina
f81bbcbd61 hv/trace_agx.py: Trace more/less things
Signed-off-by: Asahi Lina <lina@asahilina.net>
2022-08-17 15:00:00 +09:00
Hector Martin
8ae1d15fac hv/trace_pmgr.py: Tolerate missing pwrgate-regs
Signed-off-by: Hector Martin <marcan@marcan.st>
2022-07-12 13:08:16 +09:00
James Calligeros
a95c6d4de6 hv/trace_mesa: remove butchered tracer gore
Signed-off-by: James Calligeros <jcalligeros99@gmail.com>
2022-07-01 17:58:20 +09:00
James Calligeros
1e2c52b5b3 hv/trace_mesa: rename bindump of fingerprint transfer message
Signed-off-by: James Calligeros <jcalligeros99@gmail.com>
2022-07-01 17:58:20 +09:00
James Calligeros
1f21b6b7b8 hv/trace_mesa: tidy up output and trace SPI regs
We weren't tracing the SPI control registers before, and the output
was borked due to changes in m1n1. These have been fixed. Still
doesn't show much useful information..

Signed-off-by: James Calligeros <jcalligeros99@gmail.com>
2022-07-01 17:58:20 +09:00
James Calligeros
e2d671d597 hv/trace_mesa.py: add mesa tracer
Mesa is Apple's codename for the TouchID sensor. On M1-based
systems, it is connected to the SPI bus and communicates via
SIO on DMA channels 0x18 and 0x19. The application processors
seem to have very little to do with its operation.

After power on, the command buffer is encrypted by the SEP and
very little useful data can be gleaned from snooping the SIO
messages. While the commands are garbled by the SEP, we can see
that it has a few recurring themes:

* A power on routine involving some sort of calibration, perhaps
  to get a noise image to subtract from each fingerprint

* A polling mode where it is kicked by the kernel and acks if
  there's no finger on the sensor (runs while macOS waits for a
  print)

* A data transfer mode, where a SIO message is sent to an unmapped
  EP and the fingerprint scanned into memory. Likely triggered by
  an interrupt coming off the finger detection ring, but I haven't
  been able to verify this.

Signed-off-by: James Calligeros <jcalligeros99@gmail.com>
2022-06-21 17:22:16 +09:00
Martin Povišer
56d8de66db m1n1.hw.codecs.cs42l84: File the ohmmeter codec regmap
Move the regmap from experiments/ to a handier place. Also add the
codec to trace_codecs.py and codecshell.py.

Signed-off-by: Martin Povišer <povik@protonmail.com>
2022-06-21 17:20:30 +09:00
Martin Povišer
d358563d6c hv/trace_codecs.py: Trace volume/gain on speaker amps
Signed-off-by: Martin Povišer <povik@protonmail.com>
2022-06-21 17:20:30 +09:00
Janne Grunau
dc69227c96 hv/trace_nvme: Trace rtkit interface and remove hardcoded sart address
Signed-off-by: Janne Grunau <j@jannau.net>
2022-06-21 17:19:32 +09:00
Asahi Lina
5a8c54c762 hv/trace_agx.py: Encoder ID filter example
Signed-off-by: Asahi Lina <lina@asahilina.net>
2022-06-19 03:37:22 +09:00
Asahi Lina
c81df296c7 hv/trace_agx.py: Make untracing/tracing on reload less painful
Just use TraceMode.OFF instead of commenting lines out.

Also always trace the GPU panic register (TODO: do not hardcode)

Signed-off-by: Asahi Lina <lina@asahilina.net>
2022-06-02 23:51:14 +09:00
Hector Martin
eb4483f8e1 hv/trace_dcp.py: Log hexdumps to the HV log
Signed-off-by: Hector Martin <marcan@marcan.st>
2022-06-01 00:57:17 +09:00
Janne Grunau
8119130e88 hv/trace_dcp.py: update to mac OS 12.3 API
Verified calls A000 through A358 due to inconsistencies in the trace
log for A104 and A105.

Signed-off-by: Janne Grunau <j@jannau.net>
2022-05-30 22:49:00 +09:00
R
dd111b22b8 prores: test 36-bit iova; fix tracer
Signed-off-by: R <rqou@berkeley.edu>
2022-05-30 18:05:16 +09:00
R
66c019cfec prores: trace enough to dump some buffers
Signed-off-by: R <rqou@berkeley.edu>
2022-05-30 18:05:16 +09:00
R
3970b25add prores: start tracing descriptors
Signed-off-by: R <rqou@berkeley.edu>
2022-05-30 18:05:16 +09:00
Asahi Lina
a993f35874 hv/trace_agx.py: Add hypercalls for pause/resume, disable bulk tracers
Signed-off-by: Asahi Lina <lina@asahilina.net>
2022-05-21 03:54:12 +09:00
Asahi Lina
6b6dfde814 m1n1.fw.agx: Lots of GPU work
Signed-off-by: Asahi Lina <lina@asahilina.net>
2022-05-21 03:54:10 +09:00
Asahi Lina
08c34dbc37 hv/trace_agx.py: Reload some stuff
Signed-off-by: Asahi Lina <lina@asahilina.net>
2022-05-21 03:52:43 +09:00
Scott Mansell
980b9241d2 m1n1.trace.agx: Trace AGX wip
Signed-off-by: Scott Mansell <phiren@gmail.com>
2022-05-21 03:46:36 +09:00
Scott Mansell
254f01b3ea m1n1.proxyutils.RegMon: Allow custom read lambda
Useful for monitoring ranges beind an iommu

Signed-off-by: Scott Mansell <phiren@gmail.com>
2022-05-21 03:46:14 +09:00
R
4a09eca74a dart-t8110: Initial commit
Signed-off-by: R <rqou@berkeley.edu>
2022-04-16 19:24:00 +09:00
Janne Grunau
c2a48da4c1 m1n1.hv: Add trace script keyboard/trackpad
Input devices use HID over SPI. HID communication is obscured by "sio"
DMA.

Signed-off-by: Janne Grunau <j@jannau.net>
2022-03-11 12:06:01 +09:00
Janne Grunau
9c80a69266 m1n1.hv: Use dynamic pin maps in trace_gpio.py
Hardcoded pin maps do not make sense with additional HW support.
Allows tracing of a single pin in another tracing module, for example
for tracing the SPI cs pin.

Signed-off-by: Janne Grunau <j@jannau.net>
2022-03-11 12:06:01 +09:00
Janne Grunau
a57696366f hv/trace_dcp.py: Update to macOS 12.x API
DCP API seems to be mostly unchanged from 12 beta to 12.2.

Signed-off-by: Janne Grunau <j@jannau.net>
2022-02-24 23:55:46 +09:00
Hector Martin
a8a93a3b5f hv/trace_smc.py: Add GetKeyByIndex decoding
Signed-off-by: Hector Martin <marcan@marcan.st>
2022-02-15 14:05:13 +09:00
Hector Martin
434a3b6c78 hv/trace_smc.py: Support RW ops
Signed-off-by: Hector Martin <marcan@marcan.st>
2022-01-19 03:22:16 +09:00
Hector Martin
07c695926d hv/trace_dcp.py: Fix typo
Signed-off-by: Hector Martin <marcan@marcan.st>
2022-01-19 03:21:55 +09:00
Hector Martin
323e163eb4 hv/trace_dcp.py: Fix reinitialization
Signed-off-by: Hector Martin <marcan@marcan.st>
2022-01-17 04:42:00 +09:00
Hector Martin
17e0dfceab hv/trace_dcp.py: Add EPIC support and refactor
This now partially uses the scaffolding in m1n1.fw.afk.

Signed-off-by: Hector Martin <marcan@marcan.st>
2022-01-16 19:39:03 +09:00
Hector Martin
23b9b45040 hv/trace_all.py: Use async tracing by default
Signed-off-by: Hector Martin <marcan@marcan.st>
2022-01-16 19:39:03 +09:00