Commit graph

2050 commits

Author SHA1 Message Date
Hector Martin
780c0644d4 display: Fix HPD detection bug
Turns out it's just an 8-bit bool, not 32 bits, and when cast to int
the top bits can cause it to be interpreted as an error randomly...

Signed-off-by: Hector Martin <marcan@marcan.st>
2022-03-27 16:46:23 +09:00
Hector Martin
8af401ade1 display: Also prefer <4K modes in the vertical dimension
Apparently 2:1 scaled modes like 1920x2160 are a thing?

Signed-off-by: Hector Martin <marcan@marcan.st>
2022-03-27 16:08:39 +09:00
Janne Grunau
df53f16f76 m1n1.hv: Copy /chosen/memory-map/preoslog if it exists
preoslog was added in macos 12.3 and seems to contain iBootStage1 log
output. Since macos 12.3 accesses it it has to be copied to after the
guest image.

Signed-off-by: Janne Grunau <j@jannau.net>
2022-03-20 03:04:13 +09:00
Sven Peter
0a1a9348c3 kboot: try SEPROM for the random seeds first
Signed-off-by: Sven Peter <sven@svenpeter.dev>
2022-03-19 02:33:54 +09:00
Sven Peter
4c62ef47ad kboot: split off dt_set_rng_seed
Signed-off-by: Sven Peter <sven@svenpeter.dev>
2022-03-19 02:33:54 +09:00
Sven Peter
4e5a949382 sep: add simple SEP TRNG API
Signed-off-by: Sven Peter <sven@svenpeter.dev>
2022-03-19 02:33:54 +09:00
Hector Martin
bad5aebc7d kboot: Forward kblang code to asahi,kblang-code
Signed-off-by: Hector Martin <marcan@marcan.st>
2022-03-18 06:56:57 +09:00
Hector Martin
b64a6b9321 Makefile: git-describe using --tags
Signed-off-by: Hector Martin <marcan@marcan.st>
2022-03-17 16:22:13 +09:00
Hector Martin
d4635f60e2 chainload: Properly reserve memory for everything up to bootargs
Signed-off-by: Hector Martin <marcan@marcan.st>
2022-03-16 01:56:57 +09:00
Hector Martin
3331d9e1e1 kboot: Properly prune cpu-map and IRQ affinities for missing CPUs
Signed-off-by: Hector Martin <marcan@marcan.st>
2022-03-14 21:09:20 +09:00
Hector Martin
94d640aa20 tools/run_guest.py: Support restricting CPU list available to guest
Signed-off-by: Hector Martin <marcan@marcan.st>
2022-03-14 21:08:23 +09:00
Hector Martin
d580963043 smp: Guard CPU indexes > MAX_CPUS
Signed-off-by: Hector Martin <marcan@marcan.st>
2022-03-14 21:08:07 +09:00
Hector Martin
be1421d2ad m1n1.hw.spi: Update register definitions
This had been sitting in my worktree...

Signed-off-by: Hector Martin <marcan@marcan.st>
2022-03-11 22:14:46 +09:00
Hector Martin
822b3c3cca m1n1.trace.spi: Remove UNBUF mode
Signed-off-by: Hector Martin <marcan@marcan.st>
2022-03-11 22:13:27 +09:00
Hector Martin
29adf670b5 payload: Fix /chosen arg setting
Signed-off-by: Hector Martin <marcan@marcan.st>
2022-03-11 22:12:22 +09:00
Janne Grunau
c2a48da4c1 m1n1.hv: Add trace script keyboard/trackpad
Input devices use HID over SPI. HID communication is obscured by "sio"
DMA.

