public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 0/3] Add mediatek,gce-props.yaml for other bindings reference
@ 2024-01-19  6:32 Jason-JH.Lin
  2024-01-19  6:32 ` [PATCH v3 1/3] dt-bindings: mailbox: Add mediatek,gce-props.yaml Jason-JH.Lin
                   ` (2 more replies)
  0 siblings, 3 replies; 13+ messages in thread
From: Jason-JH.Lin @ 2024-01-19  6:32 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Matthias Brugger,
	AngeloGioacchino Del Regno, Chun-Kuang Hu
  Cc: devicetree, linux-kernel, linux-arm-kernel, linux-mediatek,
	dri-devel, linux-media, linaro-mm-sig, Jason-ch Chen,
	Johnson Wang, Jason-JH . Lin, Singo Chang, Nancy Lin, Shawn Sung,
	Project_Global_Chrome_Upstream_Group, Jason-jh Lin

From: Jason-jh Lin <jason-jh.lin@mediatek.corp-partner.google.com>

The property "mediatek,gce-events" is used for GCE event ID corresponding
to a hardware event signal sent by the hardware or a sofware driver.
If the mailbox providers or consumers want to manipulate the value of
the event ID, they need to know the specific event ID.

Since mediatek,gce-events property is used for both mailbox producers
and consumers, we add a mediatek,gce-props.yaml to place the common GCE
properties like mediatek,gce-events.

Change in v3:
1. Add more description and fix typo and grammar.
2. Fix $ref as full path.

Change in v2:
1. Add mediatek,gce-props.yaml for other binding reference.

Jason-JH.Lin (3):
  dt-bindings: mailbox: Add mediatek,gce-props.yaml
  dt-bindings: media: mediatek: mdp: Change mediatek,gce-events to
    reference
  dt-bindings: soc: mediatek: Change mediatek,gce-events to refernece

 .../bindings/mailbox/mediatek,gce-props.yaml  | 52 +++++++++++++++++++
 .../bindings/media/mediatek,mdp3-rdma.yaml    | 11 ++--
 .../bindings/media/mediatek,mdp3-rsz.yaml     | 12 ++---
 .../bindings/media/mediatek,mdp3-wrot.yaml    | 12 ++---
 .../bindings/soc/mediatek/mediatek,ccorr.yaml | 12 ++---
 .../bindings/soc/mediatek/mediatek,mutex.yaml | 11 ++--
 .../bindings/soc/mediatek/mediatek,wdma.yaml  | 12 ++---
 7 files changed, 74 insertions(+), 48 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/mailbox/mediatek,gce-props.yaml

-- 
2.18.0


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

* [PATCH v3 1/3] dt-bindings: mailbox: Add mediatek,gce-props.yaml
  2024-01-19  6:32 [PATCH v3 0/3] Add mediatek,gce-props.yaml for other bindings reference Jason-JH.Lin
@ 2024-01-19  6:32 ` Jason-JH.Lin
  2024-01-19 10:53   ` AngeloGioacchino Del Regno
                     ` (2 more replies)
  2024-01-19  6:32 ` [PATCH v3 2/3] dt-bindings: media: mediatek: mdp: Change mediatek,gce-events to reference Jason-JH.Lin
  2024-01-19  6:32 ` [PATCH v3 3/3] dt-bindings: soc: mediatek: Change mediatek,gce-events to refernece Jason-JH.Lin
  2 siblings, 3 replies; 13+ messages in thread
From: Jason-JH.Lin @ 2024-01-19  6:32 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Matthias Brugger,
	AngeloGioacchino Del Regno, Chun-Kuang Hu
  Cc: devicetree, linux-kernel, linux-arm-kernel, linux-mediatek,
	dri-devel, linux-media, linaro-mm-sig, Jason-ch Chen,
	Johnson Wang, Jason-JH . Lin, Singo Chang, Nancy Lin, Shawn Sung,
	Project_Global_Chrome_Upstream_Group

Add mediatek,gce-props.yaml for common GCE properties that is used for
both mailbox providers and consumers. We place the common property
"mediatek,gce-events" in this binding currently.

The property "mediatek,gce-events" is used for GCE event ID corresponding
to a hardware event signal sent by the hardware or a sofware driver.
If the mailbox providers or consumers want to manipulate the value of
the event ID, they need to know the specific event ID.

Signed-off-by: Jason-JH.Lin <jason-jh.lin@mediatek.com>
---
 .../bindings/mailbox/mediatek,gce-props.yaml  | 52 +++++++++++++++++++
 1 file changed, 52 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/mailbox/mediatek,gce-props.yaml

diff --git a/Documentation/devicetree/bindings/mailbox/mediatek,gce-props.yaml b/Documentation/devicetree/bindings/mailbox/mediatek,gce-props.yaml
new file mode 100644
index 000000000000..68b519ff089f
--- /dev/null
+++ b/Documentation/devicetree/bindings/mailbox/mediatek,gce-props.yaml
@@ -0,0 +1,52 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/mailbox/mediatek,gce-props.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: MediaTek Global Command Engine Common Propertes
+
+maintainers:
+  - Houlong Wei <houlong.wei@mediatek.com>
+
+description:
+  The Global Command Engine (GCE) is an instruction based, multi-threaded,
+  single-core command dispatcher for MediaTek hardware. The Command Queue
+  (CMDQ) mailbox driver is a driver for GCE, implemented using the Linux
+  mailbox framework. It is used to receive messages from mailbox consumers
+  and configure GCE to execute the specified instruction set in the message.
+  We use mediatek,gce-mailbox.yaml to define the properties for CMDQ mailbox
+  driver. A device driver that uses the CMDQ driver to configure its hardware
+  registers is a mailbox consumer. The mailbox consumer can request a mailbox
+  channel corresponding to a GCE hardware thread to send a message, specifying
+  that the GCE thread to configure its hardware. The mailbox provider can also
+  reserved a mailbox channel to configure GCE hardware register by the spcific
+  GCE thread. This binding defines the common GCE properties for both mailbox
+  provider and consumers.
+
+properties:
+  mediatek,gce-events:
+    description:
+      GCE has an event table in SRAM, consisting of 1024 event IDs (0~1023).
+      Each event ID has a boolean event value with the default value 0.
+      The property mediatek,gce-events is used to obtain the event IDs.
+      Some gce-events are hardware-bound and cannot be changed by software.
+      For instance, in MT8195, when VDO0_MUTEX is stream done, VDO_MUTEX will
+      send an event signal to GCE, setting the value of event ID 597 to 1.
+      Similarly, in MT8188, the value of event ID 574 will be set to 1 when
+      VOD0_MUTEX is stream done.
+      On the other hand, some gce-events are not hardware-bound and can be
+      changed by software. For example, in MT8188, we can set the value of
+      event ID 855, which is not bound to any hardware, to 1 when the driver
+      in the secure world completes a task. However, in MT8195, event ID 855
+      is already bound to VDEC_LAT1, so we need to select another event ID to
+      achieve the same purpose. This event ID can be any ID that is not bound
+      to any hardware and is not yet used in any software driver.
+      To determine if the event ID is bound to the hardware or used by a
+      software driver, refer to the GCE header
+      include/dt-bindings/gce/<chip>-gce.h of each chip.
+    $ref: /schemas/types.yaml#/definitions/uint32-array
+    minItems: 1
+    maxItems: 1024
+
+additionalProperties: true
-- 
2.18.0


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

* [PATCH v3 2/3] dt-bindings: media: mediatek: mdp: Change mediatek,gce-events to reference
  2024-01-19  6:32 [PATCH v3 0/3] Add mediatek,gce-props.yaml for other bindings reference Jason-JH.Lin
  2024-01-19  6:32 ` [PATCH v3 1/3] dt-bindings: mailbox: Add mediatek,gce-props.yaml Jason-JH.Lin
@ 2024-01-19  6:32 ` Jason-JH.Lin
  2024-01-19 16:44   ` Conor Dooley
  2024-01-19  6:32 ` [PATCH v3 3/3] dt-bindings: soc: mediatek: Change mediatek,gce-events to refernece Jason-JH.Lin
  2 siblings, 1 reply; 13+ messages in thread
From: Jason-JH.Lin @ 2024-01-19  6:32 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Matthias Brugger,
	AngeloGioacchino Del Regno, Chun-Kuang Hu
  Cc: devicetree, linux-kernel, linux-arm-kernel, linux-mediatek,
	dri-devel, linux-media, linaro-mm-sig, Jason-ch Chen,
	Johnson Wang, Jason-JH . Lin, Singo Chang, Nancy Lin, Shawn Sung,
	Project_Global_Chrome_Upstream_Group

Change mediatek,gce-events property to reference mediatek,gce-props.yaml
instead of defining itself.

Signed-off-by: Jason-JH.Lin <jason-jh.lin@mediatek.com>
---
 .../bindings/media/mediatek,mdp3-rdma.yaml           | 11 +++--------
 .../devicetree/bindings/media/mediatek,mdp3-rsz.yaml | 12 ++++--------
 .../bindings/media/mediatek,mdp3-wrot.yaml           | 12 ++++--------
 3 files changed, 11 insertions(+), 24 deletions(-)

diff --git a/Documentation/devicetree/bindings/media/mediatek,mdp3-rdma.yaml b/Documentation/devicetree/bindings/media/mediatek,mdp3-rdma.yaml
index 59db8306485b..4a286d46c8ee 100644
--- a/Documentation/devicetree/bindings/media/mediatek,mdp3-rdma.yaml
+++ b/Documentation/devicetree/bindings/media/mediatek,mdp3-rdma.yaml
@@ -44,13 +44,6 @@ properties:
       4 arguments defined in this property. Each GCE subsys id is mapping to
       a client defined in the header include/dt-bindings/gce/<chip>-gce.h.
 
-  mediatek,gce-events:
-    description:
-      The event id which is mapping to the specific hardware event signal
-      to gce. The event id is defined in the gce header
-      include/dt-bindings/gce/<chip>-gce.h of each chips.
-    $ref: /schemas/types.yaml#/definitions/uint32-array
-
   mediatek,scp:
     $ref: /schemas/types.yaml#/definitions/phandle
     description:
@@ -96,6 +89,8 @@ required:
   - '#dma-cells'
 
 allOf:
+  - $ref: /schemas/mailbox/mediatek,gce-props.yaml
+
   - if:
       properties:
         compatible:
@@ -142,7 +137,7 @@ allOf:
         clocks:
           maxItems: 1
 
-additionalProperties: false
+unevaluatedProperties: false
 
 examples:
   - |
diff --git a/Documentation/devicetree/bindings/media/mediatek,mdp3-rsz.yaml b/Documentation/devicetree/bindings/media/mediatek,mdp3-rsz.yaml
index f5676bec4326..4774fdde1a1b 100644
--- a/Documentation/devicetree/bindings/media/mediatek,mdp3-rsz.yaml
+++ b/Documentation/devicetree/bindings/media/mediatek,mdp3-rsz.yaml
@@ -38,13 +38,6 @@ properties:
       4 arguments defined in this property. Each GCE subsys id is mapping to
       a client defined in the header include/dt-bindings/gce/<chip>-gce.h.
 
-  mediatek,gce-events:
-    description:
-      The event id which is mapping to the specific hardware event signal
-      to gce. The event id is defined in the gce header
-      include/dt-bindings/gce/<chip>-gce.h of each chips.
-    $ref: /schemas/types.yaml#/definitions/uint32-array
-
   clocks:
     minItems: 1
 
@@ -55,7 +48,10 @@ required:
   - mediatek,gce-events
   - clocks
 
-additionalProperties: false
+allOf:
+  - $ref: /schemas/mailbox/mediatek,gce-props.yaml
+
+unevaluatedProperties: false
 
 examples:
   - |
diff --git a/Documentation/devicetree/bindings/media/mediatek,mdp3-wrot.yaml b/Documentation/devicetree/bindings/media/mediatek,mdp3-wrot.yaml
index 53a679338402..a31f3f5aea96 100644
--- a/Documentation/devicetree/bindings/media/mediatek,mdp3-wrot.yaml
+++ b/Documentation/devicetree/bindings/media/mediatek,mdp3-wrot.yaml
@@ -38,13 +38,6 @@ properties:
       4 arguments defined in this property. Each GCE subsys id is mapping to
       a client defined in the header include/dt-bindings/gce/<chip>-gce.h.
 
-  mediatek,gce-events:
-    description:
-      The event id which is mapping to the specific hardware event signal
-      to gce. The event id is defined in the gce header
-      include/dt-bindings/gce/<chip>-gce.h of each chips.
-    $ref: /schemas/types.yaml#/definitions/uint32-array
-
   power-domains:
     maxItems: 1
 
@@ -67,7 +60,10 @@ required:
   - iommus
   - '#dma-cells'
 
-additionalProperties: false
+allOf:
+  - $ref: /schemas/mailbox/mediatek,gce-props.yaml
+
+unevaluatedProperties: false
 
 examples:
   - |
-- 
2.18.0


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

* [PATCH v3 3/3] dt-bindings: soc: mediatek: Change mediatek,gce-events to refernece
  2024-01-19  6:32 [PATCH v3 0/3] Add mediatek,gce-props.yaml for other bindings reference Jason-JH.Lin
  2024-01-19  6:32 ` [PATCH v3 1/3] dt-bindings: mailbox: Add mediatek,gce-props.yaml Jason-JH.Lin
  2024-01-19  6:32 ` [PATCH v3 2/3] dt-bindings: media: mediatek: mdp: Change mediatek,gce-events to reference Jason-JH.Lin
@ 2024-01-19  6:32 ` Jason-JH.Lin
  2024-01-19 16:45   ` Conor Dooley
  2 siblings, 1 reply; 13+ messages in thread
From: Jason-JH.Lin @ 2024-01-19  6:32 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Matthias Brugger,
	AngeloGioacchino Del Regno, Chun-Kuang Hu
  Cc: devicetree, linux-kernel, linux-arm-kernel, linux-mediatek,
	dri-devel, linux-media, linaro-mm-sig, Jason-ch Chen,
	Johnson Wang, Jason-JH . Lin, Singo Chang, Nancy Lin, Shawn Sung,
	Project_Global_Chrome_Upstream_Group

Change mediatek,gce-events property to reference mediatek,gce-props.yaml
instead of defining itself.

Signed-off-by: Jason-JH.Lin <jason-jh.lin@mediatek.com>
---
 .../bindings/soc/mediatek/mediatek,ccorr.yaml        | 12 ++++--------
 .../bindings/soc/mediatek/mediatek,mutex.yaml        | 11 +++--------
 .../bindings/soc/mediatek/mediatek,wdma.yaml         | 12 ++++--------
 3 files changed, 11 insertions(+), 24 deletions(-)

diff --git a/Documentation/devicetree/bindings/soc/mediatek/mediatek,ccorr.yaml b/Documentation/devicetree/bindings/soc/mediatek/mediatek,ccorr.yaml
index 4380b98b0dfe..305f2cd9f865 100644
--- a/Documentation/devicetree/bindings/soc/mediatek/mediatek,ccorr.yaml
+++ b/Documentation/devicetree/bindings/soc/mediatek/mediatek,ccorr.yaml
@@ -34,13 +34,6 @@ properties:
       4 arguments defined in this property. Each GCE subsys id is mapping to
       a client defined in the header include/dt-bindings/gce/<chip>-gce.h.
 
-  mediatek,gce-events:
-    description:
-      The event id which is mapping to the specific hardware event signal
-      to gce. The event id is defined in the gce header
-      include/dt-bindings/gce/<chip>-gce.h of each chips.
-    $ref: /schemas/types.yaml#/definitions/uint32-array
-
   clocks:
     minItems: 1
 
@@ -51,7 +44,10 @@ required:
   - mediatek,gce-events
   - clocks
 
-additionalProperties: false
+allOf:
+  - $ref: /schemas/mailbox/mediatek,gce-props.yaml#
+
+unevaluatedProperties: false
 
 examples:
   - |
diff --git a/Documentation/devicetree/bindings/soc/mediatek/mediatek,mutex.yaml b/Documentation/devicetree/bindings/soc/mediatek/mediatek,mutex.yaml
index ba2014a8725c..61cf16ce8b0b 100644
--- a/Documentation/devicetree/bindings/soc/mediatek/mediatek,mutex.yaml
+++ b/Documentation/devicetree/bindings/soc/mediatek/mediatek,mutex.yaml
@@ -53,13 +53,6 @@ properties:
     items:
       - description: MUTEX Clock
 
-  mediatek,gce-events:
-    description:
-      The event id which is mapping to the specific hardware event signal
-      to gce. The event id is defined in the gce header
-      include/dt-bindings/gce/<chip>-gce.h of each chips.
-    $ref: /schemas/types.yaml#/definitions/uint32-array
-
   mediatek,gce-client-reg:
     $ref: /schemas/types.yaml#/definitions/phandle-array
     items:
@@ -73,6 +66,8 @@ properties:
       a client defined in the header include/dt-bindings/gce/<chip>-gce.h.
 
 allOf:
+  - $ref: /schemas/mailbox/mediatek,gce-props.yaml#
+
   - if:
       properties:
         compatible:
@@ -97,7 +92,7 @@ required:
   - interrupts
   - power-domains
 
-additionalProperties: false
+unevaluatedProperties: false
 
 examples:
   - |
diff --git a/Documentation/devicetree/bindings/soc/mediatek/mediatek,wdma.yaml b/Documentation/devicetree/bindings/soc/mediatek/mediatek,wdma.yaml
index 69afb329e5f4..d9dd4428c036 100644
--- a/Documentation/devicetree/bindings/soc/mediatek/mediatek,wdma.yaml
+++ b/Documentation/devicetree/bindings/soc/mediatek/mediatek,wdma.yaml
@@ -35,13 +35,6 @@ properties:
       4 arguments defined in this property. Each GCE subsys id is mapping to
       a client defined in the header include/dt-bindings/gce/<chip>-gce.h.
 
-  mediatek,gce-events:
-    description:
-      The event id which is mapping to the specific hardware event signal
-      to gce. The event id is defined in the gce header
-      include/dt-bindings/gce/<chip>-gce.h of each chips.
-    $ref: /schemas/types.yaml#/definitions/uint32-array
-
   power-domains:
     maxItems: 1
 
@@ -60,7 +53,10 @@ required:
   - clocks
   - iommus
 
-additionalProperties: false
+allOf:
+  - $ref: /schemas/mailbox/mediatek,gce-props.yaml#
+
+unevaluatedProperties: false
 
 examples:
   - |
-- 
2.18.0


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

* Re: [PATCH v3 1/3] dt-bindings: mailbox: Add mediatek,gce-props.yaml
  2024-01-19  6:32 ` [PATCH v3 1/3] dt-bindings: mailbox: Add mediatek,gce-props.yaml Jason-JH.Lin
