Commit graph

1878 commits

Author SHA1 Message Date
Asahi Lina
29ee0d5d32 m1n1.hv: Don't catch SystemExit from tracers/shells
Signed-off-by: Asahi Lina <lina@asahilina.net>
2022-12-04 13:15:55 +09:00
Asahi Lina
b4d5ff7520 m1n1.agx: Add printing IRQs
Signed-off-by: Asahi Lina <lina@asahilina.net>
2022-12-04 13:15:55 +09:00
Asahi Lina
2fe37d6dfa m1n1.fw.agx: Misc field renames & fixes
Signed-off-by: Asahi Lina <lina@asahilina.net>
2022-12-04 13:15:55 +09:00
Asahi Lina
b4a19572f2 m1n1.fw.agx.handoff: Add CUR_CTX field
Signed-off-by: Asahi Lina <lina@asahilina.net>
2022-12-04 13:15:55 +09:00
Asahi Lina
3aa2be6489 m1n1.hw.uat: Flushing cleanup
Signed-off-by: Asahi Lina <lina@asahilina.net>
2022-12-04 13:15:55 +09:00
Asahi Lina
4a6a4c0376 kboot: Add initial GPU property forwarding
Signed-off-by: Asahi Lina <lina@asahilina.net>
2022-12-04 13:15:55 +09:00
Asahi Lina
f92be5a076 experiments/agx_parallel.py: Uncomment some power-related tracers
Signed-off-by: Asahi Lina <lina@asahilina.net>
2022-12-04 13:15:55 +09:00
Asahi Lina
f6dad68156 m1n1.fw.agx.initdata: Disable KTrace by default
Signed-off-by: Asahi Lina <lina@asahilina.net>
2022-12-04 13:15:55 +09:00
Asahi Lina
20fce92280 m1n1.trace.agx: Disable some hex dumps
Signed-off-by: Asahi Lina <lina@asahilina.net>
2022-12-04 13:15:55 +09:00
Asahi Lina
b8bf3f485e m1n1.trace.agx: Various UAT related improvements
Signed-off-by: Asahi Lina <lina@asahilina.net>
2022-12-04 13:15:55 +09:00
Asahi Lina
a097e5b744 m1n1.trace.agx: Instantiate SGXRegs
Signed-off-by: Asahi Lina <lina@asahilina.net>
2022-12-04 13:15:55 +09:00
Asahi Lina
621e7b535a m1n1.fw.agx: Misc structure tweaks
Signed-off-by: Asahi Lina <lina@asahilina.net>
2022-12-04 13:15:55 +09:00
Asahi Lina
2978f246f2 m1n1.agx.render: PowerVR style tile param calculation
Also document some other registers

Signed-off-by: Asahi Lina <lina@asahilina.net>
2022-12-04 13:15:55 +09:00
Asahi Lina
c72b6ce98c m1n1.hv: Translate DC CIVAC argument if trapped
Signed-off-by: Asahi Lina <lina@asahilina.net>
2022-12-04 13:15:55 +09:00
Asahi Lina
633e551c2d m1n1.agx.object: Support reading back directly from physmem
Signed-off-by: Asahi Lina <lina@asahilina.net>
2022-12-04 13:15:55 +09:00
Asahi Lina
bc99d3411a m1n1.agx.context: Fix blocklist indexing
Signed-off-by: Asahi Lina <lina@asahilina.net>
2022-12-04 13:15:55 +09:00
Asahi Lina
5e39db820b m1n1.agx: Only try to decode fault if fault happened
Signed-off-by: Asahi Lina <lina@asahilina.net>
2022-12-04 13:15:55 +09:00
Asahi Lina
1f28498b0a m1n1.hw.agx: Export R_FAULT_INFO
Signed-off-by: Asahi Lina <lina@asahilina.net>
2022-12-04 13:15:55 +09:00
Asahi Lina
b8f9008953 m1n1.hw.uat: Show context ID in exceptions
Signed-off-by: Asahi Lina <lina@asahilina.net>
2022-12-04 13:15:55 +09:00
Asahi Lina
b04cc0c7c8 m1n1.hw.uat: Document attribute indexes
Signed-off-by: Asahi Lina <lina@asahilina.net>
2022-12-04 13:15:55 +09:00
Asahi Lina
6a0008884d m1n1.agx: Add an initdata hook
Signed-off-by: Asahi Lina <lina@asahilina.net>
2022-12-04 13:15:55 +09:00
Hector Martin
9e2eeeb911 hv/trace_pmgr.py: Get rid of pwrgate stuff
It's broken

Signed-off-by: Hector Martin <marcan@marcan.st>
2022-12-04 13:10:59 +09:00
Janne Grunau
71baff4adc experiments/dcp.py: Set the display with surface swap
Needs testing on DP/HDMI outputs.