Signed-off-by: Janne Grunau <j@jannau.net>
2022-03-11 12:06:01 +09:00
Janne Grunau
387fab6132 m1n1.utils: Add CRC-16 (polygon 0xA001)
Signed-off-by: Janne Grunau <j@jannau.net>
2022-03-11 12:06:01 +09:00
Janne Grunau
025fa41e90 m1n1.trace: Add SPI tracer
Signed-off-by: Janne Grunau <j@jannau.net>
2022-03-11 12:06:01 +09:00
Janne Grunau
45824d2676 m1n1: move SPI register to m1n1.hw
Signed-off-by: Janne Grunau <j@jannau.net>
2022-03-11 12:06:01 +09:00
Janne Grunau
e90be797a8 m1n1.trace.gpio: Update register description based on the Linux driver
Signed-off-by: Janne Grunau <j@jannau.net>
2022-03-11 12:06:01 +09:00
Janne Grunau
9c80a69266 m1n1.hv: Use dynamic pin maps in trace_gpio.py
Hardcoded pin maps do not make sense with additional HW support.
Allows tracing of a single pin in another tracing module, for example
for tracing the SPI cs pin.

Signed-off-by: Janne Grunau <j@jannau.net>
2022-03-11 12:06:01 +09:00
Janne Grunau
5e8beca9fe experiments/dcp.py: Upload fb in 512k chunks for slow (v)UARTs
Signed-off-by: Janne Grunau <j@jannau.net>
2022-03-11 12:05:21 +09:00
Janne Grunau
f297decfb4 experiments/dcp.py: Use display size for frame buffers
Signed-off-by: Janne Grunau <j@jannau.net>
2022-03-11 12:05:21 +09:00
Janne Grunau
6a8016a8e3 experiments/dcp.py: set DVA offset from ADT
This does not appear to be necessary. It worked on t8103 before and I
see no different behavior on t6001.

Signed-off-by: Janne Grunau <j@jannau.net>
2022-03-11 12:05:21 +09:00
Janne Grunau
66f4d625b8 experiments/dcp.py: Use t8103/t600x specific code paths
MMIO space differes between t8103 and t600x so the hardcoded RegMonitor
addresses make only sens on the former.
set_display_device difference is taken from macOS trace on t6001.

Signed-off-by: Janne Grunau <j@jannau.net>
2022-03-11 12:05:21 +09:00
Janne Grunau
d1d93eb2b5 m1n1.fw.dcp: Add callbacks used by t600x-dcp
Signed-off-by: Janne Grunau <j@jannau.net>
2022-03-11 12:05:21 +09:00
Janne Grunau
7028f3e2d8 m1n1.fw.dcp: Zero dcpep's shared memeory
Fixes a crash of DCP with experiments/dcp.py after chainloading m1n1 on
j314c.

Signed-off-by: Janne Grunau <j@jannau.net>
2022-03-11 12:05:21 +09:00
Ferdinand Bachmann
5983d997d8 rust: do not assume realloc preserves alignment
Signed-off-by: Ferdinand Bachmann <theferdi265@gmail.com>
2022-03-11 12:02:36 +09:00
Hector Martin
d161de0037 nvme: Stop CPU properly on shutdown
Signed-off-by: Hector Martin <marcan@marcan.st>
2022-03-10 04:01:15 +09:00
Hector Martin
82ec1695ba payload: Fix broken chosen var handling
Signed-off-by: Hector Martin <marcan@marcan.st>
2022-03-10 00:30:31 +09:00
Hector Martin
99124a41fe tools/chainload.py: Support chainloading raw binaries
Signed-off-by: Hector Martin <marcan@marcan.st>
2022-03-10 00:30:15 +09:00
Hector Martin
ca04d8c9f4 Makefile: Generate build_cfg.h without echo -ne
Signed-off-by: Hector Martin <marcan@marcan.st>
2022-03-09 22:15:09 +09:00
Hector Martin
24b1fd9b22 Makefile: Add mkdir build where it was missing
Signed-off-by: Hector Martin <marcan@marcan.st>
2022-03-09 22:01:42 +09:00
Hector Martin
cfbaac1eac dts: Remove
We're building these from the U-Boot tree, this is long obsolete. Just nuke it.

Signed-off-by: Hector Martin <marcan@marcan.st>
2022-03-09 22:01:42 +09:00
Hector Martin
4575b35479 rust: Initial Rust-based EFI FAT32 chainloader
This code is gated behind the CHAINLOADING define. To build a
release-style m1n1 with chainloading for use with the installer
or kmutil, use:

