Commit graph

1204 commits

Author SHA1 Message Date
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
Janne Grunau
fb49d88d90 m1n1.fw.dcp.ipc: annotate swap_complete_intent_gated
Signed-off-by: Janne Grunau <j@jannau.net>
2022-02-24 23:55:46 +09:00
Sven Peter
53af416b07 hv.py: Add helper to break on symbols
We already have breakpoints and symbols, let's make our life easier
by also allowing to break on symbols.

Signed-off-by: Sven Peter <sven@svenpeter.dev>
2022-02-24 23:55:25 +09:00
Hector Martin
287a963bcc kboot: Hide the notch
Signed-off-by: Hector Martin <marcan@marcan.st>
2022-02-22 01:04:55 +09:00
Hector Martin
5531b9ae32 display: statify local functions
Signed-off-by: Hector Martin <marcan@marcan.st>
2022-02-22 00:54:17 +09:00
Hector Martin
5aaedef975 main: Add RELEASE mode features
- Hide console by default unless booting in verbose mode.
- In verbose mode, enable USB early and poll for connection before
  launching payloads.
- Show console on fallback to proxy.

Signed-off-by: Hector Martin <marcan@marcan.st>
2022-02-22 00:30:54 +09:00
Hector Martin
a9088e2278 fb: Add the ability to defer FB console activation
This differs from removing the IODEV usage in that console contents
are still buffered.

Signed-off-by: Hector Martin <marcan@marcan.st>
2022-02-21 16:06:14 +09:00
Hector Martin
d1dcf16c66 display: Update boot args in place for HV guests
Signed-off-by: Hector Martin <marcan@marcan.st>
2022-02-21 16:03:23 +09:00
Hector Martin
08b77c2b1b m1n1.adt: Handle underscores in properties as __
Signed-off-by: Hector Martin <marcan@marcan.st>
2022-02-21 15:31:31 +09:00
Hector Martin
5bf8c5ac83 m1n1.hv: Use p.mcc_hv_unmap_carveouts()
Fixes random SErrors due to the guest issuing speculative instruction
fetches into TZ regions.

Signed-off-by: Hector Martin <marcan@marcan.st>
2022-02-21 15:30:25 +09:00
Hector Martin
50a9593034 mcc: Add mcc_hv_unmap_carveouts() and proxy op
This is necessary to stop the guest from speculating into carveouts.

Signed-off-by: Hector Martin <marcan@marcan.st>
2022-02-21 15:30:21 +09:00
Hector Martin
a8a93a3b5f hv/trace_smc.py: Add GetKeyByIndex decoding
Signed-off-by: Hector Martin <marcan@marcan.st>
2022-02-15 14:05:13 +09:00
Hector Martin
ec126bb16a experiments/smc.py: Turn into SMC key dumper
Signed-off-by: Hector Martin <marcan@marcan.st>
2022-02-15 14:05:13 +09:00
Hector Martin
d381341865 m1n1.trace.asc: Add missing power control messages
Signed-off-by: Hector Martin <marcan@marcan.st>
2022-02-15 14:05:13 +09:00
Hector Martin
45c3682f60 m1n1.fw.smc: Handle notifications
Signed-off-by: Hector Martin <marcan@marcan.st>
2022-02-15 14:05:13 +09:00
Hector Martin
a0680a2678 m1n1.adt: Better parse PMU props
Signed-off-by: Hector Martin <marcan@marcan.st>
2022-02-15 14:05:13 +09:00
Martin Povišer
7bab3d0fc3 exception: Fix silent mode
Do not forget to clear the L2C_ERR flags in silent mode also. This is
necessary for proper recovery.

Signed-off-by: Martin Povišer <povik@protonmail.com>
2022-02-14 11:47:04 +09:00
Martin Povišer
41f0874f99 experiments/audio_capture.py: Demonstrate audio capture
Signed-off-by: Martin Povišer <povik@protonmail.com>
2022-02-08 14:18:20 +09:00
Martin Povišer
78aa55f0bc experiments/speaker_amp.py: Revamp hardware setup
Use register definitions where they are now available. Start from full
AUDIO_P reset and set NCO ourselves (instead of relying on iBoot
values).

Signed-off-by: Martin Povišer <povik@protonmail.com>
2022-02-08 14:18:20 +09:00
Martin Povišer
0d4c7af26b m1n1.hw.mca: Add MCA register definitions
Signed-off-by: Martin Povišer <povik@protonmail.com>
2022-02-08 14:18:20 +09:00
Martin Povišer
90c4a1ae46 m1n1.hw.admac: Improve polling
Make sure we read any reports before we start submitting new
descriptors. Also put sleep in busy-wait loop and make speaker_amp.py
exit once EOF is reached.

Signed-off-by: Martin Povišer <povik@protonmail.com>
2022-02-08 14:18:20 +09:00
Martin Povišer
9bd84dfbb9 experiments/speaker_amp.py: Drop 'polling console'
Drop the 'polling console' code as there are now better ways to achieve
the same. (One can use USB_VUART for second proxy session, see 85ee2f24)

Signed-off-by: Martin Povišer <povik@protonmail.com>
2022-02-08 14:18:20 +09:00
Martin Povišer
532f260fae m1n1.hw.admac: Label burst size, buswidth registers
Signed-off-by: Martin Povišer <povik@protonmail.com>
2022-02-08 14:18:20 +09:00
Martin Povišer
3a8ae74907 m1n1.hw.admac: Introduce RX channels
Fill in register definitions and extend the driver code to introduce
support for RX channels. This involves change of channel numbering.

Signed-off-by: Martin Povišer <povik@protonmail.com>
2022-02-08 14:18:20 +09:00
Martin Povišer
590722b29d m1n1.hw.admac: Use stderr for debug prints
Signed-off-by: Martin Povišer <povik@protonmail.com>
2022-02-08 14:18:20 +09:00
Martin Povišer
64d8f9d1b3 m1n1.loadobjs: Add util for loading objects on target
For those of us who can't write assembly but still need to run code on
the other side.

  >>> from m1n1.loadobjs import *
  >>> lp = LinkedProgram(u)
  >>> lp.debug_printf("hello from the other side (%d)\n", 42)
  TTY> hello from the other side (42)
  0x1f
  >>> lp.load_obj("build/test.o")
  >>> lp.test()
  TTY> hello from loaded object
  0x19
  >>> lp.clear_objs()

Signed-off-by: Martin Povišer <povik@protonmail.com>
2022-02-08 14:14:38 +09:00
Hector Martin
6f525fc0f1 smp: Skip missing CPUs and continue
This will probably fix missing CPUs on low-binned machines

Signed-off-by: Hector Martin <marcan@marcan.st>
2022-02-08 13:35:49 +09:00
Janne Grunau
1903dbd17e kboot: reload dt offset after dt_set_uboot_dm_preloc
Fixes adding "u-boot,dm-pre-reloc" to all required power-management
nodes on t600x.

Signed-off-by: Janne Grunau <j@jannau.net>
2022-02-07 01:02:21 +09:00
Hector Martin
0d35eb3da7 m1n1.proxyutils: Wrap ADT base to 64 bits
This works around a wraparound issue when the virt base ends up causing
the ADT address to go negative, when on 12.1+ using a dummy virt base.

Fixes: #155
Signed-off-by: Hector Martin <marcan@marcan.st>
2022-02-06 20:49:54 +09:00
Hector Martin
7697e992b0 fb: Fix init message pointer
Signed-off-by: Hector Martin <marcan@marcan.st>
2022-02-06 15:41:30 +09:00
Hector Martin
e1a7deb2d5 i2c: Increase low-level timeouts to 50ms.
Hopefully this will cover all corner cases of the Ace2s being slow.

Issue: #101
Signed-off-by: Hector Martin <marcan@marcan.st>
2022-02-06 15:36:22 +09:00
Sven Peter
cad8df30ce nvme: delete IO SQ/CQ when shutting down
This should not be required but it looks like the 12.1 ANS2 firmware
complains when NVME_CC.EN is cleared before the IO queues have been
deleted.

