arm: dts: apple: Add Apple M2 device trees

Device trees for the M2 MacBook Air and the M2 13" MacBook Pro.
Taken from the asahi branch of the Asahi Linux github repository.

Signed-off-by: Mark Kettenis <kettenis@openbsd.org>
This commit is contained in:
Mark Kettenis 2022-07-20 00:35:29 +02:00
parent 514b2c004f
commit c969c4ebce
9 changed files with 4302 additions and 1 deletions

View file

@ -44,7 +44,11 @@ dtb-$(CONFIG_ARCH_APPLE) += \
t8103-j293.dtb \
t8103-j313.dtb \
t8103-j456.dtb \
t8103-j457.dtb
t8103-j457.dtb \
t8112-j413.dtb \
t8112-j415.dtb \
t8112-j473.dtb \
t8112-j493.dtb
dtb-$(CONFIG_ARCH_DAVINCI) += \
da850-evm.dtb \

View file

@ -0,0 +1,92 @@
// SPDX-License-Identifier: GPL-2.0+ OR MIT
/*
* ISP configuration for platforms with IMX558 sensor in
* config #0 mode.
*
* These platforms enable MLVNR for all configs except
* #0, which we don't support. Config #0 is an uncropped
* square 1920x1920 sensor, with dark corners.
* Therefore, we synthesize common resolutions by using
* crop/scale while always choosing config #0.
*
* Copyright The Asahi Linux Contributors
*/
#include "isp-common.dtsi"
&isp {
apple,temporal-filter = <0>;
sensor-presets {
/* 1920x1080 */
preset0 {
apple,config-index = <0>;
apple,input-size = <1920 1920>;
apple,output-size = <1920 1080>;
apple,crop = <0 420 1920 1080>;
};
/* 1080x1920 */
preset1 {
apple,config-index = <0>;
apple,input-size = <1920 1920>;
apple,output-size = <1080 1920>;
apple,crop = <420 0 1080 1920>;
};
/* 1920x1440 */
preset2 {
apple,config-index = <0>;
apple,input-size = <1920 1920>;
apple,output-size = <1920 1440>;
apple,crop = <0 240 1920 1440>;
};
/* 1440x1920 */
preset3 {
apple,config-index = <0>;
apple,input-size = <1920 1920>;
apple,output-size = <1440 1920>;
apple,crop = <240 0 1440 1920>;
};
/* 1280x720 */
preset4 {
apple,config-index = <0>;
apple,input-size = <1920 1920>;
apple,output-size = <1280 720>;
apple,crop = <0 420 1920 1080>;
};
/* 720x1280 */
preset5 {
apple,config-index = <0>;
apple,input-size = <1920 1920>;
apple,output-size = <720 1280>;
apple,crop = <420 0 1080 1920>;
};
/* 1280x960 */
preset6 {
apple,config-index = <0>;
apple,input-size = <1920 1920>;
apple,output-size = <1280 960>;
apple,crop = <0 240 1920 1440>;
};
/* 960x1280 */
preset7 {
apple,config-index = <0>;
apple,input-size = <1920 1920>;
apple,output-size = <960 1280>;
apple,crop = <240 0 1440 1920>;
};
/* 640x480 */
preset8 {
apple,config-index = <0>;
apple,input-size = <1920 1920>;
apple,output-size = <640 480>;
apple,crop = <0 240 1920 1440>;
};
/* 480x640 */
preset9 {
apple,config-index = <0>;
apple,input-size = <1920 1920>;
apple,output-size = <480 640>;
apple,crop = <240 0 1440 1920>;
};
};
};

245
arch/arm/dts/t8112-j413.dts Normal file
View file