Signed-off-by: Janne Grunau <j@jannau.net>
2022-11-29 01:36:14 +09:00
Janne Grunau
7d9608adc4 m1n1.fw.dcp.manager: Add backlight callbacks
DCP reports the display brightness with
PropRelay::pr_publish(prop_id=15, value=...). The value divided by
"Brightness_scale" appears to be the display brightness in nits.
Add other callbacks encountered on j314c.

Signed-off-by: Janne Grunau <j@jannau.net>
2022-11-29 01:36:14 +09:00
Janne Grunau
6aa1da3c31 m1n1.fw.dcp.ipc: Annotate backlight fields in swap_rec
Allows brightness control of integrated displays.

Signed-off-by: Janne Grunau <j@jannau.net>
2022-11-29 01:36:14 +09:00
Janne Grunau
98e8e48171 experiments/dcp.py: Add set_digital_out_mode call
Initializes the display if not already done by iboot/m1n1. Not expected
to change anything for disp0 but might be helful in bringing DP alt
mode for dispexp[0-7].

Signed-off-by: Janne Grunau <j@jannau.net>
2022-11-29 01:36:14 +09:00
Janne Grunau
053eb7bfda experiments/dcp.py: Handle external displays correctly
Pass disp0's comaptible string to DCPManager.
Fixes Mac Studio and M1 Macbook handling.

Signed-off-by: Janne Grunau <j@jannau.net>
2022-11-29 01:36:14 +09:00
Janne Grunau
452a3243c0 m1n1.fw.dcp.manager: Add SetDigitalOutMode convenience function
This prints the selected modes. In addition omits printing the whole
DCPAVProps.

Signed-off-by: Janne Grunau <j@jannau.net>
2022-11-29 01:36:14 +09:00
Janne Grunau
dc3397888d m1n1.fw.dcp.manager: Add update_backlight_factor_prop call back
Signed-off-by: Janne Grunau <j@jannau.net>
2022-11-29 01:36:14 +09:00
Janne Grunau
aa7088f3fb m1n1.fw.dcp.manager: Support 't600x' in rt_bandwidth_setup_ap
Signed-off-by: Janne Grunau <j@jannau.net>
2022-11-29 01:36:14 +09:00
Janne Grunau
e91cc63708 m1n1.fw.dcp.manager: Fix swap_complete_intent_gated after fb49d88d90
Signed-off-by: Janne Grunau <j@jannau.net>
2022-11-29 01:36:14 +09:00
Janne Grunau
0aafd74b69 kboot: Transfer display memory carveouts for M2
Signed-off-by: Janne Grunau <j@jannau.net>
2022-11-29 01:33:30 +09:00
Janne Grunau
a954eb47f9 dart: Support locking dart-t8110
Signed-off-by: Janne Grunau <j@jannau.net>
2022-11-29 01:33:30 +09:00
Janne Grunau
ba1dfab4d2 kboot: Enable dart-disp0 as part of the display setup
Devicetrees with dart-disp0 will have it disabled to avoid breaking
scanout off the boot framebuffer when booting via m1n1 version which
does not lock dart-disp0.

Signed-off-by: Janne Grunau <j@jannau.net>
2022-11-15 17:52:16 +09:00
Martin Povišer
de0c0323a5 experiments/mmio_sweep.py: Patch in AOP power-domains on t6000
The ADT lacks some of the info on AOP power domains on t6000, so fill
that in manually.

Signed-off-by: Martin Povišer <povik@protonmail.com>
2022-11-04 12:36:49 +09:00
Martin Povišer
fc66046d76 experiments/aop.py: Extend AOP experiment, add tracer
The AOP uses an 'EPIC' protocol similar to the one other coprocessor
firmware is using but not in the exact same version. Add code for
tracing the AOP calls and extend the aop.py experiment with the client
side of it. Include description of audio calls and some other calls
related to sensor discovery.

Furthermore, in experiments/aop.py, do some AOP audio setup. Once that
is done we can start streaming samples from the internal microphones by
making what AOP considers power state adjustment calls. That is, we
adjust the power state of a 'hpai' device, first to a 'pw1 ' stage,
then to 'pwrd' stage.

So, to see microphone samples, enter the AOP experiment shell first:

  $ M1N1DEVICE=/dev/ttyACM0 experiments/aop.py

Within the shell, adjust the power state of 'hpai':

  >>> aop_set_audio_pstate('hpai', 'pw1 ')

At that point /arm-io/admac-aop-audio powers up. In parallel to the AOP
shell, we can start tools/admac_stream.py on the just powered-up ADMAC
instance:

  $ M1N1HEAP=0x10010000000 M1N1DEVICE=/dev/ttyACM1 tools/admac_stream.py \
        --node admac-aop-audio --channel 1 -v | xxd -g 4 -c 12 -e

Returning back to the AOP shell, we can then set 'hpai' to 'pwrd' state
to kick off the streaming:

  >>> aop_set_audio_pstate('hpai', 'pwrd')

By that point, we should see samples coming out on the ADMAC end. The
samples are 32-bit floats packed in groups of three in a frame, e.g.

00000000: ba7ac6a7 ba32d3c3 baa17ae2  ..z...2..z..
0000000c: 38ccea5f b99c1a37 ba0c4bb1  _..87....K..
00000018: 39d2354f 3964b5ff 39b209fb  O5.9..d9...9
00000024: b96a1d1f 39c8503f 3958fc4f  ..j.?P.9O.X9
00000030: b6b1f5ff 39c72b8f 39bbe017  .....+.9...9
0000003c: 3a912de5 36dd4f7f 37f1147f  .-.:.O.6...7

This has been tested and will to some degree be specific to 2021 Macbook
Pro (t6000). Differences on other models TBD (at the very least the
number of microphones can be presumed different).

Signed-off-by: Martin Povišer <povik@protonmail.com>
2022-11-04 12:36:49 +09:00
Martin Povišer
a8ef753520 m1n1.fw.aop: In AOPBase only refer to ProxyUtils attribute
Signed-off-by: Martin Povišer <povik@protonmail.com>
2022-11-04 12:36:49 +09:00
Martin Povišer
abd0c2ac3c m1n1.fw.aop: Tweak bootargs diff format
Signed-off-by: Martin Povišer <povik@protonmail.com>
2022-11-04 12:36:49 +09:00
Martin Povišer
2bacc044e8 m1n1.fw.aop: Move bootargs helpers to new class AOPBase
The new class can possibly be shared between the m1n1 AOP tracer and
AOP client.

Signed-off-by: Martin Povišer <povik@protonmail.com>
2022-11-04 12:36:49 +09:00
Martin Povišer
6ad59beb0c experiments/aop.py: Allocate oslog buffer on request
We need to allocate a buffer for the AOP on the OSLog endpoint for it to
fully boot. Copy in a modified version of the general OSLog endpoint
driver to do that.

Signed-off-by: Martin Povišer <povik@protonmail.com>
2022-11-04 12:36:49 +09:00
Martin Povišer
f87d65a971 experiments/aop.py: Make _bootargs_span a property
Signed-off-by: Martin Povišer <povik@protonmail.com>
2022-11-04 12:36:49 +09:00
Martin Povišer
1d2a157fe8 m1n1.fw.aop: Split off ASCArgumentSection from experiments/aop.py
Signed-off-by: Martin Povišer <povik@protonmail.com>
2022-11-04 12:36:49 +09:00
Martin Povišer
79890a15d6 experiments/aop.py: Work around ADT inconsistencies
In t6000 ADT, the AOP SRAM base is specified *including* the bus offset
where the bus offset isn't expected, so our decoding of it includes the
bus offset twice. Patch it.

Signed-off-by: Martin Povišer <povik@protonmail.com>
2022-11-04 12:36:49 +09:00
Martin Povišer
b6ae985377 m1n1.fw.afk: Accept AOP buffer magic
Signed-off-by: Martin Povišer <povik@protonmail.com>
2022-11-04 12:36:49 +09:00
Martin Povišer
8347301eff m1n1.hw.adt: Add prop parsing rules related to AOP audio
We need to adapt the prop-parsing logic to give precedence to path
matching over name matching, since otherwise the audio-* rule (which is
already in the list) catches (...)/aop-audio/audio-pdm2. We want that
to fall under *aop-audio* rule instead.

Signed-off-by: Martin Povišer <povik@protonmail.com>
2022-11-04 12:36:49 +09:00
Martin Povišer
fcf6170a9f m1n1.proxyutils: Accept M1N1HEAP environment variable
Let user override the proxyutils heap base for concurrent running of two
proxyclient sessions.

Signed-off-by: Martin Povišer <povik@protonmail.com>
2022-11-04 12:36:49 +09:00
Martin Povišer
d735d6ad49 m1n1.hw.dart: Pass in kwargs arguments of from_adt()
Signed-off-by: Martin Povišer <povik@protonmail.com>
2022-11-04 12:36:49 +09:00
Martin Povišer
9a93d5c307 m1n1.trace: Drop stale super().__init__() call
The Reloadable parent doesn't have an __init__ method, so calling the
super may call at unexpected places in richer inheritance hierarchies.

Signed-off-by: Martin Povišer <povik@protonmail.com>
2022-11-04 12:36:49 +09:00
Martin Povišer
c5e80f0d5a m1n1.fw.afk: Fix TX/RX_BUFSIZE confusion
Signed-off-by: Martin Povišer <povik@protonmail.com>
2022-11-04 12:36:49 +09:00
Martin Povišer
ce517b10a3 tools/admac_stream.py: Add tool for engaging ADMAC
Signed-off-by: Martin Povišer <povik@protonmail.com>
2022-11-04 12:36:49 +09:00