All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] Add DTs for all Apple M1 (t8103) devices
@ 2021-11-16 21:53 ` Janne Grunau
  0 siblings, 0 replies; 10+ messages in thread
From: Janne Grunau @ 2021-11-16 21:53 UTC (permalink / raw)
  To: Hector Martin, Sven Peter, Alyssa Rosenzweig, Rob Herring
  Cc: Mark Kettenis, linux-arm-kernel, devicetree, linux-kernel

this series adds DTs for 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)

With the addition of PCIe support the devices started to differ in
their supported hardware. The MacBook Air and Pro do not have an
ethernet and USB PCIe controllers. The 24-inch iMac has a configuration
without USB ihost controller.

In addtion it will help with AsahiLinux bootloader (m1n1). It started
in October to refuse to load DTs that do not match the model it is
running on.

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

 .../devicetree/bindings/arm/apple.yaml        |  6 ++-
 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 +++++++++++++++++++
 8 files changed, 212 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

-- 
2.33.1


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

* [PATCH 0/2] Add DTs for all Apple M1 (t8103) devices
@ 2021-11-16 21:53 ` Janne Grunau
  0 siblings, 0 replies; 10+ messages in thread
From: Janne Grunau @ 2021-11-16 21:53 UTC (permalink / raw)
  To: Hector Martin, Sven Peter, Alyssa Rosenzweig, Rob Herring
  Cc: Mark Kettenis, linux-arm-kernel, devicetree, linux-kernel

this series adds DTs for 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)

With the addition of PCIe support the devices started to differ in
their supported hardware. The MacBook Air and Pro do not have an
ethernet and USB PCIe controllers. The 24-inch iMac has a configuration
without USB ihost controller.

In addtion it will help with AsahiLinux bootloader (m1n1). It started
in October to refuse to load DTs that do not match the model it is
running on.

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

 .../devicetree/bindings/arm/apple.yaml        |  6 ++-
 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 +++++++++++++++++++
 8 files changed, 212 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

-- 
2.33.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH 1/2] dt-bindings: arm: apple: Add iMac (24-inch 2021) to Apple bindings
  2021-11-16 21:53 ` Janne Grunau
@ 2021-11-16 21:53   ` Janne Grunau
  -1 siblings, 0 replies; 10+ messages in thread
From: Janne Grunau @ 2021-11-16 21:53 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)

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..1416ed3a5623 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 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.33.1


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

* [PATCH 1/2] dt-bindings: arm: apple: Add iMac (24-inch 2021) to Apple bindings
@ 2021-11-16 21:53   ` Janne Grunau
  0 siblings, 0 replies; 10+ messages in thread
From: Janne Grunau @ 2021-11-16 21:53 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)

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..1416ed3a5623 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 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.33.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH 2/2] arm64: dts: apple: Add missing M1 (t8103) devices
  2021-11-16 21:53 ` Janne Grunau
@ 2021-11-16 21:53   ` Janne Grunau
  -1 siblings, 0 replies; 10+ messages in thread
From: Janne Grunau @ 2021-11-16 21:53 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)

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


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

* [PATCH 2/2] arm64: dts: apple: Add missing M1 (t8103) devices
@ 2021-11-16 21:53   ` Janne Grunau
  0 siblings, 0 replies; 10+ messages in thread
From: Janne Grunau @ 2021-11-16 21:53 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)

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


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH 1/2] dt-bindings: arm: apple: Add iMac (24-inch 2021) to Apple bindings
  2021-11-16 21:53   ` Janne Grunau
@ 2021-11-19 11:22     ` Mark Kettenis
  -1 siblings, 0 replies; 10+ messages in thread
From: Mark Kettenis @ 2021-11-19 11:22 UTC (permalink / raw)
  To: Janne Grunau
  Cc: marcan, sven, alyssa, robh+dt, linux-arm-kernel, devicetree,
	linux-kernel

> From: Janne Grunau <j@jannau.net>
> Date: Tue, 16 Nov 2021 22:53:14 +0100
> 
> 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)
> 
> Signed-off-by: Janne Grunau <j@jannau.net>
> ---
>  Documentation/devicetree/bindings/arm/apple.yaml | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)

Minor nit below.  Maybe not even worth respinning this series for.

Reviewed-by: Mark Kettenis <kettenis@openbsd.org>

> diff --git a/Documentation/devicetree/bindings/arm/apple.yaml b/Documentation/devicetree/bindings/arm/apple.yaml
> index 1e772c85206c..1416ed3a5623 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 2021)

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

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

* Re: [PATCH 1/2] dt-bindings: arm: apple: Add iMac (24-inch 2021) to Apple bindings
@ 2021-11-19 11:22     ` Mark Kettenis
  0 siblings, 0 replies; 10+ messages in thread
From: Mark Kettenis @ 2021-11-19 11:22 UTC (permalink / raw)
  To: Janne Grunau
  Cc: marcan, sven, alyssa, robh+dt, linux-arm-kernel, devicetree,
	linux-kernel

> From: Janne Grunau <j@jannau.net>
> Date: Tue, 16 Nov 2021 22:53:14 +0100
> 
> 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)
> 
> Signed-off-by: Janne Grunau <j@jannau.net>
> ---
>  Documentation/devicetree/bindings/arm/apple.yaml | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)

Minor nit below.  Maybe not even worth respinning this series for.

Reviewed-by: Mark Kettenis <kettenis@openbsd.org>

> diff --git a/Documentation/devicetree/bindings/arm/apple.yaml b/Documentation/devicetree/bindings/arm/apple.yaml
> index 1e772c85206c..1416ed3a5623 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 2021)

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

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH 2/2] arm64: dts: apple: Add missing M1 (t8103) devices
  2021-11-16 21:53   ` Janne Grunau
@ 2021-11-19 11:25     ` Mark Kettenis
  -1 siblings, 0 replies; 10+ messages in thread
From: Mark Kettenis @ 2021-11-19 11:25 UTC (permalink / raw)
  To: Janne Grunau
  Cc: marcan, sven, alyssa, robh+dt, linux-arm-kernel, devicetree,
	linux-kernel

> From: Janne Grunau <j@jannau.net>
> Cc: Mark Kettenis <mark.kettenis@xs4all.nl>,
>         linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org,
>         linux-kernel@vger.kernel.org
> Date: Tue, 16 Nov 2021 22:53:15 +0100
> 
> This adds support for following Apple M1 devices:
>  - MacBook Pro (13-inch, M1, 2020)
>  - MacBook Air (M1, 2020)
>  - iMac (24-inch 2021)
> 
> 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

There are multiple ways to skin this cat.  But I think this is a
reasonable way to do things and this should work fine for U-Boot and
OpenBSD.

Reviewed-by: Mark Kettenis <kettenis@openbsd.org>

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

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

* Re: [PATCH 2/2] arm64: dts: apple: Add missing M1 (t8103) devices
@ 2021-11-19 11:25     ` Mark Kettenis
  0 siblings, 0 replies; 10+ messages in thread
From: Mark Kettenis @ 2021-11-19 11:25 UTC (permalink / raw)
  To: Janne Grunau
  Cc: marcan, sven, alyssa, robh+dt, linux-arm-kernel, devicetree,
	linux-kernel

> From: Janne Grunau <j@jannau.net>
> Cc: Mark Kettenis <mark.kettenis@xs4all.nl>,
>         linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org,
>         linux-kernel@vger.kernel.org
> Date: Tue, 16 Nov 2021 22:53:15 +0100
> 
> This adds support for following Apple M1 devices:
>  - MacBook Pro (13-inch, M1, 2020)
>  - MacBook Air (M1, 2020)
>  - iMac (24-inch 2021)
> 
> 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

There are multiple ways to skin this cat.  But I think this is a
reasonable way to do things and this should work fine for U-Boot and
OpenBSD.

Reviewed-by: Mark Kettenis <kettenis@openbsd.org>

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

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

end of thread, other threads:[~2021-11-19 11:27 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-16 21:53 [PATCH 0/2] Add DTs for all Apple M1 (t8103) devices Janne Grunau
2021-11-16 21:53 ` Janne Grunau
2021-11-16 21:53 ` [PATCH 1/2] dt-bindings: arm: apple: Add iMac (24-inch 2021) to Apple bindings Janne Grunau
2021-11-16 21:53   ` Janne Grunau
2021-11-19 11:22   ` Mark Kettenis
2021-11-19 11:22     ` Mark Kettenis
2021-11-16 21:53 ` [PATCH 2/2] arm64: dts: apple: Add missing M1 (t8103) devices Janne Grunau
2021-11-16 21:53   ` Janne Grunau
2021-11-19 11:25   ` Mark Kettenis
2021-11-19 11:25     ` Mark Kettenis

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.