Skip to content

Commit

Permalink
arm64: dts: apple: t8112: Initial t8112 (M2) device trees
Browse files Browse the repository at this point in the history
Signed-off-by: Hector Martin <[email protected]>
  • Loading branch information
marcan committed Jul 21, 2022
1 parent 5dd6d71 commit e568948
Show file tree
Hide file tree
Showing 6 changed files with 2,735 additions and 0 deletions.
2 changes: 2 additions & 0 deletions arch/arm64/boot/dts/apple/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,5 @@ dtb-$(CONFIG_ARCH_APPLE) += t6000-j316s.dtb
dtb-$(CONFIG_ARCH_APPLE) += t6001-j316c.dtb
dtb-$(CONFIG_ARCH_APPLE) += t6001-j375c.dtb
dtb-$(CONFIG_ARCH_APPLE) += t6002-j375d.dtb
dtb-$(CONFIG_ARCH_APPLE) += t8112-j413.dtb
dtb-$(CONFIG_ARCH_APPLE) += t8112-j493.dtb
182 changes: 182 additions & 0 deletions arch/arm64/boot/dts/apple/t8112-j413.dts
Original file line number Diff line number Diff line change
@@ -0,0 +1,182 @@
// 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"

/ {
compatible = "apple,j413", "apple,t8112", "apple,arm-platform";
model = "Apple MacBook Air (13-inch, M2, 2022)";

aliases {
wifi0 = &wifi0;
bluetooth0 = &bluetooth0;
};
};

/*
* 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: network@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";
};

/*
* Remove unused PCIe ports and disable the associated DARTs.
*/

/delete-node/ &port01;
/delete-node/ &port02;
/delete-node/ &port03;

&i2c0 {
/* MagSafe port */
hpm5: usb-pd@3a {
compatible = "apple,cd321x";
reg = <0x3a>;
interrupt-parent = <&pinctrl_ap>;
interrupts = <174 IRQ_TYPE_LEVEL_LOW>;
interrupt-names = "irq";
};
};

&i2c1 {
speaker_left_rear: codec@38 {
compatible = "ti,sn012776", "ti,tas2764";
reg = <0x38>;
shutdown-gpios = <&pinctrl_ap 88 GPIO_ACTIVE_HIGH>;
#sound-dai-cells = <0>;
sound-name-prefix = "Left Rear";
};

speaker_left_front: codec@39 {
compatible = "ti,sn012776", "ti,tas2764";
reg = <0x39>;
shutdown-gpios = <&pinctrl_ap 88 GPIO_ACTIVE_HIGH>;
#sound-dai-cells = <0>;
sound-name-prefix = "Left Front";
};
};

&i2c2 {
status = "okay";
};

&i2c3 {
speaker_right_rear: codec@3b {
compatible = "ti,sn012776", "ti,tas2764";
reg = <0x3b>;
shutdown-gpios = <&pinctrl_ap 88 GPIO_ACTIVE_HIGH>;
#sound-dai-cells = <0>;
sound-name-prefix = "Right Rear";
};

speaker_right_front: codec@3c {
compatible = "ti,sn012776", "ti,tas2764";
reg = <0x3c>;
shutdown-gpios = <&pinctrl_ap 88 GPIO_ACTIVE_HIGH>;
#sound-dai-cells = <0>;
sound-name-prefix = "Right Front";
};
};

&i2c4 {
status = "okay";
};

/ {
backlight: gpio-bl {
compatible = "gpio-backlight";
gpios = <&smc_gpio 18 GPIO_ACTIVE_HIGH>;
default-on;
};

sound {
compatible = "apple,j413-macaudio", "apple,macaudio";
model = "MacBook Pro J413 integrated audio";

dai-link@0 {
/*
* DANGER ZONE: You can blow your speakers!
*
* The drivers are not ready, and unless you are careful
* to attenuate the audio stream, you run the risk of
* blowing your speakers.
*/
status = "disabled";

link-name = "Speakers";
mclk-fs = <64>;

cpu {
sound-dai = <&mca 0>, <&mca 1>;
};
codec {
sound-dai = <&speaker_left_front>, <&speaker_right_front>,
<&speaker_left_rear>, <&speaker_right_rear>;
};
};
#if 0
dai-link@1 {
link-name = "Headphone Jack";
mclk-fs = <64>;

cpu {
sound-dai = <&mca 2>;
};
codec {
sound-dai = <&jack_codec>;
};
};
#endif
};
};