@ -0,0 +1,245 @@
// SPDX-License-Identifier: GPL-2.0+ OR MIT
/*
* Apple MacBook Air (M2, 2022)
*
* target-type: J413
*
* Copyright The Asahi Linux Contributors
*/
/dts-v1/;
#include "t8112.dtsi"
#include "t8112-jxxx.dtsi"
#include <dt-bindings/leds/common.h>
/ {
compatible = "apple,j413", "apple,t8112", "apple,arm-platform";
model = "Apple MacBook Air (13-inch, M2, 2022)";
aliases {
bluetooth0 = &bluetooth0;
wifi0 = &wifi0;
keyboard = &keyboard;
};
led-controller {
compatible = "pwm-leds";
led-0 {
pwms = <&fpwm1 0 40000>;
label = "kbd_backlight";
function = LED_FUNCTION_KBD_BACKLIGHT;
color = <LED_COLOR_ID_WHITE>;
max-brightness = <255>;
default-state = "keep";
};
};
};
&dcp {
panel: panel {
compatible = "apple,panel-j413", "apple,panel";
width-mm = <290>;
height-mm = <189>;
adj-height-mm = <181>;
apple,max-brightness = <525>;
};
};
/*
* Force the bus number assignments so that we can declare some of the
* on-board devices and properties that are populated by the bootloader
* (such as MAC addresses).
*/
&port00 {
bus-range = <1 1>;
pwren-gpios = <&smc_gpio 13 GPIO_ACTIVE_HIGH>;
wifi0: wifi@0,0 {
compatible = "pci14e4,4433";
reg = <0x10000 0x0 0x0 0x0 0x0>;
/* To be filled by the loader */
local-mac-address = [00 10 18 00 00 10];
apple,antenna-sku = "XX";
brcm,board-type = "apple,hokkaido";
};
bluetooth0: bluetooth@0,1 {
compatible = "pci14e4,5f71";
reg = <0x10100 0x0 0x0 0x0 0x0>;
/* To be filled by the loader */
local-bd-address = [00 00 00 00 00 00];
brcm,board-type = "apple,hokkaido";
};
};
/*
* Provide labels for the USB type C ports.
*/
&typec0 {
label = "USB-C Left-back";
};
&typec1 {
label = "USB-C Left-front";
};
&i2c0 {
/* MagSafe port */
hpm5: usb-pd@3a {
compatible = "apple,cd321x";
reg = <0x3a>;
interrupt-parent = <&pinctrl_ap>;
interrupts = <8 IRQ_TYPE_LEVEL_LOW>;
interrupt-names = "irq";
};
};
/* Virtual regulator representing the shared shutdown GPIO */
/ {
speaker_sdz: fixed-regulator-sn012776-sdz {
compatible = "regulator-fixed";
regulator-name = "sn012776-sdz";
startup-delay-us = <5000>;
gpios = <&pinctrl_ap 88 GPIO_ACTIVE_HIGH>;
enable-active-high;
};
};
&i2c1 {
speaker_left_woof: codec@38 {
compatible = "ti,sn012776", "ti,tas2764";
reg = <0x38>;
SDZ-supply = <&speaker_sdz>;
#sound-dai-cells = <0>;
sound-name-prefix = "Left Woofer";
interrupts-extended = <&pinctrl_ap 11 IRQ_TYPE_LEVEL_LOW>;
ti,imon-slot-no = <0>;
ti,vmon-slot-no = <2>;
ti,sdout-force-zero-mask = <0xf0f0>;
};
speaker_left_tweet: codec@39 {
compatible = "ti,sn012776", "ti,tas2764";
reg = <0x39>;
SDZ-supply = <&speaker_sdz>;
#sound-dai-cells = <0>;
sound-name-prefix = "Left Tweeter";
interrupts-extended = <&pinctrl_ap 11 IRQ_TYPE_LEVEL_LOW>;
ti,imon-slot-no = <8>;
ti,vmon-slot-no = <10>;
};
};
&i2c3 {
speaker_right_woof: codec@3b {
compatible = "ti,sn012776", "ti,tas2764";
reg = <0x3b>;
SDZ-supply = <&speaker_sdz>;
#sound-dai-cells = <0>;
sound-name-prefix = "Right Woofer";
interrupts-extended = <&pinctrl_ap 11 IRQ_TYPE_LEVEL_LOW>;
ti,imon-slot-no = <4>;
ti,vmon-slot-no = <6>;
ti,sdout-force-zero-mask = <0x0f0f>;
};
speaker_right_tweet: codec@3c {
compatible = "ti,sn012776", "ti,tas2764";
reg = <0x3c>;
SDZ-supply = <&speaker_sdz>;
#sound-dai-cells = <0>;
sound-name-prefix = "Right Tweeter";
interrupts-extended = <&pinctrl_ap 11 IRQ_TYPE_LEVEL_LOW>;
ti,imon-slot-no = <12>;
ti,vmon-slot-no = <14>;
};
jack_codec: codec@4b {
compatible = "cirrus,cs42l84";
reg = <0x4b>;
reset-gpios = <&pinctrl_nub 12 GPIO_ACTIVE_HIGH>;
#sound-dai-cells = <0>;
interrupts-extended = <&pinctrl_ap 149 IRQ_TYPE_LEVEL_LOW>;
sound-name-prefix = "Jack";
};
};
&i2c4 {
status = "okay";
};
&fpwm1 {
status = "okay";
};
/ {
sound {
compatible = "apple,j413-macaudio", "apple,macaudio";
model = "MacBook Air J413";
dai-link@0 {
link-name = "Speakers";
cpu {
sound-dai = <&mca 0>, <&mca 1>;
};
codec {
sound-dai = <&speaker_left_woof>, <&speaker_left_tweet>,
<&speaker_right_woof>, <&speaker_right_tweet>;
};
};
dai-link@1 {
link-name = "Headphone Jack";
cpu {
sound-dai = <&mca 2>;
};
codec {
sound-dai = <&jack_codec>;
};
};
};
};
&mtp {
status = "okay";
};
&mtp_mbox {
status = "okay";
};
&mtp_dart {
status = "okay";
};
&mtp_dockchannel {
status = "okay";
};
&mtp_hid {
multi-touch {
apple,afe-reset-gpios = <&smc_gpio 8 GPIO_ACTIVE_LOW>;
firmware-name = "apple/tpmtfw-j413.bin";
};
keyboard: keyboard {
hid-country-code = <0>;
apple,keyboard-layout-id = <0>;
};
stm {
apple,stm-reset-gpios = <&smc_gpio 24 GPIO_ACTIVE_LOW>;
};
actuator {
};
tp_accel {
};
};
#include "isp-imx558-cfg0.dtsi"
&isp {
apple,platform-id = <14>;
apple,temporal-filter = <1>;
};

