Skip to contentSkip to conversation

Add DTs for all Apple M1 (t8103) devices

PATCH Superseded Janne Grunau 4 participants 18 messages Nov 22, 2021 – Nov 26, 2021

Subsystems (2)

v3 of 4 Superseded Latest is v4 →

lore
Share & tools
lore

Janne Grunau

author maintainer
#0 lore raw

v3 cover Add DTs for all Apple M1 (t8103) devices

Hej All,

this series extends the device tree files and bindings to all current Apple M1 devices. Specifically it adds DTs for following devices:
- MacBook Air (M1, 2020)
- Macbook Pro (13-inch, M1, 2020)
- iMac (24-inch, M1, 2021)

It also adds i2c and cd321x devices nodes. Bindings and code changes for those were merged for 5.16 without adding devices to the device tree. Patches are include in a single series for dependencies

Changes since v2:
- split i2c and cd321x changes into 2 commit
- add i2c4 used by MacBooc Pros (j293, 13-inch, M1, 2020)
- add hpm2 and hpm3 for the additional USB-C ports on j456 iMac (24-inch, M1, 2021) models

Series depends for functionality and dtbs verification on "[PATCH 0/3] Apple Arm patform device tree and bindings fixes".

thanks,
Janne

The series is available as branch from:

    https://github.com/jannau/linux/tree/apple_m1/dt-for-5.17_v3

Janne Grunau (4):
dt-bindings: arm: apple: Add iMac (24-inch 2021) to Apple bindings
arm64: dts: apple: Add missing M1 (t8103) devices
arm64: dts: apple: t8103: Add i2c nodes
arm64: dts: apple: t8103: Add cd321x nodes

 .../devicetree/bindings/arm/apple.yaml        |  6 +-
 arch/arm64/boot/dts/apple/Makefile            |  4 +
 arch/arm64/boot/dts/apple/t8103-j274.dts      | 33 +------
 arch/arm64/boot/dts/apple/t8103-j293.dts      | 41 +++++++++
 arch/arm64/boot/dts/apple/t8103-j313.dts      | 33 +++++++
 arch/arm64/boot/dts/apple/t8103-j456.dts      | 59 ++++++++++++
 arch/arm64/boot/dts/apple/t8103-j457.dts      | 47 ++++++++++
 arch/arm64/boot/dts/apple/t8103-jxxx.dtsi     | 67 ++++++++++++++
 arch/arm64/boot/dts/apple/t8103.dtsi          | 92 +++++++++++++++++++
 9 files changed, 352 insertions(+), 30 deletions(-)
 create mode 100644 arch/arm64/boot/dts/apple/t8103-j293.dts
 create mode 100644 arch/arm64/boot/dts/apple/t8103-j313.dts
 create mode 100644 arch/arm64/boot/dts/apple/t8103-j456.dts
 create mode 100644 arch/arm64/boot/dts/apple/t8103-j457.dts
 create mode 100644 arch/arm64/boot/dts/apple/t8103-jxxx.dtsi
Signature · 1 line
2.34.0
author maintainer
#1 lore raw

PATCH v3 1/4 dt-bindings: arm: apple: Add iMac (24-inch 2021) to Apple bindings

This introduces compatible strings for both 2021 Apple iMac M1 devices:

* apple,j456 - iMac (24-inch, 4x USB-C, M1, 2021)
* apple,j457 - iMac (24-inch, 2x USB-C, M1, 2021)

---
 Documentation/devicetree/bindings/arm/apple.yaml | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
Documentation/devicetree/bindings/arm/apple.yaml +4 -2
index 1e772c85206c..b23c8dc5a27d 100644
@@ -12,12 +12,12 @@ maintainers:
 description: |
   ARM platforms using SoCs designed by Apple Inc., branded "Apple Silicon".
 
-  This currently includes devices based on the "M1" SoC, starting with the
-  three Mac models released in late 2020:
+  This currently includes devices based on the "M1" SoC:
 
   - Mac mini (M1, 2020)
   - MacBook Pro (13-inch, M1, 2020)
   - MacBook Air (M1, 2020)
+  - iMac (24-inch, M1, 2021)
 
   The compatible property should follow this format:
 
@@ -56,6 +56,8 @@ properties:
               - apple,j274 # Mac mini (M1, 2020)
               - apple,j293 # MacBook Pro (13-inch, M1, 2020)
               - apple,j313 # MacBook Air (M1, 2020)
+              - apple,j456 # iMac (24-inch, 4x USB-C, M1, 2021)
+              - apple,j457 # iMac (24-inch, 2x USB-C, M1, 2021)
           - const: apple,t8103
           - const: apple,arm-platform
 
