Commit graph

1783 commits

Author SHA1 Message Date
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
Martin Povišer
8ff430aefa m1n1.hw.admac: Add CHAN_SRAM_CARVEOUT registers
The new registers contain SRAM limits allocated to each channel.

Signed-off-by: Martin Povišer <povik@protonmail.com>
2022-11-04 12:36:49 +09:00
Martin Povišer
1836913ef6 m1n1.utils: Accept 'base' in chexundump
Signed-off-by: Martin Povišer <povik@protonmail.com>
2022-11-04 12:36:49 +09:00
Martin Povišer
e03603df35 m1n1.utils: Skip empty lines on chexundump input
Signed-off-by: Martin Povišer <povik@protonmail.com>
2022-11-04 12:36:49 +09:00
Martin Povišer
f83af93c05 m1n1.utils: Fix chexundump exception
Signed-off-by: Martin Povišer <povik@protonmail.com>
2022-11-04 12:36:49 +09:00
R
9a23d55b83 scaler: Can scale W larger
Signed-off-by: R <rqou@berkeley.edu>
2022-11-04 12:32:23 +09:00
R
642f3af5e8 scaler: Basic scaling kinda works
Signed-off-by: R <rqou@berkeley.edu>
2022-11-04 12:32:23 +09:00
R
fc6378a86a scaler: Imports from RE
Signed-off-by: R <rqou@berkeley.edu>
2022-11-04 12:32:23 +09:00
R
8cea72dfab scaler: clarify flip/rotate
Signed-off-by: R <rqou@berkeley.edu>
2022-11-04 12:32:23 +09:00
R
a10865bf11 scaler: Understand most basic of w/h
Signed-off-by: R <rqou@berkeley.edu>
2022-11-04 12:32:23 +09:00
R
31c80bca04 scaler: work out flip/rotate
Signed-off-by: R <rqou@berkeley.edu>
2022-11-04 12:32:23 +09:00
R
7559de8705 scaler: Can copy data without changing
Signed-off-by: R <rqou@berkeley.edu>
2022-11-04 12:32:23 +09:00
R
84e13c7967 scaler: add some unknown regs near the start
Signed-off-by: R <rqou@berkeley.edu>
2022-11-04 12:32:23 +09:00
R
784febab4c scaler: initial commit
Signed-off-by: R <rqou@berkeley.edu>
2022-11-04 12:32:23 +09:00
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
Sven Peter
aa3ce98a53 m1n1.hw.atc: Add more registers
Signed-off-by: Sven Peter <sven@svenpeter.dev>
2022-10-31 18:22:46 +09:00
Janne Grunau
0bb521c2c3 kboot: Save notch height in dcp node
DCP will use this information to provide "notch-less" display modes.

Signed-off-by: Janne Grunau <j@jannau.net>
2022-10-26 01:22:00 +09:00
Janne Grunau
53e6254497 kboot: Skip over missing dcp aliases
Prevents failing on non-existant carveout regions from the M1 Ultra on
M1 Pro/Max.

Signed-off-by: Janne Grunau <j@jannau.net>
2022-10-26 01:22:00 +09:00
Hector Martin
aa0a3e6fcf kboot: Don't fail if there are fewer than 6 DCPEXTs on t600x
Signed-off-by: Hector Martin <marcan@marcan.st>
2022-10-25 00:23:42 +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
Janne Grunau
ca68e1a9d2 kboot: Transfer dcpext* iommu mappings to device tree
Only dcpext* has memory mapped iboot.

Signed-off-by: Janne Grunau <j@jannau.net>
2022-10-23 17:21:26 +09:00
Janne Grunau
21dc622735 kboot: Transfer display related memory carveouts to device tree
DCP and disp0 need their bootloader iommu mappings maintained until
an OS driver can take over. DCP's mappings have to be kept
indefinitively since it's unknown if or how it can be restarted.

Bindings based on
https://lore.kernel.org/asahi/20220923123557.866972-1-thierry.reding@gmail.com

Signed-off-by: Janne Grunau <j@jannau.net>
2022-10-23 17:21:26 +09:00
Janne Grunau
7ae0aac831 kboot: lock dart-disp0 to prevent accidental resets
This prevents older systems from resetting dart-disp0 on init when they
encounter device trees with DCP/disp nodes.

Signed-off-by: Janne Grunau <j@jannau.net>
2022-10-23 17:21:26 +09:00
Janne Grunau
e5db7233a9 dart: add dart_init_fdt()
Used to intialize by FDT phandle.

Signed-off-by: Janne Grunau <j@jannau.net>
2022-10-23 17:21:26 +09:00
Janne Grunau
d27ca705c1 devicetree: Add dt utils for "ranges" based address translation
Signed-off-by: Janne Grunau <j@jannau.net>
2022-10-23 17:21:26 +09:00
Janne Grunau
f1664ccef4 dart: Add DART_PTR_ERR to indicate failures for IOVA returning functions
0 is a valid and used device virtual address. Daart functions returning
device address can not use 0 to indicate errors.

Signed-off-by: Janne Grunau <j@jannau.net>
2022-10-23 17:21:26 +09:00
Hector Martin
2e1ed1d457 nvme: Increase enable timeout to 5s, do a clean shutdown on fail
It seems unclean startup sometimes takes longer. On top of that, if we
don't do a clean shutdown in the error path, the next startup will
continue failing (we know hard-disable triggers races and crashes the
ASC).

Signed-off-by: Hector Martin <marcan@marcan.st>
2022-10-17 22:14:21 +09:00
Asahi Lina
67901fa1bb main: Move tunables_apply_static() here
m1n1 python scripts probably want this too, let's just do it
unconditionally.

Signed-off-by: Asahi Lina <lina@asahilina.net>
2022-10-17 22:14:21 +09:00
Asahi Lina
3e36d18241 tools/run_guest_kernel.sh: Support --
Signed-off-by: Asahi Lina <lina@asahilina.net>
2022-10-17 22:14:21 +09:00
Asahi Lina
d6d72b6398 hv_exc: Pass through TLBI OS instructions
Gues VM TLBI OS instructions don't work. Trap them and pass them through
as the host.

Signed-off-by: Asahi Lina <lina@asahilina.net>
2022-10-17 22:14:21 +09:00
Asahi Lina
d8c2d68ebf exception: Fix FAR decoding in GL2
Signed-off-by: Asahi Lina <lina@asahilina.net>
2022-10-17 22:14:21 +09:00
Asahi Lina
52e72c62b8 hv: Fix bugs in split r/w emulation
Signed-off-by: Asahi Lina <lina@asahilina.net>
2022-10-17 22:14:21 +09:00
Asahi Lina
4274c9d74a hv: Log memory attribute & sharability info in mmiotrace
Signed-off-by: Asahi Lina <lina@asahilina.net>
2022-10-17 22:14:21 +09:00
Zhuowei Zhang
5836db9305 m1n1.proxy: increase p.call max args to 5 to match proxy.c
Commit 6a1a9bfc3c raised the limit in proxy.c but not in the Python code.

Signed-off-by: Zhuowei Zhang <zhuoweizhang@yahoo.com>
2022-10-11 22:55:53 +09:00
Janne Grunau
81acfe96d8 kboot: Adapt multi-die handling to linux submitted DT
"simple-bus" restricts the node names to predefined list. "soc" looks
like the most appropiate name considering the dies are M1 Max SoCs.

Signed-off-by: Janne Grunau <j@jannau.net>
2022-09-28 01:23:28 +09:00
Radovan Blažek
e9e2571a17 proxyclient/m1n1/proxy.py: Add missing returns
Return the result in setX, clearX and maskX functions.

Signed-off-by: Radovan Blažek <blazra@gmail.com>
2022-09-28 01:21:47 +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
fe0d3e8e34 tunables_static: New module to set up static tunables
This is for things that xnu hard-codes. This first one for AGX is
required to make coprocessor TLB coherency work properly...

Signed-off-by: Asahi Lina <lina@asahilina.net>
2022-09-27 06:04:41 +09:00