The macOS 13.3 DCP firmware extended swap_set_layer_cmd in an
incompatible way. Let dcp_ib_swap_set_layer() send the matching struct
based on the firmware version.
Signed-off-by: Janne Grunau <j@jannau.net>
The macOS 13.3 DCP firmware uses TYPE_REPLY instead of TYPE_NOTIFY for
the disp0-service interface init message.
Signed-off-by: Janne Grunau <j@jannau.net>
This add supports for concatenated (compressed) cpio archives and relies
on the kernel to decompress the initramfs.
Signed-off-by: Janne Grunau <j@jannau.net>
This definitely isn't going to work yet, but it's better than ending up
in the secondary loop if it ever works.
Signed-off-by: Hector Martin <marcan@marcan.st>
This lets us eliminate HV timer ticks on secondary CPUs, which should
significantly improve the scalability of this whole thing.
(We leave them at 1Hz just in case, since that much won't hurt)
Signed-off-by: Hector Martin <marcan@marcan.st>
This will be useful for CI and similar use cases, to distinguish
different machines. Also fix spurious NUL-termination of the descriptor
strings while I'm here.
Signed-off-by: Hector Martin <marcan@marcan.st>
Put the WFI mode back how macOS expects it on boot, since it won't set
it itself. Then, also trap attempts by macOS to disable FIQs. This
happens in the sleep/core off path. It is not sufficient to make all
that work properly, but it's a start.
Signed-off-by: Hector Martin <marcan@marcan.st>
I already screwed something up in cpufreq, and it makes it difficult to
understand what happened if it happens in stage1 before the proxy runs,
and difficult to undo in stage2.
Let's move all this stuff to kboot, since it isn't necessary until then
(and this will also avoid doing unnecessary init for macOS under the
HV). If we need it in proxy scripts, we can add proxy commands for this
later.
Signed-off-by: Hector Martin <marcan@marcan.st>
I don't think that field ever did anything and Apple don't set it on
newer macOS/SoCs. Also expand DESIRED1 to T602x width.
Signed-off-by: Hector Martin <marcan@marcan.st>
Nobody can figure out where this code came from and it's broken for
devices where OSLog is actually implemented these days... let's drop it
and see if anything complains.
Signed-off-by: Hector Martin <marcan@marcan.st>
We're not using it in the end because we fixed this in Linux, but I went
through the trouble of writing the function so we might as well leave it
lying around.
Signed-off-by: Hector Martin <marcan@marcan.st>
The SD card reader on Macbook Pro 14"/16" and Mac Studio uses yet
another property to override the port's "maximum-link-speed" property.
Add parsing for "expected-link-speed" and always look in the port's
first child for these properties.
Increases the link speed to PCIe 2.0 which is required for the full
bandwidth of SDXC UHS-II.
Signed-off-by: Janne Grunau <j@jannau.net>
Fixes a copy and paste error in 1b5dee2496 checking dart-dcp twice.
Fixes: 1b5dee2496 ("display: Map the framebuffer if it is not mapped")
Signed-off-by: Janne Grunau <j@jannau.net>
Additional L2 tables for dart-dcp/disp0 need to be from carveout memory
so they can kept after m1n1 exist. iboot has "pt-region-X" and "l2-tt-X"
in the ADT. For DCP on M2 we have to start installing them at "vm-base"
which is 0x8_0000_0000.
This probably causes problems on M2 Pro which uses 1 << 40 as vm-base
for dart-dcp0.
Signed-off-by: Janne Grunau <j@jannau.net>
U-Boot is moving to a new set of tags to indicate devices that
should be bound/probed in early bootstrap phases. Add 'bootph-all'
tags from the new bindings such that probing the serial port
early on in U-Boot continues to work and doesn't hang the system.
Signed-off-by: Mark Kettenis <kettenis@openbsd.org>
This is in preparation for the next commit to use "framebuffer" as
compatible string for the boot framebuffer. This is in line with a
proposed change for boot framebuffer handling on Nvidia Tegra SoCs.
It will allow removing simpledrm via
drm_aperture_remove_conflicting_framebuffers().
Signed-off-by: Janne Grunau <j@jannau.net>
This is in preparation for the next commit to use "framebuffer" as
compatible string for the boot framebuffer. This is in line with a
proposed change for boot framebuffer handling on Nvidia Tegra SoCs.
It will allow removing simpledrm via
drm_aperture_remove_conflicting_framebuffers().
Signed-off-by: Janne Grunau <j@jannau.net>
The main part of function will be used to add a reserved memory region
for the framebuffer from "/vram" instead of the carveout.
Signed-off-by: Janne Grunau <j@jannau.net>
Add some minimal implementation of virtio peripherals. At the level
of on-target hypervisor code we implement the MMIO layout and
maintain virtqueues. Once a buffer is available, we break into the
host proxyclient to deal with it.
Specific device-classes of the virtio spec ought to be implemented in
the proxyclient. Here the one device implemented is 9P transport,
exporting the m1n1 source directory.
Signed-off-by: Martin Povišer <povik@cutebit.org>
This includes mapping it to 12.3.0 for compat in both DCP and GPU.
Added for machines with replaced logic boards that trigger the 12.3
bootloop issue.
Also fix the 12.5/12.6 version arrays which were wrong.
Signed-off-by: Hector Martin <marcan@marcan.st>
dcp_txt is mapped on dart-dcp and dart-dcpext so check if its reserved
memory node already exist before adding it.
Signed-off-by: Janne Grunau <j@jannau.net>
This avoids having duplicate calls for dcpext* on each mayor SoC
variant. Fixes setting firmware versions for dcpext on t8103 and t8112.
Signed-off-by: Janne Grunau <j@jannau.net>
This uses a similar algorithm to t600x, but with different constants and
exponents. The current limit also engages here, so add it, and add the
t600x one too (even though it is never hit).
Signed-off-by: Asahi Lina <lina@asahilina.net>
Devicetrees with dart-disp0 will have it disabled to avoid breaking
scanout off the boot framebuffer when booting via m1n1 version which
does not lock dart-disp0.
Signed-off-by: Janne Grunau <j@jannau.net>