Signature · 1 line
2.34.0
author maintainer
#2 lore raw

PATCH v3 2/4 arm64: dts: apple: Add missing M1 (t8103) devices

In reply to Janne Grunau

This adds support for following Apple M1 devices:
- MacBook Pro (13-inch, M1, 2020)
- MacBook Air (M1, 2020)
- iMac (24-inch 2021)

---
 arch/arm64/boot/dts/apple/Makefile        |  4 ++
 arch/arm64/boot/dts/apple/t8103-j274.dts  | 29 +-------------
 arch/arm64/boot/dts/apple/t8103-j293.dts  | 33 +++++++++++++++
 arch/arm64/boot/dts/apple/t8103-j313.dts  | 33 +++++++++++++++
 arch/arm64/boot/dts/apple/t8103-j456.dts  | 41 +++++++++++++++++++
 arch/arm64/boot/dts/apple/t8103-j457.dts  | 47 ++++++++++++++++++++++
 arch/arm64/boot/dts/apple/t8103-jxxx.dtsi | 49 +++++++++++++++++++++++
 7 files changed, 208 insertions(+), 28 deletions(-)
 create mode 100644 arch/arm64/boot/dts/apple/t8103-j293.dts
 create mode 100644 arch/arm64/boot/dts/apple/t8103-j313.dts
 create mode 100644 arch/arm64/boot/dts/apple/t8103-j456.dts
 create mode 100644 arch/arm64/boot/dts/apple/t8103-j457.dts
 create mode 100644 arch/arm64/boot/dts/apple/t8103-jxxx.dtsi
arch/arm64/boot/dts/apple/Makefile +4 -0
index cbbd701ebf05..c0510c25ca6a 100644
@@ -1,2 +1,6 @@
 # SPDX-License-Identifier: GPL-2.0
 dtb-$(CONFIG_ARCH_APPLE) += t8103-j274.dtb
+dtb-$(CONFIG_ARCH_APPLE) += t8103-j293.dtb
+dtb-$(CONFIG_ARCH_APPLE) += t8103-j313.dtb
+dtb-$(CONFIG_ARCH_APPLE) += t8103-j456.dtb
+dtb-$(CONFIG_ARCH_APPLE) += t8103-j457.dtb
arch/arm64/boot/dts/apple/t8103-j274.dts +1 -28
index 02c36301e985..9e01ef70039d 100644
@@ -10,39 +10,15 @@
 /dts-v1/;
 
 #include "t8103.dtsi"
+#include "t8103-jxxx.dtsi"
 
 / {
 	compatible = "apple,j274", "apple,t8103", "apple,arm-platform";
 	model = "Apple Mac mini (M1, 2020)";
 
 	aliases {
-		serial0 = &serial0;
 		ethernet0 = &ethernet0;
 	};
-
-	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 */
-			/* Format properties will be added by loader */
-			status = "disabled";
-		};
-	};
-
-	memory@800000000 {
-		device_type = "memory";
-		reg = <0x8 0 0x2 0>; /* To be filled by loader */
-	};
-};
-
-&serial0 {
-	status = "okay";
 };
 
 /*
@@ -50,9 +26,6 @@ &serial0 {
  * on-board devices and properties that are populated by the bootloader
  * (such as MAC addresses).
  */
-&port00 {
-	bus-range = <1 1>;
-};
 
 &port01 {
 	bus-range = <2 2>;
arch/arm64/boot/dts/apple/t8103-j293.dts new file +33 -0
new file mode 100644
index 000000000000..466035f00b69
@@ -0,0 +1,33 @@
+// SPDX-License-Identifier: GPL-2.0+ OR MIT
+/*
+ * Apple MacBook Pro (13-inch, M1, 2020)
+ *
+ * target-type: J293
+ *
+ * Copyright The Asahi Linux Contributors
+ */
+
+/dts-v1/;
+
+#include "t8103.dtsi"
+#include "t8103-jxxx.dtsi"
+
+/ {
+	compatible = "apple,j293", "apple,t8103", "apple,arm-platform";
+	model = "Apple MacBook Pro (13-inch, M1, 2020)";
+};
+
+/*
+ * Remove unused PCIe ports and disable the associated DARTs.
+ */
+
+&pcie0_dart_1 {
+	status = "disabled";
+};
+
+&pcie0_dart_2 {
+	status = "disabled";
+};
+
+/delete-node/ &port01;
+/delete-node/ &port02;
arch/arm64/boot/dts/apple/t8103-j313.dts new file +33 -0
new file mode 100644
index 000000000000..b0ebb45bdb6f
@@ -0,0 +1,33 @@
+// SPDX-License-Identifier: GPL-2.0+ OR MIT
+/*
+ * Apple MacBook Air (M1, 2020)
+ *
+ * target-type: J313
+ *
+ * Copyright The Asahi Linux Contributors
+ */
+
+/dts-v1/;
+
+#include "t8103.dtsi"
+#include "t8103-jxxx.dtsi"
+
+/ {
+	compatible = "apple,j313", "apple,t8103", "apple,arm-platform";
+	model = "Apple MacBook Air (M1, 2020)";
+};
+
+/*
+ * Remove unused PCIe ports and disable the associated DARTs.
+ */
+
+&pcie0_dart_1 {
+	status = "disabled";
+};
+
+&pcie0_dart_2 {
+	status = "disabled";
+};
+
+/delete-node/ &port01;
+/delete-node/ &port02;
arch/arm64/boot/dts/apple/t8103-j456.dts new file +41 -0

41 lines not on this page · raw message

arch/arm64/boot/dts/apple/t8103-j457.dts new file +47 -0

47 lines not on this page · raw message

arch/arm64/boot/dts/apple/t8103-jxxx.dtsi new file +49 -0

49 lines not on this page · raw message

Signature · 1 line
2.34.0
author maintainer
#3 lore raw

PATCH v3 3/4 arm64: dts: apple: t8103: Add i2c nodes

In reply to Janne Grunau

Apple M1 has at least 5 i2c controllers. i2c0, i2c1 and i2c3 are used on all M1 Mac devices. The 2020 Mac Mini uses i2c2 and the 13-inch MacBook Pro uses i2c2 and i2c4.

---
 arch/arm64/boot/dts/apple/t8103-j274.dts |  4 ++
 arch/arm64/boot/dts/apple/t8103-j293.dts |  8 +++
 arch/arm64/boot/dts/apple/t8103.dtsi     | 92 ++++++++++++++++++++++++
 3 files changed, 104 insertions(+)
arch/arm64/boot/dts/apple/t8103-j274.dts +4 -0
index 9e01ef70039d..2cd429efba5b 100644
@@ -39,3 +39,7 @@ ethernet0: ethernet@0,0 {
 		local-mac-address = [00 10 18 00 00 00];
 	};
 };
+
+&i2c2 {
+	status = "okay";
+};
arch/arm64/boot/dts/apple/t8103-j293.dts +8 -0
index 466035f00b69..49cdf4b560a3 100644
@@ -31,3 +31,11 @@ &pcie0_dart_2 {
 
 /delete-node/ &port01;
 /delete-node/ &port02;
+
+&i2c2 {
+	status = "okay";
+};
+
+&i2c4 {
+	status = "okay";
+};
arch/arm64/boot/dts/apple/t8103.dtsi +92 -0

104 lines not on this page · raw message

Signature · 1 line
2.34.0
Acked-by on v3 3/4
#4 lore raw

Re: [PATCH v3 3/4] arm64: dts: apple: t8103: Add i2c nodes

Quoted 17 lines · Janne Grunau

Apple M1 has at least 5 i2c controllers. i2c0, i2c1 and i2c3 are used on all M1 Mac devices. The 2020 Mac Mini uses i2c2 and the 13-inch MacBook Pro uses i2c2 and i2c4.

---
  arch/arm64/boot/dts/apple/t8103-j274.dts |  4 ++
  arch/arm64/boot/dts/apple/t8103-j293.dts |  8 +++
  arch/arm64/boot/dts/apple/t8103.dtsi     | 92 ++++++++++++++++++++++++
  3 files changed, 104 insertions(+)
arch/arm64/boot/dts/apple/t8103.dtsi +0 -0
index c320c8baeb41..15fec48f943a 100644

arch/arm64/boot/dts/apple/t8103.dtsi serial0: serial@235200000 { · line 132

Quoted 7 lines
arch/arm64/boot/dts/apple/t8103.dtsi +4 -0
@@ -126,6 +126,73 @@ serial0: serial@235200000 {
  			status = "disabled";
  		};
 
+		i2c0: i2c@235010000 {
+			compatible = "apple,t8103-i2c", "apple,i2c";
+			reg = <0x2 0x35010000 0x0 0x4000>;
+			clocks = <&clk24>;

[...]

Please put these before serial0; I want to keep the nodes sorted by address.

With that fixed:

Signature · 2 lines
Hector Martin ([email protected])
Public Key: https://mrcn.st/pub
#5 lore raw

Re: [PATCH v3 3/4] arm64: dts: apple: t8103: Add i2c nodes

In reply to Janne Grunau
Quoted 3 lines · Janne Grunau

Apple M1 has at least 5 i2c controllers. i2c0, i2c1 and i2c3 are used on all M1 Mac devices. The 2020 Mac Mini uses i2c2 and the 13-inch MacBook Pro uses i2c2 and i2c4.

On further testing: i2c3 is not used on the 1GbE variant of j274. iBoot actually kills the node entirely. The interesting thing is it doesn't work; it times out probe transactions. I suspect iBoot does not enable its clock or something like that.

I'll poke around this on IRC, but a priori we probably need m1n1 code to kill this node when the ADT doesn't have it. Maybe I should generalize the dwc3 killing code...

Signature · 2 lines
Hector Martin ([email protected])
Public Key: https://mrcn.st/pub
#6 lore raw

Re: [PATCH v3 3/4] arm64: dts: apple: t8103: Add i2c nodes

Quoted 5 lines · Hector Martin
Quoted 3 lines · Janne Grunau

Apple M1 has at least 5 i2c controllers. i2c0, i2c1 and i2c3 are used on all M1 Mac devices. The 2020 Mac Mini uses i2c2 and the 13-inch MacBook Pro uses i2c2 and i2c4.

Quoted 8 lines

On further testing: i2c3 is not used on the 1GbE variant of j274. iBoot actually kills the node entirely. The interesting thing is it doesn't work; it times out probe transactions. I suspect iBoot does not enable its clock or something like that.

I'll poke around this on IRC, but a priori we probably need m1n1 code to kill this node when the ADT doesn't have it. Maybe I should generalize the dwc3 killing code...

Did that as of m1n1 be7ff3a, so we're good now :)

For those following along in the list: the reason why i2c3 was getting stuck is because it seems the unused bus is weakly pulled low on these machines, which jams it. Setting the GPIO pull mode to pull-up makes it work as an empty bus, but let's just not instantiate at all in this case. m1n1 now checks the Apple DT and sets any FDT i2c devices that are not present in it to disabled.

Signature · 2 lines
Hector Martin ([email protected])
Public Key: https://mrcn.st/pub
#7 lore raw

Re: [PATCH v3 3/4] arm64: dts: apple: t8103: Add i2c nodes

Quoted 3 lines · Hector Martin

For those following along in the list: the reason why i2c3 was getting stuck is because it seems the unused bus is weakly pulled low on these machines, which jams it.

That looks like some power saving attempt.

I suppose that means that even i2c buses that are in use could be weakly pulled low when suspending the system and maybe even inbetween transactions to save some leak current.

Yours,
Linus Walleij

#8 lore raw

Re: [PATCH v3 3/4] arm64: dts: apple: t8103: Add i2c nodes

Quoted 6 lines · Linus Walleij
Quoted 3 lines · Hector Martin

For those following along in the list: the reason why i2c3 was getting stuck is because it seems the unused bus is weakly pulled low on these machines, which jams it.

Quoted 6 lines

That looks like some power saving attempt.

I suppose that means that even i2c buses that are in use could be weakly pulled low when suspending the system and maybe even inbetween transactions to save some leak current.

Pulled up vs. down dosn't really result in better power savings; neither state will necessarily have more leakage. I think it's just that the pins are completely disconnected, and there's some very minor leakage to ground (megaohms will do) that ends up pulling them down.

Pulling down an I2C bus between transactions is not legal; the idle state has to be high.

Apple are actually not very good at configuring GPIOs for power saving; e.g. the I/Os for that unused i2c bus still have their input buffers turned on, which is a waste of power. If they wanted to save the smallest drop of power they'd turn that off. But the effect of this is so trivial it probably makes no difference in the context of a laptop, nevermind a desktop like the Mac Mini.

Signature · 2 lines
Hector Martin ([email protected])
Public Key: https://mrcn.st/pub
#9 lore raw

Re: [PATCH v3 3/4] arm64: dts: apple: t8103: Add i2c nodes

Quoted 2 lines · Hector Martin

Pulling down an I2C bus between transactions is not legal; the idle state has to be high.

Oh right.

Quoted 6 lines

Apple are actually not very good at configuring GPIOs for power saving; e.g. the I/Os for that unused i2c bus still have their input buffers turned on, which is a waste of power. If they wanted to save the smallest drop of power they'd turn that off. But the effect of this is so trivial it probably makes no difference in the context of a laptop, nevermind a desktop like the Mac Mini.

Hm that's true. The saying is that 99% is the backlight, the remaining 1% isn't so significant after that.

Yours,
Linus Walleij

_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

#10 lore raw

Re: [PATCH v3 3/4] arm64: dts: apple: t8103: Add i2c nodes

Quoted 14 lines · Linus Walleij
Quoted 2 lines · Hector Martin

Pulling down an I2C bus between transactions is not legal; the idle state has to be high.

Oh right.

Quoted 6 lines

Apple are actually not very good at configuring GPIOs for power saving; e.g. the I/Os for that unused i2c bus still have their input buffers turned on, which is a waste of power. If they wanted to save the smallest drop of power they'd turn that off. But the effect of this is so trivial it probably makes no difference in the context of a laptop, nevermind a desktop like the Mac Mini.

Quoted 2 lines

Hm that's true. The saying is that 99% is the backlight, the remaining 1% isn't so significant after that.

From watching a USB power meter plugged into the MacBook Air, I can say the backlight is about 70% :-)

Then again, the new MBPs have LED matrix backlit screens... so suddenly dark themes are more efficient again! I should measure that one, see how much power changing themes saves.

Signature · 2 lines
Hector Martin "marcan" ([email protected])
Public key: https://mrcn.st/pub
Reviewed-by on v3 3/4
#11 lore raw

Re: [PATCH v3 3/4] arm64: dts: apple: t8103: Add i2c nodes

In reply to Janne Grunau
Quoted 47 lines · Janne Grunau

Apple M1 has at least 5 i2c controllers. i2c0, i2c1 and i2c3 are used on all M1 Mac devices. The 2020 Mac Mini uses i2c2 and the 13-inch MacBook Pro uses i2c2 and i2c4.

---
 arch/arm64/boot/dts/apple/t8103-j274.dts |  4 ++
 arch/arm64/boot/dts/apple/t8103-j293.dts |  8 +++
 arch/arm64/boot/dts/apple/t8103.dtsi     | 92 ++++++++++++++++++++++++
 3 files changed, 104 insertions(+)
arch/arm64/boot/dts/apple/t8103-j274.dts +4 -0
index 9e01ef70039d..2cd429efba5b 100644
@@ -39,3 +39,7 @@ ethernet0: ethernet@0,0 {
 		local-mac-address = [00 10 18 00 00 00];
 	};
 };
+
+&i2c2 {
+	status = "okay";
+};
arch/arm64/boot/dts/apple/t8103-j293.dts +8 -0
index 466035f00b69..49cdf4b560a3 100644
@@ -31,3 +31,11 @@ &pcie0_dart_2 {
 
 /delete-node/ &port01;
 /delete-node/ &port02;
+
+&i2c2 {
+	status = "okay";
+};
+
+&i2c4 {
+	status = "okay";
+};
arch/arm64/boot/dts/apple/t8103.dtsi +0 -0
index c320c8baeb41..15fec48f943a 100644

arch/arm64/boot/dts/apple/t8103.dtsi serial0: serial@235200000 { · line 133

Quoted 8 lines
arch/arm64/boot/dts/apple/t8103.dtsi +5 -0
@@ -126,6 +126,73 @@ serial0: serial@235200000 {
 			status = "disabled";
 		};
 
+		i2c0: i2c@235010000 {
+			compatible = "apple,t8103-i2c", "apple,i2c";
+			reg = <0x2 0x35010000 0x0 0x4000>;
+			clocks = <&clk24>;
+			clock-names = "ref";

No need for clock-names in these nodes. The schema only allows a single clock anyway.
With that removed and Hector's comments addressed:

author maintainer
#12 lore raw

PATCH v3 4/4 arm64: dts: apple: t8103: Add cd321x nodes

In reply to Janne Grunau

All M1 Mac devices have 2 SoC connected USB-C ports and use cd321x USB type C port switch and power deliver controllers. I2c bus and adresses configuration are for all devices equal.
The iMac (24-inch, 2021) has a configuration with 2 additional USB-C ports (j456) using two addiotional cd321x controllers.

---
 arch/arm64/boot/dts/apple/t8103-j456.dts  | 18 ++++++++++++++++++
 arch/arm64/boot/dts/apple/t8103-jxxx.dtsi | 18 ++++++++++++++++++
 2 files changed, 36 insertions(+)
arch/arm64/boot/dts/apple/t8103-j456.dts +18 -0
index 7267e069355b..c6b8c28455f5 100644
@@ -21,6 +21,24 @@ aliases {
 	};
 };
 
+&i2c0 {
+	hpm2: tps6598x@3b {
+		compatible = "apple,cd321x";
+		reg = <0x3b>;
+		interrupt-parent = <&pinctrl_ap>;
+		interrupts = <106 IRQ_TYPE_LEVEL_LOW>;
+		interrupt-names = "irq";
+	};
+
+	hpm3: tps6598x@3c {
+		compatible = "apple,cd321x";
+		reg = <0x3c>;
+		interrupt-parent = <&pinctrl_ap>;
+		interrupts = <106 IRQ_TYPE_LEVEL_LOW>;
+		interrupt-names = "irq";
+	};
+};
+
 /*
  * Force the bus number assignments so that we can declare some of the
  * on-board devices and properties that are populated by the bootloader
arch/arm64/boot/dts/apple/t8103-jxxx.dtsi +18 -0
index 53d22b434d76..5f748f3f60d2 100644
@@ -39,6 +39,24 @@ &serial0 {
 	status = "okay";
 };
 
+&i2c0 {
+	hpm0: tps6598x@38 {
+		compatible = "apple,cd321x";
+		reg = <0x38>;
+		interrupt-parent = <&pinctrl_ap>;
+		interrupts = <106 IRQ_TYPE_LEVEL_LOW>;
+		interrupt-names = "irq";
+	};
+
+	hpm1: tps6598x@3f {
+		compatible = "apple,cd321x";
+		reg = <0x3f>;
+		interrupt-parent = <&pinctrl_ap>;
+		interrupts = <106 IRQ_TYPE_LEVEL_LOW>;
+		interrupt-names = "irq";
+	};
+};
+
 /*
  * Force the bus number assignments so that we can declare some of the
  * on-board devices and properties that are populated by the bootloader
Signature · 1 line
2.34.0
Reviewed-by on v3 4/4
#13 lore raw

Re: [PATCH v3 4/4] arm64: dts: apple: t8103: Add cd321x nodes

Quoted 18 lines · Janne Grunau

All M1 Mac devices have 2 SoC connected USB-C ports and use cd321x USB type C port switch and power deliver controllers. I2c bus and adresses configuration are for all devices equal.
The iMac (24-inch, 2021) has a configuration with 2 additional USB-C ports (j456) using two addiotional cd321x controllers.

---
 arch/arm64/boot/dts/apple/t8103-j456.dts  | 18 ++++++++++++++++++
 arch/arm64/boot/dts/apple/t8103-jxxx.dtsi | 18 ++++++++++++++++++
 2 files changed, 36 insertions(+)
arch/arm64/boot/dts/apple/t8103-j456.dts +0 -0
index 7267e069355b..c6b8c28455f5 100644

arch/arm64/boot/dts/apple/t8103-j456.dts aliases { · line 25

Quoted 5 lines
arch/arm64/boot/dts/apple/t8103-j456.dts +2 -0
@@ -21,6 +21,24 @@ aliases {
 	};
 };
 
+&i2c0 {
+	hpm2: tps6598x@3b {

I know that the tps example in the binding uses tps6598x as the node name but I think that these names are usually more general. Maybe usb-pd@3b instead which is used in arch/arm64/boot/dts/freescale/imx8mq-librem5.dtsi and reflects the function of this device.

With that fixed:

Thanks,

Sven

Acked-by on v3 4/4
#14 lore raw

Re: [PATCH v3 4/4] arm64: dts: apple: t8103: Add cd321x nodes

In reply to Janne Grunau
Quoted 61 lines · Janne Grunau

All M1 Mac devices have 2 SoC connected USB-C ports and use cd321x USB type C port switch and power deliver controllers. I2c bus and adresses configuration are for all devices equal.
The iMac (24-inch, 2021) has a configuration with 2 additional USB-C ports (j456) using two addiotional cd321x controllers.

---
  arch/arm64/boot/dts/apple/t8103-j456.dts  | 18 ++++++++++++++++++
  arch/arm64/boot/dts/apple/t8103-jxxx.dtsi | 18 ++++++++++++++++++
  2 files changed, 36 insertions(+)
arch/arm64/boot/dts/apple/t8103-j456.dts +18 -0
index 7267e069355b..c6b8c28455f5 100644
@@ -21,6 +21,24 @@ aliases {
  	};
  };
 
+&i2c0 {
+	hpm2: tps6598x@3b {
+		compatible = "apple,cd321x";
+		reg = <0x3b>;
+		interrupt-parent = <&pinctrl_ap>;
+		interrupts = <106 IRQ_TYPE_LEVEL_LOW>;
+		interrupt-names = "irq";
+	};
+
+	hpm3: tps6598x@3c {
+		compatible = "apple,cd321x";
+		reg = <0x3c>;
+		interrupt-parent = <&pinctrl_ap>;
+		interrupts = <106 IRQ_TYPE_LEVEL_LOW>;
+		interrupt-names = "irq";
+	};
+};
+
  /*
   * Force the bus number assignments so that we can declare some of the
   * on-board devices and properties that are populated by the bootloader
arch/arm64/boot/dts/apple/t8103-jxxx.dtsi +11 -0
index 53d22b434d76..5f748f3f60d2 100644
@@ -39,6 +39,24 @@ &serial0 {
  	status = "okay";
  };
 
+&i2c0 {
+	hpm0: tps6598x@38 {
+		compatible = "apple,cd321x";
+		reg = <0x38>;
+		interrupt-parent = <&pinctrl_ap>;
+		interrupts = <106 IRQ_TYPE_LEVEL_LOW>;
+		interrupt-names = "irq";
+	};
+
+	hpm1: tps6598x@3f {
+		compatible = "apple,cd321x";

arch/arm64/boot/dts/apple/t8103-jxxx.dtsi &serial0 { · line 62

Quoted 10 lines
arch/arm64/boot/dts/apple/t8103-jxxx.dtsi +7 -0
+		reg = <0x3f>;
+		interrupt-parent = <&pinctrl_ap>;
+		interrupts = <106 IRQ_TYPE_LEVEL_LOW>;
+		interrupt-names = "irq";
+	};
+};
+
  /*
   * Force the bus number assignments so that we can declare some of the
   * on-board devices and properties that are populated by the bootloader

With sven's comments addressed,

Signature · 7 lines
Hector Martin ([email protected])
Public Key: https://mrcn.st/pub

_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Tested-by on the v3 series
#15 lore raw
In reply to Janne Grunau
Quoted 43 lines · Janne Grunau

Hej All,

this series extends the device tree files and bindings to all current Apple M1 devices. Specifically it adds DTs for following devices:
- MacBook Air (M1, 2020)
- Macbook Pro (13-inch, M1, 2020)
- iMac (24-inch, M1, 2021)

It also adds i2c and cd321x devices nodes. Bindings and code changes for those were merged for 5.16 without adding devices to the device tree. Patches are include in a single series for dependencies

Changes since v2:
- split i2c and cd321x changes into 2 commit
- add i2c4 used by MacBooc Pros (j293, 13-inch, M1, 2020)
- add hpm2 and hpm3 for the additional USB-C ports on j456 iMac

    (24-inch, M1, 2021) models

Series depends for functionality and dtbs verification on "[PATCH 0/3] Apple Arm patform device tree and bindings fixes".

thanks,
Janne

The series is available as branch from:

     https://github.com/jannau/linux/tree/apple_m1/dt-for-5.17_v3

Janne Grunau (4):
dt-bindings: arm: apple: Add iMac (24-inch 2021) to Apple bindings
arm64: dts: apple: Add missing M1 (t8103) devices
arm64: dts: apple: t8103: Add i2c nodes
arm64: dts: apple: t8103: Add cd321x nodes

  .../devicetree/bindings/arm/apple.yaml        |  6 +-
  arch/arm64/boot/dts/apple/Makefile            |  4 +
  arch/arm64/boot/dts/apple/t8103-j274.dts      | 33 +------
  arch/arm64/boot/dts/apple/t8103-j293.dts      | 41 +++++++++
  arch/arm64/boot/dts/apple/t8103-j313.dts      | 33 +++++++
  arch/arm64/boot/dts/apple/t8103-j456.dts      | 59 ++++++++++++
  arch/arm64/boot/dts/apple/t8103-j457.dts      | 47 ++++++++++
  arch/arm64/boot/dts/apple/t8103-jxxx.dtsi     | 67 ++++++++++++++
  arch/arm64/boot/dts/apple/t8103.dtsi          | 92 +++++++++++++++++++
  9 files changed, 352 insertions(+), 30 deletions(-)
Quoted 6 lines

create mode 100644 arch/arm64/boot/dts/apple/t8103-j293.dts create mode 100644 arch/arm64/boot/dts/apple/t8103-j313.dts create mode 100644 arch/arm64/boot/dts/apple/t8103-j456.dts create mode 100644 arch/arm64/boot/dts/apple/t8103-j457.dts create mode 100644 arch/arm64/boot/dts/apple/t8103-jxxx.dtsi

Whole series is:

on j274, j313, j456.

Thanks! If you spin up a v4 with the minor comments addressed, I'll be happy to merge it :)

Signature · 7 lines
Hector Martin ([email protected])
Public Key: https://mrcn.st/pub

_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
author maintainer
#16 lore raw

Hej,

Quoted 25 lines · Hector Martin
Quoted 17 lines · Janne Grunau

Janne Grunau (4):
dt-bindings: arm: apple: Add iMac (24-inch 2021) to Apple bindings
arm64: dts: apple: Add missing M1 (t8103) devices
arm64: dts: apple: t8103: Add i2c nodes
arm64: dts: apple: t8103: Add cd321x nodes

  .../devicetree/bindings/arm/apple.yaml        |  6 +-
  arch/arm64/boot/dts/apple/Makefile            |  4 +
  arch/arm64/boot/dts/apple/t8103-j274.dts      | 33 +------
  arch/arm64/boot/dts/apple/t8103-j293.dts      | 41 +++++++++
  arch/arm64/boot/dts/apple/t8103-j313.dts      | 33 +++++++
  arch/arm64/boot/dts/apple/t8103-j456.dts      | 59 ++++++++++++
  arch/arm64/boot/dts/apple/t8103-j457.dts      | 47 ++++++++++
  arch/arm64/boot/dts/apple/t8103-jxxx.dtsi     | 67 ++++++++++++++
  arch/arm64/boot/dts/apple/t8103.dtsi          | 92 +++++++++++++++++++
  9 files changed, 352 insertions(+), 30 deletions(-)
Quoted 6 lines

create mode 100644 arch/arm64/boot/dts/apple/t8103-j293.dts create mode 100644 arch/arm64/boot/dts/apple/t8103-j313.dts create mode 100644 arch/arm64/boot/dts/apple/t8103-j456.dts create mode 100644 arch/arm64/boot/dts/apple/t8103-j457.dts create mode 100644 arch/arm64/boot/dts/apple/t8103-jxxx.dtsi

Quoted 8 lines

Whole series is:

on j274, j313, j456.

Thanks! If you spin up a v4 with the minor comments addressed, I'll be happy to merge it :)

there is already a v4 with Sven's comments addressed at

https://lore.kernel.org/linux-arm-kernel/[email protected]/

Jean-Marc Ranger notified me off-list of a typo in "arm64: dts: apple:
t8103: Add cd321x nodes" commit messages: 'addiotional'.

I don't think it's worth spinning up a v5 for fixing that typo.

thanks,

Janne

_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

#17 lore raw
Quoted 37 lines · Janne Grunau

Hej,

Quoted 25 lines · Hector Martin
Quoted 17 lines · Janne Grunau

Janne Grunau (4):
dt-bindings: arm: apple: Add iMac (24-inch 2021) to Apple bindings
arm64: dts: apple: Add missing M1 (t8103) devices
arm64: dts: apple: t8103: Add i2c nodes
arm64: dts: apple: t8103: Add cd321x nodes

   .../devicetree/bindings/arm/apple.yaml        |  6 +-
   arch/arm64/boot/dts/apple/Makefile            |  4 +
   arch/arm64/boot/dts/apple/t8103-j274.dts      | 33 +------
   arch/arm64/boot/dts/apple/t8103-j293.dts      | 41 +++++++++
   arch/arm64/boot/dts/apple/t8103-j313.dts      | 33 +++++++
   arch/arm64/boot/dts/apple/t8103-j456.dts      | 59 ++++++++++++
   arch/arm64/boot/dts/apple/t8103-j457.dts      | 47 ++++++++++
   arch/arm64/boot/dts/apple/t8103-jxxx.dtsi     | 67 ++++++++++++++
   arch/arm64/boot/dts/apple/t8103.dtsi          | 92 +++++++++++++++++++
   9 files changed, 352 insertions(+), 30 deletions(-)
Quoted 6 lines

create mode 100644 arch/arm64/boot/dts/apple/t8103-j293.dts create mode 100644 arch/arm64/boot/dts/apple/t8103-j313.dts create mode 100644 arch/arm64/boot/dts/apple/t8103-j456.dts create mode 100644 arch/arm64/boot/dts/apple/t8103-j457.dts create mode 100644 arch/arm64/boot/dts/apple/t8103-jxxx.dtsi

Quoted 8 lines

Whole series is:

on j274, j313, j456.

Thanks! If you spin up a v4 with the minor comments addressed, I'll be happy to merge it :)

Quoted 8 lines

there is already a v4 with Sven's comments addressed at

https://lore.kernel.org/linux-arm-kernel/[email protected]/

Jean-Marc Ranger notified me off-list of a typo in "arm64: dts: apple:
t8103: Add cd321x nodes" commit messages: 'addiotional'.

I don't think it's worth spinning up a v5 for fixing that typo.

Oh whoops, I think I mixed that one up with this one when scrolling through email and thought they were the same series. Was just catching up on email and it hadn't hit me yet... thanks for pointing it out.

Signature · 7 lines
Hector Martin ([email protected])
Public Key: https://mrcn.st/pub

_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel