Commit graph

2142 commits

Author SHA1 Message Date
Janne Grunau
a823c311ab m1n1.fw.dcp.ipc: Add support for the macOS 13.3 firmware
Signed-off-by: Janne Grunau <j@jannau.net>
2023-09-20 22:33:45 +09:00
Janne Grunau
c159c5bbfd m1n1/fw/dcp/parse_log: Parse firmware version from log
Incomplete, needs to reload fw.dcp.ipc.

Signed-off-by: Janne Grunau <j@jannau.net>
2023-09-20 22:33:45 +09:00
Janne Grunau
635e046d56 m1n1.fw.dcp: Parse AVPropChunks in parse_log
Signed-off-by: Janne Grunau <j@jannau.net>
2023-09-20 22:33:45 +09:00
Janne Grunau
faec98b10c m1n1.constructutils: Add 13.5 firmware symbol
Signed-off-by: Janne Grunau <j@jannau.net>
2023-09-20 22:33:45 +09:00
Janne Grunau
7e5d12d33e kboot: disable touchbar on missing calibration data
There is at least on Macbook Pro (M1, 13-inch) with missing
"multi-touch-calibration" in the ADT. Disabling the device as error
handling instead of refusing to boot the kernel.

Signed-off-by: Janne Grunau <j@jannau.net>
2023-09-20 22:32:56 +09:00
Mark Kettenis
ea64e7bda4 m1n1.asm: make it work again on OpenBSD
Using llvm from ports.

Signed-off-by: Mark Kettenis <kettenis@openbsd.org>
2023-09-07 19:19:38 +09:00
Hector Martin
24a3a0d962 kboot: Move MCC cache enable to kboot
Following the general "do more in stage2/kboot, do less in stage1/proxy"
rule. In case something goes wrong here we want to be able to fix it in
stage2.

Thanks to the stupid bug, the past year+ of stage1 installs has had this
codepath disabled, so that works well with this change.

Signed-off-by: Hector Martin <marcan@marcan.st>
2023-09-05 23:33:19 +09:00
Hector Martin
655299382d mcc: Initialize cache_disable for t60xx
Shouldn't matter since this should be zero-initialized anyway, but
clearer.

Signed-off-by: Hector Martin <marcan@marcan.st>
2023-09-04 03:51:31 +09:00
Hector Martin
99e659ae01 mcc: Add missing cache disable reg (?) for t8112
Signed-off-by: Hector Martin <marcan@marcan.st>
2023-09-04 03:24:03 +09:00
Hector Martin
0ec145974a mcc: Fix for t602x
Signed-off-by: Hector Martin <marcan@marcan.st>
2023-09-04 02:43:25 +09:00
Hector Martin
1d2b8f91f6 mcc: Actually enable the caches.
That was dumb.

Signed-off-by: Hector Martin <marcan@marcan.st>
2023-09-04 01:08:23 +09:00
Hector Martin
00099452cb kboot: Fix missing newlines
Signed-off-by: Hector Martin <marcan@marcan.st>
2023-08-24 20:20:56 +09:00
Hector Martin
6d0979e71e m1n1.adt: Decode apcie tunables
Signed-off-by: Hector Martin <marcan@marcan.st>
2023-08-21 23:16:08 +09:00
Hector Martin
8ca5d671ad sio: Fix error paths
Signed-off-by: Hector Martin <marcan@marcan.st>
2023-08-21 14:00:33 +09:00
Martin Povišer
6a61c001d2 clk: Set up LEAP/PDM clocks
Signed-off-by: Martin Povišer <povik@cutebit.org>
2023-08-21 00:17:27 +09:00
Martin Povišer
f7824561af afk: Add missing wptr wraparound
Signed-off-by: Martin Povišer <povik@cutebit.org>
2023-08-17 19:57:12 +09:00
Martin Povišer
264e18169f afk: Fix ringbuf space checks in afk_epic_tx
Redo the checks to make sure we never cause rptr==wptr, because that
signifies an empty buffer, not a full one.

Signed-off-by: Martin Povišer <povik@cutebit.org>
2023-08-17 19:57:12 +09:00
Martin Povišer
07ea5a92c3 afk: Fix edge case in ringbuf pointer assert
Signed-off-by: Martin Povišer <povik@cutebit.org>
2023-08-17 19:57:12 +09:00
Martin Povišer
fd0ae3663a afk: Drop stray 'rptr' field
Signed-off-by: Martin Povišer <povik@cutebit.org>
2023-08-17 19:57:12 +09:00
Martin Povišer
526f81f51e m1n1.hw.codecs: Add iMac codec
Signed-off-by: Martin Povišer <povik@cutebit.org>
2023-08-17 19:50:09 +09:00
Martin Povišer
d29df8e69b sio: Use 'FDT' in prints consistently
Both 'DT:' and 'FDT:' are in use as prefices in prints that relate to
the non-Apple devicetree. Put in 'FDT:' everywhere for consistence.

Signed-off-by: Martin Povišer <povik@cutebit.org>
2023-08-17 19:49:43 +09:00
Martin Povišer
8f8c3f903d kboot: Look up SIO by alias
Signed-off-by: Martin Povišer <povik@cutebit.org>
2023-08-17 19:49:43 +09:00
Martin Povišer
1ba260c090 sio: Add missing exit on bad ADT data
Signed-off-by: Martin Povišer <povik@cutebit.org>
2023-08-17 19:49:43 +09:00
Martin Povišer
94cf41e124 kboot: Postpone setting of /memory
Postpone the setting of the /memory node so that any allocations made
in course of the devicetree prep (e.g. the SIO reservations allocated
from the top of memory) are reflected in the usable memory span that's
set on the /memory node.

Signed-off-by: Martin Povišer <povik@cutebit.org>
2023-08-17 19:49:43 +09:00
Martin Povišer
9f12d5b3ff sio: Move to 'copy rules'
Summarize the preparation of SIO firmware data in a table of 'copy
rules'.

Signed-off-by: Martin Povišer <povik@cutebit.org>
2023-08-17 19:49:43 +09:00
Martin Povišer
8824bd2dbf sio: Allocate from top of memory
Place the firmware data we are preparing at the top of memory.

Signed-off-by: Martin Povišer <povik@cutebit.org>
2023-08-17 19:49:43 +09:00
Martin Povišer
fa820a7164 display: Factor out top of memory allocation
Move it into utils.c before we reuse it for SIO data.

Signed-off-by: Martin Povišer <povik@cutebit.org>
2023-08-17 19:49:43 +09:00
Martin Povišer
731f1c4761 kboot: Fix dt_device_set_reserved_mem error print
Signed-off-by: Martin Povišer <povik@cutebit.org>
2023-08-17 19:49:43 +09:00
Martin Povišer
39f4919fc1 sio: Set up auxiliary SIO data in FDT
On kboot, parse the ADT for SIO firmware parameters, set up the expected
data structures for SIO consumption in reserved memory, and pass those
in properties of the SIO FDT node.

Signed-off-by: Martin Povišer <povik@cutebit.org>
2023-08-17 19:49:43 +09:00
Martin Povišer
44f65b1875 kboot: Make filling in of memory-region-names optional
Signed-off-by: Martin Povišer <povik@cutebit.org>
2023-08-17 19:49:43 +09:00
Martin Povišer
9ccef6b8bd kboot: Split dt_device_set_reserved_mem
Make dt_device_set_reserved_mem take in an explicit iova instead of
reading it off from a DART. Add a separate 'from_dart' variety of the
function for getting the iova from DART.

Signed-off-by: Martin Povišer <povik@cutebit.org>
2023-08-17 19:49:43 +09:00
Martin Povišer
aa64faba4b kboot: Reserve SIO firmware
Signed-off-by: Martin Povišer <povik@cutebit.org>
2023-08-17 19:49:43 +09:00
Martin Povišer
8be10f5fa9 kboot: Add dt_reserve_asc_firmware
The new function parses ADT's segment-ranges and builds up nodes in
/reserved-memory representing the appropriate physical and device
address spans. This is to describe the memory placement of ASC firmware.

