Commit graph

674 commits

Author SHA1 Message Date
Janne Grunau
43fa9185f6 WIP: AFK: Support multiple endpoints with IOP initiated communication
Endpoint 0x2a (dptx-port) sees DCP initiated notify messages. Those need
to be handled with the correct endpoint context and must not be rejected
when other endpoints are polling for new messages.
2023-03-31 17:46:30 +02:00
Janne Grunau
32431d8ba1 WIP: dcp/dptx: Add support for dcp endpoint dptx
Supposedly required for HDMI out initilization on M2 (Pro)? Mac minis.
2023-03-31 17:46:30 +02:00
Janne Grunau
a2b4a7479a payload: Add a custom header with a payload size field for initramfs'
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>
2023-03-31 17:46:30 +02:00
Asahi Lina
fa3dcd3e77 payload: Add tso=1 m1n1 option to enable TSO
Signed-off-by: Asahi Lina <lina@asahilina.net>
2023-03-28 19:06:20 +09:00
Asahi Lina
0a05a0171e proxy: Add smp_is_alive() thunk
Signed-off-by: Asahi Lina <lina@asahilina.net>
2023-03-28 19:06:20 +09:00
Eileen Yoon
4a679b12bd tunables_static: improve sequence iter
Signed-off-by: Eileen Yoon <eyn@gmx.com>
2023-03-28 17:19:45 +09:00
Eileen Yoon
2abf3af38e tunables_static: add t8103 ane tunables
Signed-off-by: Eileen Yoon <eyn@gmx.com>
2023-03-28 17:19:45 +09:00
Eileen Yoon
cf09e4ff56 tunables_static: abstraction to reuse entries
Signed-off-by: Eileen Yoon <eyn@gmx.com>
2023-03-28 17:19:45 +09:00
Hector Martin
a633b90634 kboot: Remove leftover IPD lookup dead code
Signed-off-by: Hector Martin <marcan@marcan.st>
2023-03-19 20:30:01 +09:00
Hector Martin
a024101b75 kboot: Pass keyboard layout ID & country code in HID device
Signed-off-by: Hector Martin <marcan@marcan.st>
2023-03-19 18:14:44 +09:00
Janne Grunau
c6c426581b pcie: Add link speed override for SD card reader
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>
2023-03-12 00:32:10 +09:00
Asahi Lina
5d5fa70efa firmware: Add 13.1/13.2 to version list
Signed-off-by: Asahi Lina <lina@asahilina.net>
2023-03-06 15:15:17 +09:00
Janne Grunau
583f290b2b Add a space between '//' and '#' to satisfy clang-format 15
Signed-off-by: Janne Grunau <j@jannau.net>
2023-02-02 09:51:08 +09:00
Janne Grunau
c8c0bd5dc5 display: Check if FB IOVA is available on dart-disp0
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>
2023-02-02 09:50:33 +09:00
Janne Grunau
4e7398e3a8 display: Start scanning for fb IOVA at vm-base
Required for M2 devices as the M2 Mac mini.

Signed-off-by: Janne Grunau <j@jannau.net>
2023-02-02 09:50:33 +09:00
Janne Grunau
bff8aa647c dcp: Offset temporary IOVA space from vm-base
Required on M2 devices.

Signed-off-by: Janne Grunau <j@jannau.net>
2023-02-02 09:50:33 +09:00
Janne Grunau
7e33a578d8 rtkit: Extend IOVA to 36-bit
Required for DCP on M2.

Signed-off-by: Janne Grunau <j@jannau.net>
2023-02-02 09:50:33 +09:00
Janne Grunau
f68a842ab7 rtkit: Apply "asc-dram-mask" consistently
Required for DCP on M2 which requires 36-bit IOVA space.

Signed-off-by: Janne Grunau <j@jannau.net>
2023-02-02 09:50:33 +09:00
Janne Grunau
6466f8dec8 dcp: Parse dart SID for DCP
Required for M2 which for which the dice showed "5".

Signed-off-by: Janne Grunau <j@jannau.net>
2023-02-02 09:50:33 +09:00
Janne Grunau
8af2489d84 dart: Increase IO address space to 36-bit
This address space a single TTBR can hold with a 16k page size. Required
for DCP on M2.

Signed-off-by: Janne Grunau <j@jannau.net>
2023-02-02 09:50:33 +09:00
Janne Grunau
93abc760b2 dart: Add checks to dart_translate_internal()
Previous assumptions are not longer true with dart8110 on M2.

Signed-off-by: Janne Grunau <j@jannau.net>
2023-02-02 09:50:33 +09:00
Janne Grunau
c3c29bbd92 dart: Allow SIDs != 0 in dart_setup_pt_region()
Required for dart-dcp on M2 and M2 Pro/Max.

Signed-off-by: Janne Grunau <j@jannau.net>
2023-02-02 09:50:33 +09:00
Janne Grunau
72cdec0e31 dart: Use "vm-base" as start when installing L2 tables
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>
2023-02-02 09:50:33 +09:00
Sasha Finkelstein
d110da1e75 copy the touchscreen calibration
Signed-off-by: Sasha Finkelstein <fnkl.kernel@gmail.com>
2023-01-28 21:58:44 +09:00
Sven Peter
90d0cd6b89 kboot: Copy ACIO tunables and DROM data
Signed-off-by: Sven Peter <sven@svenpeter.dev>
2023-01-28 10:56:03 +09:00
Mark Kettenis
951afdd033 kboot: Add new U-Boot driver model 'phase-tags'
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>
2023-01-22 23:54:00 +09:00
Janne Grunau
a56e3fbc78 kboot: dcp: Add "memory-region-names" properties
Signed-off-by: Janne Grunau <j@jannau.net>
2023-01-22 23:47:40 +09:00
Janne Grunau
fe38315f1c kboot: reserve framebuffer from "/vram"
Fixes dcp if m1n1 reallocated the framebuffer due to large boot display
resolution. In that case we update "/vram" but leave the carveout
unmodified.

Use "framebuffer" as compatible string as proposed in
https://lore.kernel.org/dri-devel/20221117184039.2291937-4-thierry.reding@gmail.com/

Signed-off-by: Janne Grunau <j@jannau.net>
2023-01-22 23:47:40 +09:00
Janne Grunau
d73f53d9a0 kboot: dcp: Use "apple,asc-mem" as compatible strings for reserved memory
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>
2023-01-22 23:47:40 +09:00
Janne Grunau
9ca6016a4e kboot: dcp: Use "apple,asc-mem" as compatible strings for reserved memory
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>
2023-01-22 23:47:40 +09:00
Janne Grunau
4ed1a9c862 kboot: move dt_carveout_reserved_regions() after refactoring
Signed-off-by: Janne Grunau <j@jannau.net>
2023-01-22 23:47:40 +09:00
Janne Grunau
2667b10054 kboot: refactor dt_carveout_reserved_regions()
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>
2023-01-22 23:47:40 +09:00
Asahi Lina
3d28ac4d6f tools/chainload.py: Properly sleep DCP when chainloading macOS
Signed-off-by: Asahi Lina <lina@asahilina.net>
2023-01-20 18:18:13 +09:00
Martin Povišer
7db691737e kboot: Transfer virtio nodes from ADT to FDT
Signed-off-by: Martin Povišer <povik@cutebit.org>
2023-01-13 17:25:25 +09:00
Martin Povišer
6661ab14d0 hv: Add 9P virtio peripheral
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>
2023-01-13 17:25:25 +09:00
Hector Martin
fb36e30236 firmware: Add support for 12.3.1 firmware.
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>
2022-12-08 23:04:01 +09:00
Janne Grunau
426604926d kboot/dcpext: Fix mapping of dcp_txt on t8112 / M2
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>
2022-12-04 22:04:40 +09:00
Janne Grunau
159c553c6a kboot: Call dt_set_dcp_firmware() from dt_carveout_reserved_regions()
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>
2022-12-04 22:04:40 +09:00
Hector Martin
2abf2b1693 kboot: Forward DCP firmware versions into the DT
Signed-off-by: Hector Martin <marcan@marcan.st>
2022-12-04 16:06:27 +09:00
Hector Martin
e1b2c45f34 kboot_gpu: Set firmware versions from ADT
The kernel side doesn't check this yet, we'll let Lina take care of
that.

Signed-off-by: Hector Martin <marcan@marcan.st>
2022-12-04 16:06:27 +09:00
Hector Martin
c8d95baca0 kboot: Forward iBoot, firmware and m1n1 versions into the DT
Signed-off-by: Hector Martin <marcan@marcan.st>
2022-12-04 16:06:27 +09:00
Hector Martin
c19303dc87 firmware: New module to detect firmware version
Signed-off-by: Hector Martin <marcan@marcan.st>
2022-12-04 16:06:27 +09:00
Asahi Lina
db93de58b8 kboot_gpu: Add proper max-power and leakage calculations for t8112
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>
2022-12-04 13:17:10 +09:00
Asahi Lina
d20d89b704 tunables_static: Add t8112 GPU tunables
Signed-off-by: Asahi Lina <lina@asahilina.net>
2022-12-04 13:17:10 +09:00
Asahi Lina
f9862415b1 tunables_static: Add t600x GPU tunables
Signed-off-by: Asahi Lina <lina@asahilina.net>
2022-12-04 13:17:10 +09:00
Asahi Lina
e6ffbb018b kboot_gpu: Add proper max-power and leakage calculations for t600x/t8103
Signed-off-by: Asahi Lina <lina@asahilina.net>
2022-12-04 13:17:10 +09:00
Asahi Lina
057151cb21 math: Add expf() implementation from musl
Signed-off-by: Asahi Lina <lina@asahilina.net>
2022-12-04 13:17:10 +09:00
Asahi Lina
444c3c854b kboot_gpu: Dummy t8112 power calculation
This is wrong but it will do for now

Signed-off-by: Asahi Lina <lina@asahilina.net>
2022-12-04 13:17:10 +09:00
Asahi Lina
3278d75453 kboot_gpu: Add preliminary T600x support
Signed-off-by: Asahi Lina <lina@asahilina.net>
2022-12-04 13:17:10 +09:00
Asahi Lina
4a6a4c0376 kboot: Add initial GPU property forwarding
Signed-off-by: Asahi Lina <lina@asahilina.net>
2022-12-04 13:15:55 +09:00