Extend start_interface() with the number of expected services so it can
stop when all services are initialized.
Fixes failed display init on some devices in stage 1 due to a too slow
IOP which does not manage to send service announce messages in 20
mailbox / ringbuffer query operations.
Proper fix for this is to let the endpoint implementations drive the
initialization via afk_epic_work() until the expected services are
found.
Signed-off-by: Janne Grunau <j@jannau.net>
clang 17 now enforces strict prototyping. add void to the parameters
to fix building with clang going forward.
Signed-off-by: James Calligeros <jcalligeros99@gmail.com>
Fixes display initialization from stage 1 m1n1. 20ms looked reliable on
j473 but let's add 25% safety margin. Someone with more motivation (and
HW serial) to do repeated `kmutil configure-boot ...` can try to
minimize this and test on t602x.
Signed-off-by: Janne Grunau <j@jannau.net>
Without this property u-boot will add reserved memory regions to the
EFI memory map with the wrong type. This results in Linux mapping it
and thus breaking the intended use in the asahi driver.
Signed-off-by: Janne Grunau <j@jannau.net>
On M2* desktop systems the HDMI output is not managed by dcp/dcp0. This
allows more flexibility, for example dcp on the M2 Mac mini can be
routed to the USB-C/ThunderBolt ports.
For m1n1 this adds quite ab bit of complexity. In addition to the DCP
iboot endpoint/protocol two additional endpoints have to be started.
Only the dptx-port endpoint has a meaningful AP <=> DCP communication.
In addition we start the system endpoint to optionally enable more
verbose syslog messages (if RTKIT_SYSLOG is defined).
In addition the dptx-phy or lpdptx-phy has to be programmed. Those two
phy look mostly identical. MacOS seems to use a static DP configuration
(4 lanes, HBR3*) regardless of the connected display.
The added SMC gpio support is used to power the MCDP29xx DP to HDMI
converter on.
Config is unfortunately a mess since Apple can't name the device tree
nodes consistently. On M2 Ultra devices only the four dcpext*/dispext*
on each die are used. M2 Ultra support is untested.
* link rate might differ on t602x based devices for 8k60 support
Signed-off-by: Janne Grunau <j@jannau.net>
They exceed 256 with repeated chainloading of m1n1.bin on j473. Do not
hold a service for every possible channel but keep a fixed array of 8
services identified by the channel number.
Signed-off-by: Janne Grunau <j@jannau.net>
This needs to ensure that the data processing does not block on
message retrieval from the mailbox. Command processing must not block
and have to ensure that afk_epic_command() receives the reply to its
command.
DCP's dptx-port endpoint (endpoint 0x2a) can send notifies at any time
which needs to be processed in the right context.
Signed-off-by: Janne Grunau <j@jannau.net>