Commit graph

1371 commits

Author SHA1 Message Date
Eileen Yoon
bf5a3a6e98 m1n1.fw.afk: Add more hello handlers used by aop
Signed-off-by: Eileen Yoon <eyn@gmx.com>
2024-10-31 01:24:36 +09:00
Eileen Yoon
eb3710edb1 experiments/dcp: Make dcp*.py scripts run again
Signed-off-by: Eileen Yoon <eyn@gmx.com>
2024-10-31 01:24:36 +09:00
Eileen Yoon
8fd1e4bef4 m1n1.adt: Parse aop audio pdm ratios
Signed-off-by: Eileen Yoon <eyn@gmx.com>
2024-10-31 01:24:36 +09:00
Eileen Yoon
0ac31ec584 m1n1.utils: Strip before splitting on chexundump()
Signed-off-by: Eileen Yoon <eyn@gmx.com>
2024-10-31 01:24:36 +09:00
Eileen Yoon
6e8d16aaa1 m1n1.fw.aop: Add aop client and ep boilerplate
Signed-off-by: Eileen Yoon <eyn@gmx.com>
2024-10-31 01:24:36 +09:00
Eileen Yoon
65501cdd70 m1n1.fw.aop: Fix 13.5 bootargs ABI break + rename
Move from __init__.py to base.py so it can be imported.

Signed-off-by: Eileen Yoon <eyn@gmx.com>
2024-10-31 01:24:36 +09:00
Christian Gmeiner
9d445d8291 hw/aes.py: Fix python error after 183991ca19
Fixes: 183991ca19 ("m1n1.hw.dart: Hide all DART variants behind common interface")
Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
2024-09-25 08:32:39 +09:00
Janne Grunau
5c8c3ccc7b m1n1: hv: Use Apple implementation specific ACTLR_EL12 on M1*
Fixes: 99571e5 ("hv: Use architectural ACTLR_EL12 on M2+")
Signed-off-by: Janne Grunau <j@jannau.net>
2024-09-25 08:22:45 +09:00
Asahi Lina
99571e5308 hv: Use architectural ACTLR_EL12 on M2+
Signed-off-by: Asahi Lina <lina@asahilina.net>
2024-09-22 01:09:43 +09:00
Hector Martin
94a6b50684 m1n1.find_regs: Fix register names
Signed-off-by: Hector Martin <marcan@marcan.st>
2024-08-11 20:21:21 +09:00
Asahi Lina
e41d51d222 m1n1.trace.agx: Decode VDM on G14X
Signed-off-by: Asahi Lina <lina@asahilina.net>
2024-06-15 16:46:04 +09:00
Asahi Lina
9d9bcd564c m1n1.proxyutils: Add v13_5
Signed-off-by: Asahi Lina <lina@asahilina.net>
2024-06-15 16:46:04 +09:00
Asahi Lina
52e1855c2a m1n1.trace.agx: Perfctr stuff
Signed-off-by: Asahi Lina <lina@asahilina.net>
2024-06-15 16:46:04 +09:00
Asahi Lina
c602bfd72e m1n1.constructutils: Don't spam
Signed-off-by: Asahi Lina <lina@asahilina.net>
2024-06-15 16:46:04 +09:00
Asahi Lina
97e27d8a11 m1n1.agx.initdata: Updates
Signed-off-by: Asahi Lina <lina@asahilina.net>
2024-06-15 16:46:04 +09:00
Asahi Lina
4d9ae1a907 m1n1.trace.agx: Helper stuff & misc fixes
Signed-off-by: Asahi Lina <lina@asahilina.net>
2024-06-15 16:46:04 +09:00
Asahi Lina
b50e29bcf6 m1n1.fw.agx: Helper and sampler stuff
Signed-off-by: Asahi Lina <lina@asahilina.net>
2024-06-15 16:46:04 +09:00
Hector Martin
ebec2d362d experiments/dmp.py: DMP/GoFetch bug test experiment
Signed-off-by: Hector Martin <marcan@marcan.st>
2024-04-09 11:06:46 +09:00
Hector Martin
af6ca83187 proxy: Add EL0 SMP ops
Signed-off-by: Hector Martin <marcan@marcan.st>
2024-04-09 09:20:40 +09:00
Eileen Yoon
3b9a71422e avd: Make experiment display an option
Signed-off-by: Eileen Yoon <eyn@gmx.com>
2024-01-11 16:20:49 +09:00
Eileen Yoon
16a6b41c98 m1n1/avd: Add initial AVD driver prototype/tracer
Not much to see here, most of the juice is over at:

    https://github.com/eiln/avd.git

The kernel driver (m1n1.fw.avd) only really pipes the instruction stream
into the respective hardware FIFOs and then hushes the interrupt lines.
Most of the work (bitstream syntax parsing and instruction generation)
is done in the avid repo above.

I'm hoping to keep this userland-kernel separation in the very imminent
actual driver.

experiments/avd.py: Decode on the command line. Read file for usage.
experiments/avd_e.py: Decode via emulated instruction stream.
experiments/avd_f.py: Decode via Cortex-M3 firmware (for debugging).
hv/trace_avd.py: Tracer. Read file for usage.
m1n1/fw/avd/__init__.py: Driver base class (power, tunables, etc).
m1n1/fw/avd/decoder.py: Codec-specific decode logic + mini media player.

Signed-off-by: Eileen Yoon <eyn@gmx.com>
2024-01-11 16:20:49 +09:00
Josh Soref
e52eaf4f43 Spelling fixes
Correct misspellings identified by the check-spelling action.

Signed-off-by: Josh Soref <jsoref@gmail.com>
2023-12-13 16:50:42 +09:00
Hector Martin
71125063e4 hv/trace_mtp.py: New experiment
Signed-off-by: Hector Martin <marcan@marcan.st>
2023-12-03 19:36:22 +09:00
Daniel Berlin
b50b17ceb5 Support non-constant unknown values in adt.py
On m3, these previouly expected-to-be-constant fields have exciting
non-constant values.  This updates adt.py to allow them to be
non-constant.  The second field is also really a flags field,
though i could not tell you all the flags involved.

Signed-off-by: Daniel Berlin <dberlin@dberlin.org>
2023-12-03 17:43:04 +09:00
Janne Grunau
736acde3e1 m1n1.fw.dcp.ipc: Add D592 - abort_swap_ap_gated
Also fixes a type for set_idle_caching_state_ap.

Signed-off-by: Janne Grunau <j@jannau.net>
2023-11-27 13:33:08 +09:00
Janne Grunau
2b92f4b1c3 hv/dcp: Add OOB ASYNC call context
Only observed with dcp/dptx in linux after initialisation and reset in
m1n1. On the initial startup dcp sends two D576 (hotPlug_notify_gated)
presumendly due to state confusion due to  the multiple dptx
connections.

Signed-off-by: Janne Grunau <j@jannau.net>
2023-11-27 13:33:08 +09:00
Daniel Berlin
b48c6d2ea4 Add ipython shell to proxyclient
Same functionality as the readline shell, but based on
ipython so that it has nicer help/autocomplete/etc

Signed-off-by: Daniel Berlin <dberlin@dberlin.org>
2023-11-27 13:30:27 +09:00
Alyssa Ross
93cce40476 m1n1.adt: introduce yet another DAPFT8110 variant
When I tried to use the proxyclient shell, I got:
"Exception parsing /device-tree/arm-io/dart-dcp.dapf-instance-0 value […]"

I laid out the hex dump in a text editor, and added line breaks every
56 bytes (the former size of DAPFT8110B):

0000703b020000000080713b0200000020000000000000000000000000000000000000000000000000000000000000000003010000000000
40723b020000000080723b020000002000000000000000000000000000000000000000000000000000000000000000000301000000000000
003b020000007f73073b02000000200000000000000000000000000000000000000000000000000000000000000000030100000000000028
3d020000000040283d020000002000000000000000000000000000000000000000000000000000000000000000000301000000000080003d
020000000380003d020000002000000000000000000000000000000000000000000000000000000000000000000301000000000000e03f02
000000ffffef3f0200000020000000000000000000000000000000000000000000000000000000000000000003010000000000c0403e0200
0000ffff403e020000002000000000000000000000000000000000000000000000000000000000000000000301000000000000433e020000
00ff3f433e020000002000000000000000000000000000000000000000000000000000000000000000000301000000000000783d02000000
03417a3d0200000020000000000000000000000000000000000000000000000000000000000000000003010000000000003c3b0200000000
003e3b020000002000000000000000000000000000000000000000000000000000000000000000000301000000000000403c02000000ffff
473c020000002000000000000000000000000000000000000000000000000000000000000000000301000000000000103c020000004f0c10
3c020000002000000000000000000000000000000000000000000000000000000000000000000301000000000000703d020000000341723d
02000000200000000000000000000000000000000000000000000000000000000000000000030100000000

Looking at the patterns shared by all struct instances
(r0h = 3, r0l = 1, for example), each row appeared to be shifted one
byte to the left compared to its predecessor.  This suggests that
DAPFT8110B has only three extra bytes of padding compared to
DAPFT8110.

So, here I introduce DAPFT8110C, a new variant, one byte shorter than
DAPFT8110B.  Unlike DAPFT8110, there's no flag to differentiate
between these two variants, so we just have to guess based on what
divisor makes whole structs.

Signed-off-by: Alyssa Ross <hi@alyssa.is>
2023-11-14 18:59:27 +09:00
Alyssa Ross
0d5454e235 m1n1.shell: carry on if saving history fails
This shouldn't crash the shell — it's enough to warn about it and
carry on.

Signed-off-by: Alyssa Ross <hi@alyssa.is>
2023-11-02 15:54:23 +09:00
Hector Martin
680f1c9bd9 run_guest_kernel: s/python/python3/
Signed-off-by: Hector Martin <marcan@marcan.st>
2023-10-12 02:47:07 +09:00
Asahi Lina
12ba00d98b m1n1.trace.dart: Add basic IOVA tracer
In the spirit of what we have for AGX, but simpler.

Signed-off-by: Asahi Lina <lina@asahilina.net>
2023-10-08 16:12:59 +09:00
Asahi Lina
23d4f99bb4 m1n1.trace.isp: t8112 etc changes
Signed-off-by: Asahi Lina <lina@asahilina.net>
2023-10-08 16:12:59 +09:00
Hector Martin
595ecb423a m1n1.adt: Fix the weird DAPF variant parsing
Looks like there is a flag bit for this...

Signed-off-by: Hector Martin <marcan@marcan.st>
2023-10-05 16:05:53 +09:00
Asahi Lina
5e2e537506 m1n1.adt: Add DAPF decoding
There's a weird thing with DCP DAPF entries being larger... but we don't
use them anyway?

Signed-off-by: Asahi Lina <lina@asahilina.net>
2023-10-05 14:21:13 +09:00
Asahi Lina
e1bb8e85a6 m1n1.adt: Fix dashes in __delattr__
Signed-off-by: Asahi Lina <lina@asahilina.net>
2023-10-05 14:21:13 +09:00
Asahi Lina
0e471529cc m1n1.trace.isp: Hexdump to HV log
Signed-off-by: Asahi Lina <lina@asahilina.net>
2023-10-05 14:21:13 +09:00
Asahi Lina
204f6b8189 m1n1.fw.isp: Fix message validity check
Signed-off-by: Asahi Lina <lina@asahilina.net>
2023-10-05 14:21:13 +09:00
Hector Martin
e378605d70 hv/trace_wlan.py: Backplane tracing & more
Signed-off-by: Hector Martin <marcan@marcan.st>
2023-10-05 14:11:59 +09:00
Hector Martin
11748d6261 m1n1.hv: Make xnu_mode reflect if we used a macho or not
Signed-off-by: Hector Martin <marcan@marcan.st>
2023-10-05 14:11:59 +09:00
Asahi Lina
0b1c9d98b7 m1n1.hw.dart8110: 4-level support
Signed-off-by: Asahi Lina <lina@asahilina.net>
2023-10-05 14:11:59 +09:00
Eileen Yoon
51b6dd8701 isp: Initial commit
Add initial stream demo + patched tracer

Signed-off-by: Eileen Yoon <eyn@gmx.com>
2023-10-05 14:02:49 +09:00
Janne Grunau
fb6e035950 hv/trace_dcp: Support commands with retcode only replies
Seen with the SetProperty command of DCP's system EP.

Signed-off-by: Janne Grunau <j@jannau.net>
2023-09-20 22:33:45 +09:00
Janne Grunau
ea5c9be657 hv/trace_dcp: simplify tracing of dcpext*
It's now enough to change the variable dcp_name to dcpext[0-7].
'dcpext' on t8103/t8112 is handled by "/aliases" in the ADT.

Signed-off-by: Janne Grunau <j@jannau.net>
2023-09-20 22:33:45 +09:00
Janne Grunau
c11632947b hv/trace_dcp: port dptxport commands to macos 13.5 fw
Signed-off-by: Janne Grunau <j@jannau.net>
2023-09-20 22:33:45 +09:00
Janne Grunau
161a96a06d hv/trace_dcp: extend tracing of ap_std_calls
Signed-off-by: Janne Grunau <j@jannau.net>
2023-09-20 22:33:45 +09:00
Janne Grunau
1b10a51a51 hv/trace_dcp.py: import firmware vesrions from the HV
Signed-off-by: Janne Grunau <j@jannau.net>
2023-09-20 22:33:45 +09:00
Janne Grunau
ea063b6534 hv/trace_dcp.py: more verbose logging of AFK/EPIC endpoints
Signed-off-by: Janne Grunau <j@jannau.net>
2023-09-20 22:33:45 +09:00
Janne Grunau
1d46073077 hv/trace_dcp: Use 'elif' instead of 'if'
Signed-off-by: Janne Grunau <j@jannau.net>
2023-09-20 22:33:45 +09:00
Janne Grunau
34b0204c27 proxy: hv: Add trace_dptx.py for tracing dptx-phy on j473/t8112
Signed-off-by: Janne Grunau <j@jannau.net>
2023-09-20 22:33:45 +09:00
Janne Grunau
303d08382c experiments/dcp: add system ep
Signed-off-by: Janne Grunau <j@jannau.net>
2023-09-20 22:33:45 +09:00