268
arch/arm/dts/t8112-j415.dts Normal file
View file

@ -0,0 +1,268 @@
// SPDX-License-Identifier: GPL-2.0+ OR MIT
/*
* Apple MacBook Air (15-inchl, M2, 2023)
*
* target-type: J415
*
* Copyright The Asahi Linux Contributors
*/
/dts-v1/;
#include "t8112.dtsi"
#include "t8112-jxxx.dtsi"
#include <dt-bindings/leds/common.h>
/ {
compatible = "apple,j415", "apple,t8112", "apple,arm-platform";
model = "Apple MacBook Air (15-inch, M2, 2023)";
aliases {
bluetooth0 = &bluetooth0;
wifi0 = &wifi0;
keyboard = &keyboard;
};
led-controller {
compatible = "pwm-leds";
led-0 {
pwms = <&fpwm1 0 40000>;
label = "kbd_backlight";
function = LED_FUNCTION_KBD_BACKLIGHT;
color = <LED_COLOR_ID_WHITE>;
max-brightness = <255>;
default-state = "keep";
};
};
};
&dcp {
panel: panel {
compatible = "apple,panel-j415", "apple,panel";
width-mm = <327>;
height-mm = <211>;
adj-height-mm = <204>;
apple,max-brightness = <500>;
};
};
/*
* Force the bus number assignments so that we can declare some of the
* on-board devices and properties that are populated by the bootloader
* (such as MAC addresses).
*/
&port00 {
bus-range = <1 1>;
pwren-gpios = <&smc_gpio 13 GPIO_ACTIVE_HIGH>;
wifi0: wifi@0,0 {
compatible = "pci14e4,4433";
reg = <0x10000 0x0 0x0 0x0 0x0>;
/* To be filled by the loader */
local-mac-address = [00 10 18 00 00 10];
apple,antenna-sku = "XX";
brcm,board-type = "apple,snake";
};
bluetooth0: bluetooth@0,1 {
compatible = "pci14e4,5f71";
reg = <0x10100 0x0 0x0 0x0 0x0>;
/* To be filled by the loader */
local-bd-address = [00 00 00 00 00 00];
brcm,board-type = "apple,snake";
};
};
/*
* Provide labels for the USB type C ports.
*/
&typec0 {
label = "USB-C Left-back";
};
&typec1 {
label = "USB-C Left-front";
};
&i2c0 {
/* MagSafe port */
hpm5: usb-pd@3a {
compatible = "apple,cd321x";
reg = <0x3a>;
interrupt-parent = <&pinctrl_ap>;
interrupts = <8 IRQ_TYPE_LEVEL_LOW>;
interrupt-names = "irq";
};
};
/* Virtual regulator representing the shared shutdown GPIO */
/ {
speaker_sdz: fixed-regulator-sn012776-sdz {
compatible = "regulator-fixed";
regulator-name = "sn012776-sdz";
startup-delay-us = <5000>;
gpios = <&pinctrl_ap 88 GPIO_ACTIVE_HIGH>;
enable-active-high;
};
};
&i2c1 {
speaker_left_woof1: codec@38 {
compatible = "ti,sn012776", "ti,tas2764";
reg = <0x38>;
SDZ-supply = <&speaker_sdz>;
#sound-dai-cells = <0>;
sound-name-prefix = "Left Woofer 1";
interrupts-extended = <&pinctrl_ap 11 IRQ_TYPE_LEVEL_LOW>;
ti,imon-slot-no = <0>;
ti,vmon-slot-no = <2>;
ti,sdout-force-zero-mask = <0xf0f0f0>;
};
speaker_left_tweet: codec@39 {
compatible = "ti,sn012776", "ti,tas2764";
reg = <0x39>;
SDZ-supply = <&speaker_sdz>;
#sound-dai-cells = <0>;
sound-name-prefix = "Left Tweeter";
interrupts-extended = <&pinctrl_ap 11 IRQ_TYPE_LEVEL_LOW>;
ti,imon-slot-no = <8>;
ti,vmon-slot-no = <10>;
};
speaker_left_woof2: codec@3a {
compatible = "ti,sn012776", "ti,tas2764";
reg = <0x3a>;
SDZ-supply = <&speaker_sdz>;
#sound-dai-cells = <0>;
sound-name-prefix = "Left Woofer 2";
interrupts-extended = <&pinctrl_ap 11 IRQ_TYPE_LEVEL_LOW>;
ti,imon-slot-no = <16>;
ti,vmon-slot-no = <18>;
};
};
&i2c3 {
speaker_right_woof1: codec@3b {
compatible = "ti,sn012776", "ti,tas2764";
reg = <0x3b>;
SDZ-supply = <&speaker_sdz>;
#sound-dai-cells = <0>;
sound-name-prefix = "Right Woofer 1";
interrupts-extended = <&pinctrl_ap 11 IRQ_TYPE_LEVEL_LOW>;
ti,imon-slot-no = <4>;
ti,vmon-slot-no = <6>;
ti,sdout-force-zero-mask = <0x0f0f0f>;
};
speaker_right_tweet: codec@3c {
compatible = "ti,sn012776", "ti,tas2764";
reg = <0x3c>;
SDZ-supply = <&speaker_sdz>;
#sound-dai-cells = <0>;
sound-name-prefix = "Right Tweeter";
interrupts-extended = <&pinctrl_ap 11 IRQ_TYPE_LEVEL_LOW>;
ti,imon-slot-no = <12>;
ti,vmon-slot-no = <14>;
};
speaker_right_woof2: codec@3d {
compatible = "ti,sn012776", "ti,tas2764";
reg = <0x3d>;
SDZ-supply = <&speaker_sdz>;
#sound-dai-cells = <0>;
sound-name-prefix = "Right Woofer 2";
interrupts-extended = <&pinctrl_ap 11 IRQ_TYPE_LEVEL_LOW>;
ti,imon-slot-no = <20>;
ti,vmon-slot-no = <22>;
};
jack_codec: codec@4b {
compatible = "cirrus,cs42l84";
reg = <0x4b>;
reset-gpios = <&pinctrl_nub 12 GPIO_ACTIVE_HIGH>;
#sound-dai-cells = <0>;
interrupts-extended = <&pinctrl_ap 149 IRQ_TYPE_LEVEL_LOW>;
sound-name-prefix = "Jack";
};
};
&fpwm1 {
status = "okay";
};
/ {
sound {
compatible = "apple,j415-macaudio", "apple,macaudio";
model = "MacBook Air J415";
dai-link@0 {
link-name = "Speakers";
cpu {
sound-dai = <&mca 0>, <&mca 1>;
};
codec {
sound-dai = <&speaker_left_woof1>,
<&speaker_left_tweet>,
<&speaker_left_woof2>,
<&speaker_right_woof1>,
<&speaker_right_tweet>,
<&speaker_right_woof2>;
};
};
dai-link@1 {
link-name = "Headphone Jack";
cpu {
sound-dai = <&mca 2>;
};
codec {
sound-dai = <&jack_codec>;
};
};
};
};
&mtp {
status = "okay";
};
&mtp_mbox {
status = "okay";
};
&mtp_dart {
status = "okay";
};
&mtp_dockchannel {
status = "okay";
};
&mtp_hid {
apple,afe-reset-gpios = <&smc_gpio 8 GPIO_ACTIVE_LOW>;
apple,stm-reset-gpios = <&smc_gpio 24 GPIO_ACTIVE_LOW>;
multi-touch {
firmware-name = "apple/tpmtfw-j415.bin";
};
keyboard: keyboard {
hid-country-code = <0>;
apple,keyboard-layout-id = <0>;
};
stm {
};
actuator {
};
tp_accel {
};
};
#include "isp-imx558-cfg0.dtsi"
&isp {
apple,platform-id = <15>;
apple,temporal-filter = <1>;
};

