xref: /freebsd-src/sys/contrib/device-tree/Bindings/mailbox/mediatek,gce-props.yaml (revision 0e8011faf58b743cc652e3b2ad0f7671227610df)
1*0e8011faSEmmanuel Vadot# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2*0e8011faSEmmanuel Vadot%YAML 1.2
3*0e8011faSEmmanuel Vadot---
4*0e8011faSEmmanuel Vadot$id: http://devicetree.org/schemas/mailbox/mediatek,gce-props.yaml#
5*0e8011faSEmmanuel Vadot$schema: http://devicetree.org/meta-schemas/core.yaml#
6*0e8011faSEmmanuel Vadot
7*0e8011faSEmmanuel Vadottitle: MediaTek Global Command Engine Common Properties
8*0e8011faSEmmanuel Vadot
9*0e8011faSEmmanuel Vadotmaintainers:
10*0e8011faSEmmanuel Vadot  - Houlong Wei <houlong.wei@mediatek.com>
11*0e8011faSEmmanuel Vadot
12*0e8011faSEmmanuel Vadotdescription:
13*0e8011faSEmmanuel Vadot  The Global Command Engine (GCE) is an instruction based, multi-threaded,
14*0e8011faSEmmanuel Vadot  single-core command dispatcher for MediaTek hardware. The Command Queue
15*0e8011faSEmmanuel Vadot  (CMDQ) mailbox driver is a driver for GCE, implemented using the Linux
16*0e8011faSEmmanuel Vadot  mailbox framework. It is used to receive messages from mailbox consumers
17*0e8011faSEmmanuel Vadot  and configure GCE to execute the specified instruction set in the message.
18*0e8011faSEmmanuel Vadot  We use mediatek,gce-mailbox.yaml to define the properties for CMDQ mailbox
19*0e8011faSEmmanuel Vadot  driver. A device driver that uses the CMDQ driver to configure its hardware
20*0e8011faSEmmanuel Vadot  registers is a mailbox consumer. The mailbox consumer can request a mailbox
21*0e8011faSEmmanuel Vadot  channel corresponding to a GCE hardware thread to send a message, specifying
22*0e8011faSEmmanuel Vadot  that the GCE thread to configure its hardware. The mailbox provider can also
23*0e8011faSEmmanuel Vadot  reserve a mailbox channel to configure GCE hardware register by the specific
24*0e8011faSEmmanuel Vadot  GCE thread. This binding defines the common GCE properties for both mailbox
25*0e8011faSEmmanuel Vadot  provider and consumers.
26*0e8011faSEmmanuel Vadot
27*0e8011faSEmmanuel Vadotproperties:
28*0e8011faSEmmanuel Vadot  mediatek,gce-events:
29*0e8011faSEmmanuel Vadot    description:
30*0e8011faSEmmanuel Vadot      GCE has an event table in SRAM, consisting of 1024 event IDs (0~1023).
31*0e8011faSEmmanuel Vadot      Each event ID has a boolean event value with the default value 0.
32*0e8011faSEmmanuel Vadot      The property mediatek,gce-events is used to obtain the event IDs.
33*0e8011faSEmmanuel Vadot      Some gce-events are hardware-bound and cannot be changed by software.
34*0e8011faSEmmanuel Vadot      For instance, in MT8195, when VDO0_MUTEX is stream done, VDO_MUTEX will
35*0e8011faSEmmanuel Vadot      send an event signal to GCE, setting the value of event ID 597 to 1.
36*0e8011faSEmmanuel Vadot      Similarly, in MT8188, the value of event ID 574 will be set to 1 when
37*0e8011faSEmmanuel Vadot      VOD0_MUTEX is stream done.
38*0e8011faSEmmanuel Vadot      On the other hand, some gce-events are not hardware-bound and can be
39*0e8011faSEmmanuel Vadot      changed by software. For example, in MT8188, we can set the value of
40*0e8011faSEmmanuel Vadot      event ID 855, which is not bound to any hardware, to 1 when the driver
41*0e8011faSEmmanuel Vadot      in the secure world completes a task. However, in MT8195, event ID 855
42*0e8011faSEmmanuel Vadot      is already bound to VDEC_LAT1, so we need to select another event ID to
43*0e8011faSEmmanuel Vadot      achieve the same purpose. This event ID can be any ID that is not bound
44*0e8011faSEmmanuel Vadot      to any hardware and is not yet used in any software driver.
45*0e8011faSEmmanuel Vadot      To determine if the event ID is bound to the hardware or used by a
46*0e8011faSEmmanuel Vadot      software driver, refer to the GCE header
47*0e8011faSEmmanuel Vadot      include/dt-bindings/gce/<chip>-gce.h of each chip.
48*0e8011faSEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/uint32-array
49*0e8011faSEmmanuel Vadot    minItems: 1
50*0e8011faSEmmanuel Vadot    maxItems: 32
51*0e8011faSEmmanuel Vadot
52*0e8011faSEmmanuel VadotadditionalProperties: true
53