@ 2024-01-19 10:53   ` AngeloGioacchino Del Regno
  2024-01-20  9:48     ` Jason-JH Lin (林睿祥)
  2024-01-19 16:44   ` Conor Dooley
  2024-01-22  3:44   ` Fei Shao
  2 siblings, 1 reply; 13+ messages in thread
From: AngeloGioacchino Del Regno @ 2024-01-19 10:53 UTC (permalink / raw)
  To: Jason-JH.Lin, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Matthias Brugger, Chun-Kuang Hu
  Cc: devicetree, linux-kernel, linux-arm-kernel, linux-mediatek,
	dri-devel, linux-media, linaro-mm-sig, Jason-ch Chen,
	Johnson Wang, Singo Chang, Nancy Lin, Shawn Sung,
	Project_Global_Chrome_Upstream_Group

Il 19/01/24 07:32, Jason-JH.Lin ha scritto:
> Add mediatek,gce-props.yaml for common GCE properties that is used for
> both mailbox providers and consumers. We place the common property
> "mediatek,gce-events" in this binding currently.
> 
> The property "mediatek,gce-events" is used for GCE event ID corresponding
> to a hardware event signal sent by the hardware or a sofware driver.
> If the mailbox providers or consumers want to manipulate the value of
> the event ID, they need to know the specific event ID.
> 
> Signed-off-by: Jason-JH.Lin <jason-jh.lin@mediatek.com>
> ---
>   .../bindings/mailbox/mediatek,gce-props.yaml  | 52 +++++++++++++++++++
>   1 file changed, 52 insertions(+)
>   create mode 100644 Documentation/devicetree/bindings/mailbox/mediatek,gce-props.yaml
> 
> diff --git a/Documentation/devicetree/bindings/mailbox/mediatek,gce-props.yaml b/Documentation/devicetree/bindings/mailbox/mediatek,gce-props.yaml
> new file mode 100644
> index 000000000000..68b519ff089f
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/mailbox/mediatek,gce-props.yaml
> @@ -0,0 +1,52 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/mailbox/mediatek,gce-props.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: MediaTek Global Command Engine Common Propertes
> +
> +maintainers:
> +  - Houlong Wei <houlong.wei@mediatek.com>
> +
> +description:
> +  The Global Command Engine (GCE) is an instruction based, multi-threaded,
> +  single-core command dispatcher for MediaTek hardware. The Command Queue
> +  (CMDQ) mailbox driver is a driver for GCE, implemented using the Linux
> +  mailbox framework. It is used to receive messages from mailbox consumers
> +  and configure GCE to execute the specified instruction set in the message.
> +  We use mediatek,gce-mailbox.yaml to define the properties for CMDQ mailbox
> +  driver. A device driver that uses the CMDQ driver to configure its hardware
> +  registers is a mailbox consumer. The mailbox consumer can request a mailbox
> +  channel corresponding to a GCE hardware thread to send a message, specifying
> +  that the GCE thread to configure its hardware. The mailbox provider can also
> +  reserved a mailbox channel to configure GCE hardware register by the spcific
> +  GCE thread. This binding defines the common GCE properties for both mailbox
> +  provider and consumers.
> +
> +properties:
> +  mediatek,gce-events:
> +    description:
> +      GCE has an event table in SRAM, consisting of 1024 event IDs (0~1023).
> +      Each event ID has a boolean event value with the default value 0.
> +      The property mediatek,gce-events is used to obtain the event IDs.
> +      Some gce-events are hardware-bound and cannot be changed by software.
> +      For instance, in MT8195, when VDO0_MUTEX is stream done, VDO_MUTEX will
> +      send an event signal to GCE, setting the value of event ID 597 to 1.
> +      Similarly, in MT8188, the value of event ID 574 will be set to 1 when
> +      VOD0_MUTEX is stream done.
> +      On the other hand, some gce-events are not hardware-bound and can be
> +      changed by software. For example, in MT8188, we can set the value of
> +      event ID 855, which is not bound to any hardware, to 1 when the driver
> +      in the secure world completes a task. However, in MT8195, event ID 855
> +      is already bound to VDEC_LAT1, so we need to select another event ID to
> +      achieve the same purpose. This event ID can be any ID that is not bound
> +      to any hardware and is not yet used in any software driver.
> +      To determine if the event ID is bound to the hardware or used by a
> +      software driver, refer to the GCE header
> +      include/dt-bindings/gce/<chip>-gce.h of each chip.
> +    $ref: /schemas/types.yaml#/definitions/uint32-array
> +    minItems: 1
> +    maxItems: 1024

maxItems: 1024 seems to be a bit too many... this means that one devicetree node
may have up to 1024 gce events, which is impossible! If a driver needed all of
the 1024 events, this means that it's not an user of the GCE, but the GCE itself!

Imagine seeing a devicetree node with 1024 array entries for mediatek,gce-events...

I'd set that to a more sensible value of 32 - eventually we can extend it later,
if ever needed.

Besides, nice job about all this documentation of the GCE and its events: love it!

Cheers,
Angelo


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

* Re: [PATCH v3 1/3] dt-bindings: mailbox: Add mediatek,gce-props.yaml
  2024-01-19  6:32 ` [PATCH v3 1/3] dt-bindings: mailbox: Add mediatek,gce-props.yaml Jason-JH.Lin
  2024-01-19 10:53   ` AngeloGioacchino Del Regno
@ 2024-01-19 16:44   ` Conor Dooley
  2024-01-22 10:38     ` AngeloGioacchino Del Regno
  2024-01-22  3:44   ` Fei Shao
  2 siblings, 1 reply; 13+ messages in thread
From: Conor Dooley @ 2024-01-19 16:44 UTC (permalink / raw)
  To: Jason-JH.Lin
  Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Matthias Brugger,
	AngeloGioacchino Del Regno, Chun-Kuang Hu, devicetree,
	linux-kernel, linux-arm-kernel, linux-mediatek, dri-devel,
	linux-media, linaro-mm-sig, Jason-ch Chen, Johnson Wang,
	Singo Chang, Nancy Lin, Shawn Sung,
	Project_Global_Chrome_Upstream_Group

[-- Attachment #1: Type: text/plain, Size: 4144 bytes --]

Rob,

On Fri, Jan 19, 2024 at 02:32:22PM +0800, Jason-JH.Lin wrote:
> Add mediatek,gce-props.yaml for common GCE properties that is used for
> both mailbox providers and consumers. We place the common property
> "mediatek,gce-events" in this binding currently.
> 
> The property "mediatek,gce-events" is used for GCE event ID corresponding
> to a hardware event signal sent by the hardware or a sofware driver.
> If the mailbox providers or consumers want to manipulate the value of
> the event ID, they need to know the specific event ID.
> 
> Signed-off-by: Jason-JH.Lin <jason-jh.lin@mediatek.com>
> ---
>  .../bindings/mailbox/mediatek,gce-props.yaml  | 52 +++++++++++++++++++

Is bindings/mailbox the correct directory to put this in?

>  1 file changed, 52 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/mailbox/mediatek,gce-props.yaml
> 
> diff --git a/Documentation/devicetree/bindings/mailbox/mediatek,gce-props.yaml b/Documentation/devicetree/bindings/mailbox/mediatek,gce-props.yaml
> new file mode 100644
> index 000000000000..68b519ff089f
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/mailbox/mediatek,gce-props.yaml
> @@ -0,0 +1,52 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/mailbox/mediatek,gce-props.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: MediaTek Global Command Engine Common Propertes
> +
> +maintainers:
> +  - Houlong Wei <houlong.wei@mediatek.com>
> +
> +description:
> +  The Global Command Engine (GCE) is an instruction based, multi-threaded,
> +  single-core command dispatcher for MediaTek hardware. The Command Queue
> +  (CMDQ) mailbox driver is a driver for GCE, implemented using the Linux
> +  mailbox framework. It is used to receive messages from mailbox consumers
> +  and configure GCE to execute the specified instruction set in the message.
> +  We use mediatek,gce-mailbox.yaml to define the properties for CMDQ mailbox
> +  driver. A device driver that uses the CMDQ driver to configure its hardware
> +  registers is a mailbox consumer. The mailbox consumer can request a mailbox
> +  channel corresponding to a GCE hardware thread to send a message, specifying
> +  that the GCE thread to configure its hardware. The mailbox provider can also
> +  reserved a mailbox channel to configure GCE hardware register by the spcific
> +  GCE thread. This binding defines the common GCE properties for both mailbox
> +  provider and consumers.
> +
> +properties:
> +  mediatek,gce-events:
> +    description:
> +      GCE has an event table in SRAM, consisting of 1024 event IDs (0~1023).
> +      Each event ID has a boolean event value with the default value 0.
> +      The property mediatek,gce-events is used to obtain the event IDs.
> +      Some gce-events are hardware-bound and cannot be changed by software.
> +      For instance, in MT8195, when VDO0_MUTEX is stream done, VDO_MUTEX will
> +      send an event signal to GCE, setting the value of event ID 597 to 1.
> +      Similarly, in MT8188, the value of event ID 574 will be set to 1 when
> +      VOD0_MUTEX is stream done.
> +      On the other hand, some gce-events are not hardware-bound and can be
> +      changed by software. For example, in MT8188, we can set the value of
> +      event ID 855, which is not bound to any hardware, to 1 when the driver
> +      in the secure world completes a task. However, in MT8195, event ID 855
> +      is already bound to VDEC_LAT1, so we need to select another event ID to
> +      achieve the same purpose. This event ID can be any ID that is not bound
> +      to any hardware and is not yet used in any software driver.
> +      To determine if the event ID is bound to the hardware or used by a
> +      software driver, refer to the GCE header
> +      include/dt-bindings/gce/<chip>-gce.h of each chip.
> +    $ref: /schemas/types.yaml#/definitions/uint32-array
> +    minItems: 1
> +    maxItems: 1024
> +
> +additionalProperties: true
> -- 
> 2.18.0
> 

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

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

* Re: [PATCH v3 2/3] dt-bindings: media: mediatek: mdp: Change mediatek,gce-events to reference
  2024-01-19  6:32 ` [PATCH v3 2/3] dt-bindings: media: mediatek: mdp: Change mediatek,gce-events to reference Jason-JH.Lin