185
arch/arm/dts/t8112-j473.dts Normal file
View file

@ -0,0 +1,185 @@
// SPDX-License-Identifier: GPL-2.0+ OR MIT
/*
* Apple Mac mini (M2, 2023)
*
* target-type: J473
*
* Copyright The Asahi Linux Contributors
*/
/dts-v1/;
#include "t8112.dtsi"
#include "t8112-jxxx.dtsi"
/ {
compatible = "apple,j473", "apple,t8112", "apple,arm-platform";
model = "Apple Mac mini (M2, 2023)";
aliases {
bluetooth0 = &bluetooth0;
/delete-property/ dcp;
dcpext = &dcpext;
ethernet0 = &ethernet0;
wifi0 = &wifi0;
};
};
&framebuffer0 {
power-domains = <&ps_dispext_cpu0>, <&ps_dptx_ext_phy>;
};
&dptxphy {
status = "okay";
};
&dcp {
status = "disabled";
};
&display {
iommus = <&dispext0_dart 0>;
};
&dispext0_dart {
status = "okay";
};
&dcpext_dart {
status = "okay";
};
&dcpext_mbox {
status = "okay";
};
&dcpext {
status = "okay";
apple,connector-type = "HDMI-A";
/* HDMI HPD gpio, used as interrupt*/
hdmi-hpd-gpios = <&pinctrl_aop 49 GPIO_ACTIVE_HIGH>;
hdmi-pwren-gpios = <&smc_gpio 21 GPIO_ACTIVE_HIGH>;
dp2hdmi-pwren-gpios = <&smc_gpio 22 GPIO_ACTIVE_HIGH>;
phys = <&dptxphy>;
phy-names = "dp-phy";
apple,dptx-phy = <5>;
};
/*
* Provide labels for the USB type C ports.
*/
&typec0 {
label = "USB-C Back-left";
};
&typec1 {
label = "USB-C Back-right";
};
/*
* Force the bus number assignments so that we can declare some of the
* on-board devices and properties that are populated by the bootloader
* (such as MAC addresses).
*/
&port00 {
bus-range = <1 1>;
pwren-gpios = <&smc_gpio 13 GPIO_ACTIVE_HIGH>;
wifi0: wifi@0,0 {
compatible = "pci14e4,4434";
reg = <0x10000 0x0 0x0 0x0 0x0>;
/* To be filled by the loader */
local-mac-address = [00 10 18 00 00 10];
apple,antenna-sku = "XX";
brcm,board-type = "apple,miyake";
};
bluetooth0: bluetooth@0,1 {
compatible = "pci14e4,5f72";
reg = <0x10100 0x0 0x0 0x0 0x0>;
/* To be filled by the loader */
local-bd-address = [00 00 00 00 00 00];
brcm,board-type = "apple,miyake";
};
};
&port01 {
bus-range = <2 2>;
pwren-gpios = <&smc_gpio 24 GPIO_ACTIVE_HIGH>;
status = "okay";
};
&port02 {
bus-range = <3 3>;
status = "okay";
ethernet0: ethernet@0,0 {
reg = <0x30000 0x0 0x0 0x0 0x0>;
/* To be filled by the loader */
local-mac-address = [00 10 18 00 00 00];
};
};
&pcie1_dart {
status = "okay";
};
&pcie2_dart {
status = "okay";
};
&i2c1 {
speaker_amp: codec@38 {
compatible = "ti,sn012776", "ti,tas2764";
reg = <0x38>;
shutdown-gpios = <&pinctrl_ap 88 GPIO_ACTIVE_HIGH>;
#sound-dai-cells = <0>;
interrupt-parent = <&pinctrl_ap>;
interrupts = <11 IRQ_TYPE_LEVEL_LOW>;
ti,imon-slot-no = <0>;
ti,vmon-slot-no = <2>;
};
jack_codec: codec@4b {
compatible = "cirrus,cs42l84";
reg = <0x4b>;
reset-gpios = <&pinctrl_nub 12 GPIO_ACTIVE_HIGH>;
interrupt-parent = <&pinctrl_ap>;
interrupts = <149 IRQ_TYPE_LEVEL_LOW>;
#sound-dai-cells = <0>;
cirrus,ts-inv = <1>;
sound-name-prefix = "Jack";
};
};
/ {
sound {
compatible = "apple,j473-macaudio", "apple,macaudio";
model = "Mac mini J473";
dai-link@0 {
link-name = "Speaker";
cpu {
sound-dai = <&mca 0>;
};
codec {
sound-dai = <&speaker_amp>;
};
};
dai-link@1 {
link-name = "Headphone Jack";
cpu {
sound-dai = <&mca 2>;
};
codec {
sound-dai = <&jack_codec>;
};
};
};
};
&gpu {
apple,perf-base-pstate = <3>;
};

267
arch/arm/dts/t8112-j493.dts Normal file
View file

@ -0,0 +1,267 @@
// SPDX-License-Identifier: GPL-2.0+ OR MIT
/*
* Apple MacBook Pro (13-inch, M1, 2022)
*
* target-type: J493
*
* Copyright The Asahi Linux Contributors
*/
/dts-v1/;
#include "t8112.dtsi"
#include "t8112-jxxx.dtsi"
#include <dt-bindings/leds/common.h>
/ {
compatible = "apple,j493", "apple,t8112", "apple,arm-platform";
model = "Apple MacBook Pro (13-inch, M2, 2022)";
aliases {
bluetooth0 = &bluetooth0;
wifi0 = &wifi0;
keyboard = &keyboard;
touchbar0 = &touchbar0;
};
led-controller {
compatible = "pwm-leds";
led-0 {
pwms = <&fpwm1 0 40000>;
label = "kbd_backlight";
function = LED_FUNCTION_KBD_BACKLIGHT;
color = <LED_COLOR_ID_WHITE>;
max-brightness = <255>;
default-state = "keep";
};
};
};
&dcp {
panel: panel {
compatible = "apple,panel-j493", "apple,panel";
width-mm = <286>;
height-mm = <179>;
apple,max-brightness = <525>;
};
};
&display_dfr {
status = "okay";
#address-cells = <1>;
#size-cells = <0>;
dfr_panel: panel@0 {
compatible = "apple,summit";
reg = <0>;
};
};
&displaydfr_dart {
status = "okay";
};
/*
* Force the bus number assignments so that we can declare some of the
* on-board devices and properties that are populated by the bootloader
* (such as MAC addresses).
*/
&port00 {
bus-range = <1 1>;
pwren-gpios = <&smc_gpio 13 GPIO_ACTIVE_HIGH>;
wifi0: wifi@0,0 {
compatible = "pci14e4,4425";
reg = <0x10000 0x0 0x0 0x0 0x0>;
/* To be filled by the loader */
local-mac-address = [00 00 00 00 00 00];
apple,antenna-sku = "XX";
brcm,board-type = "apple,kyushu";
};
bluetooth0: bluetooth@0,1 {
compatible = "pci14e4,5f69";
reg = <0x10100 0x0 0x0 0x0 0x0>;
/* To be filled by the loader */
local-bd-address = [00 00 00 00 00 00];
brcm,board-type = "apple,kyushu";
};
};
/*
* Provide labels for the USB type C ports.
*/
&typec0 {
label = "USB-C Left-back";
};
&typec1 {
label = "USB-C Left-front";
};
/* Virtual regulator representing the shared shutdown GPIO */
/ {
speaker_sdz: fixed-regulator-sn012776-sdz {
compatible = "regulator-fixed";
regulator-name = "sn012776-sdz";
startup-delay-us = <5000>;
gpios = <&pinctrl_ap 88 GPIO_ACTIVE_HIGH>;
enable-active-high;
};
};
&i2c1 {
speaker_left_rear: codec@38 {
compatible = "ti,sn012776", "ti,tas2764";
reg = <0x38>;
SDZ-supply = <&speaker_sdz>;
#sound-dai-cells = <0>;
sound-name-prefix = "Left Rear";
interrupts-extended = <&pinctrl_ap 11 IRQ_TYPE_LEVEL_LOW>;
ti,imon-slot-no = <8>;
ti,vmon-slot-no = <10>;
};
speaker_left_front: codec@39 {
compatible = "ti,sn012776", "ti,tas2764";
reg = <0x39>;
SDZ-supply = <&speaker_sdz>;
#sound-dai-cells = <0>;
sound-name-prefix = "Left Front";
interrupts-extended = <&pinctrl_ap 11 IRQ_TYPE_LEVEL_LOW>;
ti,imon-slot-no = <0>;
ti,vmon-slot-no = <2>;
ti,sdout-force-zero-mask = <0xf0f0>;
};
};
&i2c3 {
speaker_right_rear: codec@3b {
compatible = "ti,sn012776", "ti,tas2764";
reg = <0x3b>;
SDZ-supply = <&speaker_sdz>;
#sound-dai-cells = <0>;
sound-name-prefix = "Right Rear";
interrupts-extended = <&pinctrl_ap 11 IRQ_TYPE_LEVEL_LOW>;
ti,imon-slot-no = <12>;
ti,vmon-slot-no = <14>;
};
speaker_right_front: codec@3c {
compatible = "ti,sn012776", "ti,tas2764";
reg = <0x3c>;
SDZ-supply = <&speaker_sdz>;
#sound-dai-cells = <0>;
sound-name-prefix = "Right Front";
interrupts-extended = <&pinctrl_ap 11 IRQ_TYPE_LEVEL_LOW>;
ti,imon-slot-no = <4>;
ti,vmon-slot-no = <6>;
ti,sdout-force-zero-mask = <0x0f0f>;
};
jack_codec: codec@4b {
compatible = "cirrus,cs42l84";
reg = <0x4b>;
reset-gpios = <&pinctrl_nub 12 GPIO_ACTIVE_HIGH>;
#sound-dai-cells = <0>;
interrupts-extended = <&pinctrl_ap 149 IRQ_TYPE_LEVEL_LOW>;
sound-name-prefix = "Jack";
};
};
&i2c4 {
status = "okay";
};
&fpwm1 {
status = "okay";
};
/ {
sound {
compatible = "apple,j493-macaudio", "apple,macaudio";
model = "MacBook Pro J493";
dai-link@0 {
link-name = "Speakers";
cpu {
sound-dai = <&mca 0>, <&mca 1>;
};
codec {
sound-dai = <&speaker_left_front>, <&speaker_left_rear>,
<&speaker_right_front>, <&speaker_right_rear>;
};
};
dai-link@1 {
link-name = "Headphone Jack";
cpu {
sound-dai = <&mca 2>;
};
codec {
sound-dai = <&jack_codec>;
};
};
};
};
&spi3 {
status = "okay";
touchbar0: touchbar@0 {
compatible = "apple,j493-touchbar", "apple,z2-touchbar", "apple,z2-multitouch";
reg = <0>;
label = "Mac14,7 Touch Bar";
spi-max-frequency = <8000000>;
spi-cs-setup-delay-ns = <2000>;
spi-cs-hold-delay-ns = <2000>;
reset-gpios = <&pinctrl_ap 170 GPIO_ACTIVE_LOW>;
interrupts-extended = <&pinctrl_ap 174 IRQ_TYPE_EDGE_FALLING>;
firmware-name = "apple/dfrmtfw-j493.bin";
touchscreen-size-x = <23045>;
touchscreen-size-y = <640>;
};
};
&mtp {
status = "okay";
};
&mtp_mbox {
status = "okay";
};
&mtp_dart {
status = "okay";
};
&mtp_dockchannel {
status = "okay";
};
&mtp_hid {
multi-touch {
apple,afe-reset-gpios = <&smc_gpio 8 GPIO_ACTIVE_LOW>;
firmware-name = "apple/tpmtfw-j493.bin";
};
keyboard: keyboard {
hid-country-code = <0>;
apple,keyboard-layout-id = <0>;
};
stm {
apple,stm-reset-gpios = <&smc_gpio 24 GPIO_ACTIVE_LOW>;
};
actuator {
};
tp_accel {
};
};
#include "isp-imx248.dtsi"
&isp {
apple,platform-id = <6>;
};