&framebuffer0 {
backlight = <&backlight>;
};

&mtp_hid {
multi-touch {
firmware-name = "apple/tpmtfw-j413.bin";
};
};
171 changes: 171 additions & 0 deletions arch/arm64/boot/dts/apple/t8112-j493.dts
Original file line number Diff line number Diff line change
@@ -0,0 +1,171 @@
// 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"

/ {
compatible = "apple,j493", "apple,t8112", "apple,arm-platform";
model = "Apple MacBook Pro (13-inch, M2, 2022)";

aliases {
wifi0 = &wifi0;
bluetooth0 = &bluetooth0;
};
};

/*
* 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: network@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: network@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";
};

/*
* Remove unused PCIe ports and disable the associated DARTs.
*/

/delete-node/ &port01;
/delete-node/ &port02;
/delete-node/ &port03;

&i2c1 {
speaker_left_rear: codec@38 {
compatible = "ti,sn012776", "ti,tas2764";
reg = <0x38>;
shutdown-gpios = <&pinctrl_ap 88 GPIO_ACTIVE_HIGH>;
#sound-dai-cells = <0>;
sound-name-prefix = "Left Rear";
};

speaker_left_front: codec@39 {
compatible = "ti,sn012776", "ti,tas2764";
reg = <0x39>;
shutdown-gpios = <&pinctrl_ap 88 GPIO_ACTIVE_HIGH>;
#sound-dai-cells = <0>;
sound-name-prefix = "Left Front";
};
};

&i2c2 {
status = "okay";
};

&i2c3 {
speaker_right_rear: codec@3b {
compatible = "ti,sn012776", "ti,tas2764";
reg = <0x3b>;
shutdown-gpios = <&pinctrl_ap 88 GPIO_ACTIVE_HIGH>;
#sound-dai-cells = <0>;
sound-name-prefix = "Right Rear";
};

speaker_right_front: codec@3c {
compatible = "ti,sn012776", "ti,tas2764";
reg = <0x3c>;
shutdown-gpios = <&pinctrl_ap 88 GPIO_ACTIVE_HIGH>;
#sound-dai-cells = <0>;
sound-name-prefix = "Right Front";
};
};

&i2c4 {
status = "okay";
};

/ {
backlight: gpio-bl {
compatible = "gpio-backlight";
gpios = <&smc_gpio 18 GPIO_ACTIVE_HIGH>;
default-on;
};

sound {
compatible = "apple,j493-macaudio", "apple,macaudio";
model = "MacBook Pro J493 integrated audio";

dai-link@0 {
/*
* DANGER ZONE: You can blow your speakers!
*
* The drivers are not ready, and unless you are careful
* to attenuate the audio stream, you run the risk of
* blowing your speakers.
*/
status = "disabled";

link-name = "Speakers";
mclk-fs = <64>;

cpu {
sound-dai = <&mca 0>, <&mca 1>;
};
codec {
sound-dai = <&speaker_left_front>, <&speaker_right_front>,
<&speaker_left_rear>, <&speaker_right_rear>;
};
};
#if 0
dai-link@1 {
link-name = "Headphone Jack";
mclk-fs = <64>;

cpu {
sound-dai = <&mca 2>;
};
codec {
sound-dai = <&jack_codec>;
};
};
#endif
};
};

&framebuffer0 {
backlight = <&backlight>;
};

&mtp_hid {
multi-touch {
firmware-name = "apple/tpmtfw-j493.bin";
};
};
Loading

0 comments on commit e568948

Please sign in to comment.