@ 2024-01-19 16:44   ` Conor Dooley
  0 siblings, 0 replies; 13+ messages in thread
From: Conor Dooley @ 2024-01-19 16:44 UTC (permalink / raw)
  To: Jason-JH.Lin
  Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Matthias Brugger,
	AngeloGioacchino Del Regno, Chun-Kuang Hu, devicetree,
	linux-kernel, linux-arm-kernel, linux-mediatek, dri-devel,
	linux-media, linaro-mm-sig, Jason-ch Chen, Johnson Wang,
	Singo Chang, Nancy Lin, Shawn Sung,
	Project_Global_Chrome_Upstream_Group

[-- Attachment #1: Type: text/plain, Size: 310 bytes --]

On Fri, Jan 19, 2024 at 02:32:23PM +0800, Jason-JH.Lin wrote:
> Change mediatek,gce-events property to reference mediatek,gce-props.yaml
> instead of defining itself.
> 
> Signed-off-by: Jason-JH.Lin <jason-jh.lin@mediatek.com>

Reviewed-by: Conor Dooley <conor.dooley@microchip.com>

Cheers,
Conor.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

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

* Re: [PATCH v3 3/3] dt-bindings: soc: mediatek: Change mediatek,gce-events to refernece
  2024-01-19  6:32 ` [PATCH v3 3/3] dt-bindings: soc: mediatek: Change mediatek,gce-events to refernece Jason-JH.Lin
@ 2024-01-19 16:45   ` Conor Dooley
  0 siblings, 0 replies; 13+ messages in thread
From: Conor Dooley @ 2024-01-19 16:45 UTC (permalink / raw)
  To: Jason-JH.Lin
  Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Matthias Brugger,
	AngeloGioacchino Del Regno, Chun-Kuang Hu, devicetree,
	linux-kernel, linux-arm-kernel, linux-mediatek, dri-devel,
	linux-media, linaro-mm-sig, Jason-ch Chen, Johnson Wang,
	Singo Chang, Nancy Lin, Shawn Sung,
	Project_Global_Chrome_Upstream_Group

[-- Attachment #1: Type: text/plain, Size: 310 bytes --]

On Fri, Jan 19, 2024 at 02:32:24PM +0800, Jason-JH.Lin wrote:
> Change mediatek,gce-events property to reference mediatek,gce-props.yaml
> instead of defining itself.
> 
> Signed-off-by: Jason-JH.Lin <jason-jh.lin@mediatek.com>

Reviewed-by: Conor Dooley <conor.dooley@microchip.com>

Cheers,
Conor.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

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

* Re: [PATCH v3 1/3] dt-bindings: mailbox: Add mediatek,gce-props.yaml
  2024-01-19 10:53   ` AngeloGioacchino Del Regno
@ 2024-01-20  9:48     ` Jason-JH Lin (林睿祥)
  0 siblings, 0 replies; 13+ messages in thread
From: Jason-JH Lin (林睿祥) @ 2024-01-20  9:48 UTC (permalink / raw)
  To: matthias.bgg@gmail.com, chunkuang.hu@kernel.org,
	angelogioacchino.delregno@collabora.com, robh+dt@kernel.org,
	krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org
  Cc: linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org,
	Singo Chang (張興國),
	Johnson Wang (王聖鑫),
	linaro-mm-sig@lists.linaro.org, linux-media@vger.kernel.org,
	devicetree@vger.kernel.org,
	Jason-ch Chen (陳建豪),
	Shawn Sung (宋孝謙),
	Nancy Lin (林欣螢),
	dri-devel@lists.freedesktop.org,
	Project_Global_Chrome_Upstream_Group,
	linux-arm-kernel@lists.infradead.org

Hi Angelo,

Thanks for the reviews.

On Fri, 2024-01-19 at 11:53 +0100, AngeloGioacchino Del Regno wrote:
> Il 19/01/24 07:32, Jason-JH.Lin ha scritto:
> > Add mediatek,gce-props.yaml for common GCE properties that is used
> > for
> > both mailbox providers and consumers. We place the common property
> > "mediatek,gce-events" in this binding currently.
> > 
> > The property "mediatek,gce-events" is used for GCE event ID
> > corresponding
> > to a hardware event signal sent by the hardware or a sofware
> > driver.
> > If the mailbox providers or consumers want to manipulate the value
> > of
> > the event ID, they need to know the specific event ID.
> > 
> > Signed-off-by: Jason-JH.Lin <jason-jh.lin@mediatek.com>
> > ---
> >   .../bindings/mailbox/mediatek,gce-props.yaml  | 52
> > +++++++++++++++++++
> >   1 file changed, 52 insertions(+)
> >   create mode 100644
> > Documentation/devicetree/bindings/mailbox/mediatek,gce-props.yaml
> > 
> > diff --git
> > a/Documentation/devicetree/bindings/mailbox/mediatek,gce-props.yaml 
> > b/Documentation/devicetree/bindings/mailbox/mediatek,gce-props.yaml
> > new file mode 100644
> > index 000000000000..68b519ff089f
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/mailbox/mediatek,gce-
> > props.yaml
> > @@ -0,0 +1,52 @@
> > +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> > +%YAML 1.2
> > +---
> > +$id: 
> > https://urldefense.com/v3/__http://devicetree.org/schemas/mailbox/mediatek,gce-props.yaml*__;Iw!!CTRNKA9wMg0ARbw!kMCkhwQ_az8HouSQgqMuDC5QpKFizQrWMlwaWPfYp1GphlueXVfPfS9FA83806_7K_qqcfHOaprqAWNOoBkzsTJNUSZpugRS_Q$
> >  
> > +$schema: 
> > https://urldefense.com/v3/__http://devicetree.org/meta-schemas/core.yaml*__;Iw!!CTRNKA9wMg0ARbw!kMCkhwQ_az8HouSQgqMuDC5QpKFizQrWMlwaWPfYp1GphlueXVfPfS9FA83806_7K_qqcfHOaprqAWNOoBkzsTJNUSYsot_sog$
> >  
> > +
> > +title: MediaTek Global Command Engine Common Propertes
> > +
> > +maintainers:
> > +  - Houlong Wei <houlong.wei@mediatek.com>
> > +
> > +description:
> > +  The Global Command Engine (GCE) is an instruction based, multi-
> > threaded,
> > +  single-core command dispatcher for MediaTek hardware. The
> > Command Queue
> > +  (CMDQ) mailbox driver is a driver for GCE, implemented using the
> > Linux
> > +  mailbox framework. It is used to receive messages from mailbox
> > consumers
> > +  and configure GCE to execute the specified instruction set in
> > the message.
> > +  We use mediatek,gce-mailbox.yaml to define the properties for
> > CMDQ mailbox
> > +  driver. A device driver that uses the CMDQ driver to configure
> > its hardware
> > +  registers is a mailbox consumer. The mailbox consumer can
> > request a mailbox
> > +  channel corresponding to a GCE hardware thread to send a
> > message, specifying
> > +  that the GCE thread to configure its hardware. The mailbox
> > provider can also
> > +  reserved a mailbox channel to configure GCE hardware register by
> > the spcific
> > +  GCE thread. This binding defines the common GCE properties for
> > both mailbox
> > +  provider and consumers.
> > +
> > +properties:
> > +  mediatek,gce-events:
> > +    description:
> > +      GCE has an event table in SRAM, consisting of 1024 event IDs
> > (0~1023).
> > +      Each event ID has a boolean event value with the default
> > value 0.
> > +      The property mediatek,gce-events is used to obtain the event
> > IDs.
> > +      Some gce-events are hardware-bound and cannot be changed by
> > software.
> > +      For instance, in MT8195, when VDO0_MUTEX is stream done,
> > VDO_MUTEX will
> > +      send an event signal to GCE, setting the value of event ID
> > 597 to 1.
> > +      Similarly, in MT8188, the value of event ID 574 will be set
> > to 1 when
> > +      VOD0_MUTEX is stream done.
> > +      On the other hand, some gce-events are not hardware-bound
> > and can be
> > +      changed by software. For example, in MT8188, we can set the
> > value of
> > +      event ID 855, which is not bound to any hardware, to 1 when
> > the driver
> > +      in the secure world completes a task. However, in MT8195,
> > event ID 855
> > +      is already bound to VDEC_LAT1, so we need to select another
> > event ID to
> > +      achieve the same purpose. This event ID can be any ID that
> > is not bound
> > +      to any hardware and is not yet used in any software driver.
> > +      To determine if the event ID is bound to the hardware or
> > used by a
> > +      software driver, refer to the GCE header
> > +      include/dt-bindings/gce/<chip>-gce.h of each chip.
> > +    $ref: /schemas/types.yaml#/definitions/uint32-array
> > +    minItems: 1
> > +    maxItems: 1024
> 
> maxItems: 1024 seems to be a bit too many... this means that one
> devicetree node
> may have up to 1024 gce events, which is impossible! If a driver
> needed all of
> the 1024 events, this means that it's not an user of the GCE, but the
> GCE itself!
> 
> Imagine seeing a devicetree node with 1024 array entries for
> mediatek,gce-events...
> 
Yes, that's impossible to set up to 1024 array entries.
I just have used the maximum value to cover all the possible cases.

> I'd set that to a more sensible value of 32 - eventually we can
> extend it later,
> if ever needed.
> 
OK, I agree with that!
I'll change the maxItems to 32.

> Besides, nice job about all this documentation of the GCE and its
> events: love it!
> 
I'm appreciate you love it :)

Regards,
Jason-JH.Lin

> Cheers,
> Angelo
> 
> 

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

* Re: [PATCH v3 1/3] dt-bindings: mailbox: Add mediatek,gce-props.yaml
  2024-01-19  6:32 ` [PATCH v3 1/3] dt-bindings: mailbox: Add mediatek,gce-props.yaml Jason-JH.Lin
  2024-01-19 10:53   ` AngeloGioacchino Del Regno
  2024-01-19 16:44   ` Conor Dooley
@ 2024-01-22  3:44   ` Fei Shao
  2024-01-23  9:21     ` Jason-JH Lin (林睿祥)
  2 siblings, 1 reply; 13+ messages in thread
From: Fei Shao @ 2024-01-22  3:44 UTC (permalink / raw)
  To: Jason-JH.Lin
  Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Matthias Brugger,
	AngeloGioacchino Del Regno, Chun-Kuang Hu, devicetree,
	linux-kernel, linux-arm-kernel, linux-mediatek, dri-devel,
	linux-media, linaro-mm-sig, Jason-ch Chen, Johnson Wang,
	Singo Chang, Nancy Lin, Shawn Sung,
	Project_Global_Chrome_Upstream_Group

On Fri, Jan 19, 2024 at 2:32 PM Jason-JH.Lin <jason-jh.lin@mediatek.com> wrote:
Hi Jason,

Just few nitpicks about typo:
>
> Add mediatek,gce-props.yaml for common GCE properties that is used for
> both mailbox providers and consumers. We place the common property
> "mediatek,gce-events" in this binding currently.
>
> The property "mediatek,gce-events" is used for GCE event ID corresponding
> to a hardware event signal sent by the hardware or a sofware driver.
software

> If the mailbox providers or consumers want to manipulate the value of
> the event ID, they need to know the specific event ID.
>
> Signed-off-by: Jason-JH.Lin <jason-jh.lin@mediatek.com>
> ---
>  .../bindings/mailbox/mediatek,gce-props.yaml  | 52 +++++++++++++++++++
>  1 file changed, 52 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/mailbox/mediatek,gce-props.yaml
>
> diff --git a/Documentation/devicetree/bindings/mailbox/mediatek,gce-props.yaml b/Documentation/devicetree/bindings/mailbox/mediatek,gce-props.yaml
> new file mode 100644
> index 000000000000..68b519ff089f
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/mailbox/mediatek,gce-props.yaml
> @@ -0,0 +1,52 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/mailbox/mediatek,gce-props.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: MediaTek Global Command Engine Common Propertes
Properties

> +
> +maintainers:
> +  - Houlong Wei <houlong.wei@mediatek.com>
> +
> +description:
> +  The Global Command Engine (GCE) is an instruction based, multi-threaded,
> +  single-core command dispatcher for MediaTek hardware. The Command Queue
> +  (CMDQ) mailbox driver is a driver for GCE, implemented using the Linux
> +  mailbox framework. It is used to receive messages from mailbox consumers
> +  and configure GCE to execute the specified instruction set in the message.
> +  We use mediatek,gce-mailbox.yaml to define the properties for CMDQ mailbox
> +  driver. A device driver that uses the CMDQ driver to configure its hardware
> +  registers is a mailbox consumer. The mailbox consumer can request a mailbox
> +  channel corresponding to a GCE hardware thread to send a message, specifying
> +  that the GCE thread to configure its hardware. The mailbox provider can also
> +  reserved a mailbox channel to configure GCE hardware register by the spcific
s/reserved/reserve/
s/spcific/specific/

Regards,
Fei


> +  GCE thread. This binding defines the common GCE properties for both mailbox
> +  provider and consumers.
> +
> +properties:
> +  mediatek,gce-events:
> +    description:
> +      GCE has an event table in SRAM, consisting of 1024 event IDs (0~1023).
> +      Each event ID has a boolean event value with the default value 0.
> +      The property mediatek,gce-events is used to obtain the event IDs.
> +      Some gce-events are hardware-bound and cannot be changed by software.
> +      For instance, in MT8195, when VDO0_MUTEX is stream done, VDO_MUTEX will
> +      send an event signal to GCE, setting the value of event ID 597 to 1.
> +      Similarly, in MT8188, the value of event ID 574 will be set to 1 when
> +      VOD0_MUTEX is stream done.
> +      On the other hand, some gce-events are not hardware-bound and can be
> +      changed by software. For example, in MT8188, we can set the value of
> +      event ID 855, which is not bound to any hardware, to 1 when the driver
> +      in the secure world completes a task. However, in MT8195, event ID 855
> +      is already bound to VDEC_LAT1, so we need to select another event ID to
> +      achieve the same purpose. This event ID can be any ID that is not bound
> +      to any hardware and is not yet used in any software driver.
> +      To determine if the event ID is bound to the hardware or used by a
> +      software driver, refer to the GCE header
> +      include/dt-bindings/gce/<chip>-gce.h of each chip.
> +    $ref: /schemas/types.yaml#/definitions/uint32-array
> +    minItems: 1
> +    maxItems: 1024
> +
> +additionalProperties: true
> --
> 2.18.0
>
>

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

* Re: [PATCH v3 1/3] dt-bindings: mailbox: Add mediatek,gce-props.yaml
  2024-01-19 16:44   ` Conor Dooley
@ 2024-01-22 10:38     ` AngeloGioacchino Del Regno
  2024-01-23 17:01       ` Conor Dooley
  0 siblings, 1 reply; 13+ messages in thread
From: AngeloGioacchino Del Regno @ 2024-01-22 10:38 UTC (permalink / raw)
  To: Conor Dooley, Jason-JH.Lin
  Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Matthias Brugger,
	Chun-Kuang Hu, devicetree, linux-kernel, linux-arm-kernel,
	linux-mediatek, dri-devel, linux-media, linaro-mm-sig,
	Jason-ch Chen, Johnson Wang, Singo Chang, Nancy Lin, Shawn Sung,
	Project_Global_Chrome_Upstream_Group

Il 19/01/24 17:44, Conor Dooley ha scritto:
> Rob,
> 
> On Fri, Jan 19, 2024 at 02:32:22PM +0800, Jason-JH.Lin wrote:
>> Add mediatek,gce-props.yaml for common GCE properties that is used for
>> both mailbox providers and consumers. We place the common property
>> "mediatek,gce-events" in this binding currently.
>>
>> The property "mediatek,gce-events" is used for GCE event ID corresponding
>> to a hardware event signal sent by the hardware or a sofware driver.
>> If the mailbox providers or consumers want to manipulate the value of
>> the event ID, they need to know the specific event ID.
>>
>> Signed-off-by: Jason-JH.Lin <jason-jh.lin@mediatek.com>
>> ---
>>   .../bindings/mailbox/mediatek,gce-props.yaml  | 52 +++++++++++++++++++
> 
> Is bindings/mailbox the correct directory to put this in?
> 

Well, the GCE is a mailbox :-)

...but I get why you're asking... and I don't think that this should go to
arm/mediatek/ as it's really just only referring to extra properties for kind of
"special" mailbox client events...

Cheers,
Angelo

>>   1 file changed, 52 insertions(+)
>>   create mode 100644 Documentation/devicetree/bindings/mailbox/mediatek,gce-props.yaml
>>
>> diff --git a/Documentation/devicetree/bindings/mailbox/mediatek,gce-props.yaml b/Documentation/devicetree/bindings/mailbox/mediatek,gce-props.yaml
>> new file mode 100644
>> index 000000000000..68b519ff089f
>> --- /dev/null
>> +++ b/Documentation/devicetree/bindings/mailbox/mediatek,gce-props.yaml
>> @@ -0,0 +1,52 @@
>> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
>> +%YAML 1.2
>> +---
>> +$id: http://devicetree.org/schemas/mailbox/mediatek,gce-props.yaml#
>> +$schema: http://devicetree.org/meta-schemas/core.yaml#
>> +
>> +title: MediaTek Global Command Engine Common Propertes
>> +
>> +maintainers:
>> +  - Houlong Wei <houlong.wei@mediatek.com>
>> +
>> +description:
>> +  The Global Command Engine (GCE) is an instruction based, multi-threaded,
>> +  single-core command dispatcher for MediaTek hardware. The Command Queue
>> +  (CMDQ) mailbox driver is a driver for GCE, implemented using the Linux
>> +  mailbox framework. It is used to receive messages from mailbox consumers
>> +  and configure GCE to execute the specified instruction set in the message.
>> +  We use mediatek,gce-mailbox.yaml to define the properties for CMDQ mailbox
>> +  driver. A device driver that uses the CMDQ driver to configure its hardware
>> +  registers is a mailbox consumer. The mailbox consumer can request a mailbox
>> +  channel corresponding to a GCE hardware thread to send a message, specifying
>> +  that the GCE thread to configure its hardware. The mailbox provider can also
>> +  reserved a mailbox channel to configure GCE hardware register by the spcific
>> +  GCE thread. This binding defines the common GCE properties for both mailbox
>> +  provider and consumers.
>> +
>> +properties:
>> +  mediatek,gce-events:
>> +    description:
>> +      GCE has an event table in SRAM, consisting of 1024 event IDs (0~1023).
>> +      Each event ID has a boolean event value with the default value 0.
>> +      The property mediatek,gce-events is used to obtain the event IDs.
>> +      Some gce-events are hardware-bound and cannot be changed by software.
>> +      For instance, in MT8195, when VDO0_MUTEX is stream done, VDO_MUTEX will
>> +      send an event signal to GCE, setting the value of event ID 597 to 1.
>> +      Similarly, in MT8188, the value of event ID 574 will be set to 1 when
>> +      VOD0_MUTEX is stream done.
>> +      On the other hand, some gce-events are not hardware-bound and can be
>> +      changed by software. For example, in MT8188, we can set the value of
>> +      event ID 855, which is not bound to any hardware, to 1 when the driver
>> +      in the secure world completes a task. However, in MT8195, event ID 855
>> +      is already bound to VDEC_LAT1, so we need to select another event ID to
>> +      achieve the same purpose. This event ID can be any ID that is not bound
>> +      to any hardware and is not yet used in any software driver.
>> +      To determine if the event ID is bound to the hardware or used by a
>> +      software driver, refer to the GCE header
>> +      include/dt-bindings/gce/<chip>-gce.h of each chip.
>> +    $ref: /schemas/types.yaml#/definitions/uint32-array
>> +    minItems: 1
>> +    maxItems: 1024
>> +
>> +additionalProperties: true
>> -- 
>> 2.18.0
>>


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

* Re: [PATCH v3 1/3] dt-bindings: mailbox: Add mediatek,gce-props.yaml
  2024-01-22  3:44   ` Fei Shao
@ 2024-01-23  9:21     ` Jason-JH Lin (林睿祥)
  0 siblings, 0 replies; 13+ messages in thread
From: Jason-JH Lin (林睿祥) @ 2024-01-23  9:21 UTC (permalink / raw)
  To: fshao@chromium.org
  Cc: linux-kernel@vger.kernel.org, robh+dt@kernel.org,
	Singo Chang (張興國),
	linux-mediatek@lists.infradead.org,
	linaro-mm-sig@lists.linaro.org, linux-media@vger.kernel.org,
	devicetree@vger.kernel.org, chunkuang.hu@kernel.org,
	Jason-ch Chen (陳建豪),
	Shawn Sung (宋孝謙),
	Nancy Lin (林欣螢),
	Johnson Wang (王聖鑫), conor+dt@kernel.org,
	dri-devel@lists.freedesktop.org,
	Project_Global_Chrome_Upstream_Group,
	linux-arm-kernel@lists.infradead.org,
	krzysztof.kozlowski+dt@linaro.org, matthias.bgg@gmail.com,
	angelogioacchino.delregno@collabora.com

Hi Fei,

Thanks for the corrections.

On Mon, 2024-01-22 at 11:44 +0800, Fei Shao wrote:
>  	 
> External email : Please do not click links or open attachments until
> you have verified the sender or the content.
>  On Fri, Jan 19, 2024 at 2:32 PM Jason-JH.Lin <
> jason-jh.lin@mediatek.com> wrote:
> Hi Jason,
> 
> Just few nitpicks about typo:
> >
> > Add mediatek,gce-props.yaml for common GCE properties that is used
> for
> > both mailbox providers and consumers. We place the common property
> > "mediatek,gce-events" in this binding currently.
> >
> > The property "mediatek,gce-events" is used for GCE event ID
> corresponding
> > to a hardware event signal sent by the hardware or a sofware
> driver.
> software
> 
> > If the mailbox providers or consumers want to manipulate the value
> of
> > the event ID, they need to know the specific event ID.
> >
> > Signed-off-by: Jason-JH.Lin <jason-jh.lin@mediatek.com>
> > ---
> >  .../bindings/mailbox/mediatek,gce-props.yaml  | 52
> +++++++++++++++++++
> >  1 file changed, 52 insertions(+)
> >  create mode 100644
> Documentation/devicetree/bindings/mailbox/mediatek,gce-props.yaml
> >
> > diff --git
> a/Documentation/devicetree/bindings/mailbox/mediatek,gce-props.yaml
> b/Documentation/devicetree/bindings/mailbox/mediatek,gce-props.yaml
> > new file mode 100644
> > index 000000000000..68b519ff089f
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/mailbox/mediatek,gce-
> props.yaml
> > @@ -0,0 +1,52 @@
> > +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> > +%YAML 1.2
> > +---
> > +$id: 
> http://devicetree.org/schemas/mailbox/mediatek,gce-props.yaml#
> > +$schema: http://devicetree.org/meta-schemas/core.yaml#
> > +
> > +title: MediaTek Global Command Engine Common Propertes
> Properties
> 
> > +
> > +maintainers:
> > +  - Houlong Wei <houlong.wei@mediatek.com>
> > +
> > +description:
> > +  The Global Command Engine (GCE) is an instruction based, multi-
> threaded,
> > +  single-core command dispatcher for MediaTek hardware. The
> Command Queue
> > +  (CMDQ) mailbox driver is a driver for GCE, implemented using the
> Linux
> > +  mailbox framework. It is used to receive messages from mailbox
> consumers
> > +  and configure GCE to execute the specified instruction set in
> the message.
> > +  We use mediatek,gce-mailbox.yaml to define the properties for
> CMDQ mailbox
> > +  driver. A device driver that uses the CMDQ driver to configure
> its hardware
> > +  registers is a mailbox consumer. The mailbox consumer can
> request a mailbox
> > +  channel corresponding to a GCE hardware thread to send a
> message, specifying
> > +  that the GCE thread to configure its hardware. The mailbox
> provider can also
> > +  reserved a mailbox channel to configure GCE hardware register by
> the spcific
> s/reserved/reserve/
> s/spcific/specific/
> 
> Regards,
> Fei
> 
I'll fix these typo in the next version.

Regards,
Jason-JH.Lin


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

* Re: [PATCH v3 1/3] dt-bindings: mailbox: Add mediatek,gce-props.yaml
  2024-01-22 10:38     ` AngeloGioacchino Del Regno
@ 2024-01-23 17:01       ` Conor Dooley
  0 siblings, 0 replies; 13+ messages in thread
From: Conor Dooley @ 2024-01-23 17:01 UTC (permalink / raw)
  To: AngeloGioacchino Del Regno
  Cc: Jason-JH.Lin, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Matthias Brugger, Chun-Kuang Hu, devicetree, linux-kernel,
	linux-arm-kernel, linux-mediatek, dri-devel, linux-media,
	linaro-mm-sig, Jason-ch Chen, Johnson Wang, Singo Chang,
	Nancy Lin, Shawn Sung, Project_Global_Chrome_Upstream_Group

[-- Attachment #1: Type: text/plain, Size: 1425 bytes --]

On Mon, Jan 22, 2024 at 11:38:15AM +0100, AngeloGioacchino Del Regno wrote:
> Il 19/01/24 17:44, Conor Dooley ha scritto:
> > Rob,
> > 
> > On Fri, Jan 19, 2024 at 02:32:22PM +0800, Jason-JH.Lin wrote:
> > > Add mediatek,gce-props.yaml for common GCE properties that is used for
> > > both mailbox providers and consumers. We place the common property
> > > "mediatek,gce-events" in this binding currently.
> > > 
> > > The property "mediatek,gce-events" is used for GCE event ID corresponding
> > > to a hardware event signal sent by the hardware or a sofware driver.
> > > If the mailbox providers or consumers want to manipulate the value of
> > > the event ID, they need to know the specific event ID.
> > > 
> > > Signed-off-by: Jason-JH.Lin <jason-jh.lin@mediatek.com>
> > > ---
> > >   .../bindings/mailbox/mediatek,gce-props.yaml  | 52 +++++++++++++++++++
> > 
> > Is bindings/mailbox the correct directory to put this in?
> > 
> 
> Well, the GCE is a mailbox :-)
> 
> ...but I get why you're asking... and I don't think that this should go to
> arm/mediatek/ as it's really just only referring to extra properties for kind of
> "special" mailbox client events...

gce is a mailbox, but this isn't a binding for the mailbox itself, hence
me wondering. I haven't been able to think of something better though,
so
Reviewed-by: Conor Dooley <conor.dooley@microchip.com>

Cheers,
Conor.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

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

end of thread, other threads:[~2024-01-23 17:01 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-01-19  6:32 [PATCH v3 0/3] Add mediatek,gce-props.yaml for other bindings reference Jason-JH.Lin
2024-01-19  6:32 ` [PATCH v3 1/3] dt-bindings: mailbox: Add mediatek,gce-props.yaml Jason-JH.Lin
2024-01-19 10:53   ` AngeloGioacchino Del Regno
2024-01-20  9:48     ` Jason-JH Lin (林睿祥)
2024-01-19 16:44   ` Conor Dooley
2024-01-22 10:38     ` AngeloGioacchino Del Regno
2024-01-23 17:01       ` Conor Dooley
2024-01-22  3:44   ` Fei Shao
2024-01-23  9:21     ` Jason-JH Lin (林睿祥)
2024-01-19  6:32 ` [PATCH v3 2/3] dt-bindings: media: mediatek: mdp: Change mediatek,gce-events to reference Jason-JH.Lin
2024-01-19 16:44   ` Conor Dooley
2024-01-19  6:32 ` [PATCH v3 3/3] dt-bindings: soc: mediatek: Change mediatek,gce-events to refernece Jason-JH.Lin
2024-01-19 16:45   ` Conor Dooley

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox