Skip to content

Commit 3f56fba

Browse files
committed
Add MacBook Air M4 MTP (keyboard, trackpad) support.
Signed-off-by: Josh Rodd <[email protected]> Assisted-by: oh-my-pi:gpt-6-astra
1 parent dea38a9 commit 3f56fba

10 files changed

Lines changed: 947 additions & 270 deletions

File tree

‎Documentation/devicetree/bindings/iommu/apple,dart.yaml‎

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,29 @@ properties:
6060
Has to be one. The single cell describes the stream id emitted by
6161
a master to the IOMMU.
6262

63+
apple,sid-remap:
64+
$ref: /schemas/types.yaml#/definitions/uint32-matrix
65+
description: |
66+
Hardware requestor SID aliases required by this DART's integration.
67+
Each pair contains a source requestor SID followed by the target
68+
translation SID whose page tables and access controls it must use.
69+
Only T8110-compatible DARTs support this mapping; target SIDs are
70+
limited to the four-bit TCR remap field.
71+
72+
Aliased requestors cannot be isolated from their target and must share
73+
its translation context and IOMMU group. A source SID must not also
74+
appear as a target; self-maps, chains and cycles are not supported.
75+
SIDs not listed as sources retain identity mapping. Omit this property
76+
when no hardware requestor aliases are required.
77+
minItems: 1
78+
maxItems: 255
79+
items:
80+
items:
81+
- description: Source requestor SID
82+
maximum: 255
83+
- description: Target translation SID
84+
maximum: 15
85+
6386
power-domains:
6487
maxItems: 1
6588

@@ -69,6 +92,17 @@ required:
6992
- '#iommu-cells'
7093
- interrupts
7194

95+
allOf:
96+
- if:
97+
not:
98+
properties:
99+
compatible:
100+
contains:
101+
const: apple,t8110-dart
102+
then:
103+
properties:
104+
apple,sid-remap: false
105+
72106
additionalProperties: false
73107

74108
examples:

‎arch/arm64/boot/dts/apple/t8132-j715.dts‎

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@
1717
compatible = "apple,j715", "apple,t8132", "apple,arm-platform";
1818
model = "Apple MacBook Air (15-inch, M4, 2025)";
1919

20+
aliases {
21+
keyboard = &keyboard;
22+
};
23+
2024
led-controller {
2125
compatible = "pwm-leds";
2226
led-0 {
@@ -33,3 +37,44 @@
3337
&fpwm1 {
3438
status = "okay";
3539
};
40+
41+
&mtp {
42+
status = "okay";
43+
};
44+
45+
&mtp_mbox {
46+
status = "okay";
47+
};
48+
49+
&mtp_dart {
50+
status = "okay";
51+
};
52+
53+
&mtp_dockchannel {
54+
status = "okay";
55+
};
56+
57+
&mtp_hid {
58+
status = "okay";
59+
60+
multi-touch {
61+
firmware-name = "apple/tpmtfw-j715.bin";
62+
};
63+
64+
keyboard: keyboard {
65+
hid-country-code = <0>;
66+
apple,keyboard-layout-id = <0>;
67+
};
68+
69+
stm {
70+
};
71+
72+
actuator {
73+
};
74+
75+
tp-accel {
76+
};
77+
78+
mtp {
79+
};
80+
};

‎arch/arm64/boot/dts/apple/t8132.dtsi‎

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -790,6 +790,73 @@
790790
<AIC_IRQ 429 IRQ_TYPE_LEVEL_HIGH>;
791791
};
792792

793+
mtp: mtp@394600000 {
794+
compatible = "apple,t8132-mtp", "apple,t8132-rtk-helper-asc4",
795+
"apple,mtp", "apple,rtk-helper-asc4";
796+
reg = <0x3 0x94600000 0x0 0x4000>;
797+
reg-names = "asc";
798+
mboxes = <&mtp_mbox>;
799+
iommus = <&mtp_dart 0>;
800+
#helper-cells = <0>;
801+
status = "disabled";
802+
};
803+
804+
mtp_mbox: mbox@394608000 {
805+
compatible = "apple,t8132-asc-mailbox", "apple,asc-mailbox-v4";
806+
reg = <0x3 0x94608000 0x0 0x4000>;
807+
interrupt-parent = <&aic>;
808+
interrupts = <AIC_IRQ 1113 IRQ_TYPE_LEVEL_HIGH>,
809+
<AIC_IRQ 1114 IRQ_TYPE_LEVEL_HIGH>,
810+
<AIC_IRQ 1115 IRQ_TYPE_LEVEL_HIGH>,
811+
<AIC_IRQ 1116 IRQ_TYPE_LEVEL_HIGH>;
812+
interrupt-names = "send-empty", "send-not-empty",
813+
"recv-empty", "recv-not-empty";
814+
#mbox-cells = <0>;
815+
status = "disabled";
816+
};
817+
818+
mtp_dart: iommu@394800000 {
819+
compatible = "apple,t8132-dart", "apple,t8110-dart";
820+
reg = <0x3 0x94800000 0x0 0xc000>;
821+
interrupt-parent = <&aic>;
822+
interrupts = <AIC_IRQ 1091 IRQ_TYPE_LEVEL_HIGH>;
823+
#iommu-cells = <1>;
824+
apple,sid-remap = <1 0>, <2 0>, <3 0>;
825+
status = "disabled";
826+
};
827+
828+
mtp_dockchannel: fifo@394b14000 {
829+
compatible = "apple,t8132-dockchannel", "apple,dockchannel";
830+
reg = <0x3 0x94b14000 0x0 0x1000>;
831+
reg-names = "irq";
832+
interrupt-parent = <&aic>;
833+
interrupts = <AIC_IRQ 1093 IRQ_TYPE_LEVEL_HIGH>;
834+
ranges = <0 0x3 0x94b28000 0x10000>;
835+
nonposted-mmio;
836+
#address-cells = <1>;
837+
#size-cells = <1>;
838+
interrupt-controller;
839+
#interrupt-cells = <2>;
840+
status = "disabled";
841+
842+
mtp_hid: input@0 {
843+
compatible = "apple,t8132-dockchannel-hid", "apple,dockchannel-hid";
844+
reg = <0x0000 0x1000>,
845+
<0x4000 0x1000>,
846+
<0x8000 0x1000>,
847+
<0xc000 0x1000>;
848+
reg-names = "rmt-config", "rmt-data", "config", "data";
849+
iommus = <&mtp_dart 0>;
850+
interrupt-parent = <&mtp_dockchannel>;
851+
interrupts = <2 IRQ_TYPE_LEVEL_HIGH>,
852+
<3 IRQ_TYPE_LEVEL_HIGH>;
853+
interrupt-names = "tx", "rx";
854+
apple,fifo-size = <0x800>;
855+
apple,helper-cpu = <&mtp>;
856+
status = "disabled";
857+
};
858+
};
859+
793860
pinctrl_ap: pinctrl@39a000000 {
794861
compatible = "apple,t8132-pinctrl", "apple,t8103-pinctrl";
795862
reg = <0x3 0x9a000000 0x0 0x100000>;

‎drivers/hid/dockchannel-hid/Kconfig‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ menu "DockChannel HID support"
55
config HID_DOCKCHANNEL
66
tristate "HID over DockChannel transport layer for Apple Silicon SoCs"
77
depends on APPLE_DOCKCHANNEL && INPUT && OF && HID
8+
depends on APPLE_RTKIT_HELPER
89
help
910
Say Y here if you use an M2 or later Apple Silicon based laptop.
1011
The keyboard and touchpad are HID based devices connected via the

0 commit comments

Comments
 (0)