View file

@ -0,0 +1,177 @@
// SPDX-License-Identifier: GPL-2.0+ OR MIT
/*
* Apple M2 MacBook Air/Pro (M2, 2022)
*
* This file contains parts common to all Apple M2 devices using the t8112.
*
* target-type: J493, J413
*
* Copyright The Asahi Linux Contributors
*/
/ {
aliases {
atcphy0 = &atcphy0;
atcphy1 = &atcphy1;
dcp = &dcp;
disp0 = &display;
disp0_piodma = &disp0_piodma;
nvram = &nvram;
serial0 = &serial0;
serial2 = &serial2;
};
chosen {
#address-cells = <2>;
#size-cells = <2>;
ranges;
stdout-path = "serial0";
framebuffer0: framebuffer@0 {
compatible = "apple,simple-framebuffer", "simple-framebuffer";
reg = <0 0 0 0>; /* To be filled by loader */
power-domains = <&ps_disp0_cpu0>;
/* Format properties will be added by loader */
status = "disabled";
};
};
reserved-memory {
#address-cells = <2>;
#size-cells = <2>;
ranges;
/* To be filled by loader */
};
memory@800000000 {
device_type = "memory";
reg = <0x8 0 0x2 0>; /* To be filled by loader */
};
};
&serial0 {
status = "okay";
};
&serial2 {
status = "okay";
};
&i2c0 {
status = "okay";
hpm0: usb-pd@38 {
compatible = "apple,cd321x";
reg = <0x38>;
interrupt-parent = <&pinctrl_ap>;
interrupts = <8 IRQ_TYPE_LEVEL_LOW>;
interrupt-names = "irq";
typec0: connector {
compatible = "usb-c-connector";
power-role = "dual";
data-role = "dual";
ports {
#address-cells = <1>;
#size-cells = <0>;
port@0 {
reg = <0>;
typec0_con_hs: endpoint {
remote-endpoint = <&typec0_usb_hs>;
};
};
port@1 {
reg = <1>;
typec0_con_ss: endpoint {
remote-endpoint = <&typec0_usb_ss>;
};
};
};
};
};
hpm1: usb-pd@3f {
compatible = "apple,cd321x";
reg = <0x3f>;
interrupt-parent = <&pinctrl_ap>;
interrupts = <8 IRQ_TYPE_LEVEL_LOW>;
interrupt-names = "irq";
typec1: connector {
compatible = "usb-c-connector";
power-role = "dual";
data-role = "dual";
ports {
#address-cells = <1>;
#size-cells = <0>;
port@0 {
reg = <0>;
typec1_con_hs: endpoint {
remote-endpoint = <&typec1_usb_hs>;
};
};
port@1 {
reg = <1>;
typec1_con_ss: endpoint {
remote-endpoint = <&typec1_usb_ss>;
};
};
};
};
};
};
/* USB controllers */
&dwc3_0 {
port {
typec0_usb_hs: endpoint {
remote-endpoint = <&typec0_con_hs>;
};
};
};
&dwc3_1 {
port {
typec1_usb_hs: endpoint {
remote-endpoint = <&typec1_con_hs>;
};
};
};
/* Type-C PHYs */
&atcphy0 {
port {
typec0_usb_ss: endpoint {
remote-endpoint = <&typec0_con_ss>;
};
};
};
&atcphy1 {
port {
typec1_usb_ss: endpoint {
remote-endpoint = <&typec1_con_ss>;
};
};
};
&i2c1 {
status = "okay";
};
&i2c2 {
status = "okay";
};
&i2c3 {
status = "okay";
};
&nco_clkref {
clock-frequency = <900000000>;
};
#include "spi1-nvram.dtsi"

1262
arch/arm/dts/t8112-pmgr.dtsi Normal file

File diff suppressed because it is too large Load diff

1801
arch/arm/dts/t8112.dtsi Normal file

File diff suppressed because it is too large Load diff