linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v4 0/4] Add DTs for all Apple M1 (t8103) devices
@ 2021-11-23 22:49 Janne Grunau
  2021-11-23 22:49 ` [PATCH v4 1/4] dt-bindings: arm: apple: Add iMac (24-inch 2021) to Apple bindings Janne Grunau
                   ` (4 more replies)
  0 siblings, 5 replies; 8+ messages in thread
From: Janne Grunau @ 2021-11-23 22:49 UTC (permalink / raw)
  To: Hector Martin, Sven Peter, Alyssa Rosenzweig, Rob Herring
  Cc: Mark Kettenis, linux-arm-kernel, devicetree, linux-kernel

Hej all,

hopefully the last iteration of this series. Thanks for the reviews.

Changes since v3:
 - fixed typo in "arm64: dts: apple: t8103: Add cd321x nodes" commit
   message
 - fixed node order by address in t8103.dtsi
 - removed clock-names property from i2c nodes
 - renamed cd321x nodes to "usb-pd"
 - added Reviewed-by and Acked-by tags

This series is available as branch at
    https://github.com/jannau/linux/tree/apple_m1/dt-for-5.17_v4

For reference the message from v3:

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

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


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          | 87 +++++++++++++++++++
 9 files changed, 347 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


base-commit: fa55b7dcdc43c1aa1ba12bca9d2dd4318c2a0dbf
prerequisite-patch-id: 6827208d4389960d14555ee96768586179f9e8a7
prerequisite-patch-id: d5f23530f8cb99fbd9355f4bf0ccbaaca0cd6d7c
prerequisite-patch-id: 40ab5e8cc6dc6b5d44f075d8409f39966452bfb3
-- 
2.34.0


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH v4 1/4] dt-bindings: arm: apple: Add iMac (24-inch 2021) to Apple bindings
  2021-11-23 22:49 [PATCH v4 0/4] Add DTs for all Apple M1 (t8103) devices Janne Grunau
@ 2021-11-23 22:49 ` Janne Grunau
  2021-11-28 23:23   ` Rob Herring
  2021-11-23 22:49 ` [PATCH v4 2/4] arm64: dts: apple: Add missing M1 (t8103) devices Janne Grunau
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 8+ messages in thread
From: Janne Grunau @ 2021-11-23 22:49 UTC (permalink / raw)
  To: Hector Martin, Sven Peter, Alyssa Rosenzweig, Rob Herring
  Cc: Mark Kettenis, linux-arm-kernel, devicetree, linux-kernel

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)

Reviewed-by: Mark Kettenis <kettenis@openbsd.org>
Signed-off-by: Janne Grunau <j@jannau.net>
---
 Documentation/devicetree/bindings/arm/apple.yaml | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/Documentation/devicetree/bindings/arm/apple.yaml b/Documentation/devicetree/bindings/arm/apple.yaml
index 1e772c85206c..b23c8dc5a27d 100644
--- a/Documentation/devicetree/bindings/arm/apple.yaml
+++ b/Documentation/devicetree/bindings/arm/apple.yaml
@@ -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
 
-- 
2.34.0


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH v4 2/4] arm64: dts: apple: Add missing M1 (t8103) devices
  2021-11-23 22:49 [PATCH v4 0/4] Add DTs for all Apple M1 (t8103) devices Janne Grunau
  2021-11-23 22:49 ` [PATCH v4 1/4] dt-bindings: arm: apple: Add iMac (24-inch 2021) to Apple bindings Janne Grunau
@ 2021-11-23 22:49 ` Janne Grunau
  2021-11-23 22:49 ` [PATCH v4 3/4] arm64: dts: apple: t8103: Add i2c nodes Janne Grunau
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 8+ messages in thread
From: Janne Grunau @ 2021-11-23 22:49 UTC (permalink / raw)
  To: Hector Martin, Sven Peter, Alyssa Rosenzweig, Rob Herring
  Cc: Mark Kettenis, linux-arm-kernel, devicetree, linux-kernel

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

Reviewed-by: Mark Kettenis <kettenis@openbsd.org>
Signed-off-by: Janne Grunau <j@jannau.net>
---
 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

diff --git a/arch/arm64/boot/dts/apple/Makefile b/arch/arm64/boot/dts/apple/Makefile
index cbbd701ebf05..c0510c25ca6a 100644
--- a/arch/arm64/boot/dts/apple/Makefile
+++ b/arch/arm64/boot/dts/apple/Makefile
@@ -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
diff --git a/arch/arm64/boot/dts/apple/t8103-j274.dts b/arch/arm64/boot/dts/apple/t8103-j274.dts
index 02c36301e985..9e01ef70039d 100644
--- a/arch/arm64/boot/dts/apple/t8103-j274.dts
+++ b/arch/arm64/boot/dts/apple/t8103-j274.dts
@@ -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>;
diff --git a/arch/arm64/boot/dts/apple/t8103-j293.dts b/arch/arm64/boot/dts/apple/t8103-j293.dts
new file mode 100644
index 000000000000..466035f00b69
--- /dev/null
+++ b/arch/arm64/boot/dts/apple/t8103-j293.dts
@@ -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;
diff --git a/arch/arm64/boot/dts/apple/t8103-j313.dts b/arch/arm64/boot/dts/apple/t8103-j313.dts
new file mode 100644
index 000000000000..b0ebb45bdb6f
--- /dev/null
+++ b/arch/arm64/boot/dts/apple/t8103-j313.dts
@@ -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;
diff --git a/arch/arm64/boot/dts/apple/t8103-j456.dts b/arch/arm64/boot/dts/apple/t8103-j456.dts
new file mode 100644
index 000000000000..7267e069355b
--- /dev/null
+++ b/arch/arm64/boot/dts/apple/t8103-j456.dts
@@ -0,0 +1,41 @@
+// SPDX-License-Identifier: GPL-2.0+ OR MIT
+/*
+ * Apple iMac (24-inch, 4x USB-C, M1, 2020)
+ *
+ * target-type: J456
+ *
+ * Copyright The Asahi Linux Contributors
+ */
+
+/dts-v1/;
+
+#include "t8103.dtsi"
+#include "t8103-jxxx.dtsi"
+
+/ {
+	compatible = "apple,j456", "apple,t8103", "apple,arm-platform";
+	model = "Apple iMac (24-inch, 4x USB-C, M1, 2020)";
+
+	aliases {
+		ethernet0 = &ethernet0;
+	};
+};
+
+/*
+ * 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).
+ */
+
+&port01 {
+	bus-range = <2 2>;
+};
+
+&port02 {
+	bus-range = <3 3>;
+	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];
+	};
+};
diff --git a/arch/arm64/boot/dts/apple/t8103-j457.dts b/arch/arm64/boot/dts/apple/t8103-j457.dts
new file mode 100644
index 000000000000..d7c622931627
--- /dev/null
+++ b/arch/arm64/boot/dts/apple/t8103-j457.dts
@@ -0,0 +1,47 @@
+// SPDX-License-Identifier: GPL-2.0+ OR MIT
+/*
+ * Apple iMac (24-inch, 2x USB-C, M1, 2020)
+ *
+ * target-type: J457
+ *
+ * Copyright The Asahi Linux Contributors
+ */
+
+/dts-v1/;
+
+#include "t8103.dtsi"
+#include "t8103-jxxx.dtsi"
+
+/ {
+	compatible = "apple,j457", "apple,t8103", "apple,arm-platform";
+	model = "Apple iMac (24-inch, 2x USB-C, M1, 2020)";
+
+	aliases {
+		ethernet0 = &ethernet0;
+	};
+};
+
+/*
+ * 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).
+ */
+
+&port02 {
+	bus-range = <3 3>;
+	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];
+	};
+};
+
+/*
+ * Remove unused PCIe port and disable the associated DART.
+ */
+
+&pcie0_dart_1 {
+	status = "disabled";
+};
+
+/delete-node/ &port01;
diff --git a/arch/arm64/boot/dts/apple/t8103-jxxx.dtsi b/arch/arm64/boot/dts/apple/t8103-jxxx.dtsi
new file mode 100644
index 000000000000..53d22b434d76
--- /dev/null
+++ b/arch/arm64/boot/dts/apple/t8103-jxxx.dtsi
@@ -0,0 +1,49 @@
+// SPDX-License-Identifier: GPL-2.0+ OR MIT
+/*
+ * Apple M1 Mac mini, MacBook Air/Pro, iMac 24" (M1, 2020/2021)
+ *
+ * This file contains parts common to all Apple M1 devices using the t8103.
+ *
+ * target-type: J274, J293, J313, J456, J457
+ *
+ * Copyright The Asahi Linux Contributors
+ */
+
+/ {
+	aliases {
+		serial0 = &serial0;
+	};
+
+	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";
+};
+
+/*
+ * 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>;
+};
-- 
2.34.0


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH v4 3/4] arm64: dts: apple: t8103: Add i2c nodes
  2021-11-23 22:49 [PATCH v4 0/4] Add DTs for all Apple M1 (t8103) devices Janne Grunau
  2021-11-23 22:49 ` [PATCH v4 1/4] dt-bindings: arm: apple: Add iMac (24-inch 2021) to Apple bindings Janne Grunau
  2021-11-23 22:49 ` [PATCH v4 2/4] arm64: dts: apple: Add missing M1 (t8103) devices Janne Grunau
@ 2021-11-23 22:49 ` Janne Grunau
  2021-11-23 22:49 ` [PATCH v4 4/4] arm64: dts: apple: t8103: Add cd321x nodes Janne Grunau
  2021-11-26  6:51 ` [PATCH v4 0/4] Add DTs for all Apple M1 (t8103) devices Hector Martin
  4 siblings, 0 replies; 8+ messages in thread
From: Janne Grunau @ 2021-11-23 22:49 UTC (permalink / raw)
  To: Hector Martin, Sven Peter, Alyssa Rosenzweig, Rob Herring
  Cc: linux-arm-kernel, devicetree, linux-kernel

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.

Signed-off-by: Janne Grunau <j@jannau.net>
Reviewed-by: Sven Peter <sven@svenpeter.dev>
Acked-by: Hector Martin <marcan@marcan.st>
---
 - fixed node order by address in t8103.dtsi
 - removed clock-names property from i2c nodes
 - added Reviewed-by and Acked-by tags

 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     | 87 ++++++++++++++++++++++++
 3 files changed, 99 insertions(+)

diff --git a/arch/arm64/boot/dts/apple/t8103-j274.dts b/arch/arm64/boot/dts/apple/t8103-j274.dts
index 9e01ef70039d..2cd429efba5b 100644
--- a/arch/arm64/boot/dts/apple/t8103-j274.dts
+++ b/arch/arm64/boot/dts/apple/t8103-j274.dts
@@ -39,3 +39,7 @@ ethernet0: ethernet@0,0 {
 		local-mac-address = [00 10 18 00 00 00];
 	};
 };
+
+&i2c2 {
+	status = "okay";
+};
diff --git a/arch/arm64/boot/dts/apple/t8103-j293.dts b/arch/arm64/boot/dts/apple/t8103-j293.dts
index 466035f00b69..49cdf4b560a3 100644
--- a/arch/arm64/boot/dts/apple/t8103-j293.dts
+++ b/arch/arm64/boot/dts/apple/t8103-j293.dts
@@ -31,3 +31,11 @@ &pcie0_dart_2 {
 
 /delete-node/ &port01;
 /delete-node/ &port02;
+
+&i2c2 {
+	status = "okay";
+};
+
+&i2c4 {
+	status = "okay";
+};
diff --git a/arch/arm64/boot/dts/apple/t8103.dtsi b/arch/arm64/boot/dts/apple/t8103.dtsi
index c320c8baeb41..c62d9082c6a3 100644
--- a/arch/arm64/boot/dts/apple/t8103.dtsi
+++ b/arch/arm64/boot/dts/apple/t8103.dtsi
@@ -111,6 +111,68 @@ soc {
 		ranges;
 		nonposted-mmio;
 
+		i2c0: i2c@235010000 {
+			compatible = "apple,t8103-i2c", "apple,i2c";
+			reg = <0x2 0x35010000 0x0 0x4000>;
+			clocks = <&clk24>;
+			interrupt-parent = <&aic>;
+			interrupts = <AIC_IRQ 627 IRQ_TYPE_LEVEL_HIGH>;
+			pinctrl-0 = <&i2c0_pins>;
+			pinctrl-names = "default";
+			#address-cells = <0x1>;
+			#size-cells = <0x0>;
+		};
+
+		i2c1: i2c@235014000 {
+			compatible = "apple,t8103-i2c", "apple,i2c";
+			reg = <0x2 0x35014000 0x0 0x4000>;
+			clocks = <&clk24>;
+			interrupt-parent = <&aic>;
+			interrupts = <AIC_IRQ 628 IRQ_TYPE_LEVEL_HIGH>;
+			pinctrl-0 = <&i2c1_pins>;
+			pinctrl-names = "default";
+			#address-cells = <0x1>;
+			#size-cells = <0x0>;
+		};
+
+		i2c2: i2c@235018000 {
+			compatible = "apple,t8103-i2c", "apple,i2c";
+			reg = <0x2 0x35018000 0x0 0x4000>;
+			clocks = <&clk24>;
+			interrupt-parent = <&aic>;
+			interrupts = <AIC_IRQ 629 IRQ_TYPE_LEVEL_HIGH>;
+			pinctrl-0 = <&i2c2_pins>;
+			pinctrl-names = "default";
+			#address-cells = <0x1>;
+			#size-cells = <0x0>;
+			status = "disabled"; /* not used in all devices */
+		};
+
+		i2c3: i2c@23501c000 {
+			compatible = "apple,t8103-i2c", "apple,i2c";
+			reg = <0x2 0x3501c000 0x0 0x4000>;
+			clocks = <&clk24>;
+			interrupt-parent = <&aic>;
+			interrupts = <AIC_IRQ 630 IRQ_TYPE_LEVEL_HIGH>;
+			pinctrl-0 = <&i2c3_pins>;
+			pinctrl-names = "default";
+			#address-cells = <0x1>;
+			#size-cells = <0x0>;
+		};
+
+		i2c4: i2c@235020000 {
+			compatible = "apple,t8103-i2c", "apple,i2c";
+			reg = <0x2 0x35020000 0x0 0x4000>;
+			clocks = <&clk24>;
+			interrupt-parent = <&aic>;
+			interrupts = <AIC_IRQ 631 IRQ_TYPE_LEVEL_HIGH>;
+			pinctrl-0 = <&i2c4_pins>;
+			pinctrl-names = "default";
+			#address-cells = <0x1>;
+			#size-cells = <0x0>;
+			status = "disabled"; /* only used in J293 */
+		};
+
 		serial0: serial@235200000 {
 			compatible = "apple,s5l-uart";
 			reg = <0x2 0x35200000 0x0 0x1000>;
@@ -153,6 +215,31 @@ pinctrl_ap: pinctrl@23c100000 {
 				     <AIC_IRQ 195 IRQ_TYPE_LEVEL_HIGH>,
 				     <AIC_IRQ 196 IRQ_TYPE_LEVEL_HIGH>;
 
+			i2c0_pins: i2c0-pins {
+				pinmux = <APPLE_PINMUX(192, 1)>,
+					 <APPLE_PINMUX(188, 1)>;
+			};
+
+			i2c1_pins: i2c1-pins {
+				pinmux = <APPLE_PINMUX(201, 1)>,
+					 <APPLE_PINMUX(199, 1)>;
+			};
+
+			i2c2_pins: i2c2-pins {
+				pinmux = <APPLE_PINMUX(163, 1)>,
+					 <APPLE_PINMUX(162, 1)>;
+			};
+
+			i2c3_pins: i2c3-pins {
+				pinmux = <APPLE_PINMUX(73, 1)>,
+					 <APPLE_PINMUX(72, 1)>;
+			};
+
+			i2c4_pins: i2c4-pins {
+				pinmux = <APPLE_PINMUX(135, 1)>,
+					 <APPLE_PINMUX(134, 1)>;
+			};
+
 			pcie_pins: pcie-pins {
 				pinmux = <APPLE_PINMUX(150, 1)>,
 					 <APPLE_PINMUX(151, 1)>,
-- 
2.34.0


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH v4 4/4] arm64: dts: apple: t8103: Add cd321x nodes
  2021-11-23 22:49 [PATCH v4 0/4] Add DTs for all Apple M1 (t8103) devices Janne Grunau
                   ` (2 preceding siblings ...)
  2021-11-23 22:49 ` [PATCH v4 3/4] arm64: dts: apple: t8103: Add i2c nodes Janne Grunau
@ 2021-11-23 22:49 ` Janne Grunau
  2021-11-26  6:51 ` [PATCH v4 0/4] Add DTs for all Apple M1 (t8103) devices Hector Martin
  4 siblings, 0 replies; 8+ messages in thread
From: Janne Grunau @ 2021-11-23 22:49 UTC (permalink / raw)
  To: Hector Martin, Sven Peter, Alyssa Rosenzweig, Rob Herring
  Cc: linux-arm-kernel, devicetree, linux-kernel

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 addresses
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.

Signed-off-by: Janne Grunau <j@jannau.net>
Reviewed-by: Sven Peter <sven@svenpeter.dev>
---
 - fixed typo in commit message
 - renamed cd321x nodes to "usb-pd"
 - added Reviewed-by tag

 arch/arm64/boot/dts/apple/t8103-j456.dts  | 18 ++++++++++++++++++
 arch/arm64/boot/dts/apple/t8103-jxxx.dtsi | 18 ++++++++++++++++++
 2 files changed, 36 insertions(+)

diff --git a/arch/arm64/boot/dts/apple/t8103-j456.dts b/arch/arm64/boot/dts/apple/t8103-j456.dts
index 7267e069355b..884fddf7d363 100644
--- a/arch/arm64/boot/dts/apple/t8103-j456.dts
+++ b/arch/arm64/boot/dts/apple/t8103-j456.dts
@@ -21,6 +21,24 @@ aliases {
 	};
 };
 
+&i2c0 {
+	hpm2: usb-pd@3b {
+		compatible = "apple,cd321x";
+		reg = <0x3b>;
+		interrupt-parent = <&pinctrl_ap>;
+		interrupts = <106 IRQ_TYPE_LEVEL_LOW>;
+		interrupt-names = "irq";
+	};
+
+	hpm3: usb-pd@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
diff --git a/arch/arm64/boot/dts/apple/t8103-jxxx.dtsi b/arch/arm64/boot/dts/apple/t8103-jxxx.dtsi
index 53d22b434d76..876278fe0afe 100644
--- a/arch/arm64/boot/dts/apple/t8103-jxxx.dtsi
+++ b/arch/arm64/boot/dts/apple/t8103-jxxx.dtsi
@@ -39,6 +39,24 @@ &serial0 {
 	status = "okay";
 };
 
+&i2c0 {
+	hpm0: usb-pd@38 {
+		compatible = "apple,cd321x";
+		reg = <0x38>;
+		interrupt-parent = <&pinctrl_ap>;
+		interrupts = <106 IRQ_TYPE_LEVEL_LOW>;
+		interrupt-names = "irq";
+	};
+
+	hpm1: usb-pd@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
-- 
2.34.0


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH v4 0/4] Add DTs for all Apple M1 (t8103) devices
  2021-11-23 22:49 [PATCH v4 0/4] Add DTs for all Apple M1 (t8103) devices Janne Grunau
                   ` (3 preceding siblings ...)
  2021-11-23 22:49 ` [PATCH v4 4/4] arm64: dts: apple: t8103: Add cd321x nodes Janne Grunau
@ 2021-11-26  6:51 ` Hector Martin
  2021-11-28 23:27   ` Rob Herring
  4 siblings, 1 reply; 8+ messages in thread
From: Hector Martin @ 2021-11-26  6:51 UTC (permalink / raw)
  To: Janne Grunau, Sven Peter, Alyssa Rosenzweig, Rob Herring
  Cc: Mark Kettenis, linux-arm-kernel, devicetree, linux-kernel

On 24/11/2021 07.49, Janne Grunau wrote:
> Hej all,
> 
> hopefully the last iteration of this series. Thanks for the reviews.
> 
> Changes since v3:
>   - fixed typo in "arm64: dts: apple: t8103: Add cd321x nodes" commit
>     message
>   - fixed node order by address in t8103.dtsi
>   - removed clock-names property from i2c nodes
>   - renamed cd321x nodes to "usb-pd"
>   - added Reviewed-by and Acked-by tags
> 
> This series is available as branch at
>      https://github.com/jannau/linux/tree/apple_m1/dt-for-5.17_v4
> 
> For reference the message from v3:
> 
> 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
> 
> Series depends for functionality and dtbs verification on
> "[PATCH 0/3] Apple Arm patform device tree and bindings fixes".
> 
> 
> 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          | 87 +++++++++++++++++++
>   9 files changed, 347 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
> 
> 
> base-commit: fa55b7dcdc43c1aa1ba12bca9d2dd4318c2a0dbf
> prerequisite-patch-id: 6827208d4389960d14555ee96768586179f9e8a7
> prerequisite-patch-id: d5f23530f8cb99fbd9355f4bf0ccbaaca0cd6d7c
> prerequisite-patch-id: 40ab5e8cc6dc6b5d44f075d8409f39966452bfb3
> 

Acked-by: Hector Martin <marcan@marcan.st>


Applied locally to asahi-soc/dt (with the #4 commit message fixed); that 
needs to be on top of the fixes branch, so I'll wait for Rob's ack on 
the binding change there before sending out the pulls. Thanks!

-- 
Hector Martin (marcan@marcan.st)
Public Key: https://mrcn.st/pub

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v4 1/4] dt-bindings: arm: apple: Add iMac (24-inch 2021) to Apple bindings
  2021-11-23 22:49 ` [PATCH v4 1/4] dt-bindings: arm: apple: Add iMac (24-inch 2021) to Apple bindings Janne Grunau
@ 2021-11-28 23:23   ` Rob Herring
  0 siblings, 0 replies; 8+ messages in thread
From: Rob Herring @ 2021-11-28 23:23 UTC (permalink / raw)
  To: Janne Grunau
  Cc: Hector Martin, Sven Peter, Alyssa Rosenzweig, linux-kernel,
	devicetree, linux-arm-kernel, Rob Herring, Mark Kettenis

On Tue, 23 Nov 2021 23:49:22 +0100, Janne Grunau wrote:
> 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)
> 
> Reviewed-by: Mark Kettenis <kettenis@openbsd.org>
> Signed-off-by: Janne Grunau <j@jannau.net>
> ---
>  Documentation/devicetree/bindings/arm/apple.yaml | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 

Acked-by: Rob Herring <robh@kernel.org>

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v4 0/4] Add DTs for all Apple M1 (t8103) devices
  2021-11-26  6:51 ` [PATCH v4 0/4] Add DTs for all Apple M1 (t8103) devices Hector Martin
@ 2021-11-28 23:27   ` Rob Herring
  0 siblings, 0 replies; 8+ messages in thread
From: Rob Herring @ 2021-11-28 23:27 UTC (permalink / raw)
  To: Hector Martin
  Cc: Janne Grunau, Sven Peter, Alyssa Rosenzweig, Mark Kettenis,
	linux-arm-kernel, devicetree, linux-kernel

On Fri, Nov 26, 2021 at 12:51 AM Hector Martin <marcan@marcan.st> wrote:
>
> On 24/11/2021 07.49, Janne Grunau wrote:
> > Hej all,
> >
> > hopefully the last iteration of this series. Thanks for the reviews.
> >
> > Changes since v3:
> >   - fixed typo in "arm64: dts: apple: t8103: Add cd321x nodes" commit
> >     message
> >   - fixed node order by address in t8103.dtsi
> >   - removed clock-names property from i2c nodes
> >   - renamed cd321x nodes to "usb-pd"
> >   - added Reviewed-by and Acked-by tags
> >
> > This series is available as branch at
> >      https://github.com/jannau/linux/tree/apple_m1/dt-for-5.17_v4
> >
> > For reference the message from v3:
> >
> > 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
> >
> > Series depends for functionality and dtbs verification on
> > "[PATCH 0/3] Apple Arm patform device tree and bindings fixes".
> >
> >
> > 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          | 87 +++++++++++++++++++
> >   9 files changed, 347 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
> >
> >
> > base-commit: fa55b7dcdc43c1aa1ba12bca9d2dd4318c2a0dbf
> > prerequisite-patch-id: 6827208d4389960d14555ee96768586179f9e8a7
> > prerequisite-patch-id: d5f23530f8cb99fbd9355f4bf0ccbaaca0cd6d7c
> > prerequisite-patch-id: 40ab5e8cc6dc6b5d44f075d8409f39966452bfb3
> >
>
> Acked-by: Hector Martin <marcan@marcan.st>
>
>
> Applied locally to asahi-soc/dt (with the #4 commit message fixed); that
> needs to be on top of the fixes branch, so I'll wait for Rob's ack on
> the binding change there before sending out the pulls. Thanks!

For just compatible additions, don't need to wait on me.

Rob

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2021-11-28 23:30 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-23 22:49 [PATCH v4 0/4] Add DTs for all Apple M1 (t8103) devices Janne Grunau
2021-11-23 22:49 ` [PATCH v4 1/4] dt-bindings: arm: apple: Add iMac (24-inch 2021) to Apple bindings Janne Grunau
2021-11-28 23:23   ` Rob Herring
2021-11-23 22:49 ` [PATCH v4 2/4] arm64: dts: apple: Add missing M1 (t8103) devices Janne Grunau
2021-11-23 22:49 ` [PATCH v4 3/4] arm64: dts: apple: t8103: Add i2c nodes Janne Grunau
2021-11-23 22:49 ` [PATCH v4 4/4] arm64: dts: apple: t8103: Add cd321x nodes Janne Grunau
2021-11-26  6:51 ` [PATCH v4 0/4] Add DTs for all Apple M1 (t8103) devices Hector Martin
2021-11-28 23:27   ` Rob Herring

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).