Commit graph

2051 commits

Author SHA1 Message Date
Hector Martin
bd59007f50 isp: Drop DART init
This is all handled properly by the kernel, once we actually instantiate
3 DARTs properly.

Signed-off-by: Hector Martin <marcan@marcan.st>
2023-09-11 00:13:32 +09:00
Hector Martin
c83323df6d dapf: Also (try to) init dart-isp0
Signed-off-by: Hector Martin <marcan@marcan.st>
2023-09-11 00:11:04 +09:00
Hector Martin
78ca54afdc kboot: Try isp/isp0 for reserving firmware
Signed-off-by: Hector Martin <marcan@marcan.st>
2023-09-10 22:52:09 +09:00
Hector Martin
35c869cfe6 kboot: Make dt_get_or_add_reserved_mem mutate existing nodes
This means we can use it with pre-created nodes in the DT.

Signed-off-by: Hector Martin <marcan@marcan.st>
2023-09-08 00:39:16 +09:00
Hector Martin
0866a33c35 kboot: Handle ISP heap carveout
Signed-off-by: Hector Martin <marcan@marcan.st>
2023-09-08 00:36:30 +09:00
Hector Martin
668ea16c09 isp: Allocate heap carveout
Allocating this in m1n1 means we can treat it as a reserved-memory node
and deal with knowing the size in m1n1, instead of the kernel. It also
means we can deal with the firmware version dependency mess here.

Signed-off-by: Hector Martin <marcan@marcan.st>
2023-09-08 00:36:30 +09:00
Hector Martin
02c03a73b0 pmgr: Expose pmgr_set_mode
For ISP stuff which is not declared in the ADT

Signed-off-by: Hector Martin <marcan@marcan.st>
2023-09-08 00:36:30 +09:00
Hector Martin
fbe3fcd85a kboot: Handle ISP/SIO reserved firmware differences
The iova field is different, handle it with a flag.

Signed-off-by: Hector Martin <marcan@marcan.st>
2023-09-08 00:36:29 +09:00
Hector Martin
ab0ef2922e kboot: Use adt_segment_ranges struct instead of open-coding
Signed-off-by: Hector Martin <marcan@marcan.st>
2023-09-08 00:36:21 +09:00
Eileen Yoon
0a5d60b2c9 isp: t6000 stream select mask
Signed-off-by: Eileen Yoon <eyn@gmx.com>
2023-09-07 20:48:53 +09:00
Eileen Yoon
81637108bc isp: t6000 13c index 0 flag
Signed-off-by: Eileen Yoon <eyn@gmx.com>
2023-09-07 20:48:53 +09:00
Eileen Yoon
151143725c isp/kboot: Prelim T6000 support
Handle /arm-io/isp0 and diff CTRR writes.

Signed-off-by: Eileen Yoon <eyn@gmx.com>
2023-09-07 20:48:53 +09:00
Eileen Yoon
1077e78195 isp: tmp - Add t8020 ISP DART workaround
Signed-off-by: Eileen Yoon <eyn@gmx.com>
2023-09-07 20:48:53 +09:00
Eileen Yoon
11dd41e020 kboot: Reserve ISP firmware
Signed-off-by: Eileen Yoon <eyn@gmx.com>
2023-09-07 20:48:53 +09:00
Eileen Yoon
7c4b785784 dapf: Support reg indexing + add ISP
Also enable power if domain exists.

Signed-off-by: Eileen Yoon <eyn@gmx.com>
2023-09-07 20:48:53 +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