linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] Apple mailbox fixup: switch to generic compatibles
@ 2021-12-09  5:50 Hector Martin
  2021-12-09  5:50 ` [PATCH 1/2] dt-bindings: mailbox: apple,mailbox: Add generic and t6000 compatibles Hector Martin
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Hector Martin @ 2021-12-09  5:50 UTC (permalink / raw)
  To: Sven Peter, Jassi Brar, Rob Herring
  Cc: Hector Martin, Alyssa Rosenzweig, Mark Kettenis,
	linux-arm-kernel, linux-kernel, devicetree

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/20211121171545.27402-3-j@jannau.net/

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(-)

-- 
2.33.0


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

* [PATCH 1/2] dt-bindings: mailbox: apple,mailbox: Add generic and t6000 compatibles
  2021-12-09  5:50 [PATCH 0/2] Apple mailbox fixup: switch to generic compatibles Hector Martin
@ 2021-12-09  5:50 ` Hector Martin
  2021-12-09 14:16   ` [PATCH 1/2] dt-bindings: mailbox: apple, mailbox: " Mark Kettenis
                     ` (2 more replies)
  2021-12-09  5:50 ` [PATCH 2/2] mailbox: apple: Bind to generic compatibles Hector Martin
  2021-12-09 16:33 ` [PATCH 0/2] Apple mailbox fixup: switch " Sven Peter
  2 siblings, 3 replies; 10+ messages in thread
From: Hector Martin @ 2021-12-09  5:50 UTC (permalink / raw)
  To: Sven Peter, Jassi Brar, Rob Herring
  Cc: Hector Martin, Alyssa Rosenzweig, Mark Kettenis,
	linux-arm-kernel, linux-kernel, devicetree

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.

Signed-off-by: Hector Martin <marcan@marcan.st>
---
 .../devicetree/bindings/mailbox/apple,mailbox.yaml   | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/Documentation/devicetree/bindings/mailbox/apple,mailbox.yaml b/Documentation/devicetree/bindings/mailbox/apple,mailbox.yaml
index 2c1704b34e7a..58007c789671 100644
--- a/Documentation/devicetree/bindings/mailbox/apple,mailbox.yaml
+++ b/Documentation/devicetree/bindings/mailbox/apple,mailbox.yaml
@@ -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",
-- 
2.33.0


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

* [PATCH 2/2] mailbox: apple: Bind to generic compatibles
  2021-12-09  5:50 [PATCH 0/2] Apple mailbox fixup: switch to generic compatibles Hector Martin
  2021-12-09  5:50 ` [PATCH 1/2] dt-bindings: mailbox: apple,mailbox: Add generic and t6000 compatibles Hector Martin
@ 2021-12-09  5:50 ` Hector Martin
  2021-12-09 16:33 ` [PATCH 0/2] Apple mailbox fixup: switch " Sven Peter
  2 siblings, 0 replies; 10+ messages in thread
From: Hector Martin @ 2021-12-09  5:50 UTC (permalink / raw)
  To: Sven Peter, Jassi Brar, Rob Herring
  Cc: Hector Martin, Alyssa Rosenzweig, Mark Kettenis,
	linux-arm-kernel, linux-kernel, devicetree

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.

Signed-off-by: Hector Martin <marcan@marcan.st>
---
 drivers/mailbox/apple-mailbox.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/mailbox/apple-mailbox.c b/drivers/mailbox/apple-mailbox.c
index 72942002a54a..f9704332cda3 100644
--- a/drivers/mailbox/apple-mailbox.c
+++ b/drivers/mailbox/apple-mailbox.c
@@ -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);
-- 
2.33.0


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

* Re: [PATCH 1/2] dt-bindings: mailbox: apple, mailbox: Add generic and t6000 compatibles
  2021-12-09  5:50 ` [PATCH 1/2] dt-bindings: mailbox: apple,mailbox: Add generic and t6000 compatibles Hector Martin
@ 2021-12-09 14:16   ` Mark Kettenis
  2021-12-15 16:59   ` [PATCH 1/2] dt-bindings: mailbox: apple,mailbox: " Rob Herring
  2021-12-15 17:13   ` Sven Peter
  2 siblings, 0 replies; 10+ messages in thread
From: Mark Kettenis @ 2021-12-09 14:16 UTC (permalink / raw)
  To: Hector Martin
  Cc: sven, jassisinghbrar, robh+dt, marcan, alyssa, kettenis,
	linux-arm-kernel, linux-kernel, devicetree

> From: Hector Martin <marcan@marcan.st>
> 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.

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

>
> Signed-off-by: Hector Martin <marcan@marcan.st>
> ---
>  .../devicetree/bindings/mailbox/apple,mailbox.yaml   | 12 +++++++++---
>  1 file changed, 9 insertions(+), 3 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/mailbox/apple,mailbox.yaml b/Documentation/devicetree/bindings/mailbox/apple,mailbox.yaml
> index 2c1704b34e7a..58007c789671 100644
> --- a/Documentation/devicetree/bindings/mailbox/apple,mailbox.yaml
> +++ b/Documentation/devicetree/bindings/mailbox/apple,mailbox.yaml
> @@ -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",
> -- 
> 2.33.0
> 
> 
> _______________________________________________
> 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 0/2] Apple mailbox fixup: switch to generic compatibles
  2021-12-09  5:50 [PATCH 0/2] Apple mailbox fixup: switch to generic compatibles Hector Martin
  2021-12-09  5:50 ` [PATCH 1/2] dt-bindings: mailbox: apple,mailbox: Add generic and t6000 compatibles Hector Martin
  2021-12-09  5:50 ` [PATCH 2/2] mailbox: apple: Bind to generic compatibles Hector Martin
@ 2021-12-09 16:33 ` Sven Peter
  2021-12-13  3:55   ` Hector Martin
  2 siblings, 1 reply; 10+ messages in thread
From: Sven Peter @ 2021-12-09 16:33 UTC (permalink / raw)
  To: Hector Martin, Jassi Brar, Rob Herring
  Cc: Alyssa Rosenzweig, Mark Kettenis, linux-arm-kernel, linux-kernel,
	devicetree

On Thu, Dec 9, 2021, at 06:50, Hector Martin wrote:
> 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


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

* Re: [PATCH 0/2] Apple mailbox fixup: switch to generic compatibles
  2021-12-09 16:33 ` [PATCH 0/2] Apple mailbox fixup: switch " Sven Peter
@ 2021-12-13  3:55   ` Hector Martin
  2021-12-15  8:43     ` Sven Peter
  0 siblings, 1 reply; 10+ messages in thread
From: Hector Martin @ 2021-12-13  3:55 UTC (permalink / raw)
  To: Sven Peter, Jassi Brar, Rob Herring
  Cc: Alyssa Rosenzweig, Mark Kettenis, linux-arm-kernel, linux-kernel,
	devicetree

On 10/12/2021 01.33, Sven Peter wrote:
> On Thu, Dec 9, 2021, at 06:50, Hector Martin wrote:
>> 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.

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?

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

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

* Re: [PATCH 0/2] Apple mailbox fixup: switch to generic compatibles
  2021-12-13  3:55   ` Hector Martin
@ 2021-12-15  8:43     ` Sven Peter
  0 siblings, 0 replies; 10+ messages in thread
From: Sven Peter @ 2021-12-15  8:43 UTC (permalink / raw)
  To: Hector Martin
  Cc: Alyssa Rosenzweig, Mark Kettenis, linux-arm-kernel, linux-kernel,
	devicetree, Jassi Brar, Rob Herring



On Mon, Dec 13, 2021, at 04:55, Hector Martin wrote:
> On 10/12/2021 01.33, Sven Peter wrote:
>> On Thu, Dec 9, 2021, at 06:50, Hector Martin wrote:
>>> 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.
>
> 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

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

* Re: [PATCH 1/2] dt-bindings: mailbox: apple,mailbox: Add generic and t6000 compatibles
  2021-12-09  5:50 ` [PATCH 1/2] dt-bindings: mailbox: apple,mailbox: Add generic and t6000 compatibles Hector Martin
  2021-12-09 14:16   ` [PATCH 1/2] dt-bindings: mailbox: apple, mailbox: " Mark Kettenis
