Commit graph

2284 commits

Author SHA1 Message Date
Asahi Lina
11163540ee exception: Format
Signed-off-by: Asahi Lina <lina@asahilina.net>
2025-01-28 05:41:48 +09:00
Asahi Lina
5ef9490522 kboot: Add GPU firmware to reserved mem, with mapping
This allows the kernel to read these pages, for crash dumps.

Signed-off-by: Asahi Lina <lina@asahilina.net>
2025-01-28 05:41:38 +09:00
Asahi Lina
9c217b71bf Makefile: Fix the cfg/tag logic again
I think this finally works as intended?

Signed-off-by: Asahi Lina <lina@asahilina.net>
2025-01-24 21:09:47 +09:00
Asahi Lina
d2956e4044 kboot: Add mapped reserved-memory ranges to memory map
This is the same thing U-Boot does for the EFI mem map, and means these
ranges get a `struct page` in the kernel.

Signed-off-by: Asahi Lina <lina@asahilina.net>
2025-01-24 20:01:03 +09:00
Asahi Lina
55efddda71 kboot_gpu: Do not set no-map prop on reserved-memory nodes
This is set in the device trees anyway, but a future kernel release may
rely on this being *not* set.

Signed-off-by: Asahi Lina <lina@asahilina.net>
2025-01-24 20:01:03 +09:00
James Calligeros
8508526515 display: contain all display init logic within display.c
Display handling was spread across main.c, utils.c and display.c
with the addition of iDevice support. Condense all of this functionality
into display.c.

This also fixes a regression introduced in 869d2ae35c ("Skip over features
unsupported in A7-A11 SoCs."), which caused devices using dcpext to skip DCP
initialisation.

Signed-off-by: James Calligeros <jcalligeros99@gmail.com>
2025-01-21 07:26:06 +09:00
Asahi Lina
f09aff9d1c Makefile: Fix CI
Signed-off-by: Asahi Lina <lina@asahilina.net>
2025-01-21 06:44:44 +09:00
Asahi Lina
c13446f4f5 m1n1.agx: Fault experiments & misc 2025-01-21 04:36:11 +09:00
Asahi Lina
c81e6654ec m1n1.agx.render: Set up tiling_control properly
Signed-off-by: Asahi Lina <lina@asahilina.net>
2025-01-21 04:36:11 +09:00
Asahi Lina
8077bbf075 m1n1.agx.render: Wait for last submitted work
Signed-off-by: Asahi Lina <lina@asahilina.net>
2025-01-21 04:36:11 +09:00
Asahi Lina
a2049af237 m1n1.proxy: Wait longer for reconnection
Useful when HDMI is disconnected and init takes longer

Signed-off-by: Asahi Lina <lina@asahilina.net>
2025-01-21 04:36:11 +09:00
Asahi Lina
4c019d2147 experiments/agx_tracetimings.py: Cleanup & update
Signed-off-by: Asahi Lina <lina@asahilina.net>
2025-01-21 04:36:11 +09:00
Asahi Lina
3ef1eb41f0 m1n1.fw.agx.cmdqueue: Scheduler context fields
Signed-off-by: Asahi Lina <lina@asahilina.net>
2025-01-21 04:36:11 +09:00
Asahi Lina
17460ffe02 m1n1.agx: Timestamp stuff
Signed-off-by: Asahi Lina <lina@asahilina.net>
2025-01-21 04:36:11 +09:00
Asahi Lina
692575cac8 m1n1.agx: Misc fixes to make m1n1 mode work again
Signed-off-by: Asahi Lina <lina@asahilina.net>
2025-01-21 04:36:11 +09:00
Asahi Lina
85b3fc00d8 m1n1.agx.initdata: Hacky t6020 support
This isn't really correct...

Signed-off-by: Asahi Lina <lina@asahilina.net>
2025-01-21 04:36:11 +09:00
Asahi Lina
e64c8ea607 m1n1.agx: Python 3.13 fix
Signed-off-by: Asahi Lina <lina@asahilina.net>
2025-01-21 04:36:11 +09:00
Hector Martin
2000f7706d usb: Add defines for PIPEHANDLER stuff
Signed-off-by: Hector Martin <marcan@marcan.st>
2025-01-17 21:50:34 +09:00
Hector Martin
891516546f kboot_atc: Move more tunables around
Signed-off-by: Hector Martin <marcan@marcan.st>
2025-01-17 21:50:34 +09:00
Hector Martin
1a0790121f m1n1.hv, chainload.py: Remove __OS_LOG from everything
Signed-off-by: Hector Martin <marcan@marcan.st>
2025-01-17 21:50:34 +09:00
Hector Martin
02b26b3c18 kboot_atc: Reorder tunables to match macOS 13.5 order on t8103
Signed-off-by: Hector Martin <marcan@marcan.st>
2025-01-17 21:50:34 +09:00
Hector Martin
d1c7942bb7 m1n1.hw.dwc3: Fix some bits
Signed-off-by: Hector Martin <marcan@marcan.st>
2025-01-17 21:50:34 +09:00
Hector Martin
093f59ea07 hv_vuart: Pass through "HVLOG: ..." messages to the main console
Signed-off-by: Hector Martin <marcan@marcan.st>
2025-01-17 21:50:34 +09:00
Hector Martin
b1972acec4 kboot: Disable hpm device for disabled USB controllers
Signed-off-by: Hector Martin <marcan@marcan.st>
2025-01-12 07:48:11 +09:00
Sven Peter
fefcd48769 kboot: Rework USB4 tunables for new device tree structure
Signed-off-by: Sven Peter <sven@svenpeter.dev>
2025-01-12 02:26:58 +09:00
Hector Martin
43592ce42e display: Fix warning in CHAINLOADING=1 builds
Signed-off-by: Hector Martin <marcan@marcan.st>
2025-01-12 02:26:58 +09:00
Hector Martin
7269fa6be8 Makefile: Fix dependencies for generated headers
Signed-off-by: Hector Martin <marcan@marcan.st>
2025-01-12 02:26:58 +09:00
Janne Grunau
dbafd058cf m1n1: Handle BootArgs revisions 1, 2 and 3
Handle revision 0 as revision 1.

Signed-off-by: Janne Grunau <j@jannau.net>
2024-11-25 07:03:59 +09:00
Sasha Finkelstein
62ff43f095 kboot: Pass through SEPFW and boot object manifests
Signed-off-by: Sasha Finkelstein <fnkl.kernel@gmail.com>
2024-11-11 22:46:25 +09:00
Nick Chan
87a1279b86 kboot: Fix get_notchless_fb() on notched Macs
Fixes: 5bb8f04bdf ("kboot: Add workarounds for ADT for A7-A11 SoCs.")
Signed-off-by: Nick Chan <towinchenmi@gmail.com>
2024-11-11 22:08:51 +09:00
Janne Grunau
3854c7668a pmgr: Fix false positive u8 pmgr ID detection on modern SoCs
The id1 field used on oder SoCs is not constant 0 for all devices on
t8122. Instead just compare the id1 fields of the two first devices.
Fixes "pmgr: Failed to find parent #36 for IOA0\n" errors in
pmgr_init().

Fixes: fb59dc03ca ("pmgr: Fix struct for older SoCs")
Signed-off-by: Janne Grunau <j@jannau.net>
2024-11-03 23:15:09 +09:00
Hector Martin
b901c2706f rust: 1.82.0 compat
Signed-off-by: Hector Martin <marcan@marcan.st>
2024-11-03 19:51:53 +09:00
a-ramses
d54b97881a apple_regs.json: add HID12 already used register
Signed-off-by: a-ramses <abdicheramzi@gmail.com>
2024-11-03 19:16:43 +09:00
Daniel Berlin
750f3307f0 m1n1.hv: Add M3 and M3 Max chip IDs
Signed-off-by: Daniel Berlin <dberlin@dberlin.org>
Signed-off-by: Janne Grunau <j@jannau.net>
2024-11-03 19:16:43 +09:00
Janne Grunau
dd74f20bf5 proxy.hv: Determine boot CPU by cpu[N].state ADT property
Signed-off-by: Daniel Berlin <dberlin@dberlin.org>
Co-Developed-by: Daniel Berlin <dberlin@dberlin.org>
Signed-off-by: Janne Grunau <j@jannau.net>
2024-11-03 19:16:43 +09:00
Janne Grunau
eb8430ba7e tools/chainload: Determine boot CPU by cpu[N].state ADT property
Signed-off-by: Janne Grunau <j@jannau.net>
2024-11-03 19:16:43 +09:00
Janne Grunau
a603b86e6b smp: Handle boot CPU index != 0
Signed-off-by: Janne Grunau <j@jannau.net>
2024-11-03 19:16:43 +09:00
Janne Grunau
293e122845 startup: Determine boot CPU by cpu[N].state ADT property
Signed-off-by: Janne Grunau <j@jannau.net>
2024-11-03 19:03:57 +09:00
Nick Chan
4bde778779 usb: Skip USB init for now on A7-A11 SoCs.
We do not support the USB controller on A7-A11 SoCs yet, but still do not
try to init dwc3 on them.

Signed-off-by: Nick Chan <towinchenmi@gmail.com>
2024-10-31 01:32:39 +09:00
Nick Chan
fb59dc03ca pmgr: Fix struct for older SoCs
At some point Apple ran out of bits and have to widen the device field
to 16-bit. This adds support for the old 8-bit layout.

Signed-off-by: Nick Chan <towinchenmi@gmail.com>
2024-10-31 01:32:39 +09:00
Nick Chan
9ca6d1c16f exceptions: add el3_call()
Signed-off-by: Nick Chan <towinchenmi@gmail.com>
2024-10-31 01:32:39 +09:00
Nick Chan
1fd17b8933 exceptions: fix el0_call() and el1_call() when running in EL1
Signed-off-by: Nick Chan <towinchenmi@gmail.com>
2024-10-31 01:32:39 +09:00
Nick Chan
5b8cfd1e7c kboot: Reserve secondary CPU stacks
The secondary CPU may potentially use the stack after leaving WFE.

Signed-off-by: Nick Chan <towinchenmi@gmail.com>
2024-10-31 01:32:39 +09:00
Nick Chan
5bb8f04bdf kboot: Add workarounds for ADT for A7-A11 SoCs.
Account for the differences between the iOS ADT and macOS ADT, and also
some physical differences between Apple Silicon Macs and A7-A11 devoces,
reflected in the ADT.

Signed-off-by: Nick Chan <towinchenmi@gmail.com>
2024-10-31 01:32:39 +09:00
Nick Chan
d0889bda14 fb: Add A7-A11 device support
This includes:
- Do not treat iPhone 5 buffer as dummy on 5s
- Added support for 24-bit framebuffer
- When we have a vertical display, use whole fb as console

Signed-off-by: Nick Chan <towinchenmi@gmail.com>
2024-10-31 01:32:39 +09:00
Nick Chan
c28d6b7172 smp: Add A7-A9X cache errata workaround
Signed-off-by: Nick Chan <towinchenmi@gmail.com>
2024-10-31 01:32:39 +09:00
Nick Chan
da3519de14 smp: Add support for deep sleep on A7-A9X
Signed-off-by: Nick Chan <towinchenmi@gmail.com>
2024-10-31 01:32:39 +09:00
Nick Chan
dadc48ed10 smp: Write _vectors_start into boot CPU rvbar where possible
On A7-A11 we have a ROM exploit and we can keep CPU0 RVBAR unlocked.

Signed-off-by: Nick Chan <towinchenmi@gmail.com>
2024-10-31 01:32:39 +09:00
Nick Chan
3b7fd2ce5e smp: Add support for ADT from old FW
Old ADT does not have /cpus/cpu<n>/cpu-impl-reg, and the value is in
/arm-io/pmgr/reg[2*n+2].

Signed-off-by: Nick Chan <towinchenmi@gmail.com>
2024-10-31 01:32:39 +09:00
Nick Chan
cb0ceb4ee8 smp: Added A7-A11 start support
This includes:

- EL3 handling
- "Slow" IPI support
- New start offsets

Signed-off-by: Nick Chan <towinchenmi@gmail.com>
2024-10-31 01:32:39 +09:00