Commit graph

2177 commits

Author SHA1 Message Date
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
Asahi Lina
28708461fc kboot_gpu: Fix core count for T8112
Oops...

Signed-off-by: Asahi Lina <lina@asahilina.net>
2023-08-02 21:10:41 +09:00
Asahi Lina
e322312c94 kboot_gpu: Do not try to set cs/afr pstates on <G14X
Signed-off-by: Asahi Lina <lina@asahilina.net>
2023-08-02 15:11:32 +09:00
Asahi Lina
86d75d4dba kboot: Add 13.5 firmware compats
Signed-off-by: Asahi Lina <lina@asahilina.net>
2023-07-20 11:54:11 +09:00
Asahi Lina
f58e213529 kboot_gpu: Power calc fixes for t6020
Looks like this is different from t6021, and now I wonder if we need to
recheck t6000...

Signed-off-by: Asahi Lina <lina@asahilina.net>
2023-07-20 11:54:11 +09:00
Asahi Lina
dfecc20114 firmware: Add 13.5b4 and 13.5 versions
Signed-off-by: Asahi Lina <lina@asahilina.net>
2023-07-19 13:12:24 +09:00
Asahi Lina
538693a05a hv/trace_agx{_defer}.py: Enable command dumps
Signed-off-by: Asahi Lina <lina@asahilina.net>
2023-07-11 01:49:13 +09:00
Asahi Lina
d437d04dd4 m1n1.trace.agx: Fix broken TA parsing
Signed-off-by: Asahi Lina <lina@asahilina.net>
2023-07-11 01:49:13 +09:00
Asahi Lina
d2cb85d048 m1n1.trace.agx: Add a missing UAT inval
Signed-off-by: Asahi Lina <lina@asahilina.net>
2023-07-11 01:49:13 +09:00
Asahi Lina
6e40dd9aaa m1n1.trace.agx: Add AGXDECODE solib support & trace VDM
Signed-off-by: Asahi Lina <lina@asahilina.net>
2023-07-11 01:49:13 +09:00
Asahi Lina
825fbaf1ec m1n1.agx.initdata: Split buffer manager mappings between GPU/FW
Signed-off-by: Asahi Lina <lina@asahilina.net>
2023-07-11 01:49:13 +09:00
Asahi Lina
817b48dbc9 m1n1.fw.agx & co: Unbork a bunch of stuff on <G14X
Signed-off-by: Asahi Lina <lina@asahilina.net>
2023-07-11 01:49:13 +09:00
Asahi Lina
b270f2f86c m1n1.agx: Handle pending stamps properly for V13_5B4
Signed-off-by: Asahi Lina <lina@asahilina.net>
2023-07-11 01:49:13 +09:00
Asahi Lina
6761cd2d53 m1n1.fw.agx: Blit stuff for G14X
Just hacking on the structures to get it to dump, this probably broke
other firmware combinations...

Signed-off-by: Asahi Lina <lina@asahilina.net>
2023-07-11 01:49:13 +09:00
Asahi Lina
788a5b9866 m1n1.trace.agx: Changes to unbreak G14X tracing
Signed-off-by: Asahi Lina <lina@asahilina.net>
2023-07-11 01:49:13 +09:00
Asahi Lina
40c9dfe128 m1n1.trace.agx: Skip tracing the stats queue
This is spammy and sometimes so slow it blocks forever. Let's explicitly
remove these ranges from the GPUVM tracer.

Signed-off-by: Asahi Lina <lina@asahilina.net>
2023-07-11 01:49:13 +09:00