@ 2021-12-15 16:59   ` Rob Herring
  2021-12-15 17:13   ` Sven Peter
  2 siblings, 0 replies; 10+ messages in thread
From: Rob Herring @ 2021-12-15 16:59 UTC (permalink / raw)
  To: Hector Martin
  Cc: Mark Kettenis, Jassi Brar, devicetree, linux-arm-kernel,
	Alyssa Rosenzweig, Rob Herring, Sven Peter, linux-kernel

On Thu, 09 Dec 2021 14:50:48 +0900, Hector Martin wrote:
> 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.
> 
> Signed-off-by: Hector Martin <marcan@marcan.st>
> ---
>  .../devicetree/bindings/mailbox/apple,mailbox.yaml   | 12 +++++++++---
>  1 file changed, 9 insertions(+), 3 deletions(-)
> 

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

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

* Re: [PATCH 1/2] dt-bindings: mailbox: apple,mailbox: Add generic and t6000 compatibles
  2021-12-09  5:50 ` [PATCH 1/2] dt-bindings: mailbox: apple,mailbox: Add generic and t6000 compatibles Hector Martin
  2021-12-09 14:16   ` [PATCH 1/2] dt-bindings: mailbox: apple, mailbox: " Mark Kettenis
  2021-12-15 16:59   ` [PATCH 1/2] dt-bindings: mailbox: apple,mailbox: " Rob Herring
@ 2021-12-15 17:13   ` Sven Peter
  2021-12-15 17:14     ` Sven Peter
  2 siblings, 1 reply; 10+ messages in thread
From: Sven Peter @ 2021-12-15 17:13 UTC (permalink / raw)
  To: Hector Martin, Jassi Brar, Rob Herring
  Cc: Alyssa Rosenzweig, Mark Kettenis, linux-arm-kernel, linux-kernel,
	devicetree



On Thu, Dec 9, 2021, at 06:50, Hector Martin wrote:
> 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.
>
> Signed-off-by: Hector Martin <marcan@marcan.st>
> ---
Reviewed-by: Sven Peter <sven@svenpeter.dev>

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

* Re: [PATCH 1/2] dt-bindings: mailbox: apple,mailbox: Add generic and t6000 compatibles
  2021-12-15 17:13   ` Sven Peter
@ 2021-12-15 17:14     ` Sven Peter
  0 siblings, 0 replies; 10+ messages in thread
From: Sven Peter @ 2021-12-15 17:14 UTC (permalink / raw)
  To: Hector Martin, Jassi Brar, Rob Herring
  Cc: Alyssa Rosenzweig, Mark Kettenis, linux-arm-kernel, linux-kernel,
	devicetree



On Wed, Dec 15, 2021, at 18:13, Sven Peter wrote:
> On Thu, Dec 9, 2021, at 06:50, Hector Martin wrote:
>> 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.
>>
>> Signed-off-by: Hector Martin <marcan@marcan.st>
>> ---
> Reviewed-by: Sven Peter <sven@svenpeter.dev>

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


Sven

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

end of thread, other threads:[~2021-12-15 17:14 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-09  5:50 [PATCH 0/2] Apple mailbox fixup: switch to generic compatibles Hector Martin
2021-12-09  5:50 ` [PATCH 1/2] dt-bindings: mailbox: apple,mailbox: Add generic and t6000 compatibles Hector Martin
2021-12-09 14:16   ` [PATCH 1/2] dt-bindings: mailbox: apple, mailbox: " Mark Kettenis
2021-12-15 16:59   ` [PATCH 1/2] dt-bindings: mailbox: apple,mailbox: " Rob Herring
2021-12-15 17:13   ` Sven Peter
2021-12-15 17:14     ` Sven Peter
2021-12-09  5:50 ` [PATCH 2/2] mailbox: apple: Bind to generic compatibles Hector Martin
2021-12-09 16:33 ` [PATCH 0/2] Apple mailbox fixup: switch " Sven Peter
2021-12-13  3:55   ` Hector Martin
2021-12-15  8:43     ` Sven Peter

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