Signed-off-by: Sven Peter <sven@svenpeter.dev>
2022-02-02 22:57:54 +09:00
Sven Peter
768be5bd58 sart: fix sart3_set_entry
writel_relaxed(val, addr) inside Linux but write32(addr, val) inside
m1n1 confused my muscle memory.

Signed-off-by: Sven Peter <sven@svenpeter.dev>
2022-02-02 22:57:54 +09:00
Sven Peter
2ee920d229 sart: fix for 12.1
Looks like Apple decided to change the compatible to sart,coastguard and rely
on the sart-version ADT property to differentiate between M1 and M1 Pro/Max
instead. sart-version is already present in the 11.x ADT so let's just
always decide based on that.

Signed-off-by: Sven Peter <sven@svenpeter.dev>
2022-02-02 22:57:54 +09:00
Hector Martin
fbc15bd77c payload: Consider an IMG4 blob as the end of payloads
When loading m1n1.bin, SEPFW follows m1n1 and thus will show up at
the payload offset if there are no payloads.

Fixes: #158
Signed-off-by: Hector Martin <marcan@marcan.st>
2022-02-01 15:52:08 +09:00
Mikhail Gusarov
88874936c6 proxyclient: utils.py: add ehexdump()
ehexdump is similar to chexdump, and uses CP437 control characters
and Braille to improve eyeballability of character output.

Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net>
2022-01-26 15:39:23 +09:00
Sven Peter
ccf4b20a1d proxy: add nvme_{read,flush}
Signed-off-by: Sven Peter <sven@svenpeter.dev>
2022-01-26 15:38:40 +09:00
Sven Peter
5f17b4743e nvme: bring up controller and implement nvme_read
Signed-off-by: Sven Peter <sven@svenpeter.dev>
2022-01-26 15:38:40 +09:00
Sven Peter
54ff538df9 asc: use timeout_*
Signed-off-by: Sven Peter <sven@svenpeter.dev>
2022-01-26 15:38:40 +09:00
Sven Peter
2bbf994089 utils: add timeout_{calculate,expired}
Signed-off-by: Sven Peter <sven@svenpeter.dev>
2022-01-26 15:38:40 +09:00
Sven Peter
21fec139bf utils: add write64_lo_hi
Signed-off-by: Sven Peter <sven@svenpeter.dev>
2022-01-26 15:38:40 +09:00
Sven Peter
bbea5167d5 rtkit: fix RTKIT_SYSLOG
Signed-off-by: Sven Peter <sven@svenpeter.dev>
2022-01-26 15:38:40 +09:00
Sven Peter
f44d5db4fa proxyclient/asc: s/Mgmt_StartSyslog/Mgmt_SetAPPower/
Signed-off-by: Sven Peter <sven@svenpeter.dev>
2022-01-26 15:38:40 +09:00
Mark Kettenis
30d6c6374d kboot: Add u-boot,dm-pre-reloc properties
These properties are needed such that U-Boot can enable the
serial port in its early pre-relocation phase.

Signed-off-by: Mark Kettenis <kettenis@openbsd.org>
2022-01-26 15:37:47 +09:00
Sven Peter
2bd7bf4020 afk: use version 3 for epic_sub_hdr
This drops the tx/rxcookie and accepts TYPE_NOTIFY in addition to
TYPE_REPLY for command replies to make the DCP code also work on 11.x.

It'll still complain about an unexpected message during init but work.

Signed-off-by: Sven Peter <sven@svenpeter.dev>
2022-01-19 03:24:20 +09:00
Sven Peter
6816c151bb proxyclient/epic: Add support for SubHeader.version = 3
Signed-off-by: Sven Peter <sven@svenpeter.dev>
2022-01-19 03:24:20 +09:00
Hector Martin
f20a0fbcd5 rtkit: Do not ack prealloc'd buffers
Signed-off-by: Hector Martin <marcan@marcan.st>
2022-01-19 03:23:42 +09:00