Commit graph

2197 commits

Author SHA1 Message Date
Davide Cavalca
a71c0724db docker: install rust toolchain for stage1 builds
Signed-off-by: Davide Cavalca <dcavalca@fedoraproject.org>
2024-09-25 08:31:20 +09:00
Ayrton
58fe1d7f0c Makefile: Fix build when using clang as AS
Unlike gcc, clang enforces -mgeneral-regs-only when used as the assembler so
this removes that flag to fix the error in #393. This is only needed for
utils_asm.S which has code saving/restoring SIMD state, but this commit applies
it to all asm files for simplicity since code for fp regs shouldn't be generated
unless they're explicitly used anyway.

Signed-off-by: Ayrton Munoz <a.munoz3327@gmail.com>
2024-09-25 08:30:36 +09:00
Daniel Berlin
69d241ccc2 Give AMX context reg a name.
This register is used to store AMX context information.

Signed-off-by: Daniel Berlin <dberlin@dberlin.org>
2024-09-25 08:27:13 +09:00
Sasha Finkelstein
a42c839120 z2: Deal with missing calibration data
(by not sending anything in that case)

Signed-off-by: Sasha Finkelstein <fnkl.kernel@gmail.com>
2024-09-25 08:26:16 +09:00
Janne Grunau
48837f4d47 kboot: Expose m1n1 console log in phram MTD reserved memory node
This registers a log buffer IODEV similar to the frame buffer IODEV. It
is using a console IODEV to allow writing to the buffer until m1n1 jumps
to the next stage. This allows also to increase the buffer size without
increasing m1n1's size. The current CONSOLE_BUFFER_SIZE of 8k is not
large enough to hold the entire log of executing m1n1 under the
hypervisor on the M1 Ultra Mac Studio.

Signed-off-by: Janne Grunau <j@jannau.net>
2024-09-25 08:25:42 +09:00
Janne Grunau
1d5556ccf3 kboot: Expose ADT in phram MTD reserved memory node
Requires CONFIG_MTD_PHRAM in Linux.

Signed-off-by: Janne Grunau <j@jannau.net>
2024-09-25 08:25:42 +09:00
Janne Grunau
d76dd3a16e kboot: Add param for no-map proterty in dt_get_or_add_reserved_mem()
Signed-off-by: Janne Grunau <j@jannau.net>
2024-09-25 08:25:42 +09:00
Janne Grunau
2ef60e6360 hv: Use architectural ACTLR_EL12 on M2+ for secondary init
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
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
Janne Grunau
b3e9eb1223 github: workflow: Update to actions/upload-artifact@v4
Signed-off-by: Janne Grunau <j@jannau.net>
2024-09-25 08:22:36 +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
83ac04c1a9 fb: Fix FB junk leftover from stage1 in stage2
Signed-off-by: Hector Martin <marcan@marcan.st>
2024-09-18 00:00:22 +09:00
Hector Martin
9741ff9b97 fb: Fix UAF after fb shutdown
fb_console_reserve_lines() in mmu_shutdown() was causing a blit from the
freed framebuffer, putting heap metadata junk at the top left corner.

Signed-off-by: Hector Martin <marcan@marcan.st>
2024-09-17 23:59:29 +09:00
Hector Martin
cdb6d41aa2 display: Add workaround for Sequoia DCP handoff bug
Signed-off-by: Hector Martin <marcan@marcan.st>
2024-09-17 23:42:42 +09:00
Hector Martin
793ca17209 firmware: Add 15.0 and function to check SFW against a range
Signed-off-by: Hector Martin <marcan@marcan.st>
2024-09-17 23:42:05 +09:00
Hector Martin
8a122f86c4 exception: Fix EL1 exception return path
Signed-off-by: Hector Martin <marcan@marcan.st>
2024-08-11 20:21:21 +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
Janne Grunau
421dfa4252 dcp: Fix firmware mapping check on t8103/t600x
t8103 and t600x use "asc-dram-mask" in iop-dcp-nub to mask bits out of
DMA addresses. This needs to be used in the firmware mappings
check/remap since the segments have maskable bits sets.

Fixes: 8332e24 ("dcp: Undo carnage from bad stage1 DART code")
Signed-off-by: Janne Grunau <j@jannau.net>
2024-05-18 14:51:24 +09:00
Janne Grunau
56feda2b5e dart: Fix parsing of variable lenght "vm-base" property
Signed-off-by: Janne Grunau <j@jannau.net>
2024-05-18 14:51:24 +09:00
Hector Martin
dfffdf6609 display: Avoid placing FBs at IOVA 0
Also search harder for a matching dcp/disp iova, in case it matters.

Fixes: #391
Signed-off-by: Hector Martin <marcan@marcan.st>
2024-05-17 10:22:55 +09:00
Hector Martin
1841d88dcd clang-format: Gate out 18.1.6 changes
So `make format` in Fedora doesn't disagree with CI...

Signed-off-by: Hector Martin <marcan@marcan.st>
2024-05-17 02:18:29 +09:00
Hector Martin
4f8ddca920 clang-format 18.1.6 changes
This isn't in Fedora yet...

Signed-off-by: Hector Martin <marcan@marcan.st>
2024-05-17 02:16:14 +09:00
Hector Martin
c8afe3412e clang-format: Show changes as diff in workflow
Signed-off-by: Hector Martin <marcan@marcan.st>
2024-05-17 02:12:39 +09:00
Hector Martin
387cc2ecec kboot_gpu: Fix warnings
Signed-off-by: Hector Martin <marcan@marcan.st>
2024-05-17 02:05:12 +09:00
Hector Martin
657654ac09 clang-format 18
Signed-off-by: Hector Martin <marcan@marcan.st>
2024-05-17 02:05:12 +09:00
Hector Martin
8332e2454c dcp: Undo carnage from bad stage1 DART code
A bug in our DART code was wiping and aliasing page tables. Go through
the segment ranges for DCP and redo any missing mappings. If we redid
any mappings, then PMGR reset DCP so it can recover from having faulted
on the previous boot.

Signed-off-by: Hector Martin <marcan@marcan.st>
2024-05-17 01:57:34 +09:00
Hector Martin
c83ad3fc4d dart: Fix silent logic for dart_translate()
Signed-off-by: Hector Martin <marcan@marcan.st>
2024-05-17 01:56:57 +09:00
Hector Martin
8c107bf80a dart: Introduce dart_map_flags() and dart_translate_silent()
Signed-off-by: Hector Martin <marcan@marcan.st>
2024-05-17 01:56:32 +09:00
Hector Martin
58090bb58c dart: Fix L2 table allocation & half-fix carnage from stage1
We were assuming L2 tables were always allocated consecutively at low
IOVAs. 14.5 broke this, causing all kinds of explosions.

The new code looks for the first unused L2 PT, and also checks whether
the first 2 entries are aliased to latter entries (which is what the old
code caused). If so, it clears them and reallocates them. This doesn't
undo the PT wipe from stage1 though, so downstream code has to redo any
missing mappings...

Signed-off-by: Hector Martin <marcan@marcan.st>
2024-05-17 01:54:30 +09:00
Janne Grunau
0c64b6b4c1 sio: Rework sio init for dual die SoCs
Use a struct instead of global variable to hold the necessary setup
information. This allows executing the setup for both sio instances.
In addition change the status to "okay" so that sio can remain disabled
if the setup fails.

Signed-off-by: Janne Grunau <j@jannau.net>
2024-04-29 16:46:20 +09:00
Hector Martin
396d1d7207 rust: Switch to new core::ffi types
CStr is now here. This gets rid of three vendored deps, whee.

Signed-off-by: Hector Martin <marcan@marcan.st>
2024-04-09 13:20:00 +09:00
Hector Martin
313547db0f rust: Update uuid to 1.7.0
Signed-off-by: Hector Martin <marcan@marcan.st>
2024-04-09 13:04:02 +09:00
Hector Martin
95d67cf9d2 Update to clang-format 17
Signed-off-by: Hector Martin <marcan@marcan.st>
2024-04-09 12:57:55 +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
Hector Martin
90eef7223e Fix condition for SPMI HPM
Fixes: 9065c700df ("Workaround lack of SPMI support in usb.c")
Signed-off-by: Hector Martin <marcan@marcan.st>
2023-12-17 19:09:06 +09:00
Janne Grunau
11b9d4475b display: Fix pmgr device id for t6022 dcpext4
Signed-off-by: Janne Grunau <j@jannau.net>
2023-12-16 17:17:37 +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
Janne Grunau
c11a012697 nvme: t6022: Derive die from nvme_base address
For some reason the ans node for t602x devices has an empty
"clock-gates" property. Use the MMIO address instead to determine on
which die the device is.

Fixes: 34f49a5 ("nvme: assume die 0 if clock-gates not set")
Signed-off-by: Janne Grunau <j@jannau.net>
2023-12-12 10:42:26 +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
Gregor Haas
a26e439489 Add option for building verbosely
Signed-off-by: Gregor Haas <gregorhaas1997@gmail.com>
2023-12-03 17:45:52 +09:00