Skip to contentSkip to conversation

Apple mailbox fixup: switch to generic compatibles

PATCH Superseded Hector Martin 4 participants 10 messages Dec 9, 2021 – Dec 15, 2021

Subsystems (3)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

cover Apple mailbox fixup: switch to generic compatibles

Hi folks,

Just a quick fix for the Apple mailbox compatible. Similar to [1], we intend to use SoC-specific compatibles only for potential quirks, and rely on a generic compatible to allow for forward-compatibility as long as things don't break.

Since this isn't instantiated in any upstream DT yet, I think we can afford the compatibility break now.

This also goes ahead and adds the compatible for the new t600x SoCs.

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

Hector Martin (2):
dt-bindings: mailbox: apple,mailbox: Add generic and t6000 compatibles
mailbox: apple: Bind to generic compatibles

 .../devicetree/bindings/mailbox/apple,mailbox.yaml   | 12 +++++++++---
 drivers/mailbox/apple-mailbox.c                      |  4 ++--
 2 files changed, 11 insertions(+), 5 deletions(-)
Signature · 1 line
2.33.0
#1 lore raw

PATCH 1/2 dt-bindings: mailbox: apple,mailbox: Add generic and t6000 compatibles

Much as we've done with other blocks, let's introduce generic compatibles so drivers can bind to those and still work with future SoCs, as long as the hardware remains the same. Also go ahead and add compatibles for the new t600x SoCs (we group those as t6000).

Note that no DTs instantiate devices with this binding yet.

---
 .../devicetree/bindings/mailbox/apple,mailbox.yaml   | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)
Documentation/devicetree/bindings/mailbox/apple,mailbox.yaml +9 -3
index 2c1704b34e7a..58007c789671 100644
@@ -27,14 +27,20 @@ properties:
           for example for the display controller, the system management
           controller and the NVMe coprocessor.
         items:
-          - const: apple,t8103-asc-mailbox
+          - enum:
+              - apple,t8103-asc-mailbox
+              - apple,t6000-asc-mailbox
+          - const: apple,asc-mailbox
 
       - description:
           M3 mailboxes are an older variant with a slightly different MMIO
           interface still found on the M1. It is used for the Thunderbolt
           co-processors.
         items:
-          - const: apple,t8103-m3-mailbox
+          - enum:
+              - apple,t8103-m3-mailbox
+              - apple,t6000-m3-mailbox
+          - const: apple,m3-mailbox
 
   reg:
     maxItems: 1
@@ -68,7 +74,7 @@ additionalProperties: false
 examples:
   - |
         mailbox@77408000 {
-                compatible = "apple,t8103-asc-mailbox";
+                compatible = "apple,t8103-asc-mailbox", "apple,asc-mailbox";
                 reg = <0x77408000 0x4000>;
                 interrupts = <1 583 4>, <1 584 4>, <1 585 4>, <1 586 4>;
                 interrupt-names = "send-empty", "send-not-empty",
Signature · 1 line
2.33.0
#6 lore raw

PATCH 2/2 mailbox: apple: Bind to generic compatibles

In reply to Hector Martin

As with other blocks, we intend to have drivers bind to generic compatibles as long as there are no SoC-specific quirks. This allows forward-compatibility with future SoCs.

No upstream DTs instantiate this yet, so it's still safe to make this breaking change.

---
 drivers/mailbox/apple-mailbox.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/mailbox/apple-mailbox.c +2 -2
index 72942002a54a..f9704332cda3 100644
@@ -364,8 +364,8 @@ static const struct apple_mbox_hw apple_mbox_m3_hw = {
 };
 
 static const struct of_device_id apple_mbox_of_match[] = {
-	{ .compatible = "apple,t8103-asc-mailbox", .data = &apple_mbox_asc_hw },
-	{ .compatible = "apple,t8103-m3-mailbox", .data = &apple_mbox_m3_hw },
+	{ .compatible = "apple,asc-mailbox", .data = &apple_mbox_asc_hw },
+	{ .compatible = "apple,m3-mailbox", .data = &apple_mbox_m3_hw },
 	{}
 };
 MODULE_DEVICE_TABLE(of, apple_mbox_of_match);
Signature · 1 line
2.33.0
Reviewed-by on v1 1/2
#2 lore raw

Re: [PATCH 1/2] dt-bindings: mailbox: apple, mailbox: Add generic and t6000 compatibles

In reply to Hector Martin
Quoted 9 lines

From: Hector Martin <[email protected]>
Date: Thu, 9 Dec 2021 14:50:48 +0900

Much as we've done with other blocks, let's introduce generic compatibles so drivers can bind to those and still work with future SoCs, as long as the hardware remains the same. Also go ahead and add compatibles for the new t600x SoCs (we group those as t6000).

Note that no DTs instantiate devices with this binding yet.

I think this makes sense. There is no OpenBSD driver for this yet and my U-Boot driver has not been submitted upstream yet. So I think there are no real backwards compatibility issues.

Quoted 51 lines
---
 .../devicetree/bindings/mailbox/apple,mailbox.yaml   | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)
Documentation/devicetree/bindings/mailbox/apple,mailbox.yaml +9 -3
index 2c1704b34e7a..58007c789671 100644
@@ -27,14 +27,20 @@ properties:
           for example for the display controller, the system management
           controller and the NVMe coprocessor.
         items:
-          - const: apple,t8103-asc-mailbox
+          - enum:
+              - apple,t8103-asc-mailbox
+              - apple,t6000-asc-mailbox
+          - const: apple,asc-mailbox
 
       - description:
           M3 mailboxes are an older variant with a slightly different MMIO
           interface still found on the M1. It is used for the Thunderbolt
           co-processors.
         items:
-          - const: apple,t8103-m3-mailbox
+          - enum:
+              - apple,t8103-m3-mailbox
+              - apple,t6000-m3-mailbox
+          - const: apple,m3-mailbox
 
   reg:
     maxItems: 1
@@ -68,7 +74,7 @@ additionalProperties: false
 examples:
   - |
         mailbox@77408000 {
-                compatible = "apple,t8103-asc-mailbox";
+                compatible = "apple,t8103-asc-mailbox", "apple,asc-mailbox";
                 reg = <0x77408000 0x4000>;
                 interrupts = <1 583 4>, <1 584 4>, <1 585 4>, <1 586 4>;
                 interrupt-names = "send-empty", "send-not-empty",
Signature · 7 lines
2.33.0


_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
#7 lore raw
In reply to Hector Martin
Quoted 6 lines · Hector Martin

Hi folks,

Just a quick fix for the Apple mailbox compatible. Similar to [1], we intend to use SoC-specific compatibles only for potential quirks, and rely on a generic compatible to allow for forward-compatibility as long as things don't break.

I vaguely remember a brief discussion about this and I think we thought about using "t6000-asc", "t8103-asc" in this case since this specific mailbox hardware was only introduced in the M1. I think Apple calls this variant ascwrap-v4 and m3wrap-v2.

Doing it like you suggested is also fine with me though.

Sven

#8 lore raw
Quoted 8 lines · Sven Peter
Quoted 6 lines · Hector Martin

Hi folks,

Just a quick fix for the Apple mailbox compatible. Similar to [1], we intend to use SoC-specific compatibles only for potential quirks, and rely on a generic compatible to allow for forward-compatibility as long as things don't break.

Quoted 6 lines

I vaguely remember a brief discussion about this and I think we thought about using "t6000-asc", "t8103-asc" in this case since this specific mailbox hardware was only introduced in the M1. I think Apple calls this variant ascwrap-v4 and m3wrap-v2.

Doing it like you suggested is also fine with me though.

I think I remember that one... seems this is ascwrap-v4 in t8101 too, so not quite introduced with M1. But that one doesn't have m3wraps (or doesn't use them).

Since Apple do have some kind of sane versioning for these it seems, maybe we should follow their numbers and call them apple,asc-mailbox-v4 and apple,m3-mailbox-v2?

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

Hi folks,

Just a quick fix for the Apple mailbox compatible. Similar to [1], we intend to use SoC-specific compatibles only for potential quirks, and rely on a generic compatible to allow for forward-compatibility as long as things don't break.

Quoted 6 lines

I vaguely remember a brief discussion about this and I think we thought about using "t6000-asc", "t8103-asc" in this case since this specific mailbox hardware was only introduced in the M1. I think Apple calls this variant ascwrap-v4 and m3wrap-v2.

Doing it like you suggested is also fine with me though.

Quoted 7 lines

I think I remember that one... seems this is ascwrap-v4 in t8101 too, so not quite introduced with M1. But that one doesn't have m3wraps (or doesn't use them).

Since Apple do have some kind of sane versioning for these it seems, maybe we should follow their numbers and call them apple,asc-mailbox-v4 and apple,m3-mailbox-v2?

Sure, sounds good to me.

Sven

maintainer Reviewed-by on v1 1/2
#3 lore raw

Re: [PATCH 1/2] dt-bindings: mailbox: apple,mailbox: Add generic and t6000 compatibles

In reply to Hector Martin
Quoted 5 lines · Hector Martin

Much as we've done with other blocks, let's introduce generic compatibles so drivers can bind to those and still work with future SoCs, as long as the hardware remains the same. Also go ahead and add compatibles for the new t600x SoCs (we group those as t6000).

Quoted 7 lines

Note that no DTs instantiate devices with this binding yet.

---
 .../devicetree/bindings/mailbox/apple,mailbox.yaml   | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)
Reviewed-by on v1 1/2
#4 lore raw

Re: [PATCH 1/2] dt-bindings: mailbox: apple,mailbox: Add generic and t6000 compatibles

In reply to Hector Martin
Quoted 9 lines · Hector Martin

Much as we've done with other blocks, let's introduce generic compatibles so drivers can bind to those and still work with future SoCs, as long as the hardware remains the same. Also go ahead and add compatibles for the new t600x SoCs (we group those as t6000).

Note that no DTs instantiate devices with this binding yet.

---

#5 lore raw

Re: [PATCH 1/2] dt-bindings: mailbox: apple,mailbox: Add generic and t6000 compatibles

Quoted 11 lines · Sven Peter
Quoted 9 lines · Hector Martin

Much as we've done with other blocks, let's introduce generic compatibles so drivers can bind to those and still work with future SoCs, as long as the hardware remains the same. Also go ahead and add compatibles for the new t600x SoCs (we group those as t6000).

Note that no DTs instantiate devices with this binding yet.

---

er... wait... that was meant for v2, sorry *sigh*.

Sven