make CHAINLOADING=1 RELEASE=1

To tell m1n1 to chainload another binary, use this var payload:

chainload=<ESP partition UUID>;<file path>

e.g.

chainload=a17b7e46-e950-bb4f-bc82-8ab1047a058e;m1n1/m1n1.bin

Closes: #154
Co-authored-by: Finn Behrens <me@kloenk.dev>
Co-authored-by: Joey Gouly <joey.gouly@arm.com>
Signed-off-by: Hector Martin <marcan@marcan.st>
2022-03-09 22:01:42 +09:00
Hector Martin
e386e17550 chainload: Add new m1n1-side chainloader (raw images only)
This basically duplicates the chainload.py logic, minus the mach-o
handling.

Signed-off-by: Hector Martin <marcan@marcan.st>
2022-03-09 20:55:34 +09:00
Hector Martin
0a8a593cdc payload: Support passing arbitrary /chosen arguments
Signed-off-by: Hector Martin <marcan@marcan.st>
2022-03-09 20:55:34 +09:00
Hector Martin
78c8c4d7d6 payload: Skip hypothetical m1n1 signatures
Tentative header format: 'm1n1_sig' followed by u32 total size (inclusive).

Signed-off-by: Hector Martin <marcan@marcan.st>
2022-03-09 20:55:34 +09:00
Hector Martin
6a1a9bfc3c utils: Expand vector_args from 4 to 5 arguments
This also expands the usual call/next stage functions to match.

Signed-off-by: Hector Martin <marcan@marcan.st>
2022-03-09 20:55:34 +09:00
Hector Martin
963b74765c adt: Add adt_setprop()
Signed-off-by: Hector Martin <marcan@marcan.st>
2022-03-09 20:55:34 +09:00
Hector Martin
123d1df1a7 kboot: Replace kboot_set_bootargs with kboot_set_chosen
This allows setting arbitrary /chosen string props

Signed-off-by: Hector Martin <marcan@marcan.st>
2022-03-09 20:55:34 +09:00
Hector Martin
adb1cb943e proxy: Export smp_set_wfe_mode
Signed-off-by: Hector Martin <marcan@marcan.st>
2022-03-08 00:02:06 +09:00
Hector Martin
a2944fa123 clk: Initialize MCA clock muxes
Signed-off-by: Hector Martin <marcan@marcan.st>
2022-03-08 00:02:06 +09:00
Hector Martin
616fedaf62 nvme: Shut down the controller cleanly
Signed-off-by: Hector Martin <marcan@marcan.st>
2022-03-07 23:59:25 +09:00
Hector Martin
bb7c7dd0ce proxy: Pass through nvme retvals properly
Signed-off-by: Hector Martin <marcan@marcan.st>
2022-03-07 23:59:25 +09:00
Hector Martin
191cb157fb rtkit: Better error handling
Now failures during init/shutdown won't cause a hang.

Signed-off-by: Hector Martin <marcan@marcan.st>
2022-03-07 23:59:25 +09:00
Hector Martin
1429c2a6e3 LICENSE: Fix copyright line
No years, please.

Signed-off-by: Hector Martin <marcan@marcan.st>
2022-03-07 23:59:25 +09:00
Janne Grunau
d76f3a6631 m1n1.hw.DART: coalesce continuos l2 ptes
Signed-off-by: Janne Grunau <j@jannau.net>
2022-02-24 23:55:46 +09:00
Janne Grunau
e1c5df5037 experiments/dart_dump.py: Use DART.from_adt()
The label of the ADT node is easier to use. Uses the proper DART type on
t600x SoCs.

Signed-off-by: Janne Grunau <j@jannau.net>
2022-02-24 23:55:46 +09:00
Janne Grunau
a57696366f hv/trace_dcp.py: Update to macOS 12.x API
DCP API seems to be mostly unchanged from 12 beta to 12.2.

Signed-off-by: Janne Grunau <j@jannau.net>
2022-02-24 23:55:46 +09:00