Commit graph

936 commits

Author SHA1 Message Date
Asahi Lina
85e6208a79 m1n1.agx.shim: Move UAPI to m1n1.agx.uapi
Signed-off-by: Asahi Lina <lina@asahilina.net>
2022-08-17 13:42:59 +09:00
Asahi Lina
5eeed0a8bd m1n1.hw.uat: Add stream field to control whether to parse recursively
Signed-off-by: Asahi Lina <lina@asahilina.net>
2022-08-17 13:42:59 +09:00
Asahi Lina
8c0b6453f4 m1n1.trace.agx: Disable mon for now
Signed-off-by: Asahi Lina <lina@asahilina.net>
2022-08-17 13:42:59 +09:00
Asahi Lina
6b0f600a33 m1n1.trace.agx: Update for initdata changes
Signed-off-by: Asahi Lina <lina@asahilina.net>
2022-08-17 13:42:59 +09:00
Asahi Lina
277b840a86 m1n1.trace.agx: Log less
Signed-off-by: Asahi Lina <lina@asahilina.net>
2022-08-17 13:42:59 +09:00
Asahi Lina
08c7473c9a m1n1.trace.agx: Add redump and trace_userva options
Signed-off-by: Asahi Lina <lina@asahilina.net>
2022-08-17 13:42:59 +09:00
Asahi Lina
1f895e1ad2 m1n1.agx: Add timeout handler
Signed-off-by: Asahi Lina <lina@asahilina.net>
2022-08-17 13:42:59 +09:00
Asahi Lina
1c1331a28d m1n1.agx: Map all structs as shared for now
This makes it easier to snoop on what the GPU is doing...

Signed-off-by: Asahi Lina <lina@asahilina.net>
2022-08-17 13:42:59 +09:00
Asahi Lina
3182be4fc3 m1n1.agx: Correctly map RX channels as RX
Signed-off-by: Asahi Lina <lina@asahilina.net>
2022-08-17 13:42:59 +09:00
Asahi Lina
3ff716d321 m1n1.agx: Support tracking/diffing objects
Signed-off-by: Asahi Lina <lina@asahilina.net>
2022-08-17 13:42:59 +09:00
Asahi Lina
1e7805284c m1n1.fw.agx.initdata: Lots of fixes/updates and new fields...
Signed-off-by: Asahi Lina <lina@asahilina.net>
2022-08-17 13:42:59 +09:00
Asahi Lina
4b9bda904d m1n1.constructutils: Support loading to/from JSON
Signed-off-by: Asahi Lina <lina@asahilina.net>
2022-08-17 13:42:59 +09:00
Asahi Lina
6fad479e08 m1n1.constructutils: Add addrof()
Signed-off-by: Asahi Lina <lina@asahilina.net>
2022-08-17 13:42:59 +09:00
Asahi Lina
1fcfa3d0e3 m1n1.constructutils: Optionally do not recurse through pointers
Signed-off-by: Asahi Lina <lina@asahilina.net>
2022-08-17 13:42:59 +09:00
Asahi Lina
203c0135e7 m1n1.construcutils: Correctly set address of structs in lists
Signed-off-by: Asahi Lina <lina@asahilina.net>
2022-08-17 13:42:59 +09:00
Asahi Lina
42af4319de m1n1.constructutils: Add struct diffing feature
Signed-off-by: Asahi Lina <lina@asahilina.net>
2022-08-17 13:42:59 +09:00
Asahi Lina
2d1151041f m1n1.constructutils: Keep a global addr->struct map
This allows easily identifying pointers to the beginning of structs.

Signed-off-by: Asahi Lina <lina@asahilina.net>
2022-08-17 13:42:59 +09:00
Asahi Lina
9a94937e3f m1n1.constructutils: Add SPDX header, move imports
Signed-off-by: Asahi Lina <lina@asahilina.net>
2022-08-17 13:42:59 +09:00
Asahi Lina
ee59dec6e5 m1n1.gpiola: Support explicitly telling the LA thread to exit
Also misc fixes.

Signed-off-by: Asahi Lina <lina@asahilina.net>
2022-08-17 13:42:59 +09:00
Asahi Lina
c7254865c0 m1n1.proxy: s/ic_ivac/dc_ivac/
This was a typo...

Signed-off-by: Asahi Lina <lina@asahilina.net>
2022-08-17 13:42:59 +09:00
Asahi Lina
894f9726e1 m1n1.proxyutils: Switch RegMonitor to use chexdiff32()
Signed-off-by: Asahi Lina <lina@asahilina.net>
2022-08-17 13:42:59 +09:00
Asahi Lina
eedaf2941a m1n1.setup: Always reset PMU boot error counters
Signed-off-by: Asahi Lina <lina@asahilina.net>
2022-08-17 13:42:59 +09:00
Asahi Lina
9a39bf15ef m1n1.utils: Add chexdiff32()
Signed-off-by: Asahi Lina <lina@asahilina.net>
2022-08-17 13:13:34 +09:00
Asahi Lina
af3814c56d m1n1.gpiola: Support reg/RAM-only tracing properly
This also implements compression for reg-only tracing properly.
TODO: should probably change the logic for when both pin and reg change
detection are active.

Signed-off-by: Asahi Lina <lina@asahilina.net>
2022-08-05 15:26:05 +09:00
Hector Martin
f09c10b5fa tools/run_guest_kernel.sh: Fix initramfs support
Signed-off-by: Hector Martin <marcan@marcan.st>
2022-07-30 15:59:21 +09:00
Hector Martin
4f0be4aa2c m1n1.hv: Add ctx shell alias for context.
Signed-off-by: Hector Martin <marcan@marcan.st>
2022-07-30 15:12:55 +09:00
Hector Martin
72cce09c77 m1n1.hv: Improve context printout
Make the addresses virtual, add symbols

Signed-off-by: Hector Martin <marcan@marcan.st>
2022-07-30 15:12:55 +09:00
Hector Martin
12bff05700 tools/run_guest_kernel.sh: New utility script
Signed-off-by: Hector Martin <marcan@marcan.st>
2022-07-30 15:12:55 +09:00
Hector Martin
659093b8bb scripts/picocom-sec.sh: Add convenience script
Signed-off-by: Hector Martin <marcan@marcan.st>
2022-07-30 15:12:55 +09:00
Hector Martin
1247c2b7e4 m1n1.proxy: Default to /dev/m1n1
We have udev rules, let's just default to a pretty device name to avoid
conflicts with other devices.

Signed-off-by: Hector Martin <marcan@marcan.st>
2022-07-30 14:18:39 +09:00
amarioguy
0cf1f393ed Add raw binary support to HV scripts
Signed-off-by: amarioguy <arminders208@outlook.com>
2022-07-30 14:18:39 +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
Hector Martin
c6e95657c3 experiments/mtp.py: Dump info
Signed-off-by: Hector Martin <marcan@marcan.st>
2022-07-11 20:14:48 +09:00
Hector Martin
94a115800a m1n1.hw.dart: Support sub-instances
Signed-off-by: Hector Martin <marcan@marcan.st>
2022-07-11 19:56:16 +09:00
Hector Martin
ad6b340a3b experiments/mtp.py: Update to use client
Signed-off-by: Hector Martin <marcan@marcan.st>
2022-07-11 19:02:21 +09:00
Hector Martin
e2e093b66c m1n1.hw.asc: Add .work_pending() and .has_messages()
Signed-off-by: Hector Martin <marcan@marcan.st>
2022-07-11 19:02:21 +09:00
Hector Martin
0b509daa47 m1n1.constructutils: Handle variable-length tail structs nicely
Signed-off-by: Hector Martin <marcan@marcan.st>
2022-07-11 19:02:21 +09:00
Hector Martin
60c523d1a6 m1n1.fw.mtp: MTP client module
Signed-off-by: Hector Martin <marcan@marcan.st>
2022-07-11 19:02:21 +09:00
Hector Martin
adae2516fe m1n1.trace.dockchannel: Add DockChannel tracer
Signed-off-by: Hector Martin <marcan@marcan.st>
2022-07-11 19:02:21 +09:00
Hector Martin
4d688062db experiments/mtp.py: New experiment
Signed-off-by: Hector Martin <marcan@marcan.st>
2022-07-11 19:02:21 +09:00
Hector Martin
1526560bd9 m1n1.hw.dockchannel: New module
Signed-off-by: Hector Martin <marcan@marcan.st>
2022-07-11 19:02:21 +09:00
Hector Martin
6075388d31 tools/dump_pmgr.py: Do not dump pwrgate regs
These are gone in newer ADTs

Signed-off-by: Hector Martin <marcan@marcan.st>
2022-07-11 19:02:21 +09:00
Hector Martin
b02eed81f0 m1n1.shell: Add poll_func hook
Signed-off-by: Hector Martin <marcan@marcan.st>
2022-07-11 19:02:21 +09:00
Hector Martin
5921631f28 m1n1.setup: Always clear PMU counters
Signed-off-by: Hector Martin <marcan@marcan.st>
2022-07-11 19:02:21 +09:00
Hector Martin
b6f358021c m1n1.hw.dart8110: Pass kwargs through from_adt()
Signed-off-by: Hector Martin <marcan@marcan.st>
2022-07-11 19:02:21 +09:00
Hector Martin
4d8065807c m1n1.fw.asc: Make startup/shutdown more proper
Signed-off-by: Hector Martin <marcan@marcan.st>
2022-07-11 19:02:21 +09:00
Hector Martin
615878ce68 m1n1.fw.asc: Support setting DART stream and allow physmem passthrough
Signed-off-by: Hector Martin <marcan@marcan.st>
2022-07-11 19:02:21 +09:00
Hector Martin
4555cc5148 dapf: Initialize DAPFs from the ADT
Signed-off-by: Hector Martin <marcan@marcan.st>
2022-07-03 23:27:50 +09:00
Hector Martin
eb4fa83bbc m1n1.hw.spmi: Add some more register defs
Signed-off-by: Hector Martin <marcan@marcan.st>
2022-07-02 00:29:08 +09:00
Hector Martin
4f0c712e16 m1n1.hw.pmu: Don't hardcode PMU address
Signed-off-by: Hector Martin <marcan@marcan.st>
2022-07-02 00:28:55 +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
Hector Martin
1b8c422202 m1n1.hw.dart8110: Misc fixes
Signed-off-by: Hector Martin <marcan@marcan.st>
2022-06-28 01:47:02 +09:00
Hector Martin
fa4aedefdb m1n1.hv: Support t8112 cpustart offset
Signed-off-by: Hector Martin <marcan@marcan.st>
2022-06-28 01:47:02 +09:00
Hector Martin
4856e37a79 experiments/cpu_pstate_latencies.py: Support t8112
Signed-off-by: Hector Martin <marcan@marcan.st>
2022-06-28 01:47:02 +09:00
Hector Martin
efc83f61da m1n1.proxyutils: Add a flag for MMU-less mode
Signed-off-by: Hector Martin <marcan@marcan.st>
2022-06-28 01:41:24 +09:00
Hector Martin
6f52823441 m1n1.hw.dart8110: Support multiple instances
Signed-off-by: Hector Martin <marcan@marcan.st>
2022-06-28 01:41:24 +09:00
Hector Martin
55ccea6a2d m1n1.hw.dart8110: Use 32-bit IOVA space by default
Signed-off-by: Hector Martin <marcan@marcan.st>
2022-06-28 01:41:24 +09:00
Hector Martin
f3f883c2fc m1n1.adt: Match PMU properties properly for t8112
Apple changed the node name...

Signed-off-by: Hector Martin <marcan@marcan.st>
2022-06-28 01:41:24 +09:00
Hector Martin
96f59e6322 proxyclient/experiments/aes.py: Add t8110 DART support
Signed-off-by: Hector Martin <marcan@marcan.st>
2022-06-28 01:41:24 +09:00
Hector Martin
b077c08181 dart: Add dart,t8110 support
Signed-off-by: Hector Martin <marcan@marcan.st>
2022-06-28 01:41:24 +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
e2065decbe m1n1.trace.i2c: Clean up handling of page/immediate split
Also fix detection of read being a read of the page control register.

Signed-off-by: Martin Povišer <povik@protonmail.com>
2022-06-21 17:20:30 +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
0da13afda8 tools/codecshell.py: Add codec-poking shell
Signed-off-by: Martin Povišer <povik@protonmail.com>
2022-06-21 17:20:30 +09:00
Martin Povišer
a8bc1bc3f2 m1n1.hw.i2c: Add I2CRegMapDev base class
Signed-off-by: Martin Povišer <povik@protonmail.com>
2022-06-21 17:20:30 +09:00
Martin Povišer
46a5e0450c experiments/ohmmeter.py: Fill missing definitions
Fill in missing headset-interface-related registers into the regmap,
mostly by analogy with CS42L42.

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
Martin Povišer
97d0130bcc m1n1.trace.i2c: Extend device tracing
Start new class I2CRegMapTracer to trace register accesses on devices
with the usual paged register maps.

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
512982f4aa m1n1.agx.shim: New module
Signed-off-by: Asahi Lina <lina@asahilina.net>
2022-06-19 03:54:31 +09:00
Asahi Lina
51abb9082e m1n1.agx.render: New module
Signed-off-by: Asahi Lina <lina@asahilina.net>
2022-06-19 03:54:31 +09:00
Asahi Lina
2ffc9fb166 m1n1.agx.event: Add a new event manager class
Signed-off-by: Asahi Lina <lina@asahilina.net>
2022-06-19 03:54:31 +09:00
Asahi Lina
31dfb0c071 m1n1.agx.context: Add a pipeline object allocator
Signed-off-by: Asahi Lina <lina@asahilina.net>
2022-06-19 03:54:31 +09:00
Asahi Lina
9688aeb52c m1n1.agx: Handle faults
Signed-off-by: Asahi Lina <lina@asahilina.net>
2022-06-19 03:54:31 +09:00
Asahi Lina
b10a56f1ff m1n1.agx: Poll syslog channels first
This gets us the syslogs caused by a fault before the actual fault
raises an exception

Signed-off-by: Asahi Lina <lina@asahilina.net>
2022-06-19 03:54:31 +09:00
Asahi Lina
f829afcf80 m1n1.agx: Logging updates
Signed-off-by: Asahi Lina <lina@asahilina.net>
2022-06-19 03:54:31 +09:00
Asahi Lina
610f3e6a11 m1n1.agx.object: Support deallocation
Signed-off-by: Asahi Lina <lina@asahilina.net>
2022-06-19 03:54:31 +09:00
Asahi Lina
3fa3b5abd3 m1n1.agx.object: Support making mon tracking, align to end optional
Signed-off-by: Asahi Lina <lina@asahilina.net>
2022-06-19 03:54:31 +09:00
Asahi Lina
17142da838 m1n1.agx.object: Support setting guard page count
Signed-off-by: Asahi Lina <lina@asahilina.net>
2022-06-19 03:54:31 +09:00
Asahi Lina
6ce60e875c m1n1.agx.object: Be more efficient for pushes, verbose control
- Support compression
- Avoid pushing objects which haven't changed (optionally)

Signed-off-by: Asahi Lina <lina@asahilina.net>
2022-06-19 03:54:31 +09:00
Asahi Lina
f19625f8da m1n1.fw.agx: Disable some prints
Signed-off-by: Asahi Lina <lina@asahilina.net>
2022-06-19 03:54:31 +09:00
Asahi Lina
cd1803f6dc experiments/agx_1tri.py: Update for bunny frame, new structs
This will be obsolete soon anyway, but for now it runs...

Signed-off-by: Asahi Lina <lina@asahilina.net>
2022-06-19 03:54:28 +09:00
Asahi Lina
39f9844431 m1n1.fw.agx: Lots more structure updates / renames
Signed-off-by: Asahi Lina <lina@asahilina.net>
2022-06-19 03:54:22 +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
c34e9f95af m1n1.hw.uat: Do not always flush PTs, except for the internal allocator
This optimizes GPU submissions since the PTs can be flushed just once,
instead of for every UAT manipulation. But we need to flush for the
internal allocator since it is used by RTKit stuff that does not know
how to flush.

Signed-off-by: Asahi Lina <lina@asahilina.net>
2022-06-19 03:37:22 +09:00
Asahi Lina
0c9d64b80c m1n1.proxyutils: Improve compressed_writemem
Make progress arg optional, reduce compression. Spending more time on
gzip does not help speed things up (at least with USB).

Signed-off-by: Asahi Lina <lina@asahilina.net>
2022-06-19 03:37:22 +09:00
Asahi Lina
3de894576c m1n1.trace.agx: Do not pause after init by default
Signed-off-by: Asahi Lina <lina@asahilina.net>
2022-06-19 03:37:22 +09:00
Asahi Lina
2ecbe6f39b m1n1.trace.agx: Monitor some more initdata-referenced areas
Signed-off-by: Asahi Lina <lina@asahilina.net>
2022-06-19 03:37:22 +09:00
Asahi Lina
6335e20fae m1n1.trace.agx: Disable dumping some structures we know about
Signed-off-by: Asahi Lina <lina@asahilina.net>
2022-06-19 03:37:22 +09:00
Asahi Lina
129726ddbc m1n1.trace.agx: Add support for filtering by encoder ID
Signed-off-by: Asahi Lina <lina@asahilina.net>
2022-06-19 01:41:51 +09:00
Asahi Lina
5d245d6ba5 m1n1.utils: Support setting stride in chexdump()
Signed-off-by: Asahi Lina <lina@asahilina.net>
2022-06-19 01:36:56 +09:00
Asahi Lina
ffe2f4104e fb: Support XBGR pixel format for fb_blit()
Signed-off-by: Asahi Lina <lina@asahilina.net>
2022-06-19 01:36:41 +09:00
Asahi Lina
2d317ee515 m1n1/fw/agx/controllist.py: Improve tiler params struct
Signed-off-by: Asahi Lina <lina@asahilina.net>
2022-06-07 01:50:44 +09:00
Asahi Lina
72892e0b95 experiments/agx_1tri.py: Update magic addresses for flag demo
Signed-off-by: Asahi Lina <lina@asahilina.net>
2022-06-06 23:37:42 +09:00
Asahi Lina
a2affd834b m1n1.agx.context: Support passing block count to GPUBufferManager
Signed-off-by: Asahi Lina <lina@asahilina.net>
2022-06-06 23:37:42 +09:00
Asahi Lina
ff7a145d6f m1n1.agx.context: Support tracking userspace objects
Signed-off-by: Asahi Lina <lina@asahilina.net>
2022-06-06 23:37:42 +09:00
Asahi Lina
f7fe615251 m1n1.agx.context: Fix allocator protocol
.ctx needed for agx.reg_object() to work.

Signed-off-by: Asahi Lina <lina@asahilina.net>
2022-06-06 23:37:42 +09:00
Asahi Lina
f6db8502d1 m1n1.agx.object: Allow aligning VAs properly
Signed-off-by: Asahi Lina <lina@asahilina.net>
2022-06-06 23:37:42 +09:00