Signed-off-by: Martin Povišer <povik@cutebit.org>
2023-08-17 19:49:43 +09:00
Asahi Lina
925fe72b0b src/hv_vm: Fix some instruction emulations
Signed-off-by: Asahi Lina <lina@asahilina.net>
2023-08-17 19:46:07 +09:00
Asahi Lina
37ad9f7df6 m1n1.fw.dcp.ipc: Fix assert
Signed-off-by: Asahi Lina <lina@asahilina.net>
2023-08-17 19:46:07 +09:00
Asahi Lina
31da584be8 m1n1.fw.agx: Helpers everywhere!
Signed-off-by: Asahi Lina <lina@asahilina.net>
2023-08-17 19:46:07 +09:00
Asahi Lina
7f94c7f39a tools.chainload.py: Fixes for 13.5
Signed-off-by: Asahi Lina <lina@asahilina.net>
2023-08-17 19:46:07 +09:00
Asahi Lina
5a389fe87b kboot_gpu: Add another pwcalc difference for T602x
This doesn't make any sense... M2 Ultra should be 2x M2 Max, so there's
no reason for this constant to be different.

I get the feeling Apple messed this one up too...

Also clean up some other constants.

Signed-off-by: Asahi Lina <lina@asahilina.net>
2023-08-17 19:46:07 +09:00
Asahi Lina
db49377e5a kboot_gpu: Fixes for >1 die t602x
Signed-off-by: Asahi Lina <lina@asahilina.net>
2023-08-17 19:46:07 +09:00
Alexis Deruelle
b2e5b3ef00 proxyclient:picocom-sec.sh:warn when overriding SECDEV
Add a warning message when overriding the target serial device with
SECDEV variable, just in case one is caught by surprise there.

Signed-off-by: Alexis Deruelle <alexis.deruelle@gmail.com>
2023-08-17 19:45:13 +09:00
Alexis Deruelle
21a403a163 proxyclient:tools:add default device name for macOS
Under macOS host, secondary UART device name is different from the linux
device name. Check OS name and chose default device name accordingly.

Signed-off-by: Alexis Deruelle <alexis.deruelle@gmail.com>
2023-08-17 19:45:13 +09:00
Alexis Deruelle
0673a226c9 proxyclient:m1n1:rely on UartInterface defaults when creating object
- in 'main' section, device name and baud values are redundant as the
  UartInterface constructor handles it already
- Add a comment on how to run proxy.py as script

Signed-off-by: Alexis Deruelle <alexis.deruelle@gmail.com>
2023-08-17 19:45:13 +09:00
Alexis Deruelle
bd82c5f47a proxyclient:m1n1:add macOS device name for m1n1 primary UART
m1n1 UART device names on macOS follow /dev/cu.usbmodemP_XX naming
convention. Check for platform name using platform.system() and use the
macOS device name instead of /dev/m1n1 if equals 'Darwin'

Signed-off-by: Alexis Deruelle <alexis.deruelle@gmail.com>
2023-08-17 19:45:13 +09:00
Davide Cavalca
6bca5f77e1 m1n1.asm: make it work again with gcc
Signed-off-by: Davide Cavalca <davide@cavalca.name>
2023-08-15 18:27:51 +09:00
Hector Martin
8e3016e323 pcie: T602X APCIE-GE support
Maybe maybe?

Signed-off-by: Hector Martin <marcan@marcan.st>
2023-08-07 21:05:25 +09:00
Hector Martin
721107aa0a kboot_gpu: Fixes for T6022
This is still blind. Lina send help.

Signed-off-by: Hector Martin <marcan@marcan.st>
2023-08-07 19:27:47 +09:00
Hector Martin
31930a25f7 m1n1.hv: Add t6022 cpustart
Signed-off-by: Hector Martin <marcan@marcan.st>
2023-08-07 19:27:47 +09:00
Hector Martin
33ef9cdaa8 m1n1.adt: Fix GPUPerfStates64 for T6022
Signed-off-by: Hector Martin <marcan@marcan.st>
2023-08-07 19:27:47 +09:00
Hector Martin
bb0e9ace57 display: Make M2+ desktop disable hack more generic
This should work on the Mac Pro.

Signed-off-by: Hector Martin <marcan@marcan.st>
2023-08-07 19:27:47 +09:00
Hector Martin
9b73944684 Initial t6022 support
GPU stuff is a wild guess.

Signed-off-by: Hector Martin <marcan@marcan.st>
2023-08-07 19:27:47 +09:00