devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 0/7] Add GCE support for MT8196
@ 2024-12-19 17:07 Jason-JH.Lin
  2024-12-19 17:07 ` [PATCH v3 1/7] dt-bindings: mailbox: mediatek: Add MT8196 support for gce-mailbox Jason-JH.Lin
                   ` (6 more replies)
  0 siblings, 7 replies; 21+ messages in thread
From: Jason-JH.Lin @ 2024-12-19 17:07 UTC (permalink / raw)
  To: Jassi Brar, Chun-Kuang Hu, AngeloGioacchino Del Regno,
	Rob Herring, Krzysztof Kozlowski, Conor Dooley, Matthias Brugger,
	Mauro Carvalho Chehab
  Cc: David Airlie, Simona Vetter, linux-kernel, devicetree, dri-devel,
	linux-mediatek, linux-arm-kernel, linux-media, Jason-JH . Lin,
	Singo Chang, Nancy Lin, Moudy Ho, Xavier Chang,
	Project_Global_Chrome_Upstream_Group, Jason-jh Lin

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

This patch series adds support for the MediaTek MT8196 SoC in the CMDQ
driver and related subsystems. The changes include adding compatible
names and properties, updating driver data to accommodate hardware
changes, and modifying the usage of CMDQ APIs to support non-subsys ID
hardware.

---

Change in v3:
1. Merge 2 dt-bindings pathes together and add more detail commit message.
2. Change type u32 to phys_addr_t for pa_base of struct cmdq_client_reg.
3. Remove cmdq_subsys_is_valid() and subsys_num in CMDQ driver.
4. Add CMDQ_SUBSYS_INVALID to check subsys instead of using
   cmdq_subsys_is_invalid().
5. Make use of CMDQ_THR_SPR0 define to the parameter of CMDQ APIs.
6. Rebase on the new MACRO in mtk-mdp3-comp.h.

Change in v2:
1. Remove the constant and fix warning in dt-bindings.
2. Remove the pa_base parameter of CMDQ APIs and related modification.
3. Move subsys checking to client drivers and use 2 alternative
   CMDQ APIs to achieve the same functionality.

---

Jason-JH.Lin (7):
  dt-bindings: mailbox: mediatek: Add MT8196 support for gce-mailbox
  mailbox: mtk-cmdq: Add driver data to support for MT8196
  soc: mediatek: mtk-cmdq: Add pa_base parsing for unsupported subsys ID
    hardware
  soc: mediatek: mtk-cmdq: Add mminfra_offset compatibility for DRAM
    address
  soc: mediatek: Add programming flow for unsupported subsys ID hardware
  drm/mediatek: Add programming flow for unsupported subsys ID hardware
  media: mediatek: mdp3: Add programming flow for unsupported subsys ID
    hardware

 .../mailbox/mediatek,gce-mailbox.yaml         |    4 +
 drivers/gpu/drm/mediatek/mtk_ddp_comp.c       |   33 +-
 drivers/mailbox/mtk-cmdq-mailbox.c            |   90 +-
 .../platform/mediatek/mdp3/mtk-mdp3-cmdq.c    |   18 +-
 .../platform/mediatek/mdp3/mtk-mdp3-comp.h    |   79 +-
 drivers/soc/mediatek/mtk-cmdq-helper.c        |   53 +-
 drivers/soc/mediatek/mtk-mmsys.c              |   14 +-
 drivers/soc/mediatek/mtk-mutex.c              |   11 +-
 .../dt-bindings/mailbox/mediatek,mt8196-gce.h | 1415 +++++++++++++++++
 include/linux/mailbox/mtk-cmdq-mailbox.h      |    2 +
 include/linux/soc/mediatek/mtk-cmdq.h         |    3 +
 11 files changed, 1679 insertions(+), 43 deletions(-)
 create mode 100644 include/dt-bindings/mailbox/mediatek,mt8196-gce.h

-- 
2.43.0


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

* [PATCH v3 1/7] dt-bindings: mailbox: mediatek: Add MT8196 support for gce-mailbox
  2024-12-19 17:07 [PATCH v3 0/7] Add GCE support for MT8196 Jason-JH.Lin
@ 2024-12-19 17:07 ` Jason-JH.Lin
  2024-12-27  8:11   ` Krzysztof Kozlowski
                     ` (2 more replies)
  2024-12-19 17:07 ` [PATCH v3 2/7] mailbox: mtk-cmdq: Add driver data to support for MT8196 Jason-JH.Lin
                   ` (5 subsequent siblings)
  6 siblings, 3 replies; 21+ messages in thread
From: Jason-JH.Lin @ 2024-12-19 17:07 UTC (permalink / raw)
  To: Jassi Brar, Chun-Kuang Hu, AngeloGioacchino Del Regno,
	Rob Herring, Krzysztof Kozlowski, Conor Dooley, Matthias Brugger,
	Mauro Carvalho Chehab
  Cc: David Airlie, Simona Vetter, linux-kernel, devicetree, dri-devel,
	linux-mediatek, linux-arm-kernel, linux-media, Jason-JH . Lin,
	Singo Chang, Nancy Lin, Moudy Ho, Xavier Chang,
	Project_Global_Chrome_Upstream_Group

1. Add compatible name and iommus property to mediatek,gce-mailbox.yaml
   for MT8196.

   - The compatible name "mediatek,mt8196-gce-mailbox" is added to
     ensure that the device tree can correctly identify and configure
     the GCE mailbox for the MT8196 SoC.

   - The iommus property is added to specify the IOMMU configuration
     for the GCE mailbox, ensuring proper memory management and access
     control.

2. Add the Global Command Engine (GCE) binding header to define the
   abstrct symbol binding to the GCE hardware settings of GCE Thread
   Priority, GCE Subsys ID and GCE Event for MT8196.

   - GCE Thread Priority: Defined to configure the priority level for
     each GCE hardware thread. This is necessary for proper scheduling
     and execution of commands in the GCE.

   - GCE Subsys ID: Defined to specify the subsystem ID for GCE clients.
     This is used to correctly address and access different subsystems
     within the GCE.

   - GCE Event: Defined to specify the events that the GCE can handle.
     These events are used by the driver to synchronize and manage
     hardware operations.

   Examples of the binding usage in the driver code:
   1) GCE Thread Priority:
   - Defined in the header file: `#define CMDQ_THR_PRIO_4 4`
   - Used in the Device Tree: `mboxes = <&gce0 0 CMDQ_THR_PRIO_4>;`
   - Parsed and used in the driver to set thread priority:
     ```c
     static struct mbox_chan *cmdq_xlate(struct mbox_controller *mbox,i
     					 const struct of_phandle_args *sp)
     {
     	thread->priority = sp->args[1];
     }
     // set GCE thread priority to the priority level 4 for GCE thread 0
     writel(thread->priority, thread->base + CMDQ_THR_PRIORITY);
     ```

   2) GCE Subsys ID:
   - Defined in the header file: `#define SUBSYS_1c00XXXX 3`
   - Used in the Device Tree:
   	`mediatek,gce-client-reg = <&gce SUBSYS_1c00XXXX 0x0000 0x1000>;`
   - Parsed and used in the driver to configure subsys ID:
     ```c
     int cmdq_dev_get_client_reg(struct device *dev,
     				 struct cmdq_client_reg *client_reg,
     				 int idx)
     {
     	client_reg->subsys = (u8)spec.args[0];
     	client_reg->offset = (u16)spec.args[1];
     }
     // GCE write the value to the register 0x1c000000 + 0x0000 + offset
     cmdq_pkt_write(cmdq_handle, client_reg->subsys,
     		    client_reg->offset + offset, value);
     ```

   3) GCE Event:
   - Defined in the header file:
   	`#define CMDQ_EVENT_VDO0_DISP_STREAM_DONE_0 574`
   - Used in the Device Tree:
   	`mediatek,gce-events = <CMDQ_EVENT_VDO0_DISP_STREAM_DONE_0>;`
   - Parsed and used in the driver to handle events:
     ```c
     int mtk_crtc_create(struct drm_device *drm_dev,
     			 const unsigned int *path,
     			 unsigned int path_len, int priv_data_index,
     			 const struct mtk_drm_route *conn_routes,
     			 unsigned int num_conn_routes)
     {
     	of_property_read_u32_index(priv->mutex_node,
     				   "mediatek,gce-events", i,
     				   &mtk_crtc->cmdq_event);
     }
     // GCE clear the STREAM_DONE event sent from DISP_MUTEX hardware
     cmdq_pkt_clear_event(cmdq_handle, mtk_crtc->cmdq_event);
     ```

Signed-off-by: Jason-JH.Lin <jason-jh.lin@mediatek.com>
---
 .../mailbox/mediatek,gce-mailbox.yaml         |    4 +
 .../dt-bindings/mailbox/mediatek,mt8196-gce.h | 1415 +++++++++++++++++
 2 files changed, 1419 insertions(+)
 create mode 100644 include/dt-bindings/mailbox/mediatek,mt8196-gce.h

diff --git a/Documentation/devicetree/bindings/mailbox/mediatek,gce-mailbox.yaml b/Documentation/devicetree/bindings/mailbox/mediatek,gce-mailbox.yaml
index cef9d7601398..73d6db34d64a 100644
--- a/Documentation/devicetree/bindings/mailbox/mediatek,gce-mailbox.yaml
+++ b/Documentation/devicetree/bindings/mailbox/mediatek,gce-mailbox.yaml
@@ -25,6 +25,7 @@ properties:
           - mediatek,mt8188-gce
           - mediatek,mt8192-gce
           - mediatek,mt8195-gce
+          - mediatek,mt8196-gce
       - items:
           - const: mediatek,mt6795-gce
           - const: mediatek,mt8173-gce
@@ -49,6 +50,9 @@ properties:
     items:
       - const: gce
 
+  iommus:
+    maxItems: 1
+
 required:
   - compatible
   - "#mbox-cells"
diff --git a/include/dt-bindings/mailbox/mediatek,mt8196-gce.h b/include/dt-bindings/mailbox/mediatek,mt8196-gce.h
new file mode 100644
index 000000000000..9e0700236033
--- /dev/null
+++ b/include/dt-bindings/mailbox/mediatek,mt8196-gce.h
@@ -0,0 +1,1415 @@
+/* SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause */
+/*
+ * Copyright (c) 2024 MediaTek Inc.
+ *
+ */
+
+#ifndef _DT_BINDINGS_GCE_MT8196_H
+#define _DT_BINDINGS_GCE_MT8196_H
+
+/* GCE thread priority */
+#define CMDQ_THR_PRIO_LOWEST	0
+#define CMDQ_THR_PRIO_1		1
+#define CMDQ_THR_PRIO_2		2
+#define CMDQ_THR_PRIO_3		3
+#define CMDQ_THR_PRIO_4		4
+#define CMDQ_THR_PRIO_5		5
+#define CMDQ_THR_PRIO_6		6
+#define CMDQ_THR_PRIO_HIGHEST	7
+
+/* GCE subsys table */
+#define SUBSYS_1300XXXX		0
+#define SUBSYS_1400XXXX		1
+#define SUBSYS_1401XXXX		2
+#define SUBSYS_1402XXXX		3
+#define SUBSYS_1502XXXX		4
+#define SUBSYS_1880XXXX		5
+#define SUBSYS_1881XXXX		6
+#define SUBSYS_1882XXXX		7
+#define SUBSYS_1883XXXX		8
+#define SUBSYS_1884XXXX		9
+#define SUBSYS_1000XXXX		10
+#define SUBSYS_1001XXXX		11
+#define SUBSYS_1002XXXX		12
+#define SUBSYS_1003XXXX		13
+#define SUBSYS_1004XXXX		14
+#define SUBSYS_1005XXXX		15
+#define SUBSYS_1020XXXX		16
+#define SUBSYS_1028XXXX		17
+#define SUBSYS_1700XXXX		18
+#define SUBSYS_1701XXXX		19
+#define SUBSYS_1702XXXX		20
+#define SUBSYS_1703XXXX		21
+#define SUBSYS_1800XXXX		22
+#define SUBSYS_1801XXXX		23
+#define SUBSYS_1802XXXX		24
+#define SUBSYS_1804XXXX		25
+#define SUBSYS_1805XXXX		26
+#define SUBSYS_1808XXXX		27
+#define SUBSYS_180aXXXX		28
+#define SUBSYS_180bXXXX		29
+#define SUBSYS_NO_SUPPORT	99
+
+/* GCE-D hardware events */
+#define CMDQ_EVENT_DISP0_STREAM_SOF0						0
+#define CMDQ_EVENT_DISP0_STREAM_SOF1						1
+#define CMDQ_EVENT_DISP0_STREAM_SOF2						2
+#define CMDQ_EVENT_DISP0_STREAM_SOF3						3
+#define CMDQ_EVENT_DISP0_STREAM_SOF4						4
+#define CMDQ_EVENT_DISP0_STREAM_SOF5						5
+#define CMDQ_EVENT_DISP0_STREAM_SOF6						6
+#define CMDQ_EVENT_DISP0_STREAM_SOF7						7
+#define CMDQ_EVENT_DISP0_STREAM_SOF8						8
+#define CMDQ_EVENT_DISP0_STREAM_SOF9						9
+#define CMDQ_EVENT_DISP0_STREAM_SOF10						10
+#define CMDQ_EVENT_DISP0_STREAM_SOF11						11
+#define CMDQ_EVENT_DISP0_STREAM_SOF12						12
+#define CMDQ_EVENT_DISP0_STREAM_SOF13						13
+#define CMDQ_EVENT_DISP0_STREAM_SOF14						14
+#define CMDQ_EVENT_DISP0_STREAM_SOF15						15
+#define CMDQ_EVENT_DISP0_FRAME_DONE_SEL0					16
+#define CMDQ_EVENT_DISP0_FRAME_DONE_SEL1					17
+#define CMDQ_EVENT_DISP0_FRAME_DONE_SEL2					18
+#define CMDQ_EVENT_DISP0_FRAME_DONE_SEL3					19
+#define CMDQ_EVENT_DISP0_FRAME_DONE_SEL4					20
+#define CMDQ_EVENT_DISP0_FRAME_DONE_SEL5					21
+#define CMDQ_EVENT_DISP0_FRAME_DONE_SEL6					22
+#define CMDQ_EVENT_DISP0_FRAME_DONE_SEL7					23
+#define CMDQ_EVENT_DISP0_FRAME_DONE_SEL8					24
+#define CMDQ_EVENT_DISP0_FRAME_DONE_SEL9					25
+#define CMDQ_EVENT_DISP0_FRAME_DONE_SEL10					26
+#define CMDQ_EVENT_DISP0_FRAME_DONE_SEL11					27
+#define CMDQ_EVENT_DISP0_FRAME_DONE_SEL12					28
+#define CMDQ_EVENT_DISP0_FRAME_DONE_SEL13					29
+#define CMDQ_EVENT_DISP0_FRAME_DONE_SEL14					30
+#define CMDQ_EVENT_DISP0_FRAME_DONE_SEL15					31
+#define CMDQ_EVENT_DISP0_DISP_WDMA0_TARGET_LINE_END_ENG_EVENT			32
+#define CMDQ_EVENT_DISP0_DISP_WDMA0_SW_RST_DONE_ENG_EVENT			33
+#define CMDQ_EVENT_DISP0_DISP_POSTMASK1_RST_DONE_ENG_EVENT			34
+#define CMDQ_EVENT_DISP0_DISP_POSTMASK0_RST_DONE_ENG_EVENT			35
+#define CMDQ_EVENT_DISP0_DISP_MUTEX0_TIMEOUT_ENG_EVENT				36
+#define CMDQ_EVENT_DISP0_DISP_MUTEX0_REG_UPDATE_ENG_EVENT0			37
+#define CMDQ_EVENT_DISP0_DISP_MUTEX0_REG_UPDATE_ENG_EVENT1			38
+#define CMDQ_EVENT_DISP0_DISP_MUTEX0_REG_UPDATE_ENG_EVENT2			39
+#define CMDQ_EVENT_DISP0_DISP_MUTEX0_REG_UPDATE_ENG_EVENT3			40
+#define CMDQ_EVENT_DISP0_DISP_MUTEX0_REG_UPDATE_ENG_EVENT4			41
+#define CMDQ_EVENT_DISP0_DISP_MUTEX0_REG_UPDATE_ENG_EVENT5			42
+#define CMDQ_EVENT_DISP0_DISP_MUTEX0_REG_UPDATE_ENG_EVENT6			43
+#define CMDQ_EVENT_DISP0_DISP_MUTEX0_REG_UPDATE_ENG_EVENT7			44
+#define CMDQ_EVENT_DISP0_DISP_MUTEX0_REG_UPDATE_ENG_EVENT8			45
+#define CMDQ_EVENT_DISP0_DISP_MUTEX0_REG_UPDATE_ENG_EVENT9			46
+#define CMDQ_EVENT_DISP0_DISP_MUTEX0_REG_UPDATE_ENG_EVENT10			47
+#define CMDQ_EVENT_DISP0_DISP_MUTEX0_REG_UPDATE_ENG_EVENT11			48
+#define CMDQ_EVENT_DISP0_DISP_MUTEX0_REG_UPDATE_ENG_EVENT12			49
+#define CMDQ_EVENT_DISP0_DISP_MUTEX0_REG_UPDATE_ENG_EVENT13			50
+#define CMDQ_EVENT_DISP0_DISP_MUTEX0_REG_UPDATE_ENG_EVENT14			51
+#define CMDQ_EVENT_DISP0_DISP_MUTEX0_REG_UPDATE_ENG_EVENT15			52
+#define CMDQ_EVENT_DISP0_DISP_MUTEX0_GET_RELEASE_ENG_EVENT			53
+#define CMDQ_EVENT_DISP0_DISP_MDP_RDMA0_SW_RST_DONE_ENG_EVENT			54
+
+#define CMDQ_EVENT_DISP1_STREAM_SOF0						55
+#define CMDQ_EVENT_DISP1_STREAM_SOF1						56
+#define CMDQ_EVENT_DISP1_STREAM_SOF2						57
+#define CMDQ_EVENT_DISP1_STREAM_SOF3						58
+#define CMDQ_EVENT_DISP1_STREAM_SOF4						59
+#define CMDQ_EVENT_DISP1_STREAM_SOF5						60
+#define CMDQ_EVENT_DISP1_STREAM_SOF6						61
+#define CMDQ_EVENT_DISP1_STREAM_SOF7						62
+#define CMDQ_EVENT_DISP1_STREAM_SOF8						63
+#define CMDQ_EVENT_DISP1_STREAM_SOF9						64
+#define CMDQ_EVENT_DISP1_STREAM_SOF10						65
+#define CMDQ_EVENT_DISP1_STREAM_SOF11						66
+#define CMDQ_EVENT_DISP1_STREAM_SOF12						67
+#define CMDQ_EVENT_DISP1_STREAM_SOF13						68
+#define CMDQ_EVENT_DISP1_STREAM_SOF14						69
+#define CMDQ_EVENT_DISP1_STREAM_SOF15						70
+#define CMDQ_EVENT_DISP1_FRAME_DONE_SEL0					71
+#define CMDQ_EVENT_DISP1_FRAME_DONE_SEL1					72
+#define CMDQ_EVENT_DISP1_FRAME_DONE_SEL2					73
+#define CMDQ_EVENT_DISP1_FRAME_DONE_SEL3					74
+#define CMDQ_EVENT_DISP1_FRAME_DONE_SEL4					75
+#define CMDQ_EVENT_DISP1_FRAME_DONE_SEL5					76
+#define CMDQ_EVENT_DISP1_FRAME_DONE_SEL6					77
+#define CMDQ_EVENT_DISP1_FRAME_DONE_SEL7					78
+#define CMDQ_EVENT_DISP1_FRAME_DONE_SEL8					79
+#define CMDQ_EVENT_DISP1_FRAME_DONE_SEL9					80
+#define CMDQ_EVENT_DISP1_FRAME_DONE_SEL10					81
+#define CMDQ_EVENT_DISP1_FRAME_DONE_SEL11					82
+#define CMDQ_EVENT_DISP1_FRAME_DONE_SEL12					83
+#define CMDQ_EVENT_DISP1_FRAME_DONE_SEL13					84
+#define CMDQ_EVENT_DISP1_FRAME_DONE_SEL14					85
+#define CMDQ_EVENT_DISP1_FRAME_DONE_SEL15					86
+#define CMDQ_EVENT_DISP1_STREAM_DONE_ENG_EVENT0					87
+#define CMDQ_EVENT_DISP1_STREAM_DONE_ENG_EVENT1					88
+#define CMDQ_EVENT_DISP1_STREAM_DONE_ENG_EVENT2					89
+#define CMDQ_EVENT_DISP1_STREAM_DONE_ENG_EVENT3					90
+#define CMDQ_EVENT_DISP1_STREAM_DONE_ENG_EVENT4					91
+#define CMDQ_EVENT_DISP1_STREAM_DONE_ENG_EVENT5					92
+#define CMDQ_EVENT_DISP1_STREAM_DONE_ENG_EVENT6					93
+#define CMDQ_EVENT_DISP1_STREAM_DONE_ENG_EVENT7					94
+#define CMDQ_EVENT_DISP1_STREAM_DONE_ENG_EVENT8					95
+#define CMDQ_EVENT_DISP1_STREAM_DONE_ENG_EVENT9					96
+#define CMDQ_EVENT_DISP1_STREAM_DONE_ENG_EVENT10				97
+#define CMDQ_EVENT_DISP1_STREAM_DONE_ENG_EVENT11				98
+#define CMDQ_EVENT_DISP1_STREAM_DONE_ENG_EVENT12				99
+#define CMDQ_EVENT_DISP1_STREAM_DONE_ENG_EVENT13				100
+#define CMDQ_EVENT_DISP1_STREAM_DONE_ENG_EVENT14				101
+#define CMDQ_EVENT_DISP1_STREAM_DONE_ENG_EVENT15				102
+#define CMDQ_EVENT_DISP1_REG_UPDATE_DONE_ENG_EVENT0				103
+#define CMDQ_EVENT_DISP1_REG_UPDATE_DONE_ENG_EVENT1				104
+#define CMDQ_EVENT_DISP1_REG_UPDATE_DONE_ENG_EVENT2				105
+#define CMDQ_EVENT_DISP1_REG_UPDATE_DONE_ENG_EVENT3				106
+#define CMDQ_EVENT_DISP1_REG_UPDATE_DONE_ENG_EVENT4				107
+#define CMDQ_EVENT_DISP1_REG_UPDATE_DONE_ENG_EVENT5				108
+#define CMDQ_EVENT_DISP1_REG_UPDATE_DONE_ENG_EVENT6				109
+#define CMDQ_EVENT_DISP1_REG_UPDATE_DONE_ENG_EVENT7				110
+#define CMDQ_EVENT_DISP1_REG_UPDATE_DONE_ENG_EVENT8				111
+#define CMDQ_EVENT_DISP1_REG_UPDATE_DONE_ENG_EVENT9				112
+#define CMDQ_EVENT_DISP1_REG_UPDATE_DONE_ENG_EVENT10				113
+#define CMDQ_EVENT_DISP1_REG_UPDATE_DONE_ENG_EVENT11				114
+#define CMDQ_EVENT_DISP1_REG_UPDATE_DONE_ENG_EVENT12				115
+#define CMDQ_EVENT_DISP1_REG_UPDATE_DONE_ENG_EVENT13				116
+#define CMDQ_EVENT_DISP1_REG_UPDATE_DONE_ENG_EVENT14				117
+#define CMDQ_EVENT_DISP1_REG_UPDATE_DONE_ENG_EVENT15				118
+#define CMDQ_EVENT_DISP1_OCIP_SUBSYS_SRAM_ISOINT_ENG_EVENT			119
+#define CMDQ_EVENT_DISP1_DISP_WDMA4_TARGET_LINE_END_ENG_EVENT			120
+#define CMDQ_EVENT_DISP1_DISP_WDMA4_SW_RST_DONE_ENG_EVENT			121
+#define CMDQ_EVENT_DISP1_DISP_WDMA3_TARGET_LINE_END_ENG_EVENT			122
+#define CMDQ_EVENT_DISP1_DISP_WDMA3_SW_RST_DONE_ENG_EVENT			123
+#define CMDQ_EVENT_DISP1_DISP_WDMA2_TARGET_LINE_END_ENG_EVENT			124
+#define CMDQ_EVENT_DISP1_DISP_WDMA2_SW_RST_DONE_ENG_EVENT			125
+#define CMDQ_EVENT_DISP1_DISP_WDMA1_TARGET_LINE_END_ENG_EVENT			126
+#define CMDQ_EVENT_DISP1_DISP_WDMA1_SW_RST_DONE_ENG_EVENT			127
+#define CMDQ_EVENT_DISP1_DISP_MUTEX0_TIMEOUT_ENG_EVENT				128
+#define CMDQ_EVENT_DISP1_DISP_MUTEX0_GET_RLZ_ENG_EVENT				129
+#define CMDQ_EVENT_DISP1_DISP_MDP_RDMA1_SW_RST_DONE_ENG_EVENT			130
+#define CMDQ_EVENT_DISP1_DISP_GDMA0_SW_RST_DONE_ENG_EVENT			131
+#define CMDQ_EVENT_DISP1_DISP_DVO0_DVO_INT_TG_VSYNC_START_ENG_EVENT		132
+#define CMDQ_EVENT_DISP1_DISP_DVO0_DVO_INT_TG_VSYNC_END_ENG_EVENT		133
+#define CMDQ_EVENT_DISP1_DISP_DVO0_DVO_INT_TG_VRR_VFP_LAST_SAFE_BLANK_ENG_EVENT	134
+#define CMDQ_EVENT_DISP1_DISP_DVO0_DVO_INT_TG_VFP_START_ENG_EVENT		135
+#define CMDQ_EVENT_DISP1_DISP_DVO0_DVO_INT_TG_VFP_LAST_LINE_ENG_EVENT		136
+#define CMDQ_EVENT_DISP1_DISP_DVO0_DVO_INT_TG_VDE_END_ENG_EVENT			137
+#define CMDQ_EVENT_DISP1_DISP_DVO0_DVO_INT_TG_TRIGGER_LOOP_CLR_ENG_EVENT	138
+#define CMDQ_EVENT_DISP1_DISP_DVO0_DVO_INT_TG_TARGET_LINE1_ENG_EVENT		139
+#define CMDQ_EVENT_DISP1_DISP_DVO0_DVO_INT_TG_TARGET_LINE0_ENG_EVENT		140
+#define CMDQ_EVENT_DISP1_DISP_DVO0_DVO_EXT_TG_VSYNC_START_ENG_EVENT		141
+#define CMDQ_EVENT_DISP1_DISP_DVO0_DVO_EXT_TG_VSYNC_END_ENG_EVENT		142
+#define CMDQ_EVENT_DISP1_DISP_DVO0_DVO_EXT_TG_VDE_START_ENG_EVENT		143
+#define CMDQ_EVENT_DISP1_DISP_DVO0_DVO_EXT_TG_VDE_END_ENG_EVENT			144
+#define CMDQ_EVENT_DISP1_DISP_DSI2_ENG_EVENT0					145
+#define CMDQ_EVENT_DISP1_DISP_DSI2_ENG_EVENT1					146
+#define CMDQ_EVENT_DISP1_DISP_DSI2_ENG_EVENT2					147
+#define CMDQ_EVENT_DISP1_DISP_DSI2_ENG_EVENT3					148
+#define CMDQ_EVENT_DISP1_DISP_DSI2_ENG_EVENT4					149
+#define CMDQ_EVENT_DISP1_DISP_DSI2_ENG_EVENT5					150
+#define CMDQ_EVENT_DISP1_DISP_DSI2_ENG_EVENT6					151
+#define CMDQ_EVENT_DISP1_DISP_DSI2_ENG_EVENT7					152
+#define CMDQ_EVENT_DISP1_DISP_DSI2_ENG_EVENT8					153
+#define CMDQ_EVENT_DISP1_DISP_DSI2_ENG_EVENT9					154
+#define CMDQ_EVENT_DISP1_DISP_DSI2_ENG_EVENT10					155
+#define CMDQ_EVENT_DISP1_DISP_DSI1_ENG_EVENT0					156
+#define CMDQ_EVENT_DISP1_DISP_DSI1_ENG_EVENT1					157
+#define CMDQ_EVENT_DISP1_DISP_DSI1_ENG_EVENT2					158
+#define CMDQ_EVENT_DISP1_DISP_DSI1_ENG_EVENT3					159
+#define CMDQ_EVENT_DISP1_DISP_DSI1_ENG_EVENT4					160
+#define CMDQ_EVENT_DISP1_DISP_DSI1_ENG_EVENT5					161
+#define CMDQ_EVENT_DISP1_DISP_DSI1_ENG_EVENT6					162
+#define CMDQ_EVENT_DISP1_DISP_DSI1_ENG_EVENT7					163
+#define CMDQ_EVENT_DISP1_DISP_DSI1_ENG_EVENT8					164
+#define CMDQ_EVENT_DISP1_DISP_DSI1_ENG_EVENT9					165
+#define CMDQ_EVENT_DISP1_DISP_DSI1_ENG_EVENT10					166
+#define CMDQ_EVENT_DISP1_DISP_DSI1_ENG_EVENT11					167
+#define CMDQ_EVENT_DISP1_DISP_DSI1_ENG_EVENT12					168
+#define CMDQ_EVENT_DISP1_DISP_DSI1_ENG_EVENT13					169
+#define CMDQ_EVENT_DISP1_DISP_DSI1_ENG_EVENT14					170
+#define CMDQ_EVENT_DISP1_DISP_DSI1_ENG_EVENT15					171
+#define CMDQ_EVENT_DISP1_DISP_DSI1_ENG_EVENT16					172
+#define CMDQ_EVENT_DISP1_DISP_DSI1_ENG_EVENT17					173
+#define CMDQ_EVENT_DISP1_DISP_DSI1_ENG_EVENT18					174
+#define CMDQ_EVENT_DISP1_DISP_DSI1_ENG_EVENT19					175
+#define CMDQ_EVENT_DISP1_DISP_DSI1_ENG_EVENT20					176
+#define CMDQ_EVENT_DISP1_DISP_DSI1_ENG_EVENT21					177
+#define CMDQ_EVENT_DISP1_DISP_DSI0_ENG_EVENT0					178
+#define CMDQ_EVENT_DISP1_DISP_DSI0_ENG_EVENT1					179
+#define CMDQ_EVENT_DISP1_DISP_DSI0_ENG_EVENT2					180
+#define CMDQ_EVENT_DISP1_DISP_DSI0_ENG_EVENT3					181
+#define CMDQ_EVENT_DISP1_DISP_DSI0_ENG_EVENT4					182
+#define CMDQ_EVENT_DISP1_DISP_DSI0_ENG_EVENT5					183
+#define CMDQ_EVENT_DISP1_DISP_DSI0_ENG_EVENT6					184
+#define CMDQ_EVENT_DISP1_DISP_DSI0_ENG_EVENT7					185
+#define CMDQ_EVENT_DISP1_DISP_DSI0_ENG_EVENT8					186
+#define CMDQ_EVENT_DISP1_DISP_DSI0_ENG_EVENT9					187
+#define CMDQ_EVENT_DISP1_DISP_DSI0_ENG_EVENT10					188
+#define CMDQ_EVENT_DISP1_DISP_DP_INTF1_VSYNC_START_ENG_EVENT			189
+#define CMDQ_EVENT_DISP1_DISP_DP_INTF1_VSYNC_END_ENG_EVENT			190
+#define CMDQ_EVENT_DISP1_DISP_DP_INTF1_VDE_START_ENG_EVENT			191
+#define CMDQ_EVENT_DISP1_DISP_DP_INTF1_VDE_END_ENG_EVENT			192
+#define CMDQ_EVENT_DISP1_DISP_DP_INTF1_TARGET_LINE_ENG_EVENT			193
+#define CMDQ_EVENT_DISP1_DISP_DP_INTF0_VSYNC_START_ENG_EVENT			194
+#define CMDQ_EVENT_DISP1_DISP_DP_INTF0_VSYNC_END_ENG_EVENT			195
+#define CMDQ_EVENT_DISP1_DISP_DP_INTF0_VDE_START_ENG_EVENT			196
+#define CMDQ_EVENT_DISP1_DISP_DP_INTF0_VDE_END_ENG_EVENT			197
+#define CMDQ_EVENT_DISP1_DISP_DP_INTF0_TARGET_LINE_ENG_EVENT			198
+#define CMDQ_EVENT_DISP1_BUF_UNDERRUN_ENG_EVENT0				199
+#define CMDQ_EVENT_DISP1_BUF_UNDERRUN_ENG_EVENT1				200
+#define CMDQ_EVENT_DISP1_BUF_UNDERRUN_ENG_EVENT2				201
+#define CMDQ_EVENT_DISP1_BUF_UNDERRUN_ENG_EVENT3				202
+#define CMDQ_EVENT_DISP1_BUF_UNDERRUN_ENG_EVENT4				203
+#define CMDQ_EVENT_DISP1_BUF_UNDERRUN_ENG_EVENT5				204
+#define CMDQ_EVENT_DISP1_BUF_UNDERRUN_ENG_EVENT6				205
+#define CMDQ_EVENT_DISP1_BUF_UNDERRUN_ENG_EVENT7				206
+#define CMDQ_EVENT_DISP1_BUF_UNDERRUN_ENG_EVENT8				207
+#define CMDQ_EVENT_DISP1_BUF_UNDERRUN_ENG_EVENT9				208
+#define CMDQ_EVENT_DISP1_BUF_UNDERRUN_ENG_EVENT10				209
+
+#define CMDQ_EVENT_MML0_STREAM_SOF0						210
+#define CMDQ_EVENT_MML0_STREAM_SOF1						211
+#define CMDQ_EVENT_MML0_STREAM_SOF2						212
+#define CMDQ_EVENT_MML0_STREAM_SOF3						213
+#define CMDQ_EVENT_MML0_STREAM_SOF4						214
+#define CMDQ_EVENT_MML0_STREAM_SOF5						215
+#define CMDQ_EVENT_MML0_STREAM_SOF6						216
+#define CMDQ_EVENT_MML0_STREAM_SOF7						217
+#define CMDQ_EVENT_MML0_STREAM_SOF8						218
+#define CMDQ_EVENT_MML0_STREAM_SOF9						219
+#define CMDQ_EVENT_MML0_STREAM_SOF10						220
+#define CMDQ_EVENT_MML0_STREAM_SOF11						221
+#define CMDQ_EVENT_MML0_STREAM_SOF12						222
+#define CMDQ_EVENT_MML0_STREAM_SOF13						223
+#define CMDQ_EVENT_MML0_STREAM_SOF14						224
+#define CMDQ_EVENT_MML0_STREAM_SOF15						225
+#define CMDQ_EVENT_MML0_FRAME_DONE_SEL0						226
+#define CMDQ_EVENT_MML0_FRAME_DONE_SEL1						227
+#define CMDQ_EVENT_MML0_FRAME_DONE_SEL2						228
+#define CMDQ_EVENT_MML0_FRAME_DONE_SEL3						229
+#define CMDQ_EVENT_MML0_FRAME_DONE_SEL4						230
+#define CMDQ_EVENT_MML0_FRAME_DONE_SEL5						231
+#define CMDQ_EVENT_MML0_FRAME_DONE_SEL6						232
+#define CMDQ_EVENT_MML0_FRAME_DONE_SEL7						233
+#define CMDQ_EVENT_MML0_FRAME_DONE_SEL8						234
+#define CMDQ_EVENT_MML0_FRAME_DONE_SEL9						235
+#define CMDQ_EVENT_MML0_FRAME_DONE_SEL10					236
+#define CMDQ_EVENT_MML0_FRAME_DONE_SEL11					237
+#define CMDQ_EVENT_MML0_FRAME_DONE_SEL12					238
+#define CMDQ_EVENT_MML0_FRAME_DONE_SEL13					239
+#define CMDQ_EVENT_MML0_FRAME_DONE_SEL14					240
+#define CMDQ_EVENT_MML0_FRAME_DONE_SEL15					241
+#define CMDQ_EVENT_MML0_REG_UPDATE_DONE_ENG_EVENT0				242
+#define CMDQ_EVENT_MML0_REG_UPDATE_DONE_ENG_EVENT1				243
+#define CMDQ_EVENT_MML0_REG_UPDATE_DONE_ENG_EVENT2				244
+#define CMDQ_EVENT_MML0_REG_UPDATE_DONE_ENG_EVENT3				245
+#define CMDQ_EVENT_MML0_REG_UPDATE_DONE_ENG_EVENT4				246
+#define CMDQ_EVENT_MML0_REG_UPDATE_DONE_ENG_EVENT5				247
+#define CMDQ_EVENT_MML0_REG_UPDATE_DONE_ENG_EVENT6				248
+#define CMDQ_EVENT_MML0_REG_UPDATE_DONE_ENG_EVENT7				249
+#define CMDQ_EVENT_MML0_REG_UPDATE_DONE_ENG_EVENT8				250
+#define CMDQ_EVENT_MML0_REG_UPDATE_DONE_ENG_EVENT9				251
+#define CMDQ_EVENT_MML0_REG_UPDATE_DONE_ENG_EVENT10				252
+#define CMDQ_EVENT_MML0_REG_UPDATE_DONE_ENG_EVENT11				253
+#define CMDQ_EVENT_MML0_REG_UPDATE_DONE_ENG_EVENT12				254
+#define CMDQ_EVENT_MML0_REG_UPDATE_DONE_ENG_EVENT13				255
+#define CMDQ_EVENT_MML0_REG_UPDATE_DONE_ENG_EVENT14				256
+#define CMDQ_EVENT_MML0_REG_UPDATE_DONE_ENG_EVENT15				257
+#define CMDQ_EVENT_MML0_MDP_WROT2_SW_RST_DONE_ENG_EVENT				258
+#define CMDQ_EVENT_MML0_MDP_WROT1_SW_RST_DONE_ENG_EVENT				259
+#define CMDQ_EVENT_MML0_MDP_WROT0_SW_RST_DONE_ENG_EVENT				260
+#define CMDQ_EVENT_MML0_MDP_RROT0_SW_RST_DONE_ENG_EVENT				261
+#define CMDQ_EVENT_MML0_MDP_RDMA2_SW_RST_DONE_ENG_EVENT				262
+#define CMDQ_EVENT_MML0_MDP_RDMA1_SW_RST_DONE_ENG_EVENT				263
+#define CMDQ_EVENT_MML0_MDP_RDMA0_SW_RST_DONE_ENG_EVENT				264
+#define CMDQ_EVENT_MML0_MDP_MERGE0_SW_RST_DONE_ENG_EVENT			265
+#define CMDQ_EVENT_MML0_DISP_MUTEX0_TIMEOUT_ENG_EVENT				266
+#define CMDQ_EVENT_MML0_DISP_MUTEX0_GET_RLZ_ENG_EVENT				267
+
+#define CMDQ_EVENT_MML1_STREAM_SOF0						268
+#define CMDQ_EVENT_MML1_STREAM_SOF1						269
+#define CMDQ_EVENT_MML1_STREAM_SOF2						270
+#define CMDQ_EVENT_MML1_STREAM_SOF3						271
+#define CMDQ_EVENT_MML1_STREAM_SOF4						272
+#define CMDQ_EVENT_MML1_STREAM_SOF5						273
+#define CMDQ_EVENT_MML1_STREAM_SOF6						274
+#define CMDQ_EVENT_MML1_STREAM_SOF7						275
+#define CMDQ_EVENT_MML1_STREAM_SOF8						276
+#define CMDQ_EVENT_MML1_STREAM_SOF9						277
+#define CMDQ_EVENT_MML1_STREAM_SOF10						278
+#define CMDQ_EVENT_MML1_STREAM_SOF11						279
+#define CMDQ_EVENT_MML1_STREAM_SOF12						280
+#define CMDQ_EVENT_MML1_STREAM_SOF13						281
+#define CMDQ_EVENT_MML1_STREAM_SOF14						282
+#define CMDQ_EVENT_MML1_STREAM_SOF15						283
+#define CMDQ_EVENT_MML1_FRAME_DONE_SEL0						284
+#define CMDQ_EVENT_MML1_FRAME_DONE_SEL1						285
+#define CMDQ_EVENT_MML1_FRAME_DONE_SEL2						286
+#define CMDQ_EVENT_MML1_FRAME_DONE_SEL3						287
+#define CMDQ_EVENT_MML1_FRAME_DONE_SEL4						288
+#define CMDQ_EVENT_MML1_FRAME_DONE_SEL5						289
+#define CMDQ_EVENT_MML1_FRAME_DONE_SEL6						290
+#define CMDQ_EVENT_MML1_FRAME_DONE_SEL7						291
+#define CMDQ_EVENT_MML1_FRAME_DONE_SEL8						292
+#define CMDQ_EVENT_MML1_FRAME_DONE_SEL9						293
+#define CMDQ_EVENT_MML1_FRAME_DONE_SEL10					294
+#define CMDQ_EVENT_MML1_FRAME_DONE_SEL11					295
+#define CMDQ_EVENT_MML1_FRAME_DONE_SEL12					296
+#define CMDQ_EVENT_MML1_FRAME_DONE_SEL13					297
+#define CMDQ_EVENT_MML1_FRAME_DONE_SEL14					298
+#define CMDQ_EVENT_MML1_FRAME_DONE_SEL15					299
+#define CMDQ_EVENT_MML1_REG_UPDATE_DONE_ENG_EVENT0				300
+#define CMDQ_EVENT_MML1_REG_UPDATE_DONE_ENG_EVENT1				301
+#define CMDQ_EVENT_MML1_REG_UPDATE_DONE_ENG_EVENT2				302
+#define CMDQ_EVENT_MML1_REG_UPDATE_DONE_ENG_EVENT3				303
+#define CMDQ_EVENT_MML1_REG_UPDATE_DONE_ENG_EVENT4				304
+#define CMDQ_EVENT_MML1_REG_UPDATE_DONE_ENG_EVENT5				305
+#define CMDQ_EVENT_MML1_REG_UPDATE_DONE_ENG_EVENT6				306
+#define CMDQ_EVENT_MML1_REG_UPDATE_DONE_ENG_EVENT7				307
+#define CMDQ_EVENT_MML1_REG_UPDATE_DONE_ENG_EVENT8				308
+#define CMDQ_EVENT_MML1_REG_UPDATE_DONE_ENG_EVENT9				309
+#define CMDQ_EVENT_MML1_REG_UPDATE_DONE_ENG_EVENT10				310
+#define CMDQ_EVENT_MML1_REG_UPDATE_DONE_ENG_EVENT11				311
+#define CMDQ_EVENT_MML1_REG_UPDATE_DONE_ENG_EVENT12				312
+#define CMDQ_EVENT_MML1_REG_UPDATE_DONE_ENG_EVENT13				313
+#define CMDQ_EVENT_MML1_REG_UPDATE_DONE_ENG_EVENT14				314
+#define CMDQ_EVENT_MML1_REG_UPDATE_DONE_ENG_EVENT15				315
+#define CMDQ_EVENT_MML1_MDP_WROT2_SW_RST_DONE_ENG_EVENT				316
+#define CMDQ_EVENT_MML1_MDP_WROT1_SW_RST_DONE_ENG_EVENT				317
+#define CMDQ_EVENT_MML1_MDP_WROT0_SW_RST_DONE_ENG_EVENT				318
+#define CMDQ_EVENT_MML1_MDP_RROT0_SW_RST_DONE_ENG_EVENT				319
+#define CMDQ_EVENT_MML1_MDP_RDMA2_SW_RST_DONE_ENG_EVENT				320
+#define CMDQ_EVENT_MML1_MDP_RDMA1_SW_RST_DONE_ENG_EVENT				321
+#define CMDQ_EVENT_MML1_MDP_RDMA0_SW_RST_DONE_ENG_EVENT				322
+#define CMDQ_EVENT_MML1_MDP_MERGE0_SW_RST_DONE_ENG_EVENT			323
+#define CMDQ_EVENT_MML1_DISP_MUTEX0_TIMEOUT_ENG_EVENT				324
+#define CMDQ_EVENT_MML1_DISP_MUTEX0_GET_RLZ_ENG_EVENT				325
+
+#define CMDQ_EVENT_OVL0_STREAM_SOF0						326
+#define CMDQ_EVENT_OVL0_STREAM_SOF1						327
+#define CMDQ_EVENT_OVL0_STREAM_SOF2						328
+#define CMDQ_EVENT_OVL0_STREAM_SOF3						329
+#define CMDQ_EVENT_OVL0_STREAM_SOF4						330
+#define CMDQ_EVENT_OVL0_STREAM_SOF5						331
+#define CMDQ_EVENT_OVL0_STREAM_SOF6						332
+#define CMDQ_EVENT_OVL0_STREAM_SOF7						333
+#define CMDQ_EVENT_OVL0_STREAM_SOF8						334
+#define CMDQ_EVENT_OVL0_STREAM_SOF9						335
+#define CMDQ_EVENT_OVL0_STREAM_SOF10						336
+#define CMDQ_EVENT_OVL0_STREAM_SOF11						337
+#define CMDQ_EVENT_OVL0_STREAM_SOF12						338
+#define CMDQ_EVENT_OVL0_STREAM_SOF13						339
+#define CMDQ_EVENT_OVL0_STREAM_SOF14						340
+#define CMDQ_EVENT_OVL0_STREAM_SOF15						341
+#define CMDQ_EVENT_OVL0_FRAME_DONE_SEL0						342
+#define CMDQ_EVENT_OVL0_FRAME_DONE_SEL1						343
+#define CMDQ_EVENT_OVL0_FRAME_DONE_SEL2						344
+#define CMDQ_EVENT_OVL0_FRAME_DONE_SEL3						345
+#define CMDQ_EVENT_OVL0_FRAME_DONE_SEL4						346
+#define CMDQ_EVENT_OVL0_FRAME_DONE_SEL5						347
+#define CMDQ_EVENT_OVL0_FRAME_DONE_SEL6						348
+#define CMDQ_EVENT_OVL0_FRAME_DONE_SEL7						349
+#define CMDQ_EVENT_OVL0_FRAME_DONE_SEL8						350
+#define CMDQ_EVENT_OVL0_FRAME_DONE_SEL9						351
+#define CMDQ_EVENT_OVL0_FRAME_DONE_SEL10					352
+#define CMDQ_EVENT_OVL0_FRAME_DONE_SEL11					353
+#define CMDQ_EVENT_OVL0_FRAME_DONE_SEL12					354
+#define CMDQ_EVENT_OVL0_FRAME_DONE_SEL13					355
+#define CMDQ_EVENT_OVL0_FRAME_DONE_SEL14					356
+#define CMDQ_EVENT_OVL0_FRAME_DONE_SEL15					357
+#define CMDQ_EVENT_OVL0_OVL_UFBC_WDMA0_TARGET_LINE_END_ENG_EVENT		358
+#define CMDQ_EVENT_OVL0_OVL_MUTEX0_TIMEOUT_ENG_EVENT				359
+#define CMDQ_EVENT_OVL0_OVL_MUTEX0_REG_UPDATE_DONE_ENG_EVENT0			360
+#define CMDQ_EVENT_OVL0_OVL_MUTEX0_REG_UPDATE_DONE_ENG_EVENT1			361
+#define CMDQ_EVENT_OVL0_OVL_MUTEX0_REG_UPDATE_DONE_ENG_EVENT2			362
+#define CMDQ_EVENT_OVL0_OVL_MUTEX0_REG_UPDATE_DONE_ENG_EVENT3			363
+#define CMDQ_EVENT_OVL0_OVL_MUTEX0_REG_UPDATE_DONE_ENG_EVENT4			364
+#define CMDQ_EVENT_OVL0_OVL_MUTEX0_REG_UPDATE_DONE_ENG_EVENT5			365
+#define CMDQ_EVENT_OVL0_OVL_MUTEX0_REG_UPDATE_DONE_ENG_EVENT6			366
+#define CMDQ_EVENT_OVL0_OVL_MUTEX0_REG_UPDATE_DONE_ENG_EVENT7			367
+#define CMDQ_EVENT_OVL0_OVL_MUTEX0_REG_UPDATE_DONE_ENG_EVENT8			368
+#define CMDQ_EVENT_OVL0_OVL_MUTEX0_REG_UPDATE_DONE_ENG_EVENT9			369
+#define CMDQ_EVENT_OVL0_OVL_MUTEX0_REG_UPDATE_DONE_ENG_EVENT10			370
+#define CMDQ_EVENT_OVL0_OVL_MUTEX0_REG_UPDATE_DONE_ENG_EVENT11			371
+#define CMDQ_EVENT_OVL0_OVL_MUTEX0_REG_UPDATE_DONE_ENG_EVENT12			372
+#define CMDQ_EVENT_OVL0_OVL_MUTEX0_REG_UPDATE_DONE_ENG_EVENT13			373
+#define CMDQ_EVENT_OVL0_OVL_MUTEX0_REG_UPDATE_DONE_ENG_EVENT14			374
+#define CMDQ_EVENT_OVL0_OVL_MUTEX0_REG_UPDATE_DONE_ENG_EVENT15			375
+#define CMDQ_EVENT_OVL0_OVL_MUTEX0_GET_RELEASE_ENG_EVENT			376
+#define CMDQ_EVENT_OVL0_OVL_MDP_RDMA1_SW_RST_DONE_ENG_EVENT			377
+#define CMDQ_EVENT_OVL0_OVL_MDP_RDMA0_SW_RST_DONE_ENG_EVENT			378
+#define CMDQ_EVENT_OVL0_OVL_EXDMA9_FRAME_RESET_DONE_ENG_EVENT			379
+#define CMDQ_EVENT_OVL0_OVL_EXDMA8_FRAME_RESET_DONE_ENG_EVENT			380
+#define CMDQ_EVENT_OVL0_OVL_EXDMA7_FRAME_RESET_DONE_ENG_EVENT			381
+#define CMDQ_EVENT_OVL0_OVL_EXDMA6_FRAME_RESET_DONE_ENG_EVENT			382
+#define CMDQ_EVENT_OVL0_OVL_EXDMA5_FRAME_RESET_DONE_ENG_EVENT			383
+#define CMDQ_EVENT_OVL0_OVL_EXDMA4_FRAME_RESET_DONE_ENG_EVENT			384
+#define CMDQ_EVENT_OVL0_OVL_EXDMA3_FRAME_RESET_DONE_ENG_EVENT			385
+#define CMDQ_EVENT_OVL0_OVL_EXDMA2_FRAME_RESET_DONE_ENG_EVENT			386
+#define CMDQ_EVENT_OVL0_OVL_EXDMA1_FRAME_RESET_DONE_ENG_EVENT			387
+#define CMDQ_EVENT_OVL0_OVL_EXDMA0_FRAME_RESET_DONE_ENG_EVENT			388
+#define CMDQ_EVENT_OVL0_OVL_DISP_WDMA1_TARGET_LINE_END_ENG_EVENT		389
+#define CMDQ_EVENT_OVL0_OVL_DISP_WDMA1_SW_RST_DONE_END_ENG_EVENT		390
+#define CMDQ_EVENT_OVL0_OVL_DISP_WDMA0_TARGET_LINE_END_ENG_EVENT		391
+#define CMDQ_EVENT_OVL0_OVL_DISP_WDMA0_SW_RST_DONE_END_ENG_EVENT		392
+#define CMDQ_EVENT_OVL0_OVL_BWM0_FRAME_RESET_DONE_ENG_EVENT			393
+#define CMDQ_EVENT_OVL1_STREAM_SOF0						394
+#define CMDQ_EVENT_OVL1_STREAM_SOF1						395
+#define CMDQ_EVENT_OVL1_STREAM_SOF2						396
+#define CMDQ_EVENT_OVL1_STREAM_SOF3						397
+#define CMDQ_EVENT_OVL1_STREAM_SOF4						398
+#define CMDQ_EVENT_OVL1_STREAM_SOF5						399
+#define CMDQ_EVENT_OVL1_STREAM_SOF6						400
+#define CMDQ_EVENT_OVL1_STREAM_SOF7						401
+#define CMDQ_EVENT_OVL1_STREAM_SOF8						402
+#define CMDQ_EVENT_OVL1_STREAM_SOF9						403
+#define CMDQ_EVENT_OVL1_STREAM_SOF10						404
+#define CMDQ_EVENT_OVL1_STREAM_SOF11						405
+#define CMDQ_EVENT_OVL1_STREAM_SOF12						406
+#define CMDQ_EVENT_OVL1_STREAM_SOF13						407
+#define CMDQ_EVENT_OVL1_STREAM_SOF14						408
+#define CMDQ_EVENT_OVL1_STREAM_SOF15						409
+#define CMDQ_EVENT_OVL1_FRAME_DONE_SEL0						410
+#define CMDQ_EVENT_OVL1_FRAME_DONE_SEL1						411
+#define CMDQ_EVENT_OVL1_FRAME_DONE_SEL2						412
+#define CMDQ_EVENT_OVL1_FRAME_DONE_SEL3						413
+#define CMDQ_EVENT_OVL1_FRAME_DONE_SEL4						414
+#define CMDQ_EVENT_OVL1_FRAME_DONE_SEL5						415
+#define CMDQ_EVENT_OVL1_FRAME_DONE_SEL6						416
+#define CMDQ_EVENT_OVL1_FRAME_DONE_SEL7						417
+#define CMDQ_EVENT_OVL1_FRAME_DONE_SEL8						418
+#define CMDQ_EVENT_OVL1_FRAME_DONE_SEL9						419
+#define CMDQ_EVENT_OVL1_FRAME_DONE_SEL10					420
+#define CMDQ_EVENT_OVL1_FRAME_DONE_SEL11					421
+#define CMDQ_EVENT_OVL1_FRAME_DONE_SEL12					422
+#define CMDQ_EVENT_OVL1_FRAME_DONE_SEL13					423
+#define CMDQ_EVENT_OVL1_FRAME_DONE_SEL14					424
+#define CMDQ_EVENT_OVL1_FRAME_DONE_SEL15					425
+#define CMDQ_EVENT_OVL1_OVL_UFBC_WDMA0_TARGET_LINE_END_ENG_EVENT		426
+#define CMDQ_EVENT_OVL1_OVL_MUTEX0_TIMEOUT_ENG_EVENT				427
+#define CMDQ_EVENT_OVL1_OVL_MUTEX0_REG_UPDATE_DONE_ENG_EVENT0			428
+#define CMDQ_EVENT_OVL1_OVL_MUTEX0_REG_UPDATE_DONE_ENG_EVENT1			429
+#define CMDQ_EVENT_OVL1_OVL_MUTEX0_REG_UPDATE_DONE_ENG_EVENT2			430
+#define CMDQ_EVENT_OVL1_OVL_MUTEX0_REG_UPDATE_DONE_ENG_EVENT3			431
+#define CMDQ_EVENT_OVL1_OVL_MUTEX0_REG_UPDATE_DONE_ENG_EVENT4			432
+#define CMDQ_EVENT_OVL1_OVL_MUTEX0_REG_UPDATE_DONE_ENG_EVENT5			433
+#define CMDQ_EVENT_OVL1_OVL_MUTEX0_REG_UPDATE_DONE_ENG_EVENT6			434
+#define CMDQ_EVENT_OVL1_OVL_MUTEX0_REG_UPDATE_DONE_ENG_EVENT7			435
+#define CMDQ_EVENT_OVL1_OVL_MUTEX0_REG_UPDATE_DONE_ENG_EVENT8			436
+#define CMDQ_EVENT_OVL1_OVL_MUTEX0_REG_UPDATE_DONE_ENG_EVENT9			437
+#define CMDQ_EVENT_OVL1_OVL_MUTEX0_REG_UPDATE_DONE_ENG_EVENT10			438
+#define CMDQ_EVENT_OVL1_OVL_MUTEX0_REG_UPDATE_DONE_ENG_EVENT11			439
+#define CMDQ_EVENT_OVL1_OVL_MUTEX0_REG_UPDATE_DONE_ENG_EVENT12			440
+#define CMDQ_EVENT_OVL1_OVL_MUTEX0_REG_UPDATE_DONE_ENG_EVENT13			441
+#define CMDQ_EVENT_OVL1_OVL_MUTEX0_REG_UPDATE_DONE_ENG_EVENT14			442
+#define CMDQ_EVENT_OVL1_OVL_MUTEX0_REG_UPDATE_DONE_ENG_EVENT15			443
+#define CMDQ_EVENT_OVL1_OVL_MUTEX0_GET_RELEASE_ENG_EVENT			444
+#define CMDQ_EVENT_OVL1_OVL_MDP_RDMA1_SW_RST_DONE_ENG_EVENT			445
+#define CMDQ_EVENT_OVL1_OVL_MDP_RDMA0_SW_RST_DONE_ENG_EVENT			446
+#define CMDQ_EVENT_OVL1_OVL_EXDMA9_FRAME_RESET_DONE_ENG_EVENT			447
+#define CMDQ_EVENT_OVL1_OVL_EXDMA8_FRAME_RESET_DONE_ENG_EVENT			448
+#define CMDQ_EVENT_OVL1_OVL_EXDMA7_FRAME_RESET_DONE_ENG_EVENT			449
+#define CMDQ_EVENT_OVL1_OVL_EXDMA6_FRAME_RESET_DONE_ENG_EVENT			450
+#define CMDQ_EVENT_OVL1_OVL_EXDMA5_FRAME_RESET_DONE_ENG_EVENT			451
+#define CMDQ_EVENT_OVL1_OVL_EXDMA4_FRAME_RESET_DONE_ENG_EVENT			452
+#define CMDQ_EVENT_OVL1_OVL_EXDMA3_FRAME_RESET_DONE_ENG_EVENT			453
+#define CMDQ_EVENT_OVL1_OVL_EXDMA2_FRAME_RESET_DONE_ENG_EVENT			454
+#define CMDQ_EVENT_OVL1_OVL_EXDMA1_FRAME_RESET_DONE_ENG_EVENT			455
+#define CMDQ_EVENT_OVL1_OVL_EXDMA0_FRAME_RESET_DONE_ENG_EVENT			456
+#define CMDQ_EVENT_OVL1_OVL_DISP_WDMA1_TARGET_LINE_END_ENG_EVENT		457
+#define CMDQ_EVENT_OVL1_OVL_DISP_WDMA1_SW_RST_DONE_END_ENG_EVENT		458
+#define CMDQ_EVENT_OVL1_OVL_DISP_WDMA0_TARGET_LINE_END_ENG_EVENT		459
+#define CMDQ_EVENT_OVL1_OVL_DISP_WDMA0_SW_RST_DONE_END_ENG_EVENT		460
+#define CMDQ_EVENT_OVL1_OVL_BWM0_FRAME_RESET_DONE_ENG_EVENT			461
+
+#define CMDQ_EVENT_DPC_DT_DONE0							462
+#define CMDQ_EVENT_DPC_DT_DONE1							463
+#define CMDQ_EVENT_DPC_DT_DONE2_0_MERGE						464
+#define CMDQ_EVENT_DPC_DT_DONE2_1_MERGE						465
+#define CMDQ_EVENT_DPC_DT_DONE2_2_MERGE						466
+#define CMDQ_EVENT_DPC_DT_DONE2_3_MERGE						467
+#define CMDQ_EVENT_DPC_DT_DONE3							468
+#define CMDQ_EVENT_DPC_DT_DONE4_MERGE						469
+#define CMDQ_EVENT_DPC_DT_DONE5							470
+#define CMDQ_EVENT_DPC_DT_DONE6_0_MERGE						471
+#define CMDQ_EVENT_DPC_DT_DONE6_1_MERGE						472
+#define CMDQ_EVENT_DPC_DT_DONE6_2_MERGE						473
+#define CMDQ_EVENT_DPC_DT_DONE6_3_MERGE						474
+#define CMDQ_EVENT_DPC_DT_DONE7							475
+#define CMDQ_EVENT_DPC_DT_DONE32_MERGE						476
+#define CMDQ_EVENT_DPC_DT_DONE33						477
+#define CMDQ_EVENT_DPC_DT_DONE34_0						478
+#define CMDQ_EVENT_DPC_DT_DONE35						479
+#define CMDQ_EVENT_DPC_DISP_SSYS_DT_ERR_ON_BEFORE_OFF				480
+#define CMDQ_EVENT_DPC_DISP_SSYS_DT_ERR_PRETE_BEFORE_ON				481
+#define CMDQ_EVENT_DPC_DISP_DVFS_DT_ERR_ON_BEFORE_OFF				482
+#define CMDQ_EVENT_DPC_DISP_DVFS_DT_ERR_PRETE_BEFORE_ON				483
+#define CMDQ_EVENT_DPC_DISP_SB_DT_ERR_ON_BEFORE_OFF				484
+#define CMDQ_EVENT_DPC_DISP_SB_DT_ERR_PRETE_BEFORE_ON				485
+#define CMDQ_EVENT_DPC_DISP_SW_CONFIG_WHEN_MTCMOS_OFF				486
+#define CMDQ_EVENT_DPC_MML_SSYS_DT_ERR_ON_BEFORE_OFF				487
+#define CMDQ_EVENT_DPC_MML_SSYS_DT_ERR_PRETE_BEFORE_ON				488
+#define CMDQ_EVENT_DPC_MML_DVFS_DT_ERR_ON_BEFORE_OFF				489
+#define CMDQ_EVENT_DPC_MML_DVFS_DT_ERR_PRETE_BEFORE_ON				490
+#define CMDQ_EVENT_DPC_MML_SB_DT_ERR_ON_BEFORE_OFF				491
+#define CMDQ_EVENT_DPC_MML_SB_DT_ERR_PRETE_BEFORE_ON				492
+#define CMDQ_EVENT_DPC_MML_SW_CONFIG_WHEN_MTCMOS_OFF				493
+#define CMDQ_EVENT_DPTX_DPTX_EVENT0						494
+#define CMDQ_EVENT_DPTX_DPTX_EVENT1						495
+#define CMDQ_EVENT_DPTX_DPTX_EVENT2						496
+#define CMDQ_EVENT_DPTX_DPTX_EVENT3						497
+#define CMDQ_EVENT_EDPTX_EDPTX_EVENT0						498
+#define CMDQ_EVENT_EDPTX_EDPTX_EVENT1						499
+
+#define CMDQ_EVENT_DSI0_TE_I_DSI0_TE_I						898
+#define CMDQ_EVENT_DSI1_TE_I_DSI1_TE_I						899
+#define CMDQ_EVENT_DSI2_TE_I_DSI2_TE_I						900
+#define CMDQ_EVENT_POWEREVENT_GCE_EVENT_SUBSYS_PWR_ACK_0			901
+#define CMDQ_EVENT_POWEREVENT_GCE_EVENT_SUBSYS_PWR_ACK_1			902
+#define CMDQ_EVENT_POWEREVENT_GCE_EVENT_SUBSYS_PWR_ACK_2			903
+#define CMDQ_EVENT_POWEREVENT_GCE_EVENT_SUBSYS_PWR_ACK_3			904
+#define CMDQ_EVENT_POWEREVENT_GCE_EVENT_SUBSYS_PWR_ACK_4			905
+#define CMDQ_EVENT_POWEREVENT_GCE_EVENT_SUBSYS_PWR_ACK_5			906
+#define CMDQ_EVENT_POWEREVENT_GCE_EVENT_SUBSYS_PWR_ACK_6			907
+#define CMDQ_EVENT_POWEREVENT_GCE_EVENT_SUBSYS_PWR_ACK_7			908
+#define CMDQ_EVENT_POWEREVENT_GCE_EVENT_SUBSYS_PWR_ACK_8			909
+#define CMDQ_EVENT_POWEREVENT_GCE_EVENT_SUBSYS_PWR_ACK_9			910
+#define CMDQ_EVENT_POWEREVENT_GCE_EVENT_SUBSYS_PWR_ACK_10			911
+#define CMDQ_EVENT_POWEREVENT_GCE_EVENT_SUBSYS_PWR_ACK_11			912
+#define CMDQ_EVENT_POWEREVENT_GCE_EVENT_SUBSYS_PWR_ACK_12			913
+#define CMDQ_EVENT_POWEREVENT_GCE_EVENT_SUBSYS_PWR_ACK_13			914
+#define CMDQ_EVENT_POWEREVENT_GCE_EVENT_SUBSYS_PWR_ACK_14			915
+#define CMDQ_EVENT_POWEREVENT_GCE_EVENT_SUBSYS_PWR_ACK_15			916
+#define CMDQ_EVENT_POWEREVENT_GCE_EVENT_SUBSYS_PWR_ACK_16			917
+#define CMDQ_EVENT_POWEREVENT_GCE_EVENT_SUBSYS_PWR_ACK_17			918
+#define CMDQ_EVENT_POWEREVENT_GCE_EVENT_SUBSYS_PWR_ACK_18			919
+#define CMDQ_EVENT_POWEREVENT_GCE_EVENT_SUBSYS_PWR_ACK_19			920
+#define CMDQ_EVENT_POWEREVENT_GCE_EVENT_SUBSYS_PWR_ACK_20			921
+#define CMDQ_EVENT_POWEREVENT_GCE_EVENT_SUBSYS_PWR_ACK_21			922
+#define CMDQ_EVENT_POWEREVENT_GCE_EVENT_SUBSYS_PWR_ACK_22			923
+#define CMDQ_EVENT_POWEREVENT_GCE_EVENT_SUBSYS_PWR_ACK_23			924
+#define CMDQ_EVENT_GCE_EVENT_DPTX_GCE_EVENT_DPTX_0				925
+#define CMDQ_EVENT_GCE_EVENT_DPTX_GCE_EVENT_DPTX_1				926
+#define CMDQ_EVENT_GCE_EVENT_DPTX_P1_GCE_EVENT_DPTX_P1_0			927
+#define CMDQ_EVENT_GCE_EVENT_DPTX_P1_GCE_EVENT_DPTX_P1_1			928
+#define CMDQ_EVENT_GCE_EVENT_EDPTX_GCE_EVENT_EDPTX_0				929
+#define CMDQ_EVENT_GCE_EVENT_EDPTX_GCE_EVENT_EDPTX_1				930
+#define CMDQ_EVENT_DSI3_TE_I_DSI3_TE_I						931
+#define CMDQ_EVENT_SPI0_FINISH_EVENT_DSI4_TE_I					932
+#define CMDQ_EVENT_SPI0_EVENT_EVENT_DSI5_TE_I					933
+
+/* GCE-M hardware events */
+#define CMDQ_EVENT_VENC3_VENC_RESERVED						0
+#define CMDQ_EVENT_VENC3_VENC_FRAME_DONE					1
+#define CMDQ_EVENT_VENC3_VENC_PAUSE_DONE					2
+#define CMDQ_EVENT_VENC3_JPGENC_DONE						3
+#define CMDQ_EVENT_VENC3_VENC_MB_DONE						4
+#define CMDQ_EVENT_VENC3_VENC_128BYTE_DONE					5
+#define CMDQ_EVENT_VENC3_JPGDEC_DONE						6
+#define CMDQ_EVENT_VENC3_JPGDEC_C1_DONE						7
+#define CMDQ_EVENT_VENC3_JPGDEC_INSUFF_DONE					8
+#define CMDQ_EVENT_VENC3_JPGDEC_C1_INSUFF_DONE					9
+#define CMDQ_EVENT_VENC3_WP_2ND_STAGE_DONE					10
+#define CMDQ_EVENT_VENC3_WP_3RD_STAGE_DONE					11
+#define CMDQ_EVENT_VENC3_PPS_HEADER_DONE					12
+#define CMDQ_EVENT_VENC3_SPS_HEADER_DONE					13
+#define CMDQ_EVENT_VENC3_VPS_HEADER_DONE					14
+#define CMDQ_EVENT_VENC3_VENC_SLICE_DONE					15
+#define CMDQ_EVENT_VENC3_VENC_SOC_SLICE_DONE					16
+#define CMDQ_EVENT_VENC3_VENC_SOC_FRAME_DONE					17
+
+#define CMDQ_EVENT_VENC2_VENC_FRAME_DONE					33
+#define CMDQ_EVENT_VENC2_VENC_PAUSE_DONE					34
+#define CMDQ_EVENT_VENC2_JPGENC_DONE						35
+#define CMDQ_EVENT_VENC2_VENC_MB_DONE						36
+#define CMDQ_EVENT_VENC2_VENC_128BYTE_DONE					37
+#define CMDQ_EVENT_VENC2_JPGDEC_DONE						38
+#define CMDQ_EVENT_VENC2_JPGDEC_C1_DONE						39
+#define CMDQ_EVENT_VENC2_JPGDEC_INSUFF_DONE					40
+#define CMDQ_EVENT_VENC2_JPGDEC_C1_INSUFF_DONE					41
+#define CMDQ_EVENT_VENC2_WP_2ND_STAGE_DONE					42
+#define CMDQ_EVENT_VENC2_WP_3RD_STAGE_DONE					43
+#define CMDQ_EVENT_VENC2_PPS_HEADER_DONE					44
+#define CMDQ_EVENT_VENC2_SPS_HEADER_DONE					45
+#define CMDQ_EVENT_VENC2_VPS_HEADER_DONE					46
+#define CMDQ_EVENT_VENC2_VENC_SLICE_DONE					47
+#define CMDQ_EVENT_VENC2_VENC_SOC_SLICE_DONE					48
+#define CMDQ_EVENT_VENC2_VENC_SOC_FRAME_DONE					49
+
+#define CMDQ_EVENT_VENC1_VENC_FRAME_DONE					65
+#define CMDQ_EVENT_VENC1_VENC_PAUSE_DONE					66
+#define CMDQ_EVENT_VENC1_JPGENC_DONE						67
+#define CMDQ_EVENT_VENC1_VENC_MB_DONE						68
+#define CMDQ_EVENT_VENC1_VENC_128BYTE_DONE					69
+#define CMDQ_EVENT_VENC1_JPGDEC_DONE						70
+#define CMDQ_EVENT_VENC1_JPGDEC_C1_DONE						71
+#define CMDQ_EVENT_VENC1_JPGDEC_INSUFF_DONE					72
+#define CMDQ_EVENT_VENC1_JPGDEC_C1_INSUFF_DONE					73
+#define CMDQ_EVENT_VENC1_WP_2ND_STAGE_DONE					74
+#define CMDQ_EVENT_VENC1_WP_3RD_STAGE_DONE					75
+#define CMDQ_EVENT_VENC1_PPS_HEADER_DONE					76
+#define CMDQ_EVENT_VENC1_SPS_HEADER_DONE					77
+#define CMDQ_EVENT_VENC1_VPS_HEADER_DONE					78
+#define CMDQ_EVENT_VENC1_VENC_SLICE_DONE					79
+#define CMDQ_EVENT_VENC1_VENC_SOC_SLICE_DONE					80
+#define CMDQ_EVENT_VENC1_VENC_SOC_FRAME_DONE					81
+
+#define CMDQ_EVENT_VDEC1_VDEC_LINE_CNT_INT					192
+#define CMDQ_EVENT_VDEC1_VDEC_INT						193
+#define CMDQ_EVENT_VDEC1_VDEC1_EVENT_2						194
+#define CMDQ_EVENT_VDEC1_VDEC_DEC_ERR						195
+#define CMDQ_EVENT_VDEC1_VDEC_BUSY_OVERFLOW					196
+#define CMDQ_EVENT_VDEC1_VDEC1_EVENT_5						197
+#define CMDQ_EVENT_VDEC1_VDEC_INI_FETCH_RDY					198
+#define CMDQ_EVENT_VDEC1_VDEC1_EVENT_7						199
+#define CMDQ_EVENT_VDEC1_VDEC1_EVENT_8						200
+#define CMDQ_EVENT_VDEC1_VDEC1_EVENT_9						201
+#define CMDQ_EVENT_VDEC1_VDEC1_EVENT_10						202
+#define CMDQ_EVENT_VDEC1_VDEC1_EVENT_11						203
+
+#define CMDQ_EVENT_VDEC1_VDEC_GCE_CNT_OP_THR					207
+
+#define CMDQ_EVENT_VDEC1_VDEC1_EVENT_32						224
+#define CMDQ_EVENT_VDEC1_VDEC_LAT_INT						225
+#define CMDQ_EVENT_VDEC1_VDEC1_EVENT_34						226
+#define CMDQ_EVENT_VDEC1_VDEC_LAT_DEC_ERR					227
+#define CMDQ_EVENT_VDEC1_VDEC_LAT_BUSY_OVERFLOW					228
+#define CMDQ_EVENT_VDEC1_VDEC1_EVENT_37						229
+#define CMDQ_EVENT_VDEC1_VDEC_LAT_INI_FETCH_RDY					230
+#define CMDQ_EVENT_VDEC1_VDEC1_EVENT_39						231
+#define CMDQ_EVENT_VDEC1_VDEC1_EVENT_40						232
+#define CMDQ_EVENT_VDEC1_VDEC1_EVENT_41						233
+#define CMDQ_EVENT_VDEC1_VDEC1_EVENT_42						234
+#define CMDQ_EVENT_VDEC1_VDEC1_EVENT_43						235
+
+#define CMDQ_EVENT_VDEC1_VDEC_LAT_GCE_CNT_OP_THR				239
+
+#define CMDQ_EVENT_IMG_IMG_EVENT_0						256
+#define CMDQ_EVENT_IMG_TRAW0_CQ_THR_DONE_TRAW0_0				257
+#define CMDQ_EVENT_IMG_TRAW0_CQ_THR_DONE_TRAW0_1				258
+#define CMDQ_EVENT_IMG_TRAW0_CQ_THR_DONE_TRAW0_2				259
+#define CMDQ_EVENT_IMG_TRAW0_CQ_THR_DONE_TRAW0_3				260
+#define CMDQ_EVENT_IMG_TRAW0_CQ_THR_DONE_TRAW0_4				261
+#define CMDQ_EVENT_IMG_TRAW0_CQ_THR_DONE_TRAW0_5				262
+#define CMDQ_EVENT_IMG_TRAW0_DMA_ERR_EVENT					263
+#define CMDQ_EVENT_IMG_TRAW0_DUMMY_0						264
+#define CMDQ_EVENT_IMG_TRAW1_CQ_THR_DONE_TRAW0_0				265
+#define CMDQ_EVENT_IMG_TRAW1_CQ_THR_DONE_TRAW0_1				266
+#define CMDQ_EVENT_IMG_TRAW1_CQ_THR_DONE_TRAW0_2				267
+#define CMDQ_EVENT_IMG_TRAW1_CQ_THR_DONE_TRAW0_3				268
+#define CMDQ_EVENT_IMG_TRAW1_CQ_THR_DONE_TRAW0_4				269
+#define CMDQ_EVENT_IMG_TRAW1_CQ_THR_DONE_TRAW0_5				270
+#define CMDQ_EVENT_IMG_TRAW1_DMA_ERR_EVENT					271
+#define CMDQ_EVENT_IMG_ADL_TILE_DONE_EVENT					272
+#define CMDQ_EVENT_IMG_ADLWR0_TILE_DONE_EVENT					273
+#define CMDQ_EVENT_IMG_ADLWR1_TILE_DONE_EVENT					274
+#define CMDQ_EVENT_IMG_IMGSYS_IPE_ME_DONE					275
+#define CMDQ_EVENT_IMG_IMGSYS_IPE_MMG_DONE					276
+#define CMDQ_EVENT_IMG_QOF_ACK_EVENT_0						277
+#define CMDQ_EVENT_IMG_QOF_ACK_EVENT_1						278
+#define CMDQ_EVENT_IMG_QOF_ACK_EVENT_2						279
+#define CMDQ_EVENT_IMG_QOF_ACK_EVENT_3						280
+#define CMDQ_EVENT_IMG_QOF_ACK_EVENT_4						281
+#define CMDQ_EVENT_IMG_QOF_ACK_EVENT_5						282
+#define CMDQ_EVENT_IMG_QOF_ACK_EVENT_6						283
+#define CMDQ_EVENT_IMG_QOF_ACK_EVENT_7						284
+#define CMDQ_EVENT_IMG_QOF_ACK_EVENT_8						285
+#define CMDQ_EVENT_IMG_QOF_ACK_EVENT_9						286
+#define CMDQ_EVENT_IMG_QOF_ACK_EVENT_10						287
+#define CMDQ_EVENT_IMG_QOF_ACK_EVENT_11						288
+#define CMDQ_EVENT_IMG_QOF_ACK_EVENT_12						289
+#define CMDQ_EVENT_IMG_QOF_ACK_EVENT_13						290
+#define CMDQ_EVENT_IMG_QOF_ACK_EVENT_14						291
+#define CMDQ_EVENT_IMG_QOF_ACK_EVENT_15						292
+#define CMDQ_EVENT_IMG_QOF_ACK_EVENT_16						293
+#define CMDQ_EVENT_IMG_QOF_ACK_EVENT_17						294
+#define CMDQ_EVENT_IMG_QOF_ACK_EVENT_18						295
+#define CMDQ_EVENT_IMG_QOF_ACK_EVENT_19						296
+#define CMDQ_EVENT_IMG_QOF_ON_EVENT_0						297
+#define CMDQ_EVENT_IMG_QOF_ON_EVENT_1						298
+#define CMDQ_EVENT_IMG_QOF_ON_EVENT_2						299
+#define CMDQ_EVENT_IMG_QOF_ON_EVENT_3						300
+#define CMDQ_EVENT_IMG_QOF_ON_EVENT_4						301
+#define CMDQ_EVENT_IMG_QOF_OFF_EVENT_0						302
+#define CMDQ_EVENT_IMG_QOF_OFF_EVENT_1						303
+#define CMDQ_EVENT_IMG_QOF_OFF_EVENT_2						304
+#define CMDQ_EVENT_IMG_QOF_OFF_EVENT_3						305
+#define CMDQ_EVENT_IMG_QOF_OFF_EVENT_4						306
+#define CMDQ_EVENT_IMG_QOF_SAVE_EVENT_0						307
+#define CMDQ_EVENT_IMG_QOF_SAVE_EVENT_1						308
+#define CMDQ_EVENT_IMG_QOF_SAVE_EVENT_2						309
+#define CMDQ_EVENT_IMG_QOF_SAVE_EVENT_3						310
+#define CMDQ_EVENT_IMG_QOF_SAVE_EVENT_4						311
+#define CMDQ_EVENT_IMG_QOF_RESTORE_EVENT_0					312
+#define CMDQ_EVENT_IMG_QOF_RESTORE_EVENT_1					313
+#define CMDQ_EVENT_IMG_QOF_RESTORE_EVENT_2					314
+#define CMDQ_EVENT_IMG_QOF_RESTORE_EVENT_3					315
+#define CMDQ_EVENT_IMG_QOF_RESTORE_EVENT_4					316
+
+#define CMDQ_EVENT_IMG_DIP_CQ_THR_DONE_P2_0					317
+#define CMDQ_EVENT_IMG_DIP_CQ_THR_DONE_P2_1					318
+#define CMDQ_EVENT_IMG_DIP_CQ_THR_DONE_P2_2					319
+#define CMDQ_EVENT_IMG_DIP_CQ_THR_DONE_P2_3					320
+#define CMDQ_EVENT_IMG_DIP_CQ_THR_DONE_P2_4					321
+#define CMDQ_EVENT_IMG_DIP_CQ_THR_DONE_P2_5					322
+#define CMDQ_EVENT_IMG_DIP_DMA_ERR_EVENT					323
+#define CMDQ_EVENT_IMG_DIP_NR_DMA_ERR_EVENT					324
+#define CMDQ_EVENT_IMG_DIP_DUMMY_0						325
+
+#define CMDQ_EVENT_IMG_WPE_EIS_GCE_FRAME_DONE					326
+#define CMDQ_EVENT_IMG_WPE_EIS_DONE_SYNC_OUT					327
+#define CMDQ_EVENT_IMG_WPE_EIS_CQ_THR_DONE_P2_0					328
+#define CMDQ_EVENT_IMG_WPE_EIS_CQ_THR_DONE_P2_1					329
+#define CMDQ_EVENT_IMG_WPE_EIS_CQ_THR_DONE_P2_2					330
+#define CMDQ_EVENT_IMG_WPE_EIS_CQ_THR_DONE_P2_3					331
+#define CMDQ_EVENT_IMG_WPE_EIS_CQ_THR_DONE_P2_4					332
+#define CMDQ_EVENT_IMG_WPE_EIS_CQ_THR_DONE_P2_5					333
+#define CMDQ_EVENT_IMG_PQDIP_A_CQ_THR_DONE_P2_0					334
+#define CMDQ_EVENT_IMG_PQDIP_A_CQ_THR_DONE_P2_1					335
+#define CMDQ_EVENT_IMG_PQDIP_A_CQ_THR_DONE_P2_2					336
+#define CMDQ_EVENT_IMG_PQDIP_A_CQ_THR_DONE_P2_3					337
+#define CMDQ_EVENT_IMG_PQDIP_A_CQ_THR_DONE_P2_4					338
+#define CMDQ_EVENT_IMG_PQDIP_A_CQ_THR_DONE_P2_5					339
+#define CMDQ_EVENT_IMG_PQA_DMA_ERR_EVENT					340
+#define CMDQ_EVENT_IMG_WPE0_DUMMY_0						341
+#define CMDQ_EVENT_IMG_WPE0_DUMMY_1						342
+#define CMDQ_EVENT_IMG_WPE0_DUMMY_2						343
+#define CMDQ_EVENT_IMG_OMC_TNR_GCE_FRAME_DONE					344
+#define CMDQ_EVENT_IMG_OMC_TNR_DONE_SYNC_OUT					345
+#define CMDQ_EVENT_IMG_OMC_TNR_CQ_THR_DONE_P2_0					346
+#define CMDQ_EVENT_IMG_OMC_TNR_CQ_THR_DONE_P2_1					347
+#define CMDQ_EVENT_IMG_OMC_TNR_CQ_THR_DONE_P2_2					348
+#define CMDQ_EVENT_IMG_OMC_TNR_CQ_THR_DONE_P2_3					349
+#define CMDQ_EVENT_IMG_OMC_TNR_CQ_THR_DONE_P2_4					350
+#define CMDQ_EVENT_IMG_OMC_TNR_CQ_THR_DONE_P2_5					351
+#define CMDQ_EVENT_IMG_PQDIP_B_CQ_THR_DONE_P2_0					352
+#define CMDQ_EVENT_IMG_PQDIP_B_CQ_THR_DONE_P2_1					353
+#define CMDQ_EVENT_IMG_PQDIP_B_CQ_THR_DONE_P2_2					354
+#define CMDQ_EVENT_IMG_PQDIP_B_CQ_THR_DONE_P2_3					355
+#define CMDQ_EVENT_IMG_PQDIP_B_CQ_THR_DONE_P2_4					356
+#define CMDQ_EVENT_IMG_PQDIP_B_CQ_THR_DONE_P2_5					357
+#define CMDQ_EVENT_IMG_PQB_DMA_ERR_EVENT					358
+#define CMDQ_EVENT_IMG_WPE1_DUMMY_0						359
+#define CMDQ_EVENT_IMG_WPE1_DUMMY_1						360
+#define CMDQ_EVENT_IMG_WPE1_DUMMY_2						361
+#define CMDQ_EVENT_IMG_WPE_LITE_GCE_FRAME_DONE					362
+#define CMDQ_EVENT_IMG_WPE_LITE_DONE_SYNC_OUT					363
+#define CMDQ_EVENT_IMG_WPE_LITE_CQ_THR_DONE_P2_0				364
+#define CMDQ_EVENT_IMG_WPE_LITE_CQ_THR_DONE_P2_1				365
+#define CMDQ_EVENT_IMG_WPE_LITE_CQ_THR_DONE_P2_2				366
+#define CMDQ_EVENT_IMG_WPE_LITE_CQ_THR_DONE_P2_3				367
+#define CMDQ_EVENT_IMG_WPE_LITE_CQ_THR_DONE_P2_4				368
+#define CMDQ_EVENT_IMG_WPE_LITE_CQ_THR_DONE_P2_5				369
+#define CMDQ_EVENT_IMG_OMC_LITE_GCE_FRAME_DONE					370
+#define CMDQ_EVENT_IMG_OMC_LITE_DONE_SYNC_OUT					371
+#define CMDQ_EVENT_IMG_OMC_LITE_CQ_THR_DONE_P2_0				372
+#define CMDQ_EVENT_IMG_OMC_LITE_CQ_THR_DONE_P2_1				373
+#define CMDQ_EVENT_IMG_OMC_LITE_CQ_THR_DONE_P2_2				374
+#define CMDQ_EVENT_IMG_OMC_LITE_CQ_THR_DONE_P2_3				375
+#define CMDQ_EVENT_IMG_OMC_LITE_CQ_THR_DONE_P2_4				376
+#define CMDQ_EVENT_IMG_OMC_LITE_CQ_THR_DONE_P2_5				377
+#define CMDQ_EVENT_IMG_WPE2_DUMMY_0						378
+#define CMDQ_EVENT_IMG_WPE2_DUMMY_1						379
+#define CMDQ_EVENT_IMG_WPE2_DUMMY_2						380
+#define CMDQ_EVENT_IMG_IMGSYS_IPE_FDVT0_DONE					381
+#define CMDQ_EVENT_IMG_IMG_EVENT_126						382
+#define CMDQ_EVENT_IMG_IMG_EVENT_127						383
+
+#define CMDQ_EVENT_CAM_CAM_EVENT_0						384
+#define CMDQ_EVENT_CAM_CAM_SUBA_SW_PASS1_DONE					385
+#define CMDQ_EVENT_CAM_CAM_SUBB_SW_PASS1_DONE					386
+#define CMDQ_EVENT_CAM_CAM_SUBC_SW_PASS1_DONE					387
+#define CMDQ_EVENT_CAM_CAM_SUBA_TFMR_PASS1_DONE					388
+#define CMDQ_EVENT_CAM_CAM_SUBB_TFMR_PASS1_DONE					389
+#define CMDQ_EVENT_CAM_CAM_SUBC_TFMR_PASS1_DONE					390
+#define CMDQ_EVENT_CAM_CAMSV_A_SW_PASS1_DONE_0					391
+#define CMDQ_EVENT_CAM_CAMSV_A_SW_PASS1_DONE_1					392
+#define CMDQ_EVENT_CAM_CAMSV_A_SW_PASS1_DONE_2					393
+#define CMDQ_EVENT_CAM_CAMSV_A_SW_PASS1_DONE_3					394
+#define CMDQ_EVENT_CAM_CAMSV_B_SW_PASS1_DONE_0					395
+#define CMDQ_EVENT_CAM_CAMSV_B_SW_PASS1_DONE_1					396
+#define CMDQ_EVENT_CAM_CAMSV_B_SW_PASS1_DONE_2					397
+#define CMDQ_EVENT_CAM_CAMSV_B_SW_PASS1_DONE_3					398
+#define CMDQ_EVENT_CAM_CAMSV_C_SW_PASS1_DONE_0					399
+#define CMDQ_EVENT_CAM_CAMSV_C_SW_PASS1_DONE_1					400
+#define CMDQ_EVENT_CAM_CAMSV_C_SW_PASS1_DONE_2					401
+#define CMDQ_EVENT_CAM_CAMSV_C_SW_PASS1_DONE_3					402
+#define CMDQ_EVENT_CAM_CAMSV_D_SW_PASS1_DONE_0					403
+#define CMDQ_EVENT_CAM_CAMSV_D_SW_PASS1_DONE_1					404
+#define CMDQ_EVENT_CAM_CAMSV_D_SW_PASS1_DONE_2					405
+#define CMDQ_EVENT_CAM_CAMSV_D_SW_PASS1_DONE_3					406
+#define CMDQ_EVENT_CAM_CAMSV_E_SW_PASS1_DONE_0					407
+#define CMDQ_EVENT_CAM_CAMSV_E_SW_PASS1_DONE_1					408
+#define CMDQ_EVENT_CAM_CAMSV_E_SW_PASS1_DONE_2					409
+#define CMDQ_EVENT_CAM_CAMSV_E_SW_PASS1_DONE_3					410
+#define CMDQ_EVENT_CAM_CAMSV_F_SW_PASS1_DONE_0					411
+#define CMDQ_EVENT_CAM_CAMSV_F_SW_PASS1_DONE_1					412
+#define CMDQ_EVENT_CAM_CAMSV_F_SW_PASS1_DONE_2					413
+#define CMDQ_EVENT_CAM_CAMSV_F_SW_PASS1_DONE_3					414
+#define CMDQ_EVENT_CAM_MRAW0_SW_PASS1_DONE					415
+#define CMDQ_EVENT_CAM_MRAW1_SW_PASS1_DONE					416
+#define CMDQ_EVENT_CAM_MRAW2_SW_PASS1_DONE					417
+#define CMDQ_EVENT_CAM_MRAW3_SW_PASS1_DONE					418
+#define CMDQ_EVENT_CAM_UISP_SW_PASS1_DONE					419
+#define CMDQ_EVENT_CAM_TG_MRAW0_OUT_SOF						420
+#define CMDQ_EVENT_CAM_TG_MRAW1_OUT_SOF						421
+#define CMDQ_EVENT_CAM_TG_MRAW2_OUT_SOF						422
+#define CMDQ_EVENT_CAM_TG_MRAW3_OUT_SOF						423
+#define CMDQ_EVENT_CAM_PDA0_IRQO_EVENT_DONE_D1					424
+#define CMDQ_EVENT_CAM_PDA1_IRQO_EVENT_DONE_D1					425
+
+#define CMDQ_EVENT_CAM_DPE_DVP_CMQ_EVENT					426
+#define CMDQ_EVENT_CAM_DPE_DVS_CMQ_EVENT					427
+#define CMDQ_EVENT_CAM_DPE_DVFG_CMQ_EVENT					428
+#define CMDQ_EVENT_CAM_CAM_EVENT_45						429
+#define CMDQ_EVENT_CAM_CAM_EVENT_46						430
+#define CMDQ_EVENT_CAM_CAM_EVENT_47						431
+#define CMDQ_EVENT_CAM_CAM_EVENT_48						432
+#define CMDQ_EVENT_CAM_CAM_SUBA_TG_INT1						433
+#define CMDQ_EVENT_CAM_CAM_SUBA_TG_INT2						434
+#define CMDQ_EVENT_CAM_CAM_SUBA_TG_INT3						435
+#define CMDQ_EVENT_CAM_CAM_SUBA_TG_INT4						436
+#define CMDQ_EVENT_CAM_CAM_SUBB_TG_INT1						437
+#define CMDQ_EVENT_CAM_CAM_SUBB_TG_INT2						438
+#define CMDQ_EVENT_CAM_CAM_SUBB_TG_INT3						439
+#define CMDQ_EVENT_CAM_CAM_SUBB_TG_INT4						440
+#define CMDQ_EVENT_CAM_CAM_SUBC_TG_INT1						441
+#define CMDQ_EVENT_CAM_CAM_SUBC_TG_INT2						442
+#define CMDQ_EVENT_CAM_CAM_SUBC_TG_INT3						443
+#define CMDQ_EVENT_CAM_CAM_SUBC_TG_INT4						444
+#define CMDQ_EVENT_CAM_RAW_O_SOF_SUBA						445
+#define CMDQ_EVENT_CAM_RAW_O_SOF_SUBB						446
+#define CMDQ_EVENT_CAM_RAW_O_SOF_SUBC						447
+#define CMDQ_EVENT_CAM_TFMR_RAW_O_SOF_SUBA					448
+#define CMDQ_EVENT_CAM_TFMR_RAW_O_SOF_SUBB					449
+#define CMDQ_EVENT_CAM_TFMR_RAW_O_SOF_SUBC					450
+#define CMDQ_EVENT_CAM_RAW_SEL_SOF_UISP						451
+#define CMDQ_EVENT_CAM_CAM_SUBA_RING_BUFFER_OVERFLOW_INT_IN			452
+#define CMDQ_EVENT_CAM_CAM_SUBB_RING_BUFFER_OVERFLOW_INT_IN			453
+#define CMDQ_EVENT_CAM_CAM_SUBC_RING_BUFFER_OVERFLOW_INT_IN			454
+#define CMDQ_EVENT_CAM_CAM_EVENT_71						455
+#define CMDQ_EVENT_CAM_ADL_WR_FRAME_DONE					456
+#define CMDQ_EVENT_CAM_ADL_RD_FRAME_DONE					457
+#define CMDQ_EVENT_CAM_QOF_RAWA_POWER_ON_EVENT					458
+#define CMDQ_EVENT_CAM_QOF_RAWB_POWER_ON_EVENT					459
+#define CMDQ_EVENT_CAM_QOF_RAWC_POWER_ON_EVENT					460
+#define CMDQ_EVENT_CAM_QOF_RAWA_POWER_OFF_EVENT					461
+#define CMDQ_EVENT_CAM_QOF_RAWB_POWER_OFF_EVENT					462
+#define CMDQ_EVENT_CAM_QOF_RAWC_POWER_OFF_EVENT					463
+#define CMDQ_EVENT_CAM_QOF_RAWA_SAVE_EVENT					464
+#define CMDQ_EVENT_CAM_QOF_RAWB_SAVE_EVENT					465
+#define CMDQ_EVENT_CAM_QOF_RAWC_SAVE_EVENT					466
+#define CMDQ_EVENT_CAM_QOF_RAWA_RESTORE_EVENT					467
+#define CMDQ_EVENT_CAM_QOF_RAWB_RESTORE_EVENT					468
+#define CMDQ_EVENT_CAM_QOF_RAWC_RESTORE_EVENT					469
+#define CMDQ_EVENT_CAM_QOF_CAM_EVENT_0						470
+#define CMDQ_EVENT_CAM_QOF_CAM_EVENT_1						471
+#define CMDQ_EVENT_CAM_QOF_CAM_EVENT_2						472
+#define CMDQ_EVENT_CAM_QOF_CAM_EVENT_3						473
+#define CMDQ_EVENT_CAM_QOF_CAM_EVENT_4						474
+#define CMDQ_EVENT_CAM_QOF_CAM_EVENT_5						475
+#define CMDQ_EVENT_CAM_QOF_CAM_EVENT_6						476
+#define CMDQ_EVENT_CAM_QOF_CAM_EVENT_7						477
+#define CMDQ_EVENT_CAM_QOF_CAM_EVENT_8						478
+#define CMDQ_EVENT_CAM_QOF_CAM_EVENT_9						479
+#define CMDQ_EVENT_CAM_QOF_CAM_EVENT_10						480
+#define CMDQ_EVENT_CAM_QOF_CAM_EVENT_11						481
+#define CMDQ_EVENT_CAM_SENINF_CFG_DONE_EVENT_0					482
+#define CMDQ_EVENT_CAM_SENINF_CFG_DONE_EVENT_1					483
+#define CMDQ_EVENT_CAM_SENINF_CFG_DONE_EVENT_2					484
+#define CMDQ_EVENT_CAM_SENINF_CFG_DONE_EVENT_3					485
+#define CMDQ_EVENT_CAM_SENINF_CFG_DONE_EVENT_4					486
+#define CMDQ_EVENT_CAM_SENINF_CFG_DONE_EVENT_5					487
+#define CMDQ_EVENT_CAM_SENINF_CFG_DONE_EVENT_6					488
+#define CMDQ_EVENT_CAM_SENINF_CFG_DONE_EVENT_7					489
+#define CMDQ_EVENT_CAM_SENINF_CFG_DONE_EVENT_8					490
+#define CMDQ_EVENT_CAM_SENINF_CFG_DONE_EVENT_9					491
+#define CMDQ_EVENT_CAM_SENINF_CFG_DONE_EVENT_10					492
+#define CMDQ_EVENT_CAM_SENINF_CFG_DONE_EVENT_11					493
+#define CMDQ_EVENT_CAM_SENINF_CFG_DONE_EVENT_12					494
+#define CMDQ_EVENT_CAM_SENINF_CFG_DONE_EVENT_13					495
+#define CMDQ_EVENT_CAM_CCU0_TO_GCE_NON_SEC_IRQ					496
+#define CMDQ_EVENT_CAM_CCU0_TO_GCE_SEC_IRQ					497
+#define CMDQ_EVENT_CAM_CCU0_TO_GCE_VM_IRQ					498
+#define CMDQ_EVENT_CAM_CCU0_TO_GCE_EXCH_VM_IRQ					499
+#define CMDQ_EVENT_CAM_CCU1_TO_GCE_NON_SEC_IRQ					500
+#define CMDQ_EVENT_CAM_CCU1_TO_GCE_SEC_IRQ					501
+#define CMDQ_EVENT_CAM_CCU1_TO_GCE_VM_IRQ					502
+#define CMDQ_EVENT_CAM_CCU1_TO_GCE_EXCH_VM_IRQ					503
+#define CMDQ_EVENT_CAM_I2C_CH2_EVENT_0						504
+#define CMDQ_EVENT_CAM_I2C_CH2_EVENT_1						505
+#define CMDQ_EVENT_CAM_I2C_CH2_EVENT_2						506
+#define CMDQ_EVENT_CAM_I2C_CH2_EVENT_3						507
+#define CMDQ_EVENT_CAM_I2C_CH2_EVENT_4						508
+#define CMDQ_EVENT_CAM_CAM_EVENT_125						509
+#define CMDQ_EVENT_CAM_CAM_EVENT_126						510
+#define CMDQ_EVENT_CAM_CAM_EVENT_127						511
+
+#define CMDQ_EVENT_SMI_EVENT_MMINFRA_SMI_MMSRAM_COMM_SMIASSER			898
+#define CMDQ_EVENT_SMI_EVENT_MMINFRA_SMI_MDP_COMM_SMIASSER			899
+#define CMDQ_EVENT_SMI_EVENT_MMINFRA_SMI_DISP_COMM_SMIASSER			900
+
+#define CMDQ_MAX_HW_EVENT							512
+/* End of hardware event and begin of software token */
+
+/*
+ * CMDQ software tokens:
+ * The following are GCE software tokens, which can be used by clients
+ * event to operate API.
+ */
+
+/* Begin of GCE-D software token */
+/* MML software tokens */
+#define CMDQ_SYNC_TOKEN_MML_BUFA			630
+#define CMDQ_SYNC_TOKEN_MML_BUFB			631
+#define CMDQ_SYNC_TOKEN_MML_BUF_NEXT			632
+#define CMDQ_SYNC_TOKEN_MML_IR_MML_READY		633
+#define CMDQ_SYNC_TOKEN_MML_IR_DISP_READY		634
+#define CMDQ_SYNC_TOKEN_MML_MML_STOP			635
+#define CMDQ_SYNC_TOKEN_MML_PIPE0			636
+#define CMDQ_SYNC_TOKEN_MML_PIPE1			637
+#define CMDQ_SYNC_TOKEN_MML_PIPE1_NEXT			638
+#define CMDQ_SYNC_TOKEN_MML_APU_START			639
+
+/* Config thread notify trigger thread */
+#define CMDQ_SYNC_TOKEN_CONFIG_DIRTY			640
+/* Trigger thread notify config thread */
+#define CMDQ_SYNC_TOKEN_STREAM_EOF			641
+/* Block Trigger thread until the ESD check finishes */
+#define CMDQ_SYNC_TOKEN_ESD_EOF				642
+#define CMDQ_SYNC_TOKEN_STREAM_BLOCK			643
+/* Check CABC setup finish */
+#define CMDQ_SYNC_TOKEN_CABC_EOF			644
+
+/* VFP period token for Msync */
+#define CMDQ_SYNC_TOKEN_VFP_PERIOD			645
+/* Software sync token for dual display */
+#define CMDQ_SYNC_TOKEN_CONFIG_DIRTY_1			694
+#define CMDQ_SYNC_TOKEN_STREAM_EOF_1			695
+#define CMDQ_SYNC_TOKEN_ESD_EOF_1			696
+#define CMDQ_SYNC_TOKEN_STREAM_BLOCK_1			697
+#define CMDQ_SYNC_TOKEN_CABC_EOF_1			698
+
+/*
+ * GPR access tokens (for HW register backup)
+ * There are 15 32-bit GPR, form 3 GPR as a set
+ * (64-bit for address, 32-bit for value)
+ */
+#define CMDQ_SYNC_TOKEN_GPR_SET_0			700
+#define CMDQ_SYNC_TOKEN_GPR_SET_1			701
+#define CMDQ_SYNC_TOKEN_GPR_SET_2			702
+#define CMDQ_SYNC_TOKEN_GPR_SET_3			703
+#define CMDQ_SYNC_TOKEN_GPR_SET_4			704
+
+#define CMDQ_SYNC_TOKEN_TE_0				705
+#define CMDQ_SYNC_TOKEN_PREFETCH_TE_0			706
+#define CMDQ_SYNC_TOKEN_VIDLE_POWER_ON			707
+#define CMDQ_SYNC_TOKEN_CHECK_TRIGGER_MERGE		708
+
+/* Resource lock event to control resource in GCE thread */
+#define CMDQ_SYNC_RESOURCE_WROT0			710
+#define CMDQ_SYNC_RESOURCE_WROT1			711
+
+/* Hardware TRACE software token */
+#define CMDQ_SYNC_TOKEN_HW_TRACE_WAIT			712
+#define CMDQ_SYNC_TOKEN_HW_TRACE_LOCK			713
+
+/* Software sync token for dual display */
+#define CMDQ_SYNC_TOKEN_CONFIG_DIRTY_3			714
+#define CMDQ_SYNC_TOKEN_STREAM_EOF_3			715
+#define CMDQ_SYNC_TOKEN_ESD_EOF_3			716
+#define CMDQ_SYNC_TOKEN_STREAM_BLOCK_3			717
+#define CMDQ_SYNC_TOKEN_CABC_EOF_3			718
+/* End of GCE-D software token */
+
+/* Begin of GCE-M software token */
+/* IMGSYS_POOL */
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_1			514
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_2			515
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_3			516
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_4			517
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_5			518
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_6			519
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_7			520
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_8			521
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_9			522
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_10			523
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_11			524
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_12			525
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_13			526
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_14			527
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_15			528
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_16			529
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_17			530
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_18			531
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_19			532
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_20			533
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_21			534
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_22			535
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_23			536
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_24			537
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_25			538
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_26			539
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_27			540
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_28			541
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_29			542
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_30			543
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_31			544
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_32			545
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_33			546
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_34			547
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_35			548
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_36			549
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_37			550
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_38			551
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_39			552
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_40			553
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_41			554
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_42			555
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_43			556
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_44			557
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_45			558
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_46			559
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_47			560
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_48			561
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_49			562
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_50			563
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_51			564
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_52			565
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_53			566
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_54			567
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_55			568
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_56			569
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_57			570
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_58			571
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_59			572
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_60			573
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_61			574
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_62			575
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_63			576
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_64			577
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_65			578
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_66			579
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_67			580
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_68			581
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_69			582
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_70			583
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_71			584
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_72			585
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_73			586
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_74			587
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_75			588
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_76			589
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_77			590
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_78			591
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_79			592
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_80			593
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_81			594
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_82			595
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_83			596
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_84			597
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_85			598
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_86			599
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_87			600
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_88			601
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_89			602
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_90			603
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_91			604
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_92			605
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_93			606
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_94			607
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_95			608
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_96			609
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_97			610
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_98			611
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_99			612
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_100			613
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_101			614
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_102			615
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_103			616
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_104			617
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_105			618
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_106			619
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_107			620
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_108			621
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_109			622
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_110			623
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_111			624
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_112			625
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_113			626
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_114			627
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_115			628
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_116			629
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_117			630
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_118			631
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_119			632
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_120			633
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_121			634
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_122			635
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_123			636
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_124			637
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_125			638
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_126			639
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_127			640
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_128			641
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_129			642
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_130			643
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_131			644
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_132			645
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_133			646
+
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_134			694
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_135			695
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_136			696
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_137			697
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_138			698
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_139			699
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_140			700
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_141			701
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_142			702
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_143			703
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_144			704
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_145			705
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_146			706
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_147			707
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_148			708
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_149			709
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_150			710
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_151			711
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_152			714
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_153			715
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_154			716
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_155			717
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_156			718
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_157			719
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_158			720
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_159			721
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_160			722
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_161			723
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_162			724
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_163			725
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_164			726
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_165			727
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_166			728
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_167			729
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_168			730
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_169			731
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_170			732
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_171			733
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_172			734
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_173			735
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_174			736
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_175			737
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_176			738
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_177			739
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_178			740
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_179			741
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_180			742
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_181			743
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_182			744
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_183			745
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_184			746
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_185			747
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_186			748
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_187			749
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_188			750
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_189			751
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_190			752
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_191			753
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_192			754
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_193			755
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_194			756
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_195			757
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_196			758
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_197			759
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_198			760
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_199			761
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_200			762
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_201			763
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_202			764
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_203			765
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_204			766
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_205			767
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_206			784
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_207			785
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_208			786
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_209			787
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_210			788
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_211			789
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_212			790
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_213			791
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_214			792
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_215			793
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_216			794
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_217			795
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_218			796
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_219			797
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_220			798
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_221			799
+
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_222			833
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_223			834
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_224			835
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_225			836
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_226			837
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_227			838
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_228			839
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_229			840
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_230			841
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_231			842
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_232			843
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_233			844
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_234			845
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_235			846
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_236			847
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_237			848
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_238			849
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_239			850
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_240			851
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_241			852
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_242			853
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_243			854
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_244			855
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_245			856
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_246			857
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_247			858
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_248			859
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_249			860
+#define	CMDQ_SYNC_TOKEN_IMGSYS_POOL_250			861
+
+#define CMDQ_SYNC_TOKEN_IMGSYS_POOL_251			901
+#define CMDQ_SYNC_TOKEN_IMGSYS_POOL_252			902
+#define CMDQ_SYNC_TOKEN_IMGSYS_POOL_253			903
+#define CMDQ_SYNC_TOKEN_IMGSYS_POOL_254			904
+#define CMDQ_SYNC_TOKEN_IMGSYS_POOL_255			905
+#define CMDQ_SYNC_TOKEN_IMGSYS_POOL_256			906
+#define CMDQ_SYNC_TOKEN_IMGSYS_POOL_257			907
+#define CMDQ_SYNC_TOKEN_IMGSYS_POOL_258			908
+#define CMDQ_SYNC_TOKEN_IMGSYS_POOL_259			909
+#define CMDQ_SYNC_TOKEN_IMGSYS_POOL_260			910
+#define CMDQ_SYNC_TOKEN_IMGSYS_POOL_261			911
+#define CMDQ_SYNC_TOKEN_IMGSYS_POOL_262			912
+#define CMDQ_SYNC_TOKEN_IMGSYS_POOL_263			913
+#define CMDQ_SYNC_TOKEN_IMGSYS_POOL_264			914
+#define CMDQ_SYNC_TOKEN_IMGSYS_POOL_265			915
+#define CMDQ_SYNC_TOKEN_IMGSYS_POOL_266			916
+#define CMDQ_SYNC_TOKEN_IMGSYS_POOL_267			917
+#define CMDQ_SYNC_TOKEN_IMGSYS_POOL_268			918
+#define CMDQ_SYNC_TOKEN_IMGSYS_POOL_269			919
+#define CMDQ_SYNC_TOKEN_IMGSYS_POOL_270			920
+#define CMDQ_SYNC_TOKEN_IMGSYS_POOL_271			921
+#define CMDQ_SYNC_TOKEN_IMGSYS_POOL_272			922
+#define CMDQ_SYNC_TOKEN_IMGSYS_POOL_273			923
+#define CMDQ_SYNC_TOKEN_IMGSYS_POOL_274			924
+#define CMDQ_SYNC_TOKEN_IMGSYS_POOL_275			925
+#define CMDQ_SYNC_TOKEN_IMGSYS_POOL_276			926
+#define CMDQ_SYNC_TOKEN_IMGSYS_POOL_277			927
+#define CMDQ_SYNC_TOKEN_IMGSYS_POOL_278			928
+#define CMDQ_SYNC_TOKEN_IMGSYS_POOL_279			929
+#define CMDQ_SYNC_TOKEN_IMGSYS_POOL_280			930
+#define CMDQ_SYNC_TOKEN_IMGSYS_POOL_281			931
+#define CMDQ_SYNC_TOKEN_IMGSYS_POOL_282			932
+#define CMDQ_SYNC_TOKEN_IMGSYS_POOL_283			933
+#define CMDQ_SYNC_TOKEN_IMGSYS_POOL_284			934
+#define CMDQ_SYNC_TOKEN_IMGSYS_POOL_285			935
+#define CMDQ_SYNC_TOKEN_IMGSYS_POOL_286			936
+#define CMDQ_SYNC_TOKEN_IMGSYS_POOL_287			937
+#define CMDQ_SYNC_TOKEN_IMGSYS_POOL_288			938
+#define CMDQ_SYNC_TOKEN_IMGSYS_POOL_289			939
+#define CMDQ_SYNC_TOKEN_IMGSYS_POOL_290			940
+#define CMDQ_SYNC_TOKEN_IMGSYS_POOL_291			941
+#define CMDQ_SYNC_TOKEN_IMGSYS_POOL_292			942
+#define CMDQ_SYNC_TOKEN_IMGSYS_POOL_293			943
+#define CMDQ_SYNC_TOKEN_IMGSYS_POOL_294			944
+#define CMDQ_SYNC_TOKEN_IMGSYS_POOL_295			945
+#define CMDQ_SYNC_TOKEN_IMGSYS_POOL_296			946
+#define CMDQ_SYNC_TOKEN_IMGSYS_POOL_297			947
+#define CMDQ_SYNC_TOKEN_IMGSYS_POOL_298			948
+#define CMDQ_SYNC_TOKEN_IMGSYS_POOL_299			949
+#define CMDQ_SYNC_TOKEN_IMGSYS_POOL_300			950
+
+/* ISP software token */
+#define CMDQ_SYNC_TOKEN_IMGSYS_WPE_EIS			665
+#define CMDQ_SYNC_TOKEN_IMGSYS_OMC_TNR			666
+#define CMDQ_SYNC_TOKEN_IMGSYS_WPE_LITE			667
+#define CMDQ_SYNC_TOKEN_IMGSYS_TRAW			668
+#define CMDQ_SYNC_TOKEN_IMGSYS_LTRAW			669
+#define CMDQ_SYNC_TOKEN_IMGSYS_XTRAW			670
+#define CMDQ_SYNC_TOKEN_IMGSYS_DIP			671
+#define CMDQ_SYNC_TOKEN_IMGSYS_PQDIP_A			672
+#define CMDQ_SYNC_TOKEN_IMGSYS_PQDIP_B			673
+#define CMDQ_SYNC_TOKEN_IPESYS_ME			674
+#define CMDQ_SYNC_TOKEN_APUSYS_APU			675
+#define CMDQ_SYNC_TOKEN_IMGSYS_VSS_TRAW			676
+#define CMDQ_SYNC_TOKEN_IMGSYS_VSS_LTRAW		677
+#define CMDQ_SYNC_TOKEN_IMGSYS_VSS_XTRAW		678
+#define CMDQ_SYNC_TOKEN_IMGSYS_VSS_DIP			679
+#define CMDQ_SYNC_TOKEN_IMGSYS_OMC_LITE			680
+
+/* IMG software token for QoS */
+#define CMDQ_SYNC_TOKEN_IMGSYS_QOS_LOCK			800
+/* IMG software token for Qof */
+#define CMDQ_SYNC_TOKEN_DIP_POWER_CTRL			862
+#define CMDQ_SYNC_TOKEN_DIP_TRIG_PWR_ON			863
+#define CMDQ_SYNC_TOKEN_DIP_PWR_ON			864
+#define CMDQ_SYNC_TOKEN_DIP_TRIG_PWR_OFF		865
+#define CMDQ_SYNC_TOKEN_DIP_PWR_OFF			866
+#define CMDQ_SYNC_TOKEN_DIP_PWR_HAND_SHAKE		867
+
+#define CMDQ_SYNC_TOKEN_TRAW_POWER_CTRL			868
+#define CMDQ_SYNC_TOKEN_TRAW_TRIG_PWR_ON		869
+#define CMDQ_SYNC_TOKEN_TRAW_PWR_ON			870
+#define CMDQ_SYNC_TOKEN_TRAW_TRIG_PWR_OFF		871
+#define CMDQ_SYNC_TOKEN_TRAW_PWR_OFF			872
+#define CMDQ_SYNC_TOKEN_TRAW_PWR_HAND_SHAKE		873
+/* End of GCE-M software token */
+
+/* Begin of common software token */
+
+/*
+ * Notify normal CMDQ there are some secure task done
+ * MUST NOT CHANGE, this token sync with secure world
+ */
+#define CMDQ_SYNC_SECURE_THR_EOF			647
+
+/* CMDQ use software token */
+#define CMDQ_SYNC_TOKEN_USER_0				649
+#define CMDQ_SYNC_TOKEN_USER_1				650
+#define CMDQ_SYNC_TOKEN_POLL_MONITOR			651
+#define CMDQ_SYNC_TOKEN_TPR_LOCK			652
+
+/* TZMP software token */
+#define CMDQ_SYNC_TOKEN_TZMP_DISP_WAIT			653
+#define CMDQ_SYNC_TOKEN_TZMP_DISP_SET			654
+#define CMDQ_SYNC_TOKEN_TZMP_ISP_WAIT			655
+#define CMDQ_SYNC_TOKEN_TZMP_ISP_SET			656
+#define CMDQ_SYNC_TOKEN_TZMP_AIE_WAIT			657
+#define CMDQ_SYNC_TOKEN_TZMP_AIE_SET			658
+#define CMDQ_SYNC_TOKEN_TZMP_ADL_WAIT			659
+#define CMDQ_SYNC_TOKEN_TZMP_ADL_SET			660
+
+/* PREBUILT software token */
+#define CMDQ_SYNC_TOKEN_PREBUILT_MDP_LOCK		682
+#define CMDQ_SYNC_TOKEN_PREBUILT_MML_LOCK		685
+#define CMDQ_SYNC_TOKEN_PREBUILT_VFMT_LOCK		688
+#define CMDQ_SYNC_TOKEN_PREBUILT_DISP_LOCK		691
+#define CMDQ_SYNC_TOKEN_DISP_VA_START			692
+#define CMDQ_SYNC_TOKEN_DISP_VA_END			693
+
+/* Event for GPR timer, used in sleep and poll with timeout */
+#define CMDQ_TOKEN_GPR_TIMER_R0				994
+#define CMDQ_TOKEN_GPR_TIMER_R1				995
+#define CMDQ_TOKEN_GPR_TIMER_R2				996
+#define CMDQ_TOKEN_GPR_TIMER_R3				997
+#define CMDQ_TOKEN_GPR_TIMER_R4				998
+#define CMDQ_TOKEN_GPR_TIMER_R5				999
+#define CMDQ_TOKEN_GPR_TIMER_R6				1000
+#define CMDQ_TOKEN_GPR_TIMER_R7				1001
+#define CMDQ_TOKEN_GPR_TIMER_R8				1002
+#define CMDQ_TOKEN_GPR_TIMER_R9				1003
+#define CMDQ_TOKEN_GPR_TIMER_R10			1004
+#define CMDQ_TOKEN_GPR_TIMER_R11			1005
+#define CMDQ_TOKEN_GPR_TIMER_R12			1006
+#define CMDQ_TOKEN_GPR_TIMER_R13			1007
+#define CMDQ_TOKEN_GPR_TIMER_R14			1008
+#define CMDQ_TOKEN_GPR_TIMER_R15			1009
+/* End of common software token */
+/* CMDQ software tokens END */
+
+#endif
-- 
2.43.0


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

* [PATCH v3 2/7] mailbox: mtk-cmdq: Add driver data to support for MT8196
  2024-12-19 17:07 [PATCH v3 0/7] Add GCE support for MT8196 Jason-JH.Lin
  2024-12-19 17:07 ` [PATCH v3 1/7] dt-bindings: mailbox: mediatek: Add MT8196 support for gce-mailbox Jason-JH.Lin
@ 2024-12-19 17:07 ` Jason-JH.Lin
  2024-12-19 17:07 ` [PATCH v3 3/7] soc: mediatek: mtk-cmdq: Add pa_base parsing for unsupported subsys ID hardware Jason-JH.Lin
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 21+ messages in thread
From: Jason-JH.Lin @ 2024-12-19 17:07 UTC (permalink / raw)
  To: Jassi Brar, Chun-Kuang Hu, AngeloGioacchino Del Regno,
	Rob Herring, Krzysztof Kozlowski, Conor Dooley, Matthias Brugger,
	Mauro Carvalho Chehab
  Cc: David Airlie, Simona Vetter, linux-kernel, devicetree, dri-devel,
	linux-mediatek, linux-arm-kernel, linux-media, Jason-JH . Lin,
	Singo Chang, Nancy Lin, Moudy Ho, Xavier Chang,
	Project_Global_Chrome_Upstream_Group

MT8196 has 3 new hardware configuration compared with the previous SoC,
which correspond to the 3 new driver data:

1. mminfra_offset: For GCE data plane control
   Since GCE has been moved into mminfra, GCE needs to append the
   mminfra offset to the DRAM address when accessing the DRAM.

2. gce_vm: For GCE hardware virtualization
   Currently, the first version of the mt8196 mailbox controller only
   requires setting the VM-related registers to enable the permissions
   of a host VM.

3. dma_mask_bit: For dma address bit control
   In order to avoid the hardware limitations of MT8196 accessing DRAM,
   GCE needs to configure the DMA address to be less than 35 bits.

Signed-off-by: Jason-JH.Lin <jason-jh.lin@mediatek.com>
---
 drivers/mailbox/mtk-cmdq-mailbox.c       | 90 +++++++++++++++++++++---
 include/linux/mailbox/mtk-cmdq-mailbox.h |  2 +
 2 files changed, 84 insertions(+), 8 deletions(-)

diff --git a/drivers/mailbox/mtk-cmdq-mailbox.c b/drivers/mailbox/mtk-cmdq-mailbox.c
index d186865b8dce..442ccd332d5f 100644
--- a/drivers/mailbox/mtk-cmdq-mailbox.c
+++ b/drivers/mailbox/mtk-cmdq-mailbox.c
@@ -43,6 +43,17 @@
 #define GCE_CTRL_BY_SW				GENMASK(2, 0)
 #define GCE_DDR_EN				GENMASK(18, 16)
 
+#define GCE_VM_ID_MAP0			0x5018
+#define GCE_VM_MAP0_ALL_HOST			GENMASK(29, 0)
+#define GCE_VM_ID_MAP1			0x501c
+#define GCE_VM_MAP1_ALL_HOST			GENMASK(29, 0)
+#define GCE_VM_ID_MAP2			0x5020
+#define GCE_VM_MAP2_ALL_HOST			GENMASK(29, 0)
+#define GCE_VM_ID_MAP3			0x5024
+#define GCE_VM_MAP3_ALL_HOST			GENMASK(5, 0)
+#define GCE_VM_CPR_GSIZE		0x50c4
+#define GCE_VM_CPR_GSIZE_HSOT			GENMASK(3, 0)
+
 #define CMDQ_THR_ACTIVE_SLOT_CYCLES	0x3200
 #define CMDQ_THR_ENABLED		0x1
 #define CMDQ_THR_DISABLED		0x0
@@ -87,11 +98,24 @@ struct cmdq {
 struct gce_plat {
 	u32 thread_nr;
 	u8 shift;
+	dma_addr_t mminfra_offset;
 	bool control_by_sw;
 	bool sw_ddr_en;
+	bool gce_vm;
+	u32 dma_mask_bit;
 	u32 gce_num;
 };
 
+static inline u32 cmdq_reg_shift_addr(u32 addr, const struct gce_plat *pdata)
+{
+	return ((addr + pdata->mminfra_offset) >> pdata->shift);
+}
+
+static inline u32 cmdq_reg_revert_addr(u32 addr, const struct gce_plat *pdata)
+{
+	return ((addr << pdata->shift) - pdata->mminfra_offset);
+}
+
 static void cmdq_sw_ddr_enable(struct cmdq *cmdq, bool enable)
 {
 	WARN_ON(clk_bulk_enable(cmdq->pdata->gce_num, cmdq->clocks));
@@ -112,6 +136,30 @@ u8 cmdq_get_shift_pa(struct mbox_chan *chan)
 }
 EXPORT_SYMBOL(cmdq_get_shift_pa);
 
+dma_addr_t cmdq_get_offset_pa(struct mbox_chan *chan)
+{
+	struct cmdq *cmdq = container_of(chan->mbox, struct cmdq, mbox);
+
+	return cmdq->pdata->mminfra_offset;
+}
+EXPORT_SYMBOL(cmdq_get_offset_pa);
+
+bool cmdq_addr_need_offset(struct mbox_chan *chan, dma_addr_t addr)
+{
+	struct cmdq *cmdq = container_of(chan->mbox, struct cmdq, mbox);
+
+	if (cmdq->pdata->mminfra_offset == 0)
+		return false;
+
+	/*
+	 * mminfra will recognize the addr that greater than the mminfra_offset
+	 * as a transaction to DRAM.
+	 * So the caller needs to append mminfra_offset for the true case.
+	 */
+	return (addr >= cmdq->pdata->mminfra_offset);
+}
+EXPORT_SYMBOL(cmdq_addr_need_offset);
+
 static int cmdq_thread_suspend(struct cmdq *cmdq, struct cmdq_thread *thread)
 {
 	u32 status;
@@ -143,6 +191,17 @@ static void cmdq_init(struct cmdq *cmdq)
 	u32 gctl_regval = 0;
 
 	WARN_ON(clk_bulk_enable(cmdq->pdata->gce_num, cmdq->clocks));
+
+	if (cmdq->pdata->gce_vm) {
+		/* config cpr size for host vm */
+		writel(GCE_VM_CPR_GSIZE_HSOT, cmdq->base + GCE_VM_CPR_GSIZE);
+		/* config CPR_GSIZE before setting VM_ID_MAP to avoid data leakage */
+		writel(GCE_VM_MAP0_ALL_HOST, cmdq->base + GCE_VM_ID_MAP0);
+		writel(GCE_VM_MAP1_ALL_HOST, cmdq->base + GCE_VM_ID_MAP1);
+		writel(GCE_VM_MAP2_ALL_HOST, cmdq->base + GCE_VM_ID_MAP2);
+		writel(GCE_VM_MAP3_ALL_HOST, cmdq->base + GCE_VM_ID_MAP3);
+	}
+
 	if (cmdq->pdata->control_by_sw)
 		gctl_regval = GCE_CTRL_BY_SW;
 	if (cmdq->pdata->sw_ddr_en)
@@ -199,7 +258,7 @@ static void cmdq_task_insert_into_thread(struct cmdq_task *task)
 				prev_task->pkt->cmd_buf_size, DMA_TO_DEVICE);
 	prev_task_base[CMDQ_NUM_CMD(prev_task->pkt) - 1] =
 		(u64)CMDQ_JUMP_BY_PA << 32 |
-		(task->pa_base >> task->cmdq->pdata->shift);
+		cmdq_reg_shift_addr(task->pa_base, task->cmdq->pdata);
 	dma_sync_single_for_device(dev, prev_task->pa_base,
 				   prev_task->pkt->cmd_buf_size, DMA_TO_DEVICE);
 
@@ -264,7 +323,7 @@ static void cmdq_thread_irq_handler(struct cmdq *cmdq,
 	else
 		return;
 
-	curr_pa = readl(thread->base + CMDQ_THR_CURR_ADDR) << cmdq->pdata->shift;
+	curr_pa = cmdq_reg_shift_addr(readl(thread->base + CMDQ_THR_CURR_ADDR), cmdq->pdata);
 
 	list_for_each_entry_safe(task, tmp, &thread->task_busy_list,
 				 list_entry) {
@@ -416,9 +475,9 @@ static int cmdq_mbox_send_data(struct mbox_chan *chan, void *data)
 		 */
 		WARN_ON(cmdq_thread_reset(cmdq, thread) < 0);
 
-		writel(task->pa_base >> cmdq->pdata->shift,
+		writel(cmdq_reg_shift_addr(task->pa_base, cmdq->pdata),
 		       thread->base + CMDQ_THR_CURR_ADDR);
-		writel((task->pa_base + pkt->cmd_buf_size) >> cmdq->pdata->shift,
+		writel(cmdq_reg_shift_addr(task->pa_base + pkt->cmd_buf_size, cmdq->pdata),
 		       thread->base + CMDQ_THR_END_ADDR);
 
 		writel(thread->priority, thread->base + CMDQ_THR_PRIORITY);
@@ -426,10 +485,10 @@ static int cmdq_mbox_send_data(struct mbox_chan *chan, void *data)
 		writel(CMDQ_THR_ENABLED, thread->base + CMDQ_THR_ENABLE_TASK);
 	} else {
 		WARN_ON(cmdq_thread_suspend(cmdq, thread) < 0);
-		curr_pa = readl(thread->base + CMDQ_THR_CURR_ADDR) <<
-			cmdq->pdata->shift;
-		end_pa = readl(thread->base + CMDQ_THR_END_ADDR) <<
-			cmdq->pdata->shift;
+		curr_pa = cmdq_reg_revert_addr(readl(thread->base + CMDQ_THR_CURR_ADDR),
+					       cmdq->pdata);
+		end_pa = cmdq_reg_revert_addr(readl(thread->base + CMDQ_THR_END_ADDR),
+					      cmdq->pdata);
 		/* check boundary */
 		if (curr_pa == end_pa - CMDQ_INST_SIZE ||
 		    curr_pa == end_pa) {
@@ -663,6 +722,9 @@ static int cmdq_probe(struct platform_device *pdev)
 	if (err)
 		return err;
 
+	if (cmdq->pdata->dma_mask_bit)
+		dma_set_coherent_mask(dev, DMA_BIT_MASK(cmdq->pdata->dma_mask_bit));
+
 	cmdq->mbox.dev = dev;
 	cmdq->mbox.chans = devm_kcalloc(dev, cmdq->pdata->thread_nr,
 					sizeof(*cmdq->mbox.chans), GFP_KERNEL);
@@ -782,6 +844,17 @@ static const struct gce_plat gce_plat_mt8195 = {
 	.gce_num = 2
 };
 
+static const struct gce_plat gce_plat_mt8196 = {
+	.thread_nr = 32,
+	.shift = 3,
+	.mminfra_offset = 0x80000000, /* 2GB */
+	.control_by_sw = true,
+	.sw_ddr_en = true,
+	.gce_vm = true,
+	.dma_mask_bit = 35,
+	.gce_num = 2
+};
+
 static const struct of_device_id cmdq_of_ids[] = {
 	{.compatible = "mediatek,mt6779-gce", .data = (void *)&gce_plat_mt6779},
 	{.compatible = "mediatek,mt8173-gce", .data = (void *)&gce_plat_mt8173},
@@ -790,6 +863,7 @@ static const struct of_device_id cmdq_of_ids[] = {
 	{.compatible = "mediatek,mt8188-gce", .data = (void *)&gce_plat_mt8188},
 	{.compatible = "mediatek,mt8192-gce", .data = (void *)&gce_plat_mt8192},
 	{.compatible = "mediatek,mt8195-gce", .data = (void *)&gce_plat_mt8195},
+	{.compatible = "mediatek,mt8196-gce", .data = (void *)&gce_plat_mt8196},
 	{}
 };
 MODULE_DEVICE_TABLE(of, cmdq_of_ids);
diff --git a/include/linux/mailbox/mtk-cmdq-mailbox.h b/include/linux/mailbox/mtk-cmdq-mailbox.h
index a8f0070c7aa9..79398bf95f8d 100644
--- a/include/linux/mailbox/mtk-cmdq-mailbox.h
+++ b/include/linux/mailbox/mtk-cmdq-mailbox.h
@@ -79,5 +79,7 @@ struct cmdq_pkt {
 };
 
 u8 cmdq_get_shift_pa(struct mbox_chan *chan);
+dma_addr_t cmdq_get_offset_pa(struct mbox_chan *chan);
+bool cmdq_addr_need_offset(struct mbox_chan *chan, dma_addr_t addr);
 
 #endif /* __MTK_CMDQ_MAILBOX_H__ */
-- 
2.43.0


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

* [PATCH v3 3/7] soc: mediatek: mtk-cmdq: Add pa_base parsing for unsupported subsys ID hardware
  2024-12-19 17:07 [PATCH v3 0/7] Add GCE support for MT8196 Jason-JH.Lin
  2024-12-19 17:07 ` [PATCH v3 1/7] dt-bindings: mailbox: mediatek: Add MT8196 support for gce-mailbox Jason-JH.Lin
  2024-12-19 17:07 ` [PATCH v3 2/7] mailbox: mtk-cmdq: Add driver data to support for MT8196 Jason-JH.Lin
@ 2024-12-19 17:07 ` Jason-JH.Lin
  2024-12-19 17:07 ` [PATCH v3 4/7] soc: mediatek: mtk-cmdq: Add mminfra_offset compatibility for DRAM address Jason-JH.Lin
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 21+ messages in thread
From: Jason-JH.Lin @ 2024-12-19 17:07 UTC (permalink / raw)
  To: Jassi Brar, Chun-Kuang Hu, AngeloGioacchino Del Regno,
	Rob Herring, Krzysztof Kozlowski, Conor Dooley, Matthias Brugger,
	Mauro Carvalho Chehab
  Cc: David Airlie, Simona Vetter, linux-kernel, devicetree, dri-devel,
	linux-mediatek, linux-arm-kernel, linux-media, Jason-JH . Lin,
	Singo Chang, Nancy Lin, Moudy Ho, Xavier Chang,
	Project_Global_Chrome_Upstream_Group

When GCE executes instructions, the corresponding hardware register
can be found through the subsys ID. For hardware that does not support
subsys ID, its subsys ID will be set to invalid value and its physical
address needs to be used to generate GCE instructions.

This commit adds a pa_base parsing flow to the cmdq_client_reg structure
for these unsupported subsys ID hardware.

Signed-off-by: Jason-JH.Lin <jason-jh.lin@mediatek.com>
---
 drivers/soc/mediatek/mtk-cmdq-helper.c | 18 ++++++++++++++++--
 include/linux/soc/mediatek/mtk-cmdq.h  |  3 +++
 2 files changed, 19 insertions(+), 2 deletions(-)

diff --git a/drivers/soc/mediatek/mtk-cmdq-helper.c b/drivers/soc/mediatek/mtk-cmdq-helper.c
index 455221e8de24..aa9853100d78 100644
--- a/drivers/soc/mediatek/mtk-cmdq-helper.c
+++ b/drivers/soc/mediatek/mtk-cmdq-helper.c
@@ -8,6 +8,7 @@
 #include <linux/module.h>
 #include <linux/mailbox_controller.h>
 #include <linux/of.h>
+#include <linux/of_address.h>
 #include <linux/soc/mediatek/mtk-cmdq.h>
 
 #define CMDQ_WRITE_ENABLE_MASK	BIT(0)
@@ -60,20 +61,30 @@ int cmdq_dev_get_client_reg(struct device *dev,
 			    struct cmdq_client_reg *client_reg, int idx)
 {
 	struct of_phandle_args spec;
+	struct resource res;
 	int err;
 
 	if (!client_reg)
 		return -ENOENT;
 
+	if (of_address_to_resource(dev->of_node, 0, &res) != 0) {
+		dev_err(dev, "Missing reg in %s node\n", dev->of_node->full_name);
+		return -EINVAL;
+	}
+	client_reg->pa_base = res.start;
+
 	err = of_parse_phandle_with_fixed_args(dev->of_node,
 					       "mediatek,gce-client-reg",
 					       3, idx, &spec);
 	if (err < 0) {
-		dev_warn(dev,
+		dev_dbg(dev,
 			"error %d can't parse gce-client-reg property (%d)",
 			err, idx);
 
-		return err;
+		/* make subsys invalid */
+		client_reg->subsys = CMDQ_SUBSYS_INVALID;
+
+		return 0;
 	}
 
 	client_reg->subsys = (u8)spec.args[0];
@@ -130,6 +141,9 @@ int cmdq_pkt_create(struct cmdq_client *client, struct cmdq_pkt *pkt, size_t siz
 
 	pkt->buf_size = size;
 
+	/* need to use pkt->cl->chan later to call mbox APIs when generating instruction */
+	pkt->cl = (void *)client;
+
 	dev = client->chan->mbox->dev;
 	dma_addr = dma_map_single(dev, pkt->va_base, pkt->buf_size,
 				  DMA_TO_DEVICE);
diff --git a/include/linux/soc/mediatek/mtk-cmdq.h b/include/linux/soc/mediatek/mtk-cmdq.h
index 0c3906e8ad19..3578cc9200e9 100644
--- a/include/linux/soc/mediatek/mtk-cmdq.h
+++ b/include/linux/soc/mediatek/mtk-cmdq.h
@@ -23,6 +23,8 @@
 #define CMDQ_THR_SPR_IDX2	(2)
 #define CMDQ_THR_SPR_IDX3	(3)
 
+#define CMDQ_SUBSYS_INVALID	(U8_MAX)
+
 struct cmdq_pkt;
 
 enum cmdq_logic_op {
@@ -52,6 +54,7 @@ struct cmdq_operand {
 
 struct cmdq_client_reg {
 	u8 subsys;
+	phys_addr_t pa_base;
 	u16 offset;
 	u16 size;
 };
-- 
2.43.0


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

* [PATCH v3 4/7] soc: mediatek: mtk-cmdq: Add mminfra_offset compatibility for DRAM address
  2024-12-19 17:07 [PATCH v3 0/7] Add GCE support for MT8196 Jason-JH.Lin
                   ` (2 preceding siblings ...)
  2024-12-19 17:07 ` [PATCH v3 3/7] soc: mediatek: mtk-cmdq: Add pa_base parsing for unsupported subsys ID hardware Jason-JH.Lin
@ 2024-12-19 17:07 ` Jason-JH.Lin
  2024-12-19 17:07 ` [PATCH v3 5/7] soc: mediatek: Add programming flow for unsupported subsys ID hardware Jason-JH.Lin
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 21+ messages in thread
From: Jason-JH.Lin @ 2024-12-19 17:07 UTC (permalink / raw)
  To: Jassi Brar, Chun-Kuang Hu, AngeloGioacchino Del Regno,
	Rob Herring, Krzysztof Kozlowski, Conor Dooley, Matthias Brugger,
	Mauro Carvalho Chehab
  Cc: David Airlie, Simona Vetter, linux-kernel, devicetree, dri-devel,
	linux-mediatek, linux-arm-kernel, linux-media, Jason-JH . Lin,
	Singo Chang, Nancy Lin, Moudy Ho, Xavier Chang,
	Project_Global_Chrome_Upstream_Group

Since GCE has been moved to mminfra in MT8196, all transactions from
mminfra to DRAM will have their addresses adjusted by subtracting a
mminfra offset.
This information should be handled inside the CMDQ driver, allowing
CMDQ users to call CMDQ APIs as usual.

Therefore, CMDQ driver needs to use the mbox API to get the
mminfra_offset value of the SoC, and then add it to the DRAM address
when generating instructions to ensure GCE accesses the correct DRAM
address.

Signed-off-by: Jason-JH.Lin <jason-jh.lin@mediatek.com>
---
 drivers/soc/mediatek/mtk-cmdq-helper.c | 35 ++++++++++++++++++++++++--
 1 file changed, 33 insertions(+), 2 deletions(-)

diff --git a/drivers/soc/mediatek/mtk-cmdq-helper.c b/drivers/soc/mediatek/mtk-cmdq-helper.c
index aa9853100d78..f2853a74af01 100644
--- a/drivers/soc/mediatek/mtk-cmdq-helper.c
+++ b/drivers/soc/mediatek/mtk-cmdq-helper.c
@@ -314,10 +314,22 @@ EXPORT_SYMBOL(cmdq_pkt_write_s_mask_value);
 
 int cmdq_pkt_mem_move(struct cmdq_pkt *pkt, dma_addr_t src_addr, dma_addr_t dst_addr)
 {
+	struct cmdq_client *cl = (struct cmdq_client *)pkt->cl;
 	const u16 high_addr_reg_idx  = CMDQ_THR_SPR_IDX0;
 	const u16 value_reg_idx = CMDQ_THR_SPR_IDX1;
 	int ret;
 
+	if (!cl) {
+		pr_err("%s %d: pkt->cl is NULL!\n", __func__, __LINE__);
+		return -EINVAL;
+	}
+
+	if (cmdq_addr_need_offset(cl->chan, src_addr))
+		src_addr += cmdq_get_offset_pa(cl->chan);
+
+	if (cmdq_addr_need_offset(cl->chan, dst_addr))
+		dst_addr += cmdq_get_offset_pa(cl->chan);
+
 	/* read the value of src_addr into high_addr_reg_idx */
 	ret = cmdq_pkt_assign(pkt, high_addr_reg_idx, CMDQ_ADDR_HIGH(src_addr));
 	if (ret < 0)
@@ -428,10 +440,19 @@ EXPORT_SYMBOL(cmdq_pkt_poll_mask);
 
 int cmdq_pkt_poll_addr(struct cmdq_pkt *pkt, dma_addr_t addr, u32 value, u32 mask)
 {
+	struct cmdq_client *cl = (struct cmdq_client *)pkt->cl;
 	struct cmdq_instruction inst = { {0} };
 	u8 use_mask = 0;
 	int ret;
 
+	if (!cl) {
+		pr_err("%s %d: pkt->cl is NULL!\n", __func__, __LINE__);
+		return -EINVAL;
+	}
+
+	if (cmdq_addr_need_offset(cl->chan, addr))
+		addr += cmdq_get_offset_pa(cl->chan);
+
 	/*
 	 * Append an MASK instruction to set the mask for following POLL instruction
 	 * which enables use_mask bit.
@@ -509,11 +530,21 @@ EXPORT_SYMBOL(cmdq_pkt_assign);
 
 int cmdq_pkt_jump_abs(struct cmdq_pkt *pkt, dma_addr_t addr, u8 shift_pa)
 {
+	struct cmdq_client *cl = (struct cmdq_client *)pkt->cl;
 	struct cmdq_instruction inst = {
 		.op = CMDQ_CODE_JUMP,
-		.offset = CMDQ_JUMP_ABSOLUTE,
-		.value = addr >> shift_pa
+		.offset = CMDQ_JUMP_ABSOLUTE
 	};
+
+	if (!cl) {
+		pr_err("%s %d: pkt->cl is NULL!\n", __func__, __LINE__);
+		return -EINVAL;
+	}
+
+	if (cmdq_addr_need_offset(cl->chan, addr))
+		addr += cmdq_get_offset_pa(cl->chan);
+
+	inst.value = addr >> shift_pa;
 	return cmdq_pkt_append_command(pkt, inst);
 }
 EXPORT_SYMBOL(cmdq_pkt_jump_abs);
-- 
2.43.0


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

* [PATCH v3 5/7] soc: mediatek: Add programming flow for unsupported subsys ID hardware
  2024-12-19 17:07 [PATCH v3 0/7] Add GCE support for MT8196 Jason-JH.Lin
                   ` (3 preceding siblings ...)
  2024-12-19 17:07 ` [PATCH v3 4/7] soc: mediatek: mtk-cmdq: Add mminfra_offset compatibility for DRAM address Jason-JH.Lin
@ 2024-12-19 17:07 ` Jason-JH.Lin
  2024-12-19 17:07 ` [PATCH v3 6/7] drm/mediatek: " Jason-JH.Lin
  2024-12-19 17:08 ` [PATCH v3 7/7] media: mediatek: mdp3: " Jason-JH.Lin
  6 siblings, 0 replies; 21+ messages in thread
From: Jason-JH.Lin @ 2024-12-19 17:07 UTC (permalink / raw)
  To: Jassi Brar, Chun-Kuang Hu, AngeloGioacchino Del Regno,
	Rob Herring, Krzysztof Kozlowski, Conor Dooley, Matthias Brugger,
	Mauro Carvalho Chehab
  Cc: David Airlie, Simona Vetter, linux-kernel, devicetree, dri-devel,
	linux-mediatek, linux-arm-kernel, linux-media, Jason-JH . Lin,
	Singo Chang, Nancy Lin, Moudy Ho, Xavier Chang,
	Project_Global_Chrome_Upstream_Group

To support hardware without subsys IDs on new SoCs, add a programming
flow that checks whether the subsys ID is valid. If the subsys ID is
invalid, the flow will call 2 alternative CMDQ APIs:
cmdq_pkt_assign() and cmdq_pkt_write_s_value() to achieve the same
functionality.

Signed-off-by: Jason-JH.Lin <jason-jh.lin@mediatek.com>
---
 drivers/soc/mediatek/mtk-mmsys.c | 14 +++++++++++---
 drivers/soc/mediatek/mtk-mutex.c | 11 +++++++++--
 2 files changed, 20 insertions(+), 5 deletions(-)

diff --git a/drivers/soc/mediatek/mtk-mmsys.c b/drivers/soc/mediatek/mtk-mmsys.c
index bb4639ca0b8c..ce949b863b05 100644
--- a/drivers/soc/mediatek/mtk-mmsys.c
+++ b/drivers/soc/mediatek/mtk-mmsys.c
@@ -167,9 +167,17 @@ static void mtk_mmsys_update_bits(struct mtk_mmsys *mmsys, u32 offset, u32 mask,
 	u32 tmp;
 
 	if (mmsys->cmdq_base.size && cmdq_pkt) {
-		ret = cmdq_pkt_write_mask(cmdq_pkt, mmsys->cmdq_base.subsys,
-					  mmsys->cmdq_base.offset + offset, val,
-					  mask);
+		offset += mmsys->cmdq_base.offset;
+		if (mmsys->cmdq_base.subsys != CMDQ_SUBSYS_INVALID) {
+			ret = cmdq_pkt_write_mask(cmdq_pkt, mmsys->cmdq_base.subsys,
+						  offset, val, mask);
+		} else {
+			/* only MMIO access, no need to check mminfro_offset */
+			ret = cmdq_pkt_assign(cmdq_pkt, CMDQ_THR_SPR_IDX0,
+					      CMDQ_ADDR_HIGH(mmsys->cmdq_base.pa_base));
+			ret |= cmdq_pkt_write_s_mask_value(cmdq_pkt, CMDQ_THR_SPR_IDX0,
+							   CMDQ_ADDR_LOW(offset), val, mask);
+		}
 		if (ret)
 			pr_debug("CMDQ unavailable: using CPU write\n");
 		else
diff --git a/drivers/soc/mediatek/mtk-mutex.c b/drivers/soc/mediatek/mtk-mutex.c
index 5250c1d702eb..3788b16efbf4 100644
--- a/drivers/soc/mediatek/mtk-mutex.c
+++ b/drivers/soc/mediatek/mtk-mutex.c
@@ -963,6 +963,7 @@ int mtk_mutex_enable_by_cmdq(struct mtk_mutex *mutex, void *pkt)
 	struct mtk_mutex_ctx *mtx = container_of(mutex, struct mtk_mutex_ctx,
 						 mutex[mutex->id]);
 	struct cmdq_pkt *cmdq_pkt = (struct cmdq_pkt *)pkt;
+	dma_addr_t en_addr = mtx->addr + DISP_REG_MUTEX_EN(mutex->id);
 
 	WARN_ON(&mtx->mutex[mutex->id] != mutex);
 
@@ -971,8 +972,14 @@ int mtk_mutex_enable_by_cmdq(struct mtk_mutex *mutex, void *pkt)
 		return -ENODEV;
 	}
 
-	cmdq_pkt_write(cmdq_pkt, mtx->cmdq_reg.subsys,
-		       mtx->addr + DISP_REG_MUTEX_EN(mutex->id), 1);
+	if (mtx->cmdq_reg.subsys != CMDQ_SUBSYS_INVALID) {
+		cmdq_pkt_write(cmdq_pkt, mtx->cmdq_reg.subsys, en_addr, 1);
+	} else {
+		/* only MMIO access, no need to check mminfro_offset */
+		cmdq_pkt_assign(cmdq_pkt, CMDQ_THR_SPR_IDX0, CMDQ_ADDR_HIGH(en_addr));
+		cmdq_pkt_write_s_value(cmdq_pkt, CMDQ_THR_SPR_IDX0, CMDQ_ADDR_LOW(en_addr), 1);
+	}
+
 	return 0;
 }
 EXPORT_SYMBOL_GPL(mtk_mutex_enable_by_cmdq);
-- 
2.43.0


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

* [PATCH v3 6/7] drm/mediatek: Add programming flow for unsupported subsys ID hardware
  2024-12-19 17:07 [PATCH v3 0/7] Add GCE support for MT8196 Jason-JH.Lin
                   ` (4 preceding siblings ...)
  2024-12-19 17:07 ` [PATCH v3 5/7] soc: mediatek: Add programming flow for unsupported subsys ID hardware Jason-JH.Lin
@ 2024-12-19 17:07 ` Jason-JH.Lin
  2024-12-24  5:21   ` CK Hu (胡俊光)
  2024-12-19 17:08 ` [PATCH v3 7/7] media: mediatek: mdp3: " Jason-JH.Lin
  6 siblings, 1 reply; 21+ messages in thread
From: Jason-JH.Lin @ 2024-12-19 17:07 UTC (permalink / raw)
  To: Jassi Brar, Chun-Kuang Hu, AngeloGioacchino Del Regno,
	Rob Herring, Krzysztof Kozlowski, Conor Dooley, Matthias Brugger,
	Mauro Carvalho Chehab
  Cc: David Airlie, Simona Vetter, linux-kernel, devicetree, dri-devel,
	linux-mediatek, linux-arm-kernel, linux-media, Jason-JH . Lin,
	Singo Chang, Nancy Lin, Moudy Ho, Xavier Chang,
	Project_Global_Chrome_Upstream_Group

To support hardware without subsys IDs on new SoCs, add a programming
flow that checks whether the subsys ID is valid. If the subsys ID is
invalid, the flow will call 2 alternative CMDQ APIs:
cmdq_pkt_assign() and cmdq_pkt_write_s_value() to achieve the same
functionality.

Signed-off-by: Jason-JH.Lin <jason-jh.lin@mediatek.com>
---
 drivers/gpu/drm/mediatek/mtk_ddp_comp.c | 33 ++++++++++++++++++++-----
 1 file changed, 27 insertions(+), 6 deletions(-)

diff --git a/drivers/gpu/drm/mediatek/mtk_ddp_comp.c b/drivers/gpu/drm/mediatek/mtk_ddp_comp.c
index edc6417639e6..219d67735a54 100644
--- a/drivers/gpu/drm/mediatek/mtk_ddp_comp.c
+++ b/drivers/gpu/drm/mediatek/mtk_ddp_comp.c
@@ -66,14 +66,37 @@ struct mtk_ddp_comp_dev {
 	struct cmdq_client_reg cmdq_reg;
 };
 
+#if IS_REACHABLE(CONFIG_MTK_CMDQ)
+static void mtk_ddp_write_cmdq_pkt(struct cmdq_pkt *cmdq_pkt, struct cmdq_client_reg *cmdq_reg,
+				   unsigned int offset, unsigned int value, unsigned int mask)
+{
+	offset += cmdq_reg->offset;
+
+	if (cmdq_reg->subsys != CMDQ_SUBSYS_INVALID) {
+		if (mask == GENMASK(31, 0))
+			cmdq_pkt_write(cmdq_pkt, cmdq_reg->subsys, offset, value);
+		else
+			cmdq_pkt_write_mask(cmdq_pkt, cmdq_reg->subsys, offset, value, mask);
+	} else {
+		/* only MMIO access, no need to check mminfro_offset */
+		cmdq_pkt_assign(cmdq_pkt, 0, CMDQ_ADDR_HIGH(cmdq_reg->pa_base));
+		if (mask == GENMASK(31, 0))
+			cmdq_pkt_write_s_value(cmdq_pkt, CMDQ_THR_SPR_IDX0,
+					       CMDQ_ADDR_LOW(offset), value);
+		else
+			cmdq_pkt_write_s_mask_value(cmdq_pkt, CMDQ_THR_SPR_IDX0,
+						    CMDQ_ADDR_LOW(offset), value, mask);
+	}
+}
+#endif
+
 void mtk_ddp_write(struct cmdq_pkt *cmdq_pkt, unsigned int value,
 		   struct cmdq_client_reg *cmdq_reg, void __iomem *regs,
 		   unsigned int offset)
 {
 #if IS_REACHABLE(CONFIG_MTK_CMDQ)
 	if (cmdq_pkt)
-		cmdq_pkt_write(cmdq_pkt, cmdq_reg->subsys,
-			       cmdq_reg->offset + offset, value);
+		mtk_ddp_write_cmdq_pkt(cmdq_pkt, cmdq_reg, offset, value, GENMASK(31, 0));
 	else
 #endif
 		writel(value, regs + offset);
@@ -85,8 +108,7 @@ void mtk_ddp_write_relaxed(struct cmdq_pkt *cmdq_pkt, unsigned int value,
 {
 #if IS_REACHABLE(CONFIG_MTK_CMDQ)
 	if (cmdq_pkt)
-		cmdq_pkt_write(cmdq_pkt, cmdq_reg->subsys,
-			       cmdq_reg->offset + offset, value);
+		mtk_ddp_write_cmdq_pkt(cmdq_pkt, cmdq_reg, offset, value, GENMASK(31, 0));
 	else
 #endif
 		writel_relaxed(value, regs + offset);
@@ -98,8 +120,7 @@ void mtk_ddp_write_mask(struct cmdq_pkt *cmdq_pkt, unsigned int value,
 {
 #if IS_REACHABLE(CONFIG_MTK_CMDQ)
 	if (cmdq_pkt) {
-		cmdq_pkt_write_mask(cmdq_pkt, cmdq_reg->subsys,
-				    cmdq_reg->offset + offset, value, mask);
+		mtk_ddp_write_cmdq_pkt(cmdq_pkt, cmdq_reg, offset, value, mask);
 	} else {
 #endif
 		u32 tmp = readl(regs + offset);
-- 
2.43.0


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

* [PATCH v3 7/7] media: mediatek: mdp3: Add programming flow for unsupported subsys ID hardware
  2024-12-19 17:07 [PATCH v3 0/7] Add GCE support for MT8196 Jason-JH.Lin
                   ` (5 preceding siblings ...)
  2024-12-19 17:07 ` [PATCH v3 6/7] drm/mediatek: " Jason-JH.Lin
@ 2024-12-19 17:08 ` Jason-JH.Lin
  6 siblings, 0 replies; 21+ messages in thread
From: Jason-JH.Lin @ 2024-12-19 17:08 UTC (permalink / raw)
  To: Jassi Brar, Chun-Kuang Hu, AngeloGioacchino Del Regno,
	Rob Herring, Krzysztof Kozlowski, Conor Dooley, Matthias Brugger,
	Mauro Carvalho Chehab
  Cc: David Airlie, Simona Vetter, linux-kernel, devicetree, dri-devel,
	linux-mediatek, linux-arm-kernel, linux-media, Jason-JH . Lin,
	Singo Chang, Nancy Lin, Moudy Ho, Xavier Chang,
	Project_Global_Chrome_Upstream_Group

To support hardware without subsys IDs on new SoCs, add a programming
flow that checks whether the subsys ID is valid. If the subsys ID is
invalid, the flow will call 2 alternative CMDQ APIs:
cmdq_pkt_assign() and cmdq_pkt_write_s_mask_value() to achieve the
same functionality.

Signed-off-by: Jason-JH.Lin <jason-jh.lin@mediatek.com>
---
 .../platform/mediatek/mdp3/mtk-mdp3-cmdq.c    | 18 ++++-
 .../platform/mediatek/mdp3/mtk-mdp3-comp.h    | 79 ++++++++++++++-----
 2 files changed, 77 insertions(+), 20 deletions(-)

diff --git a/drivers/media/platform/mediatek/mdp3/mtk-mdp3-cmdq.c b/drivers/media/platform/mediatek/mdp3/mtk-mdp3-cmdq.c
index e5ccf673e152..0ee3354963db 100644
--- a/drivers/media/platform/mediatek/mdp3/mtk-mdp3-cmdq.c
+++ b/drivers/media/platform/mediatek/mdp3/mtk-mdp3-cmdq.c
@@ -321,7 +321,14 @@ static int mdp_path_config_subfrm(struct mdp_cmdq_cmd *cmd,
 	/* Enable mux settings */
 	for (index = 0; index < ctrl->num_sets; index++) {
 		set = &ctrl->sets[index];
-		cmdq_pkt_write(&cmd->pkt, set->subsys_id, set->reg, set->value);
+		if (set->subsys_id != CMDQ_SUBSYS_INVALID) {
+			cmdq_pkt_write(&cmd->pkt, set->subsys_id, set->reg, set->value);
+		} else {
+			/* only MMIO access, no need to check mminfro_offset */
+			cmdq_pkt_assign(&cmd->pkt, CMDQ_THR_SPR_IDX0, CMDQ_ADDR_HIGH(set->reg));
+			cmdq_pkt_write_s_value(&cmd->pkt, CMDQ_THR_SPR_IDX0,
+					       CMDQ_ADDR_LOW(set->reg), set->value);
+		}
 	}
 	/* Config sub-frame information */
 	for (index = (num_comp - 1); index >= 0; index--) {
@@ -376,7 +383,14 @@ static int mdp_path_config_subfrm(struct mdp_cmdq_cmd *cmd,
 	/* Disable mux settings */
 	for (index = 0; index < ctrl->num_sets; index++) {
 		set = &ctrl->sets[index];
-		cmdq_pkt_write(&cmd->pkt, set->subsys_id, set->reg, 0);
+		if (set->subsys_id != CMDQ_SUBSYS_INVALID) {
+			cmdq_pkt_write(&cmd->pkt, set->subsys_id, set->reg, 0);
+		} else {
+			/* only MMIO access, no need to check mminfro_offset */
+			cmdq_pkt_assign(&cmd->pkt, CMDQ_THR_SPR_IDX0, CMDQ_ADDR_HIGH(set->reg));
+			cmdq_pkt_write_s_value(&cmd->pkt, CMDQ_THR_SPR_IDX0,
+					       CMDQ_ADDR_LOW(set->reg), 0);
+		}
 	}
 
 	return 0;
diff --git a/drivers/media/platform/mediatek/mdp3/mtk-mdp3-comp.h b/drivers/media/platform/mediatek/mdp3/mtk-mdp3-comp.h
index 681906c16419..e20f9d080db9 100644
--- a/drivers/media/platform/mediatek/mdp3/mtk-mdp3-comp.h
+++ b/drivers/media/platform/mediatek/mdp3/mtk-mdp3-comp.h
@@ -9,17 +9,44 @@
 
 #include "mtk-mdp3-cmdq.h"
 
-#define MM_REG_WRITE_MASK(cmd, id, base, ofst, val, mask)	\
-do {								\
-	typeof(mask) (m) = (mask);				\
-	cmdq_pkt_write_mask(&((cmd)->pkt), id, (base) + (ofst),	\
-			    (val),				\
-		(((m) & (ofst##_MASK)) == (ofst##_MASK)) ?	\
-			(0xffffffff) : (m));			\
+#define MM_REG_WRITE_MASK(cmd, id, base, ofst, val, mask)		\
+do {									\
+	typeof(cmd) (_c) = (cmd);					\
+	typeof(id) (_i) = (id);						\
+	typeof(base) (_b) = (base);					\
+	typeof(ofst) (_o) = (ofst);					\
+	typeof(val) (_v) = (val);					\
+	typeof(mask) (_m) = (mask);					\
+	_m = ((_m & (ofst##_MASK)) == (ofst##_MASK)) ? 0xffffffff : _m;	\
+	if (_i != CMDQ_SUBSYS_INVALID) {				\
+		cmdq_pkt_write_mask(&_c->pkt, _i, _b + _o, _v, _m);	\
+	} else {							\
+		/* only MMIO access, no need to check mminfro_offset */	\
+		cmdq_pkt_assign(&_c->pkt, CMDQ_THR_SPR_IDX0,		\
+				CMDQ_ADDR_HIGH(_b));			\
+		cmdq_pkt_write_s_mask_value(&_c->pkt, CMDQ_THR_SPR_IDX0,\
+					    CMDQ_ADDR_LOW(_b + _o),	\
+					    _v, _m);			\
+	}								\
 } while (0)
 
-#define MM_REG_WRITE(cmd, id, base, ofst, val)			\
-	cmdq_pkt_write(&((cmd)->pkt), id, (base) + (ofst), (val))
+#define MM_REG_WRITE(cmd, id, base, ofst, val)				\
+do {									\
+	typeof(cmd) (_c) = (cmd);					\
+	typeof(id) (_i) = (id);						\
+	typeof(base) (_b) = (base);					\
+	typeof(ofst) (_o) = (ofst);					\
+	typeof(val) (_v) = (val);					\
+	if (_i != CMDQ_SUBSYS_INVALID) {				\
+		cmdq_pkt_write(&_c->pkt, _i, _b + _o, _v);		\
+	} else {							\
+		/* only MMIO access, no need to check mminfro_offset */	\
+		cmdq_pkt_assign(&_c->pkt, CMDQ_THR_SPR_IDX0,		\
+				CMDQ_ADDR_HIGH(_b));			\
+		cmdq_pkt_write_s_value(&_c->pkt, CMDQ_THR_SPR_IDX0,	\
+				       CMDQ_ADDR_LOW(_b + _o), _v);	\
+	}								\
+} while (0)
 
 #define MM_REG_WAIT(cmd, evt)					\
 do {								\
@@ -49,17 +76,33 @@ do {								\
 	cmdq_pkt_set_event(&((c)->pkt), (e));			\
 } while (0)
 
-#define MM_REG_POLL_MASK(cmd, id, base, ofst, val, _mask)	\
-do {								\
-	typeof(_mask) (_m) = (_mask);				\
-	cmdq_pkt_poll_mask(&((cmd)->pkt), id,			\
-		(base) + (ofst), (val),				\
-		(((_m) & (ofst##_MASK)) == (ofst##_MASK)) ?	\
-			(0xffffffff) : (_m));			\
+#define MM_REG_POLL_MASK(cmd, id, base, ofst, val, mask)		\
+do {									\
+	typeof(cmd) (_c) = (cmd);					\
+	typeof(id) (_i) = (id);						\
+	typeof(base) (_b) = (base);					\
+	typeof(ofst) (_o) = (ofst);					\
+	typeof(val) (_v) = (val);					\
+	typeof(mask) (_m) = (mask);					\
+	_m = ((_m & (ofst##_MASK)) == (ofst##_MASK)) ? 0xffffffff : _m;	\
+	if (_i != CMDQ_SUBSYS_INVALID)					\
+		cmdq_pkt_poll_mask(&_c->pkt, _i, _b + _o, _v, _m);	\
+	else /* POLL not support SPR, so use cmdq_pkt_poll_addr() */	\
+		cmdq_pkt_poll_addr(&_c->pkt, _b + _o, _v, _m);		\
 } while (0)
 
-#define MM_REG_POLL(cmd, id, base, ofst, val)			\
-	cmdq_pkt_poll(&((cmd)->pkt), id, (base) + (ofst), (val))
+#define MM_REG_POLL(cmd, id, base, ofst, val)				\
+do {									\
+	typeof(cmd) (_c) = (cmd);					\
+	typeof(id) (_i) = (id);						\
+	typeof(base) (_b) = (base);					\
+	typeof(ofst) (_o) = (ofst);					\
+	typeof(val) (_v) = (val);					\
+	if (_i != CMDQ_SUBSYS_INVALID)					\
+		cmdq_pkt_poll(&_c->pkt, _i, _b + _o, _v);		\
+	else /* POLL not support SPR, so use cmdq_pkt_poll_addr() */	\
+		cmdq_pkt_poll_addr(&_c->pkt, _b + _o, _v, 0xffffffff);	\
+} while (0)
 
 enum mtk_mdp_comp_id {
 	MDP_COMP_NONE = -1,	/* Invalid engine */
-- 
2.43.0


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

* Re: [PATCH v3 6/7] drm/mediatek: Add programming flow for unsupported subsys ID hardware
  2024-12-19 17:07 ` [PATCH v3 6/7] drm/mediatek: " Jason-JH.Lin
@ 2024-12-24  5:21   ` CK Hu (胡俊光)
  0 siblings, 0 replies; 21+ messages in thread
From: CK Hu (胡俊光) @ 2024-12-24  5:21 UTC (permalink / raw)
  To: chunkuang.hu@kernel.org, AngeloGioacchino Del Regno,
	robh@kernel.org, Jason-JH Lin (林睿祥),
	krzk+dt@kernel.org, jassisinghbrar@gmail.com, mchehab@kernel.org,
	matthias.bgg@gmail.com, conor+dt@kernel.org
  Cc: linux-media@vger.kernel.org,
	Singo Chang (張興國), simona@ffwll.ch,
	Moudy Ho (何宗原),
	dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org, airlied@gmail.com,
	linux-arm-kernel@lists.infradead.org,
	Xavier Chang (張獻文),
	linux-mediatek@lists.infradead.org,
	Nancy Lin (林欣螢),
	Project_Global_Chrome_Upstream_Group

Hi, Jason:

On Fri, 2024-12-20 at 01:07 +0800, Jason-JH.Lin wrote:
> To support hardware without subsys IDs on new SoCs, add a programming
> flow that checks whether the subsys ID is valid. If the subsys ID is
> invalid, the flow will call 2 alternative CMDQ APIs:
> cmdq_pkt_assign() and cmdq_pkt_write_s_value() to achieve the same
> functionality.

Reviewed-by: CK Hu <ck.hu@mediatek.com>

> 
> Signed-off-by: Jason-JH.Lin <jason-jh.lin@mediatek.com>
> ---
>  drivers/gpu/drm/mediatek/mtk_ddp_comp.c | 33 ++++++++++++++++++++-----
>  1 file changed, 27 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/gpu/drm/mediatek/mtk_ddp_comp.c b/drivers/gpu/drm/mediatek/mtk_ddp_comp.c
> index edc6417639e6..219d67735a54 100644
> --- a/drivers/gpu/drm/mediatek/mtk_ddp_comp.c
> +++ b/drivers/gpu/drm/mediatek/mtk_ddp_comp.c
> @@ -66,14 +66,37 @@ struct mtk_ddp_comp_dev {
>  	struct cmdq_client_reg cmdq_reg;
>  };
>  
> +#if IS_REACHABLE(CONFIG_MTK_CMDQ)
> +static void mtk_ddp_write_cmdq_pkt(struct cmdq_pkt *cmdq_pkt, struct cmdq_client_reg *cmdq_reg,
> +				   unsigned int offset, unsigned int value, unsigned int mask)
> +{
> +	offset += cmdq_reg->offset;
> +
> +	if (cmdq_reg->subsys != CMDQ_SUBSYS_INVALID) {
> +		if (mask == GENMASK(31, 0))
> +			cmdq_pkt_write(cmdq_pkt, cmdq_reg->subsys, offset, value);
> +		else
> +			cmdq_pkt_write_mask(cmdq_pkt, cmdq_reg->subsys, offset, value, mask);
> +	} else {
> +		/* only MMIO access, no need to check mminfro_offset */
> +		cmdq_pkt_assign(cmdq_pkt, 0, CMDQ_ADDR_HIGH(cmdq_reg->pa_base));
> +		if (mask == GENMASK(31, 0))
> +			cmdq_pkt_write_s_value(cmdq_pkt, CMDQ_THR_SPR_IDX0,
> +					       CMDQ_ADDR_LOW(offset), value);
> +		else
> +			cmdq_pkt_write_s_mask_value(cmdq_pkt, CMDQ_THR_SPR_IDX0,
> +						    CMDQ_ADDR_LOW(offset), value, mask);
> +	}
> +}
> +#endif
> +
>  void mtk_ddp_write(struct cmdq_pkt *cmdq_pkt, unsigned int value,
>  		   struct cmdq_client_reg *cmdq_reg, void __iomem *regs,
>  		   unsigned int offset)
>  {
>  #if IS_REACHABLE(CONFIG_MTK_CMDQ)
>  	if (cmdq_pkt)
> -		cmdq_pkt_write(cmdq_pkt, cmdq_reg->subsys,
> -			       cmdq_reg->offset + offset, value);
> +		mtk_ddp_write_cmdq_pkt(cmdq_pkt, cmdq_reg, offset, value, GENMASK(31, 0));
>  	else
>  #endif
>  		writel(value, regs + offset);
> @@ -85,8 +108,7 @@ void mtk_ddp_write_relaxed(struct cmdq_pkt *cmdq_pkt, unsigned int value,
>  {
>  #if IS_REACHABLE(CONFIG_MTK_CMDQ)
>  	if (cmdq_pkt)
> -		cmdq_pkt_write(cmdq_pkt, cmdq_reg->subsys,
> -			       cmdq_reg->offset + offset, value);
> +		mtk_ddp_write_cmdq_pkt(cmdq_pkt, cmdq_reg, offset, value, GENMASK(31, 0));
>  	else
>  #endif
>  		writel_relaxed(value, regs + offset);
> @@ -98,8 +120,7 @@ void mtk_ddp_write_mask(struct cmdq_pkt *cmdq_pkt, unsigned int value,
>  {
>  #if IS_REACHABLE(CONFIG_MTK_CMDQ)
>  	if (cmdq_pkt) {
> -		cmdq_pkt_write_mask(cmdq_pkt, cmdq_reg->subsys,
> -				    cmdq_reg->offset + offset, value, mask);
> +		mtk_ddp_write_cmdq_pkt(cmdq_pkt, cmdq_reg, offset, value, mask);
>  	} else {
>  #endif
>  		u32 tmp = readl(regs + offset);


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

* Re: [PATCH v3 1/7] dt-bindings: mailbox: mediatek: Add MT8196 support for gce-mailbox
  2024-12-19 17:07 ` [PATCH v3 1/7] dt-bindings: mailbox: mediatek: Add MT8196 support for gce-mailbox Jason-JH.Lin
@ 2024-12-27  8:11   ` Krzysztof Kozlowski
  2024-12-30  2:25     ` Jason-JH Lin (林睿祥)
  2024-12-27  8:13   ` Krzysztof Kozlowski
  2025-01-18 21:24   ` Jassi Brar
  2 siblings, 1 reply; 21+ messages in thread
From: Krzysztof Kozlowski @ 2024-12-27  8:11 UTC (permalink / raw)
  To: Jason-JH.Lin
  Cc: Jassi Brar, Chun-Kuang Hu, AngeloGioacchino Del Regno,
	Rob Herring, Krzysztof Kozlowski, Conor Dooley, Matthias Brugger,
	Mauro Carvalho Chehab, David Airlie, Simona Vetter, linux-kernel,
	devicetree, dri-devel, linux-mediatek, linux-arm-kernel,
	linux-media, Singo Chang, Nancy Lin, Moudy Ho, Xavier Chang,
	Project_Global_Chrome_Upstream_Group

On Fri, Dec 20, 2024 at 01:07:54AM +0800, Jason-JH.Lin wrote:
> 1. Add compatible name and iommus property to mediatek,gce-mailbox.yaml
>    for MT8196.
> 
>    - The compatible name "mediatek,mt8196-gce-mailbox" is added to
>      ensure that the device tree can correctly identify and configure


This is 100% redundant statement. Don't state the obvious and don't
explain to us how DT works.

>      the GCE mailbox for the MT8196 SoC.
> 
>    - The iommus property is added to specify the IOMMU configuration
>      for the GCE mailbox, ensuring proper memory management and access
>      control.

You should say whether device supports or does not support IOMMU. So all
devices now work with IOMMU? I guess I asked about it already, no
improvements. So again, don't state the obvious.

> 
> 2. Add the Global Command Engine (GCE) binding header to define the
>    abstrct symbol binding to the GCE hardware settings of GCE Thread

typo

>    Priority, GCE Subsys ID and GCE Event for MT8196.
> 
>    - GCE Thread Priority: Defined to configure the priority level for
>      each GCE hardware thread. This is necessary for proper scheduling
>      and execution of commands in the GCE.
> 
>    - GCE Subsys ID: Defined to specify the subsystem ID for GCE clients.
>      This is used to correctly address and access different subsystems
>      within the GCE.
> 
>    - GCE Event: Defined to specify the events that the GCE can handle.
>      These events are used by the driver to synchronize and manage
>      hardware operations.
> 
>    Examples of the binding usage in the driver code:

Drop all below from commit msg. Don't paste C code into the bindings.

Best regards,
Krzysztof


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

* Re: [PATCH v3 1/7] dt-bindings: mailbox: mediatek: Add MT8196 support for gce-mailbox
  2024-12-19 17:07 ` [PATCH v3 1/7] dt-bindings: mailbox: mediatek: Add MT8196 support for gce-mailbox Jason-JH.Lin
  2024-12-27  8:11   ` Krzysztof Kozlowski
@ 2024-12-27  8:13   ` Krzysztof Kozlowski
  2024-12-30  9:23     ` Jason-JH Lin (林睿祥)
  2025-01-18 21:24   ` Jassi Brar
  2 siblings, 1 reply; 21+ messages in thread
From: Krzysztof Kozlowski @ 2024-12-27  8:13 UTC (permalink / raw)
  To: Jason-JH.Lin
  Cc: Jassi Brar, Chun-Kuang Hu, AngeloGioacchino Del Regno,
	Rob Herring, Krzysztof Kozlowski, Conor Dooley, Matthias Brugger,
	Mauro Carvalho Chehab, David Airlie, Simona Vetter, linux-kernel,
	devicetree, dri-devel, linux-mediatek, linux-arm-kernel,
	linux-media, Singo Chang, Nancy Lin, Moudy Ho, Xavier Chang,
	Project_Global_Chrome_Upstream_Group

On Fri, Dec 20, 2024 at 01:07:54AM +0800, Jason-JH.Lin wrote:
>    2) GCE Subsys ID:
>    - Defined in the header file: `#define SUBSYS_1c00XXXX 3`
>    - Used in the Device Tree:
>    	`mediatek,gce-client-reg = <&gce SUBSYS_1c00XXXX 0x0000 0x1000>;`
>    - Parsed and used in the driver to configure subsys ID:
>      ```c
>      int cmdq_dev_get_client_reg(struct device *dev,
>      				 struct cmdq_client_reg *client_reg,
>      				 int idx)
>      {
>      	client_reg->subsys = (u8)spec.args[0];
>      	client_reg->offset = (u16)spec.args[1];
>      }
>      // GCE write the value to the register 0x1c000000 + 0x0000 + offset
>      cmdq_pkt_write(cmdq_handle, client_reg->subsys,
>      		    client_reg->offset + offset, value);

This is a proof that SUBSYS_1300XXXX is not a binding. Your driver does
not use it.

Drop all such things which are not used by drivers or explain why they
are needed to be in the binding - what do they bind.

I asked for this already, for exactly the same thing.


I did not check the rest, so next time I will choose any other random
define and if I do not find it explained nor used, I will question it.
Because you tend to apply pieces of review instead of really change your
code.

>      ```

Best regards,
Krzysztof


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

* Re: [PATCH v3 1/7] dt-bindings: mailbox: mediatek: Add MT8196 support for gce-mailbox
  2024-12-27  8:11   ` Krzysztof Kozlowski
@ 2024-12-30  2:25     ` Jason-JH Lin (林睿祥)
  0 siblings, 0 replies; 21+ messages in thread
From: Jason-JH Lin (林睿祥) @ 2024-12-30  2:25 UTC (permalink / raw)
  To: krzk@kernel.org
  Cc: Project_Global_Chrome_Upstream_Group, robh@kernel.org,
	linux-media@vger.kernel.org, simona@ffwll.ch, mchehab@kernel.org,
	AngeloGioacchino Del Regno, linux-kernel@vger.kernel.org,
	dri-devel@lists.freedesktop.org, conor+dt@kernel.org,
	linux-mediatek@lists.infradead.org, chunkuang.hu@kernel.org,
	devicetree@vger.kernel.org, jassisinghbrar@gmail.com,
	krzk+dt@kernel.org, Singo Chang (張興國),
	Nancy Lin (林欣螢),
	linux-arm-kernel@lists.infradead.org, airlied@gmail.com,
	matthias.bgg@gmail.com, Xavier Chang (張獻文),
	Moudy Ho (何宗原)

Hi Krzysztof,

On Fri, 2024-12-27 at 09:11 +0100, Krzysztof Kozlowski wrote:
> 
> External email : Please do not click links or open attachments until
> you have verified the sender or the content.
> 
> 
> On Fri, Dec 20, 2024 at 01:07:54AM +0800, Jason-JH.Lin wrote:
> > 1. Add compatible name and iommus property to mediatek,gce-
> > mailbox.yaml
> >    for MT8196.
> > 
> >    - The compatible name "mediatek,mt8196-gce-mailbox" is added to
> >      ensure that the device tree can correctly identify and
> > configure
> 
> 
> This is 100% redundant statement. Don't state the obvious and don't
> explain to us how DT works.
> 

OK, I'll drop this.

> >      the GCE mailbox for the MT8196 SoC.
> > 
> >    - The iommus property is added to specify the IOMMU
> > configuration
> >      for the GCE mailbox, ensuring proper memory management and
> > access
> >      control.
> 
> You should say whether device supports or does not support IOMMU. So
> all
> devices now work with IOMMU? I guess I asked about it already, no
> improvements. So again, don't state the obvious.
> 

Yes, I'll change the above statement as below:

In MT8196, all the command buffers allocated and used by GCE device are
working with IOMMU.

> > 
> > 2. Add the Global Command Engine (GCE) binding header to define the
> >    abstrct symbol binding to the GCE hardware settings of GCE
> > Thread
> 
> typo

Thanks, I'll fix it.

> 
> >    Priority, GCE Subsys ID and GCE Event for MT8196.
> > 
> >    - GCE Thread Priority: Defined to configure the priority level
> > for
> >      each GCE hardware thread. This is necessary for proper
> > scheduling
> >      and execution of commands in the GCE.
> > 
> >    - GCE Subsys ID: Defined to specify the subsystem ID for GCE
> > clients.
> >      This is used to correctly address and access different
> > subsystems
> >      within the GCE.
> > 
> >    - GCE Event: Defined to specify the events that the GCE can
> > handle.
> >      These events are used by the driver to synchronize and manage
> >      hardware operations.
> > 
> >    Examples of the binding usage in the driver code:
> 
> Drop all below from commit msg. Don't paste C code into the bindings.
> 
OK, I'll drop them.

Regards,
Jason-JH.Lin

> Best regards,
> Krzysztof
> 


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

* Re: [PATCH v3 1/7] dt-bindings: mailbox: mediatek: Add MT8196 support for gce-mailbox
  2024-12-27  8:13   ` Krzysztof Kozlowski
@ 2024-12-30  9:23     ` Jason-JH Lin (林睿祥)
  2025-01-03 17:04       ` Krzysztof Kozlowski
  0 siblings, 1 reply; 21+ messages in thread
From: Jason-JH Lin (林睿祥) @ 2024-12-30  9:23 UTC (permalink / raw)
  To: krzk@kernel.org
  Cc: Project_Global_Chrome_Upstream_Group, robh@kernel.org,
	linux-media@vger.kernel.org, simona@ffwll.ch, mchehab@kernel.org,
	AngeloGioacchino Del Regno, linux-kernel@vger.kernel.org,
	dri-devel@lists.freedesktop.org, conor+dt@kernel.org,
	linux-mediatek@lists.infradead.org, chunkuang.hu@kernel.org,
	devicetree@vger.kernel.org, jassisinghbrar@gmail.com,
	krzk+dt@kernel.org, Singo Chang (張興國),
	Nancy Lin (林欣螢),
	linux-arm-kernel@lists.infradead.org, airlied@gmail.com,
	matthias.bgg@gmail.com, Xavier Chang (張獻文),
	Moudy Ho (何宗原)

Hi Krzysztof,

On Fri, 2024-12-27 at 09:13 +0100, Krzysztof Kozlowski wrote:
> 
> External email : Please do not click links or open attachments until
> you have verified the sender or the content.
> 
> 
> On Fri, Dec 20, 2024 at 01:07:54AM +0800, Jason-JH.Lin wrote:
> >    2) GCE Subsys ID:
> >    - Defined in the header file: `#define SUBSYS_1c00XXXX 3`
> >    - Used in the Device Tree:
> >       `mediatek,gce-client-reg = <&gce SUBSYS_1c00XXXX 0x0000
> > 0x1000>;`
> >    - Parsed and used in the driver to configure subsys ID:
> >      ```c
> >      int cmdq_dev_get_client_reg(struct device *dev,
> >                                struct cmdq_client_reg *client_reg,
> >                                int idx)
> >      {
> >       client_reg->subsys = (u8)spec.args[0];
> >       client_reg->offset = (u16)spec.args[1];
> >      }
> >      // GCE write the value to the register 0x1c000000 + 0x0000 +
> > offset
> >      cmdq_pkt_write(cmdq_handle, client_reg->subsys,
> >                   client_reg->offset + offset, value);
> 
> This is a proof that SUBSYS_1300XXXX is not a binding. Your driver
> does
> not use it.
> 
> Drop all such things which are not used by drivers or explain why
> they
> are needed to be in the binding - what do they bind.
> 
> I asked for this already, for exactly the same thing.
> 
> 
> I did not check the rest, so next time I will choose any other random
> define and if I do not find it explained nor used, I will question
> it.
> Because you tend to apply pieces of review instead of really change
> your
> code.

Please forgive me for putting a lot of redundant message. I just want
to provide as much detail as possible to help you determine if they are
bindings. I appreciate your guidance and will make the necessary
adjustments.


I checked the clk header you accepted before:
https://lore.kernel.org/all/402ac5a2-334e-1843-0517-5ecf61f6a965@linaro.org/

Please don't mind me to make a confirmation here because I can't find
the documentation of the definition for binding header.
Do you mean all the header defined in include/dt-bindings/* should be
used in a specific driver and the DTS in the same time?

Take the `#define CLK_TOP_AXI` and `#define CLK_TOP_VPP` in
mediatek,mt8188-clk.h for example:

`CLK_TOP_AXI` is used in the drivers/clk/mediatek/clk-mt8188-topckgen.c
but not in arch/arm64/boot/dts/mediatek/mt8188.dtsi:
```
  #include <dt-bindings/clock/mediatek,mt8188-clk.h>

  ...

  static const struct mtk_mux top_mtk_muxes[] = {
	MUX_GATE_CLR_SET_UPD_FLAGS(CLK_TOP_AXI, "top_axi",
axi_parents,
				   0x020, 0x024, 0x028, 0, 4, 7, 0x04,
  ...
	
	MUX_GATE_CLR_SET_UPD(CLK_TOP_VPP, "top_vpp",
			     vpp_parents, 0x02C, 0x030, 0x034, 0, 4,
7, 
  ...
```

and `CLK_TOP_VPP` is used in the both clk-mt8188-topckgen.c and
mt8188.dtsi:
```
  power-domain@MT8188_POWER_DOMAIN_VPPSYS0 {
  	reg = <MT8188_POWER_DOMAIN_VPPSYS0>;
	clocks = <&topckgen CLK_TOP_VPP>,
		 <&topckgen CLK_TOP_CAM>,
...
```

But it seems that both of `CLK_TOP_AXI` and `CLK_TOP_VPP` are regarded
as binding headers.


From the previous description of the example you gave me:
Bindings are imaginary numbers starting from 0 or 1 which are used
between drivers and DTS, serving as abstraction layer (or abstraction
values) between these two.

As I understand, each clock definition corresponds to the clock CG
settings provided to different hardware, and each hardware driver can
control its own clock CG through the CCF to control their CG in clock
driver. So they can be an abstraction values between driver and DTS.

Similarly, the GCE subsys ID and GCE event ID correspond to symbols
used by GCE to control various hardware, and each hardware driver can
use these IDs to generate commands buffer for GCE through the API
provided by the GCE driver and achieve the desired control over their
hardware.

I guess the difference is that the clock driver has a platform-specific
clock table to store these binding headers, while the GCE driver does
not have a platform-specific thread priority table, subsys ID table,
and event ID table. Instead, the GCE client drivers can directly obtain
their respective hardware settings from the DTS.

On the other hand, definitions like CLK_TOP_MAINPLL_D3,
CLK_TOP_MAINPLL_D4, etc., correspond to different clock frequency
divider levels, and the CMDQ_THR_PRIO_X for GCE thread priority also
corresponds to different priority levels for GCE threads. Therefore, I
am not quite sure why GCE thread priority cannot be considered a
binding when it is also a symbol number for a hardware level setting.


If the condition for becoming a binding header is that it `must` be
used by a specific driver, such as a platform-specific table, then I
will remove the entire GCE dt-binding header. Because the current usage
of these definitions is that each GCE client drivers can directly store
these GCE definitions through the DTS, just like IRQ IDs, and without
the need for an additional table defined by the GCE driver.


I am not unwilling to change the code, but I hope to first understand
what qualifies as a binding header.
This way, I can confidently remove the MT8196 GCE binding header,
and other developers will also know that the GCE binding header for the
previous MTXXXX is not needed.

I sincerely hope you can guide me to meet your expectations and
standards.

Regards,
Jason-JH.Lin

> 
> >      ```
> 
> Best regards,
> Krzysztof
> 

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

* Re: [PATCH v3 1/7] dt-bindings: mailbox: mediatek: Add MT8196 support for gce-mailbox
  2024-12-30  9:23     ` Jason-JH Lin (林睿祥)
@ 2025-01-03 17:04       ` Krzysztof Kozlowski
  2025-01-07  2:42         ` Jason-JH Lin (林睿祥)
  0 siblings, 1 reply; 21+ messages in thread
From: Krzysztof Kozlowski @ 2025-01-03 17:04 UTC (permalink / raw)
  To: Jason-JH Lin (林睿祥)
  Cc: Project_Global_Chrome_Upstream_Group, robh@kernel.org,
	linux-media@vger.kernel.org, simona@ffwll.ch, mchehab@kernel.org,
	AngeloGioacchino Del Regno, linux-kernel@vger.kernel.org,
	dri-devel@lists.freedesktop.org, conor+dt@kernel.org,
	linux-mediatek@lists.infradead.org, chunkuang.hu@kernel.org,
	devicetree@vger.kernel.org, jassisinghbrar@gmail.com,
	krzk+dt@kernel.org, Singo Chang (張興國),
	Nancy Lin (林欣螢),
	linux-arm-kernel@lists.infradead.org, airlied@gmail.com,
	matthias.bgg@gmail.com, Xavier Chang (張獻文),
	Moudy Ho (何宗原)

On 30/12/2024 10:23, Jason-JH Lin (林睿祥) wrote:
> Hi Krzysztof,
> 
> On Fri, 2024-12-27 at 09:13 +0100, Krzysztof Kozlowski wrote:
>>
>> External email : Please do not click links or open attachments until
>> you have verified the sender or the content.
>>
>>
>> On Fri, Dec 20, 2024 at 01:07:54AM +0800, Jason-JH.Lin wrote:
>>>    2) GCE Subsys ID:
>>>    - Defined in the header file: `#define SUBSYS_1c00XXXX 3`
>>>    - Used in the Device Tree:
>>>       `mediatek,gce-client-reg = <&gce SUBSYS_1c00XXXX 0x0000
>>> 0x1000>;`
>>>    - Parsed and used in the driver to configure subsys ID:
>>>      ```c
>>>      int cmdq_dev_get_client_reg(struct device *dev,
>>>                                struct cmdq_client_reg *client_reg,
>>>                                int idx)
>>>      {
>>>       client_reg->subsys = (u8)spec.args[0];
>>>       client_reg->offset = (u16)spec.args[1];
>>>      }
>>>      // GCE write the value to the register 0x1c000000 + 0x0000 +
>>> offset
>>>      cmdq_pkt_write(cmdq_handle, client_reg->subsys,
>>>                   client_reg->offset + offset, value);
>>
>> This is a proof that SUBSYS_1300XXXX is not a binding. Your driver
>> does
>> not use it.
>>
>> Drop all such things which are not used by drivers or explain why
>> they
>> are needed to be in the binding - what do they bind.
>>
>> I asked for this already, for exactly the same thing.
>>
>>
>> I did not check the rest, so next time I will choose any other random
>> define and if I do not find it explained nor used, I will question
>> it.
>> Because you tend to apply pieces of review instead of really change
>> your
>> code.
> 
> Please forgive me for putting a lot of redundant message. I just want
> to provide as much detail as possible to help you determine if they are
> bindings. I appreciate your guidance and will make the necessary
> adjustments.
> 
> 
> I checked the clk header you accepted before:
> https://lore.kernel.org/all/402ac5a2-334e-1843-0517-5ecf61f6a965@linaro.org/

With arguments like "someone, somewhere acked this, so I am allowed as
well to send it" you enter tricky grounds.

> 
> Please don't mind me to make a confirmation here because I can't find
> the documentation of the definition for binding header.
> Do you mean all the header defined in include/dt-bindings/* should be
> used in a specific driver and the DTS in the same time?

Yes, otherwise how is it abstraction?

There are numerous exceptions of course when binding binds different
pieces of software/firmware. Is that the case? Nothing in commit msg
explained this.

> 
> Take the `#define CLK_TOP_AXI` and `#define CLK_TOP_VPP` in
> mediatek,mt8188-clk.h for example:
> 
> `CLK_TOP_AXI` is used in the drivers/clk/mediatek/clk-mt8188-topckgen.c
> but not in arch/arm64/boot/dts/mediatek/mt8188.dtsi:
> ```
>   #include <dt-bindings/clock/mediatek,mt8188-clk.h>
> 
>   ...
> 
>   static const struct mtk_mux top_mtk_muxes[] = {
> 	MUX_GATE_CLR_SET_UPD_FLAGS(CLK_TOP_AXI, "top_axi",
> axi_parents,
> 				   0x020, 0x024, 0x028, 0, 4, 7, 0x04,
>   ...
> 	
> 	MUX_GATE_CLR_SET_UPD(CLK_TOP_VPP, "top_vpp",
> 			     vpp_parents, 0x02C, 0x030, 0x034, 0, 4,
> 7, 
>   ...
> ```
> 
> and `CLK_TOP_VPP` is used in the both clk-mt8188-topckgen.c and
> mt8188.dtsi:
> ```
>   power-domain@MT8188_POWER_DOMAIN_VPPSYS0 {
>   	reg = <MT8188_POWER_DOMAIN_VPPSYS0>;
> 	clocks = <&topckgen CLK_TOP_VPP>,
> 		 <&topckgen CLK_TOP_CAM>,
> ...
> ```
> 
> But it seems that both of `CLK_TOP_AXI` and `CLK_TOP_VPP` are regarded
> as binding headers.

I don't get the comparisons. Both constants represent abstraction, so
they are correct.


> 
> 
> From the previous description of the example you gave me:
> Bindings are imaginary numbers starting from 0 or 1 which are used
> between drivers and DTS, serving as abstraction layer (or abstraction
> values) between these two.

Exactly, what to say more?

> 
> As I understand, each clock definition corresponds to the clock CG
> settings provided to different hardware, and each hardware driver can
> control its own clock CG through the CCF to control their CG in clock
> driver. So they can be an abstraction values between driver and DTS.
> 
> Similarly, the GCE subsys ID and GCE event ID correspond to symbols
> used by GCE to control various hardware, and each hardware driver can
> use these IDs to generate commands buffer for GCE through the API
> provided by the GCE driver and achieve the desired control over their
> hardware.

So are they abstract or not? Then use some different values, really
abstract.

I brought you definition: abstract. You now cited it. But last paragraph
entirely skips this point.


> 
> I guess the difference is that the clock driver has a platform-specific
> clock table to store these binding headers, while the GCE driver does
> not have a platform-specific thread priority table, subsys ID table,
> and event ID table. Instead, the GCE client drivers can directly obtain
> their respective hardware settings from the DTS.
> 
> On the other hand, definitions like CLK_TOP_MAINPLL_D3,
> CLK_TOP_MAINPLL_D4, etc., correspond to different clock frequency
> divider levels, and the CMDQ_THR_PRIO_X for GCE thread priority also
> corresponds to different priority levels for GCE threads. Therefore, I
> am not quite sure why GCE thread priority cannot be considered a
> binding when it is also a symbol number for a hardware level setting.

Well, maybe nothing here is a binding. I took one thing to inspect. I
did not inspect the rest. How does it help your case?


> 
> 
> If the condition for becoming a binding header is that it `must` be
> used by a specific driver, such as a platform-specific table, then I

No, "used by the driver" is indication that you use it as abstraction.

> will remove the entire GCE dt-binding header. Because the current usage
> of these definitions is that each GCE client drivers can directly store
> these GCE definitions through the DTS, just like IRQ IDs, and without
> the need for an additional table defined by the GCE driver.

Do you store IRQ IDs as binding constants in binding headers? No. Why?

Before proceeding with this header further, please answer to above - why
interrupt numbers, MMIO addresses and some other values appearing in DTS
are not used like "binding headers".


Best regards,
Krzysztof

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

* Re: [PATCH v3 1/7] dt-bindings: mailbox: mediatek: Add MT8196 support for gce-mailbox
  2025-01-03 17:04       ` Krzysztof Kozlowski
@ 2025-01-07  2:42         ` Jason-JH Lin (林睿祥)
  2025-01-07  6:16           ` Krzysztof Kozlowski
  0 siblings, 1 reply; 21+ messages in thread
From: Jason-JH Lin (林睿祥) @ 2025-01-07  2:42 UTC (permalink / raw)
  To: krzk@kernel.org
  Cc: robh@kernel.org, linux-media@vger.kernel.org, simona@ffwll.ch,
	Nancy Lin (林欣螢), AngeloGioacchino Del Regno,
	linux-mediatek@lists.infradead.org,
	Project_Global_Chrome_Upstream_Group, conor+dt@kernel.org,
	linux-kernel@vger.kernel.org, chunkuang.hu@kernel.org,
	devicetree@vger.kernel.org, krzk+dt@kernel.org,
	jassisinghbrar@gmail.com, Singo Chang (張興國),
	mchehab@kernel.org, linux-arm-kernel@lists.infradead.org,
	airlied@gmail.com, dri-devel@lists.freedesktop.org,
	matthias.bgg@gmail.com, Moudy Ho (何宗原),
	Xavier Chang (張獻文)

On Fri, 2025-01-03 at 18:04 +0100, Krzysztof Kozlowski wrote:

[snip]

> > 
> > Please forgive me for putting a lot of redundant message. I just
> > want
> > to provide as much detail as possible to help you determine if they
> > are
> > bindings. I appreciate your guidance and will make the necessary
> > adjustments.
> > 
> > 
> > I checked the clk header you accepted before:
> > https://lore.kernel.org/all/402ac5a2-334e-1843-0517-5ecf61f6a965@linaro.org/
> 
> With arguments like "someone, somewhere acked this, so I am allowed
> as
> well to send it" you enter tricky grounds.

Hmm...
I didn't mean that, I just want to find a correct reference.

> 
> > 
> > Please don't mind me to make a confirmation here because I can't
> > find
> > the documentation of the definition for binding header.
> > Do you mean all the header defined in include/dt-bindings/* should
> > be
> > used in a specific driver and the DTS in the same time?
> 
> Yes, otherwise how is it abstraction?

OK, then I think it's not abstract, because we just use it in the DTS.

> 
> There are numerous exceptions of course when binding binds different
> pieces of software/firmware. Is that the case? Nothing in commit msg
> explained this.

No, I think it is not the case. I'll drop it.

> 
> > 
> > Take the `#define CLK_TOP_AXI` and `#define CLK_TOP_VPP` in
> > mediatek,mt8188-clk.h for example:
> > 
> > `CLK_TOP_AXI` is used in the drivers/clk/mediatek/clk-mt8188-
> > topckgen.c
> > but not in arch/arm64/boot/dts/mediatek/mt8188.dtsi:
> > ```
> >   #include <dt-bindings/clock/mediatek,mt8188-clk.h>
> > 
> >   ...
> > 
> >   static const struct mtk_mux top_mtk_muxes[] = {
> >       MUX_GATE_CLR_SET_UPD_FLAGS(CLK_TOP_AXI, "top_axi",
> > axi_parents,
> >                                  0x020, 0x024, 0x028, 0, 4, 7,
> > 0x04,
> >   ...
> > 
> >       MUX_GATE_CLR_SET_UPD(CLK_TOP_VPP, "top_vpp",
> >                            vpp_parents, 0x02C, 0x030, 0x034, 0, 4,
> > 7,
> >   ...
> > ```
> > 
> > and `CLK_TOP_VPP` is used in the both clk-mt8188-topckgen.c and
> > mt8188.dtsi:
> > ```
> >   power-domain@MT8188_POWER_DOMAIN_VPPSYS0 {
> >       reg = <MT8188_POWER_DOMAIN_VPPSYS0>;
> >       clocks = <&topckgen CLK_TOP_VPP>,
> >                <&topckgen CLK_TOP_CAM>,
> > ...
> > ```
> > 
> > But it seems that both of `CLK_TOP_AXI` and `CLK_TOP_VPP` are
> > regarded
> > as binding headers.
> 
> I don't get the comparisons. Both constants represent abstraction, so
> they are correct.
> 

OK, I just want to make sure that it is not a `must` to use the binding
header in driver code and DTS at the same time.

> 
> > 
> > 
> > From the previous description of the example you gave me:
> > Bindings are imaginary numbers starting from 0 or 1 which are used
> > between drivers and DTS, serving as abstraction layer (or
> > abstraction
> > values) between these two.
> 
> Exactly, what to say more?
> 

So the key point is abstract.

> > 
> > As I understand, each clock definition corresponds to the clock CG
> > settings provided to different hardware, and each hardware driver
> > can
> > control its own clock CG through the CCF to control their CG in
> > clock
> > driver. So they can be an abstraction values between driver and
> > DTS.
> > 
> > Similarly, the GCE subsys ID and GCE event ID correspond to symbols
> > used by GCE to control various hardware, and each hardware driver
> > can
> > use these IDs to generate commands buffer for GCE through the API
> > provided by the GCE driver and achieve the desired control over
> > their
> > hardware.
> 
> So are they abstract or not? Then use some different values, really
> abstract.
> 
> I brought you definition: abstract. You now cited it. But last
> paragraph
> entirely skips this point.
> 

OK, so maybe I should use a platform-specific driver code to use it as
an abstract number for the real hardware settings.
e,g.

mt8195-cmdq-platform.c:
```
thread_prio[CMDQ_THR_PRIO_LOWEST] = 0,
thread_prio[CMDQ_THR_PRIO_1] = 0x1,
...
thread_prio[CMDQ_THR_PRIO_HEIGHEST] = 0x7,
```

and

mt8188-cmdq-platform.c:
```
thread_prio[CMDQ_THR_PRIO_LOWEST] = BIT(0),
thread_prio[CMDQ_THR_PRIO_1] = BIT(1),
...
thread_prio[CMDQ_THR_PRIO_HIGHEST] = BIT(7),
```

But I think it's not necessary in its case.
So I'll drop this dt-bindings header.

> 
> > 
> > I guess the difference is that the clock driver has a platform-
> > specific
> > clock table to store these binding headers, while the GCE driver
> > does
> > not have a platform-specific thread priority table, subsys ID
> > table,
> > and event ID table. Instead, the GCE client drivers can directly
> > obtain
> > their respective hardware settings from the DTS.
> > 
> > On the other hand, definitions like CLK_TOP_MAINPLL_D3,
> > CLK_TOP_MAINPLL_D4, etc., correspond to different clock frequency
> > divider levels, and the CMDQ_THR_PRIO_X for GCE thread priority
> > also
> > corresponds to different priority levels for GCE threads.
> > Therefore, I
> > am not quite sure why GCE thread priority cannot be considered a
> > binding when it is also a symbol number for a hardware level
> > setting.
> 
> Well, maybe nothing here is a binding. I took one thing to inspect. I
> did not inspect the rest. How does it help your case?
> 

Yes, considering the abstraction, there are no bindings here.

> 
> > 
> > 
> > If the condition for becoming a binding header is that it `must` be
> > used by a specific driver, such as a platform-specific table, then
> > I
> 
> No, "used by the driver" is indication that you use it as
> abstraction.
> 

OK, I got it.

> > will remove the entire GCE dt-binding header. Because the current
> > usage
> > of these definitions is that each GCE client drivers can directly
> > store
> > these GCE definitions through the DTS, just like IRQ IDs, and
> > without
> > the need for an additional table defined by the GCE driver.
> 
> Do you store IRQ IDs as binding constants in binding headers? No.
> Why?
> 
> Before proceeding with this header further, please answer to above -
> why
> interrupt numbers, MMIO addresses and some other values appearing in
> DTS
> are not used like "binding headers".

Because interrupt numbers and MMIO addresses are the real numbers of
hardware settings. Their driver can get them directly from their device
node in DTS. They are actual number to be set into their hardware, so
they don't need to be translated in their platform drivers.

So I think all the definitions in the `mediatek,mt8196-gce.h` are the
same case. They are actual hardware numbers for GCE hardware to use.
It should be drop from the include/dt-bindings/*.


BTW, to make these numbers more readable in DTS, can I move
`include/dt-bindings/mailbox/mediatek,mt8196-gce.h` into
`arch/arm64/boot/dts/mediatek/mt8196-gce.h`?

Just like the `arch/arm64/boot/dts/mediatek/mt8167-pinfunc.h`.

Regards,
Jason-JH.Lin

> 
> 
> Best regards,
> Krzysztof


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

* Re: [PATCH v3 1/7] dt-bindings: mailbox: mediatek: Add MT8196 support for gce-mailbox
  2025-01-07  2:42         ` Jason-JH Lin (林睿祥)
@ 2025-01-07  6:16           ` Krzysztof Kozlowski
  2025-01-07  7:26             ` Jason-JH Lin (林睿祥)
  0 siblings, 1 reply; 21+ messages in thread
From: Krzysztof Kozlowski @ 2025-01-07  6:16 UTC (permalink / raw)
  To: Jason-JH Lin (林睿祥)
  Cc: robh@kernel.org, linux-media@vger.kernel.org, simona@ffwll.ch,
	Nancy Lin (林欣螢), AngeloGioacchino Del Regno,
	linux-mediatek@lists.infradead.org,
	Project_Global_Chrome_Upstream_Group, conor+dt@kernel.org,
	linux-kernel@vger.kernel.org, chunkuang.hu@kernel.org,
	devicetree@vger.kernel.org, krzk+dt@kernel.org,
	jassisinghbrar@gmail.com, Singo Chang (張興國),
	mchehab@kernel.org, linux-arm-kernel@lists.infradead.org,
	airlied@gmail.com, dri-devel@lists.freedesktop.org,
	matthias.bgg@gmail.com, Moudy Ho (何宗原),
	Xavier Chang (張獻文)

On 07/01/2025 03:42, Jason-JH Lin (林睿祥) wrote:
>>
>> Before proceeding with this header further, please answer to above -
>> why
>> interrupt numbers, MMIO addresses and some other values appearing in
>> DTS
>> are not used like "binding headers".
> 
> Because interrupt numbers and MMIO addresses are the real numbers of
> hardware settings. Their driver can get them directly from their device
> node in DTS. They are actual number to be set into their hardware, so
> they don't need to be translated in their platform drivers.
> 
> So I think all the definitions in the `mediatek,mt8196-gce.h` are the
> same case. They are actual hardware numbers for GCE hardware to use.
> It should be drop from the include/dt-bindings/*.

I did not inspect all of the defines you have there. Maybe some are used
by driver, so I did not provide you definitive answer on entire header.
The comment was addressing one specific group of defines which were not
used as a binding.

> 
> 
> BTW, to make these numbers more readable in DTS, can I move
> `include/dt-bindings/mailbox/mediatek,mt8196-gce.h` into
> `arch/arm64/boot/dts/mediatek/mt8196-gce.h`?

Yes, sure.

> 
> Just like the `arch/arm64/boot/dts/mediatek/mt8167-pinfunc.h`.

Best regards,
Krzysztof

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

* Re: [PATCH v3 1/7] dt-bindings: mailbox: mediatek: Add MT8196 support for gce-mailbox
  2025-01-07  6:16           ` Krzysztof Kozlowski
@ 2025-01-07  7:26             ` Jason-JH Lin (林睿祥)
  0 siblings, 0 replies; 21+ messages in thread
From: Jason-JH Lin (林睿祥) @ 2025-01-07  7:26 UTC (permalink / raw)
  To: krzk@kernel.org
  Cc: robh@kernel.org, linux-media@vger.kernel.org, simona@ffwll.ch,
	mchehab@kernel.org, AngeloGioacchino Del Regno,
	linux-kernel@vger.kernel.org,
	Project_Global_Chrome_Upstream_Group, conor+dt@kernel.org,
	linux-mediatek@lists.infradead.org, chunkuang.hu@kernel.org,
	devicetree@vger.kernel.org, krzk+dt@kernel.org,
	jassisinghbrar@gmail.com, Singo Chang (張興國),
	Nancy Lin (林欣螢),
	linux-arm-kernel@lists.infradead.org, airlied@gmail.com,
	dri-devel@lists.freedesktop.org, matthias.bgg@gmail.com,
	Moudy Ho (何宗原),
	Xavier Chang (張獻文)

On Tue, 2025-01-07 at 07:16 +0100, Krzysztof Kozlowski wrote:
> 
> External email : Please do not click links or open attachments until
> you have verified the sender or the content.
> 
> 
> On 07/01/2025 03:42, Jason-JH Lin (林睿祥) wrote:
> > > 
> > > Before proceeding with this header further, please answer to
> > > above -
> > > why
> > > interrupt numbers, MMIO addresses and some other values appearing
> > > in
> > > DTS
> > > are not used like "binding headers".
> > 
> > Because interrupt numbers and MMIO addresses are the real numbers
> > of
> > hardware settings. Their driver can get them directly from their
> > device
> > node in DTS. They are actual number to be set into their hardware,
> > so
> > they don't need to be translated in their platform drivers.
> > 
> > So I think all the definitions in the `mediatek,mt8196-gce.h` are
> > the
> > same case. They are actual hardware numbers for GCE hardware to
> > use.
> > It should be drop from the include/dt-bindings/*.
> 
> I did not inspect all of the defines you have there. Maybe some are
> used
> by driver, so I did not provide you definitive answer on entire
> header.
> The comment was addressing one specific group of defines which were
> not
> used as a binding.

All of the gce binding headers in `include/dt-bindings/gce/*` or
`include/dt-bindings/mailbox/*` are not used in any drivers and they
are the actual hardware IDs or settings for GCE, not the abstract
bindings.

Maybe it is added in the wrong place from the very first time.
I think they should be moved to dts folder to make it correct.

> 
> > 
> > 
> > BTW, to make these numbers more readable in DTS, can I move
> > `include/dt-bindings/mailbox/mediatek,mt8196-gce.h` into
> > `arch/arm64/boot/dts/mediatek/mt8196-gce.h`?
> 
> Yes, sure.

OK, then I'll move it.

Thanks for your patience to let me make it clear.

Regards,
Jason-JH.Lin

> 
> > 
> > Just like the `arch/arm64/boot/dts/mediatek/mt8167-pinfunc.h`.
> 
> Best regards,
> Krzysztof


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

* Re: [PATCH v3 1/7] dt-bindings: mailbox: mediatek: Add MT8196 support for gce-mailbox
  2024-12-19 17:07 ` [PATCH v3 1/7] dt-bindings: mailbox: mediatek: Add MT8196 support for gce-mailbox Jason-JH.Lin
  2024-12-27  8:11   ` Krzysztof Kozlowski
  2024-12-27  8:13   ` Krzysztof Kozlowski
@ 2025-01-18 21:24   ` Jassi Brar
  2025-01-20  6:46     ` Chen-Yu Tsai
  2 siblings, 1 reply; 21+ messages in thread
From: Jassi Brar @ 2025-01-18 21:24 UTC (permalink / raw)
  To: Jason-JH.Lin
  Cc: Chun-Kuang Hu, AngeloGioacchino Del Regno, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Matthias Brugger,
	Mauro Carvalho Chehab, David Airlie, Simona Vetter, linux-kernel,
	devicetree, dri-devel, linux-mediatek, linux-arm-kernel,
	linux-media, Singo Chang, Nancy Lin, Moudy Ho, Xavier Chang,
	Project_Global_Chrome_Upstream_Group

On Thu, Dec 19, 2024 at 11:08 AM Jason-JH.Lin <jason-jh.lin@mediatek.com> wrote:
>
> 1. Add compatible name and iommus property to mediatek,gce-mailbox.yaml
>    for MT8196.
>
>    - The compatible name "mediatek,mt8196-gce-mailbox" is added to
>      ensure that the device tree can correctly identify and configure
>      the GCE mailbox for the MT8196 SoC.
>
>    - The iommus property is added to specify the IOMMU configuration
>      for the GCE mailbox, ensuring proper memory management and access
>      control.
>
> 2. Add the Global Command Engine (GCE) binding header to define the
>    abstrct symbol binding to the GCE hardware settings of GCE Thread
>    Priority, GCE Subsys ID and GCE Event for MT8196.
>
>    - GCE Thread Priority: Defined to configure the priority level for
>      each GCE hardware thread. This is necessary for proper scheduling
>      and execution of commands in the GCE.
>
>    - GCE Subsys ID: Defined to specify the subsystem ID for GCE clients.
>      This is used to correctly address and access different subsystems
>      within the GCE.
>
>    - GCE Event: Defined to specify the events that the GCE can handle.
>      These events are used by the driver to synchronize and manage
>      hardware operations.
>
>    Examples of the binding usage in the driver code:
>    1) GCE Thread Priority:
>    - Defined in the header file: `#define CMDQ_THR_PRIO_4 4`
>    - Used in the Device Tree: `mboxes = <&gce0 0 CMDQ_THR_PRIO_4>;`
>    - Parsed and used in the driver to set thread priority:
>      ```c
>      static struct mbox_chan *cmdq_xlate(struct mbox_controller *mbox,i
>                                          const struct of_phandle_args *sp)
>      {
>         thread->priority = sp->args[1];
>      }
>      // set GCE thread priority to the priority level 4 for GCE thread 0
>      writel(thread->priority, thread->base + CMDQ_THR_PRIORITY);
>      ```
>
>    2) GCE Subsys ID:
>    - Defined in the header file: `#define SUBSYS_1c00XXXX 3`
>    - Used in the Device Tree:
>         `mediatek,gce-client-reg = <&gce SUBSYS_1c00XXXX 0x0000 0x1000>;`
>    - Parsed and used in the driver to configure subsys ID:
>      ```c
>      int cmdq_dev_get_client_reg(struct device *dev,
>                                  struct cmdq_client_reg *client_reg,
>                                  int idx)
>      {
>         client_reg->subsys = (u8)spec.args[0];
>         client_reg->offset = (u16)spec.args[1];
>      }
>      // GCE write the value to the register 0x1c000000 + 0x0000 + offset
>      cmdq_pkt_write(cmdq_handle, client_reg->subsys,
>                     client_reg->offset + offset, value);
>      ```
>
>    3) GCE Event:
>    - Defined in the header file:
>         `#define CMDQ_EVENT_VDO0_DISP_STREAM_DONE_0 574`
>    - Used in the Device Tree:
>         `mediatek,gce-events = <CMDQ_EVENT_VDO0_DISP_STREAM_DONE_0>;`
>    - Parsed and used in the driver to handle events:
>      ```c
>      int mtk_crtc_create(struct drm_device *drm_dev,
>                          const unsigned int *path,
>                          unsigned int path_len, int priv_data_index,
>                          const struct mtk_drm_route *conn_routes,
>                          unsigned int num_conn_routes)
>      {
>         of_property_read_u32_index(priv->mutex_node,
>                                    "mediatek,gce-events", i,
>                                    &mtk_crtc->cmdq_event);
>      }
>      // GCE clear the STREAM_DONE event sent from DISP_MUTEX hardware
>      cmdq_pkt_clear_event(cmdq_handle, mtk_crtc->cmdq_event);
>      ```
>
> Signed-off-by: Jason-JH.Lin <jason-jh.lin@mediatek.com>
> ---
>  .../mailbox/mediatek,gce-mailbox.yaml         |    4 +
>  .../dt-bindings/mailbox/mediatek,mt8196-gce.h | 1415 +++++++++++++++++
>  2 files changed, 1419 insertions(+)
>  create mode 100644 include/dt-bindings/mailbox/mediatek,mt8196-gce.h
>
> diff --git a/Documentation/devicetree/bindings/mailbox/mediatek,gce-mailbox.yaml b/Documentation/devicetree/bindings/mailbox/mediatek,gce-mailbox.yaml
> index cef9d7601398..73d6db34d64a 100644
> --- a/Documentation/devicetree/bindings/mailbox/mediatek,gce-mailbox.yaml
> +++ b/Documentation/devicetree/bindings/mailbox/mediatek,gce-mailbox.yaml
> @@ -25,6 +25,7 @@ properties:
>            - mediatek,mt8188-gce
>            - mediatek,mt8192-gce
>            - mediatek,mt8195-gce
> +          - mediatek,mt8196-gce
>        - items:
>            - const: mediatek,mt6795-gce
>            - const: mediatek,mt8173-gce
> @@ -49,6 +50,9 @@ properties:
>      items:
>        - const: gce
>
> +  iommus:
> +    maxItems: 1
> +
>  required:
>    - compatible
>    - "#mbox-cells"
> diff --git a/include/dt-bindings/mailbox/mediatek,mt8196-gce.h b/include/dt-bindings/mailbox/mediatek,mt8196-gce.h
> new file mode 100644
> index 000000000000..9e0700236033
> --- /dev/null
> +++ b/include/dt-bindings/mailbox/mediatek,mt8196-gce.h
> @@ -0,0 +1,1415 @@

1415 ?  90% seem unnecessary.

> +
> +/* GCE thread priority */
> +#define CMDQ_THR_PRIO_LOWEST   0
> +#define CMDQ_THR_PRIO_1                1
> +#define CMDQ_THR_PRIO_2                2
> +#define CMDQ_THR_PRIO_3                3
> +#define CMDQ_THR_PRIO_4                4
> +#define CMDQ_THR_PRIO_5                5
> +#define CMDQ_THR_PRIO_6                6
> +#define CMDQ_THR_PRIO_HIGHEST  7
>
 Only need to HIGHEST maybe


> +
> +/* GCE subsys table */
> +#define SUBSYS_1300XXXX                0
> +#define SUBSYS_1400XXXX                1
> +#define SUBSYS_1401XXXX                2
> +#define SUBSYS_1402XXXX                3
> +#define SUBSYS_1502XXXX                4
> +#define SUBSYS_1880XXXX                5
> +#define SUBSYS_1881XXXX                6
> +#define SUBSYS_1882XXXX                7
> +#define SUBSYS_1883XXXX                8
> +#define SUBSYS_1884XXXX                9
> +#define SUBSYS_1000XXXX                10
> +#define SUBSYS_1001XXXX                11
> +#define SUBSYS_1002XXXX                12
> +#define SUBSYS_1003XXXX                13
> +#define SUBSYS_1004XXXX                14
> +#define SUBSYS_1005XXXX                15
> +#define SUBSYS_1020XXXX                16
> +#define SUBSYS_1028XXXX                17
> +#define SUBSYS_1700XXXX                18
> +#define SUBSYS_1701XXXX                19
> +#define SUBSYS_1702XXXX                20
> +#define SUBSYS_1703XXXX                21
> +#define SUBSYS_1800XXXX                22
> +#define SUBSYS_1801XXXX                23
> +#define SUBSYS_1802XXXX                24
> +#define SUBSYS_1804XXXX                25
> +#define SUBSYS_1805XXXX                26
> +#define SUBSYS_1808XXXX                27
> +#define SUBSYS_180aXXXX                28
> +#define SUBSYS_180bXXXX                29
> +#define SUBSYS_NO_SUPPORT      99
> +
Keep only that you use now or plan in  the near future. But ok.

> +/* GCE-D hardware events */
> +#define CMDQ_EVENT_DISP0_STREAM_SOF0                                           0
> +#define CMDQ_EVENT_DISP0_STREAM_SOF1                                           1
> +#define CMDQ_EVENT_DISP0_STREAM_SOF2                                           2
> +#define CMDQ_EVENT_DISP0_STREAM_SOF3                                           3
> +#define CMDQ_EVENT_DISP0_STREAM_SOF4                                           4
> +#define CMDQ_EVENT_DISP0_STREAM_SOF5                                           5
> +#define CMDQ_EVENT_DISP0_STREAM_SOF6                                           6
> +#define CMDQ_EVENT_DISP0_STREAM_SOF7                                           7
> +#define CMDQ_EVENT_DISP0_STREAM_SOF8                                           8
> +#define CMDQ_EVENT_DISP0_STREAM_SOF9                                           9
> +#define CMDQ_EVENT_DISP0_STREAM_SOF10                                          10
> +#define CMDQ_EVENT_DISP0_STREAM_SOF11                                          11
> +#define CMDQ_EVENT_DISP0_STREAM_SOF12                                          12
> +#define CMDQ_EVENT_DISP0_STREAM_SOF13                                          13
> +#define CMDQ_EVENT_DISP0_STREAM_SOF14                                          14
> +#define CMDQ_EVENT_DISP0_STREAM_SOF15                                          15
>
 you mean
  #define CMDQ_EVENT_DISP0_STREAM_SOF(n)  n

> +#define CMDQ_EVENT_DISP0_FRAME_DONE_SEL0                                       16
> +#define CMDQ_EVENT_DISP0_FRAME_DONE_SEL1                                       17
> +#define CMDQ_EVENT_DISP0_FRAME_DONE_SEL2                                       18
> +#define CMDQ_EVENT_DISP0_FRAME_DONE_SEL3                                       19
> +#define CMDQ_EVENT_DISP0_FRAME_DONE_SEL4                                       20
> +#define CMDQ_EVENT_DISP0_FRAME_DONE_SEL5                                       21
> +#define CMDQ_EVENT_DISP0_FRAME_DONE_SEL6                                       22
> +#define CMDQ_EVENT_DISP0_FRAME_DONE_SEL7                                       23
> +#define CMDQ_EVENT_DISP0_FRAME_DONE_SEL8                                       24
> +#define CMDQ_EVENT_DISP0_FRAME_DONE_SEL9                                       25
> +#define CMDQ_EVENT_DISP0_FRAME_DONE_SEL10                                      26
> +#define CMDQ_EVENT_DISP0_FRAME_DONE_SEL11                                      27
> +#define CMDQ_EVENT_DISP0_FRAME_DONE_SEL12                                      28
> +#define CMDQ_EVENT_DISP0_FRAME_DONE_SEL13                                      29
> +#define CMDQ_EVENT_DISP0_FRAME_DONE_SEL14                                      30
> +#define CMDQ_EVENT_DISP0_FRAME_DONE_SEL15                                      31

   #define CMDQ_EVENT_DISP0_FRAME_DONE_SEL(n)
            (16 + n)


> +#define CMDQ_EVENT_DISP0_DISP_WDMA0_TARGET_LINE_END_ENG_EVENT                  32
> +#define CMDQ_EVENT_DISP0_DISP_WDMA0_SW_RST_DONE_ENG_EVENT                      33
> +#define CMDQ_EVENT_DISP0_DISP_POSTMASK1_RST_DONE_ENG_EVENT                     34
> +#define CMDQ_EVENT_DISP0_DISP_POSTMASK0_RST_DONE_ENG_EVENT                     35
> +#define CMDQ_EVENT_DISP0_DISP_MUTEX0_TIMEOUT_ENG_EVENT                         36
> +#define CMDQ_EVENT_DISP0_DISP_MUTEX0_REG_UPDATE_ENG_EVENT0                     37
> +#define CMDQ_EVENT_DISP0_DISP_MUTEX0_REG_UPDATE_ENG_EVENT1                     38
> +#define CMDQ_EVENT_DISP0_DISP_MUTEX0_REG_UPDATE_ENG_EVENT2                     39
> +#define CMDQ_EVENT_DISP0_DISP_MUTEX0_REG_UPDATE_ENG_EVENT3                     40
> +#define CMDQ_EVENT_DISP0_DISP_MUTEX0_REG_UPDATE_ENG_EVENT4                     41
> +#define CMDQ_EVENT_DISP0_DISP_MUTEX0_REG_UPDATE_ENG_EVENT5                     42
> +#define CMDQ_EVENT_DISP0_DISP_MUTEX0_REG_UPDATE_ENG_EVENT6                     43
> +#define CMDQ_EVENT_DISP0_DISP_MUTEX0_REG_UPDATE_ENG_EVENT7                     44
> +#define CMDQ_EVENT_DISP0_DISP_MUTEX0_REG_UPDATE_ENG_EVENT8                     45
> +#define CMDQ_EVENT_DISP0_DISP_MUTEX0_REG_UPDATE_ENG_EVENT9                     46
> +#define CMDQ_EVENT_DISP0_DISP_MUTEX0_REG_UPDATE_ENG_EVENT10                    47
> +#define CMDQ_EVENT_DISP0_DISP_MUTEX0_REG_UPDATE_ENG_EVENT11                    48
> +#define CMDQ_EVENT_DISP0_DISP_MUTEX0_REG_UPDATE_ENG_EVENT12                    49
> +#define CMDQ_EVENT_DISP0_DISP_MUTEX0_REG_UPDATE_ENG_EVENT13                    50
> +#define CMDQ_EVENT_DISP0_DISP_MUTEX0_REG_UPDATE_ENG_EVENT14                    51
> +#define CMDQ_EVENT_DISP0_DISP_MUTEX0_REG_UPDATE_ENG_EVENT15                    52
> +#define CMDQ_EVENT_DISP0_DISP_MUTEX0_GET_RELEASE_ENG_EVENT                     53
> +#define CMDQ_EVENT_DISP0_DISP_MDP_RDMA0_SW_RST_DONE_ENG_EVENT                  54
> +
 keep only the used ones and use

> +#define CMDQ_EVENT_DISP1_STREAM_SOF0                                           55
> +#define CMDQ_EVENT_DISP1_STREAM_SOF1                                           56
> +#define CMDQ_EVENT_DISP1_STREAM_SOF2                                           57
> +#define CMDQ_EVENT_DISP1_STREAM_SOF3                                           58
> +#define CMDQ_EVENT_DISP1_STREAM_SOF4                                           59
> +#define CMDQ_EVENT_DISP1_STREAM_SOF5                                           60
> +#define CMDQ_EVENT_DISP1_STREAM_SOF6                                           61
> +#define CMDQ_EVENT_DISP1_STREAM_SOF7                                           62
> +#define CMDQ_EVENT_DISP1_STREAM_SOF8                                           63
> +#define CMDQ_EVENT_DISP1_STREAM_SOF9                                           64
> +#define CMDQ_EVENT_DISP1_STREAM_SOF10                                          65
> +#define CMDQ_EVENT_DISP1_STREAM_SOF11                                          66
> +#define CMDQ_EVENT_DISP1_STREAM_SOF12                                          67
> +#define CMDQ_EVENT_DISP1_STREAM_SOF13                                          68
> +#define CMDQ_EVENT_DISP1_STREAM_SOF14                                          69
> +#define CMDQ_EVENT_DISP1_STREAM_SOF15                                          70
>
   (55 + n)

> +#define CMDQ_EVENT_DISP1_FRAME_DONE_SEL0                                       71
> +#define CMDQ_EVENT_DISP1_FRAME_DONE_SEL1                                       72
> +#define CMDQ_EVENT_DISP1_FRAME_DONE_SEL2                                       73
> +#define CMDQ_EVENT_DISP1_FRAME_DONE_SEL3                                       74
> +#define CMDQ_EVENT_DISP1_FRAME_DONE_SEL4                                       75
> +#define CMDQ_EVENT_DISP1_FRAME_DONE_SEL5                                       76
> +#define CMDQ_EVENT_DISP1_FRAME_DONE_SEL6                                       77
> +#define CMDQ_EVENT_DISP1_FRAME_DONE_SEL7                                       78
> +#define CMDQ_EVENT_DISP1_FRAME_DONE_SEL8                                       79
> +#define CMDQ_EVENT_DISP1_FRAME_DONE_SEL9                                       80
> +#define CMDQ_EVENT_DISP1_FRAME_DONE_SEL10                                      81
> +#define CMDQ_EVENT_DISP1_FRAME_DONE_SEL11                                      82
> +#define CMDQ_EVENT_DISP1_FRAME_DONE_SEL12                                      83
> +#define CMDQ_EVENT_DISP1_FRAME_DONE_SEL13                                      84
> +#define CMDQ_EVENT_DISP1_FRAME_DONE_SEL14                                      85
> +#define CMDQ_EVENT_DISP1_FRAME_DONE_SEL15                                      86
>
   (71  + n)

> +#define CMDQ_EVENT_DISP1_STREAM_DONE_ENG_EVENT0                                        87
> +#define CMDQ_EVENT_DISP1_STREAM_DONE_ENG_EVENT1                                        88
> +#define CMDQ_EVENT_DISP1_STREAM_DONE_ENG_EVENT2                                        89
> +#define CMDQ_EVENT_DISP1_STREAM_DONE_ENG_EVENT3                                        90
> +#define CMDQ_EVENT_DISP1_STREAM_DONE_ENG_EVENT4                                        91
> +#define CMDQ_EVENT_DISP1_STREAM_DONE_ENG_EVENT5                                        92
> +#define CMDQ_EVENT_DISP1_STREAM_DONE_ENG_EVENT6                                        93
> +#define CMDQ_EVENT_DISP1_STREAM_DONE_ENG_EVENT7                                        94
> +#define CMDQ_EVENT_DISP1_STREAM_DONE_ENG_EVENT8                                        95
> +#define CMDQ_EVENT_DISP1_STREAM_DONE_ENG_EVENT9                                        96
> +#define CMDQ_EVENT_DISP1_STREAM_DONE_ENG_EVENT10                               97
> +#define CMDQ_EVENT_DISP1_STREAM_DONE_ENG_EVENT11                               98
> +#define CMDQ_EVENT_DISP1_STREAM_DONE_ENG_EVENT12                               99
> +#define CMDQ_EVENT_DISP1_STREAM_DONE_ENG_EVENT13                               100
> +#define CMDQ_EVENT_DISP1_STREAM_DONE_ENG_EVENT14                               101
> +#define CMDQ_EVENT_DISP1_STREAM_DONE_ENG_EVENT15                               102
>
  (87 + n)

> +#define CMDQ_EVENT_DISP1_REG_UPDATE_DONE_ENG_EVENT0                            103
> +#define CMDQ_EVENT_DISP1_REG_UPDATE_DONE_ENG_EVENT1                            104
> +#define CMDQ_EVENT_DISP1_REG_UPDATE_DONE_ENG_EVENT2                            105
> +#define CMDQ_EVENT_DISP1_REG_UPDATE_DONE_ENG_EVENT3                            106
> +#define CMDQ_EVENT_DISP1_REG_UPDATE_DONE_ENG_EVENT4                            107
> +#define CMDQ_EVENT_DISP1_REG_UPDATE_DONE_ENG_EVENT5                            108
> +#define CMDQ_EVENT_DISP1_REG_UPDATE_DONE_ENG_EVENT6                            109
> +#define CMDQ_EVENT_DISP1_REG_UPDATE_DONE_ENG_EVENT7                            110
> +#define CMDQ_EVENT_DISP1_REG_UPDATE_DONE_ENG_EVENT8                            111
> +#define CMDQ_EVENT_DISP1_REG_UPDATE_DONE_ENG_EVENT9                            112
> +#define CMDQ_EVENT_DISP1_REG_UPDATE_DONE_ENG_EVENT10                           113
> +#define CMDQ_EVENT_DISP1_REG_UPDATE_DONE_ENG_EVENT11                           114
> +#define CMDQ_EVENT_DISP1_REG_UPDATE_DONE_ENG_EVENT12                           115
> +#define CMDQ_EVENT_DISP1_REG_UPDATE_DONE_ENG_EVENT13                           116
> +#define CMDQ_EVENT_DISP1_REG_UPDATE_DONE_ENG_EVENT14                           117
> +#define CMDQ_EVENT_DISP1_REG_UPDATE_DONE_ENG_EVENT15                           118
>
  you know

> +#define CMDQ_EVENT_DISP1_OCIP_SUBSYS_SRAM_ISOINT_ENG_EVENT                     119
> +#define CMDQ_EVENT_DISP1_DISP_WDMA4_TARGET_LINE_END_ENG_EVENT                  120
> +#define CMDQ_EVENT_DISP1_DISP_WDMA4_SW_RST_DONE_ENG_EVENT                      121
> +#define CMDQ_EVENT_DISP1_DISP_WDMA3_TARGET_LINE_END_ENG_EVENT                  122
> +#define CMDQ_EVENT_DISP1_DISP_WDMA3_SW_RST_DONE_ENG_EVENT                      123
> +#define CMDQ_EVENT_DISP1_DISP_WDMA2_TARGET_LINE_END_ENG_EVENT                  124
> +#define CMDQ_EVENT_DISP1_DISP_WDMA2_SW_RST_DONE_ENG_EVENT                      125
> +#define CMDQ_EVENT_DISP1_DISP_WDMA1_TARGET_LINE_END_ENG_EVENT                  126
> +#define CMDQ_EVENT_DISP1_DISP_WDMA1_SW_RST_DONE_ENG_EVENT                      127
> +#define CMDQ_EVENT_DISP1_DISP_MUTEX0_TIMEOUT_ENG_EVENT                         128
> +#define CMDQ_EVENT_DISP1_DISP_MUTEX0_GET_RLZ_ENG_EVENT                         129
> +#define CMDQ_EVENT_DISP1_DISP_MDP_RDMA1_SW_RST_DONE_ENG_EVENT                  130
> +#define CMDQ_EVENT_DISP1_DISP_GDMA0_SW_RST_DONE_ENG_EVENT                      131
> +#define CMDQ_EVENT_DISP1_DISP_DVO0_DVO_INT_TG_VSYNC_START_ENG_EVENT            132
> +#define CMDQ_EVENT_DISP1_DISP_DVO0_DVO_INT_TG_VSYNC_END_ENG_EVENT              133
> +#define CMDQ_EVENT_DISP1_DISP_DVO0_DVO_INT_TG_VRR_VFP_LAST_SAFE_BLANK_ENG_EVENT        134
> +#define CMDQ_EVENT_DISP1_DISP_DVO0_DVO_INT_TG_VFP_START_ENG_EVENT              135
> +#define CMDQ_EVENT_DISP1_DISP_DVO0_DVO_INT_TG_VFP_LAST_LINE_ENG_EVENT          136
> +#define CMDQ_EVENT_DISP1_DISP_DVO0_DVO_INT_TG_VDE_END_ENG_EVENT                        137
> +#define CMDQ_EVENT_DISP1_DISP_DVO0_DVO_INT_TG_TRIGGER_LOOP_CLR_ENG_EVENT       138
> +#define CMDQ_EVENT_DISP1_DISP_DVO0_DVO_INT_TG_TARGET_LINE1_ENG_EVENT           139
> +#define CMDQ_EVENT_DISP1_DISP_DVO0_DVO_INT_TG_TARGET_LINE0_ENG_EVENT           140
> +#define CMDQ_EVENT_DISP1_DISP_DVO0_DVO_EXT_TG_VSYNC_START_ENG_EVENT            141
> +#define CMDQ_EVENT_DISP1_DISP_DVO0_DVO_EXT_TG_VSYNC_END_ENG_EVENT              142
> +#define CMDQ_EVENT_DISP1_DISP_DVO0_DVO_EXT_TG_VDE_START_ENG_EVENT              143
> +#define CMDQ_EVENT_DISP1_DISP_DVO0_DVO_EXT_TG_VDE_END_ENG_EVENT                        144
>
  keep only the used ones

> +#define CMDQ_EVENT_DISP1_DISP_DSI2_ENG_EVENT0                                  145
> +#define CMDQ_EVENT_DISP1_DISP_DSI2_ENG_EVENT1                                  146
> +#define CMDQ_EVENT_DISP1_DISP_DSI2_ENG_EVENT2                                  147
> +#define CMDQ_EVENT_DISP1_DISP_DSI2_ENG_EVENT3                                  148
> +#define CMDQ_EVENT_DISP1_DISP_DSI2_ENG_EVENT4                                  149
> +#define CMDQ_EVENT_DISP1_DISP_DSI2_ENG_EVENT5                                  150
> +#define CMDQ_EVENT_DISP1_DISP_DSI2_ENG_EVENT6                                  151
> +#define CMDQ_EVENT_DISP1_DISP_DSI2_ENG_EVENT7                                  152
> +#define CMDQ_EVENT_DISP1_DISP_DSI2_ENG_EVENT8                                  153
> +#define CMDQ_EVENT_DISP1_DISP_DSI2_ENG_EVENT9                                  154
> +#define CMDQ_EVENT_DISP1_DISP_DSI2_ENG_EVENT10                                 155
> +#define CMDQ_EVENT_DISP1_DISP_DSI1_ENG_EVENT0                                  156
> +#define CMDQ_EVENT_DISP1_DISP_DSI1_ENG_EVENT1                                  157
> +#define CMDQ_EVENT_DISP1_DISP_DSI1_ENG_EVENT2                                  158
> +#define CMDQ_EVENT_DISP1_DISP_DSI1_ENG_EVENT3                                  159
> +#define CMDQ_EVENT_DISP1_DISP_DSI1_ENG_EVENT4                                  160
> +#define CMDQ_EVENT_DISP1_DISP_DSI1_ENG_EVENT5                                  161
> +#define CMDQ_EVENT_DISP1_DISP_DSI1_ENG_EVENT6                                  162
> +#define CMDQ_EVENT_DISP1_DISP_DSI1_ENG_EVENT7                                  163
> +#define CMDQ_EVENT_DISP1_DISP_DSI1_ENG_EVENT8                                  164
> +#define CMDQ_EVENT_DISP1_DISP_DSI1_ENG_EVENT9                                  165
> +#define CMDQ_EVENT_DISP1_DISP_DSI1_ENG_EVENT10                                 166
> +#define CMDQ_EVENT_DISP1_DISP_DSI1_ENG_EVENT11                                 167
> +#define CMDQ_EVENT_DISP1_DISP_DSI1_ENG_EVENT12                                 168
> +#define CMDQ_EVENT_DISP1_DISP_DSI1_ENG_EVENT13                                 169
> +#define CMDQ_EVENT_DISP1_DISP_DSI1_ENG_EVENT14                                 170
> +#define CMDQ_EVENT_DISP1_DISP_DSI1_ENG_EVENT15                                 171
> +#define CMDQ_EVENT_DISP1_DISP_DSI1_ENG_EVENT16                                 172
> +#define CMDQ_EVENT_DISP1_DISP_DSI1_ENG_EVENT17                                 173
> +#define CMDQ_EVENT_DISP1_DISP_DSI1_ENG_EVENT18                                 174
> +#define CMDQ_EVENT_DISP1_DISP_DSI1_ENG_EVENT19                                 175
> +#define CMDQ_EVENT_DISP1_DISP_DSI1_ENG_EVENT20                                 176
> +#define CMDQ_EVENT_DISP1_DISP_DSI1_ENG_EVENT21                                 177
> +#define CMDQ_EVENT_DISP1_DISP_DSI0_ENG_EVENT0                                  178
> +#define CMDQ_EVENT_DISP1_DISP_DSI0_ENG_EVENT1                                  179
> +#define CMDQ_EVENT_DISP1_DISP_DSI0_ENG_EVENT2                                  180
> +#define CMDQ_EVENT_DISP1_DISP_DSI0_ENG_EVENT3                                  181
> +#define CMDQ_EVENT_DISP1_DISP_DSI0_ENG_EVENT4                                  182
> +#define CMDQ_EVENT_DISP1_DISP_DSI0_ENG_EVENT5                                  183
> +#define CMDQ_EVENT_DISP1_DISP_DSI0_ENG_EVENT6                                  184
> +#define CMDQ_EVENT_DISP1_DISP_DSI0_ENG_EVENT7                                  185
> +#define CMDQ_EVENT_DISP1_DISP_DSI0_ENG_EVENT8                                  186
> +#define CMDQ_EVENT_DISP1_DISP_DSI0_ENG_EVENT9                                  187
> +#define CMDQ_EVENT_DISP1_DISP_DSI0_ENG_EVENT10                                 188
>

DSI2_ENG_EVENT(n)   (145 + n)
DSI1_ENG_EVENT(n)   (156 + n)
DSI0_ENG_EVENT(n)   (178 + n)

I am not going through the math exercises below but I believe you get the idea.

thanks

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

* Re: [PATCH v3 1/7] dt-bindings: mailbox: mediatek: Add MT8196 support for gce-mailbox
  2025-01-18 21:24   ` Jassi Brar
@ 2025-01-20  6:46     ` Chen-Yu Tsai
  2025-01-20 16:56       ` Jassi Brar
  0 siblings, 1 reply; 21+ messages in thread
From: Chen-Yu Tsai @ 2025-01-20  6:46 UTC (permalink / raw)
  To: Jassi Brar, AngeloGioacchino Del Regno
  Cc: Jason-JH.Lin, Chun-Kuang Hu, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Matthias Brugger, Mauro Carvalho Chehab,
	David Airlie, Simona Vetter, linux-kernel, devicetree, dri-devel,
	linux-mediatek, linux-arm-kernel, linux-media, Singo Chang,
	Nancy Lin, Moudy Ho, Xavier Chang,
	Project_Global_Chrome_Upstream_Group

On Sun, Jan 19, 2025 at 5:24 AM Jassi Brar <jassisinghbrar@gmail.com> wrote:
>
> On Thu, Dec 19, 2024 at 11:08 AM Jason-JH.Lin <jason-jh.lin@mediatek.com> wrote:
> >
> > 1. Add compatible name and iommus property to mediatek,gce-mailbox.yaml
> >    for MT8196.
> >
> >    - The compatible name "mediatek,mt8196-gce-mailbox" is added to
> >      ensure that the device tree can correctly identify and configure
> >      the GCE mailbox for the MT8196 SoC.
> >
> >    - The iommus property is added to specify the IOMMU configuration
> >      for the GCE mailbox, ensuring proper memory management and access
> >      control.
> >
> > 2. Add the Global Command Engine (GCE) binding header to define the
> >    abstrct symbol binding to the GCE hardware settings of GCE Thread
> >    Priority, GCE Subsys ID and GCE Event for MT8196.
> >
> >    - GCE Thread Priority: Defined to configure the priority level for
> >      each GCE hardware thread. This is necessary for proper scheduling
> >      and execution of commands in the GCE.
> >
> >    - GCE Subsys ID: Defined to specify the subsystem ID for GCE clients.
> >      This is used to correctly address and access different subsystems
> >      within the GCE.
> >
> >    - GCE Event: Defined to specify the events that the GCE can handle.
> >      These events are used by the driver to synchronize and manage
> >      hardware operations.
> >
> >    Examples of the binding usage in the driver code:
> >    1) GCE Thread Priority:
> >    - Defined in the header file: `#define CMDQ_THR_PRIO_4 4`
> >    - Used in the Device Tree: `mboxes = <&gce0 0 CMDQ_THR_PRIO_4>;`
> >    - Parsed and used in the driver to set thread priority:
> >      ```c
> >      static struct mbox_chan *cmdq_xlate(struct mbox_controller *mbox,i
> >                                          const struct of_phandle_args *sp)
> >      {
> >         thread->priority = sp->args[1];
> >      }
> >      // set GCE thread priority to the priority level 4 for GCE thread 0
> >      writel(thread->priority, thread->base + CMDQ_THR_PRIORITY);
> >      ```
> >
> >    2) GCE Subsys ID:
> >    - Defined in the header file: `#define SUBSYS_1c00XXXX 3`
> >    - Used in the Device Tree:
> >         `mediatek,gce-client-reg = <&gce SUBSYS_1c00XXXX 0x0000 0x1000>;`
> >    - Parsed and used in the driver to configure subsys ID:
> >      ```c
> >      int cmdq_dev_get_client_reg(struct device *dev,
> >                                  struct cmdq_client_reg *client_reg,
> >                                  int idx)
> >      {
> >         client_reg->subsys = (u8)spec.args[0];
> >         client_reg->offset = (u16)spec.args[1];
> >      }
> >      // GCE write the value to the register 0x1c000000 + 0x0000 + offset
> >      cmdq_pkt_write(cmdq_handle, client_reg->subsys,
> >                     client_reg->offset + offset, value);
> >      ```
> >
> >    3) GCE Event:
> >    - Defined in the header file:
> >         `#define CMDQ_EVENT_VDO0_DISP_STREAM_DONE_0 574`
> >    - Used in the Device Tree:
> >         `mediatek,gce-events = <CMDQ_EVENT_VDO0_DISP_STREAM_DONE_0>;`
> >    - Parsed and used in the driver to handle events:
> >      ```c
> >      int mtk_crtc_create(struct drm_device *drm_dev,
> >                          const unsigned int *path,
> >                          unsigned int path_len, int priv_data_index,
> >                          const struct mtk_drm_route *conn_routes,
> >                          unsigned int num_conn_routes)
> >      {
> >         of_property_read_u32_index(priv->mutex_node,
> >                                    "mediatek,gce-events", i,
> >                                    &mtk_crtc->cmdq_event);
> >      }
> >      // GCE clear the STREAM_DONE event sent from DISP_MUTEX hardware
> >      cmdq_pkt_clear_event(cmdq_handle, mtk_crtc->cmdq_event);
> >      ```
> >
> > Signed-off-by: Jason-JH.Lin <jason-jh.lin@mediatek.com>
> > ---
> >  .../mailbox/mediatek,gce-mailbox.yaml         |    4 +
> >  .../dt-bindings/mailbox/mediatek,mt8196-gce.h | 1415 +++++++++++++++++
> >  2 files changed, 1419 insertions(+)
> >  create mode 100644 include/dt-bindings/mailbox/mediatek,mt8196-gce.h
> >
> > diff --git a/Documentation/devicetree/bindings/mailbox/mediatek,gce-mailbox.yaml b/Documentation/devicetree/bindings/mailbox/mediatek,gce-mailbox.yaml
> > index cef9d7601398..73d6db34d64a 100644
> > --- a/Documentation/devicetree/bindings/mailbox/mediatek,gce-mailbox.yaml
> > +++ b/Documentation/devicetree/bindings/mailbox/mediatek,gce-mailbox.yaml
> > @@ -25,6 +25,7 @@ properties:
> >            - mediatek,mt8188-gce
> >            - mediatek,mt8192-gce
> >            - mediatek,mt8195-gce
> > +          - mediatek,mt8196-gce
> >        - items:
> >            - const: mediatek,mt6795-gce
> >            - const: mediatek,mt8173-gce
> > @@ -49,6 +50,9 @@ properties:
> >      items:
> >        - const: gce
> >
> > +  iommus:
> > +    maxItems: 1
> > +
> >  required:
> >    - compatible
> >    - "#mbox-cells"
> > diff --git a/include/dt-bindings/mailbox/mediatek,mt8196-gce.h b/include/dt-bindings/mailbox/mediatek,mt8196-gce.h
> > new file mode 100644
> > index 000000000000..9e0700236033
> > --- /dev/null
> > +++ b/include/dt-bindings/mailbox/mediatek,mt8196-gce.h
> > @@ -0,0 +1,1415 @@
>
> 1415 ?  90% seem unnecessary.
>
> > +
> > +/* GCE thread priority */
> > +#define CMDQ_THR_PRIO_LOWEST   0
> > +#define CMDQ_THR_PRIO_1                1
> > +#define CMDQ_THR_PRIO_2                2
> > +#define CMDQ_THR_PRIO_3                3
> > +#define CMDQ_THR_PRIO_4                4
> > +#define CMDQ_THR_PRIO_5                5
> > +#define CMDQ_THR_PRIO_6                6
> > +#define CMDQ_THR_PRIO_HIGHEST  7
> >
>  Only need to HIGHEST maybe

Or maybe we could just get rid of them and describe the valid values
and ordering in the YAML part?

> > +
> > +/* GCE subsys table */
> > +#define SUBSYS_1300XXXX                0
> > +#define SUBSYS_1400XXXX                1
> > +#define SUBSYS_1401XXXX                2
> > +#define SUBSYS_1402XXXX                3
> > +#define SUBSYS_1502XXXX                4
> > +#define SUBSYS_1880XXXX                5
> > +#define SUBSYS_1881XXXX                6
> > +#define SUBSYS_1882XXXX                7
> > +#define SUBSYS_1883XXXX                8
> > +#define SUBSYS_1884XXXX                9
> > +#define SUBSYS_1000XXXX                10
> > +#define SUBSYS_1001XXXX                11
> > +#define SUBSYS_1002XXXX                12
> > +#define SUBSYS_1003XXXX                13
> > +#define SUBSYS_1004XXXX                14
> > +#define SUBSYS_1005XXXX                15
> > +#define SUBSYS_1020XXXX                16
> > +#define SUBSYS_1028XXXX                17
> > +#define SUBSYS_1700XXXX                18
> > +#define SUBSYS_1701XXXX                19
> > +#define SUBSYS_1702XXXX                20
> > +#define SUBSYS_1703XXXX                21
> > +#define SUBSYS_1800XXXX                22
> > +#define SUBSYS_1801XXXX                23
> > +#define SUBSYS_1802XXXX                24
> > +#define SUBSYS_1804XXXX                25
> > +#define SUBSYS_1805XXXX                26
> > +#define SUBSYS_1808XXXX                27
> > +#define SUBSYS_180aXXXX                28
> > +#define SUBSYS_180bXXXX                29
> > +#define SUBSYS_NO_SUPPORT      99
> > +
> Keep only that you use now or plan in  the near future. But ok.
>
> > +/* GCE-D hardware events */
> > +#define CMDQ_EVENT_DISP0_STREAM_SOF0                                           0
> > +#define CMDQ_EVENT_DISP0_STREAM_SOF1                                           1
> > +#define CMDQ_EVENT_DISP0_STREAM_SOF2                                           2
> > +#define CMDQ_EVENT_DISP0_STREAM_SOF3                                           3
> > +#define CMDQ_EVENT_DISP0_STREAM_SOF4                                           4
> > +#define CMDQ_EVENT_DISP0_STREAM_SOF5                                           5
> > +#define CMDQ_EVENT_DISP0_STREAM_SOF6                                           6
> > +#define CMDQ_EVENT_DISP0_STREAM_SOF7                                           7
> > +#define CMDQ_EVENT_DISP0_STREAM_SOF8                                           8
> > +#define CMDQ_EVENT_DISP0_STREAM_SOF9                                           9
> > +#define CMDQ_EVENT_DISP0_STREAM_SOF10                                          10
> > +#define CMDQ_EVENT_DISP0_STREAM_SOF11                                          11
> > +#define CMDQ_EVENT_DISP0_STREAM_SOF12                                          12
> > +#define CMDQ_EVENT_DISP0_STREAM_SOF13                                          13
> > +#define CMDQ_EVENT_DISP0_STREAM_SOF14                                          14
> > +#define CMDQ_EVENT_DISP0_STREAM_SOF15                                          15
> >
>  you mean
>   #define CMDQ_EVENT_DISP0_STREAM_SOF(n)  n
>
> > +#define CMDQ_EVENT_DISP0_FRAME_DONE_SEL0                                       16
> > +#define CMDQ_EVENT_DISP0_FRAME_DONE_SEL1                                       17
> > +#define CMDQ_EVENT_DISP0_FRAME_DONE_SEL2                                       18
> > +#define CMDQ_EVENT_DISP0_FRAME_DONE_SEL3                                       19
> > +#define CMDQ_EVENT_DISP0_FRAME_DONE_SEL4                                       20
> > +#define CMDQ_EVENT_DISP0_FRAME_DONE_SEL5                                       21
> > +#define CMDQ_EVENT_DISP0_FRAME_DONE_SEL6                                       22
> > +#define CMDQ_EVENT_DISP0_FRAME_DONE_SEL7                                       23
> > +#define CMDQ_EVENT_DISP0_FRAME_DONE_SEL8                                       24
> > +#define CMDQ_EVENT_DISP0_FRAME_DONE_SEL9                                       25
> > +#define CMDQ_EVENT_DISP0_FRAME_DONE_SEL10                                      26
> > +#define CMDQ_EVENT_DISP0_FRAME_DONE_SEL11                                      27
> > +#define CMDQ_EVENT_DISP0_FRAME_DONE_SEL12                                      28
> > +#define CMDQ_EVENT_DISP0_FRAME_DONE_SEL13                                      29
> > +#define CMDQ_EVENT_DISP0_FRAME_DONE_SEL14                                      30
> > +#define CMDQ_EVENT_DISP0_FRAME_DONE_SEL15                                      31
>
>    #define CMDQ_EVENT_DISP0_FRAME_DONE_SEL(n)
>             (16 + n)
>
> > +#define CMDQ_EVENT_DISP0_DISP_WDMA0_TARGET_LINE_END_ENG_EVENT                  32
> > +#define CMDQ_EVENT_DISP0_DISP_WDMA0_SW_RST_DONE_ENG_EVENT                      33
> > +#define CMDQ_EVENT_DISP0_DISP_POSTMASK1_RST_DONE_ENG_EVENT                     34
> > +#define CMDQ_EVENT_DISP0_DISP_POSTMASK0_RST_DONE_ENG_EVENT                     35
> > +#define CMDQ_EVENT_DISP0_DISP_MUTEX0_TIMEOUT_ENG_EVENT                         36
> > +#define CMDQ_EVENT_DISP0_DISP_MUTEX0_REG_UPDATE_ENG_EVENT0                     37
> > +#define CMDQ_EVENT_DISP0_DISP_MUTEX0_REG_UPDATE_ENG_EVENT1                     38
> > +#define CMDQ_EVENT_DISP0_DISP_MUTEX0_REG_UPDATE_ENG_EVENT2                     39
> > +#define CMDQ_EVENT_DISP0_DISP_MUTEX0_REG_UPDATE_ENG_EVENT3                     40
> > +#define CMDQ_EVENT_DISP0_DISP_MUTEX0_REG_UPDATE_ENG_EVENT4                     41
> > +#define CMDQ_EVENT_DISP0_DISP_MUTEX0_REG_UPDATE_ENG_EVENT5                     42
> > +#define CMDQ_EVENT_DISP0_DISP_MUTEX0_REG_UPDATE_ENG_EVENT6                     43
> > +#define CMDQ_EVENT_DISP0_DISP_MUTEX0_REG_UPDATE_ENG_EVENT7                     44
> > +#define CMDQ_EVENT_DISP0_DISP_MUTEX0_REG_UPDATE_ENG_EVENT8                     45
> > +#define CMDQ_EVENT_DISP0_DISP_MUTEX0_REG_UPDATE_ENG_EVENT9                     46
> > +#define CMDQ_EVENT_DISP0_DISP_MUTEX0_REG_UPDATE_ENG_EVENT10                    47
> > +#define CMDQ_EVENT_DISP0_DISP_MUTEX0_REG_UPDATE_ENG_EVENT11                    48
> > +#define CMDQ_EVENT_DISP0_DISP_MUTEX0_REG_UPDATE_ENG_EVENT12                    49
> > +#define CMDQ_EVENT_DISP0_DISP_MUTEX0_REG_UPDATE_ENG_EVENT13                    50
> > +#define CMDQ_EVENT_DISP0_DISP_MUTEX0_REG_UPDATE_ENG_EVENT14                    51
> > +#define CMDQ_EVENT_DISP0_DISP_MUTEX0_REG_UPDATE_ENG_EVENT15                    52
> > +#define CMDQ_EVENT_DISP0_DISP_MUTEX0_GET_RELEASE_ENG_EVENT                     53
> > +#define CMDQ_EVENT_DISP0_DISP_MDP_RDMA0_SW_RST_DONE_ENG_EVENT                  54
> > +
>  keep only the used ones and use

This is the only publicly available table of the numbers. Having
the complete table somewhere would be nice. OOTH the numbers being
like IRQ or DRQ numbers, don't actually get used in the driver.
So maybe we could keep the full list but move it under the dts directory?


ChenYu

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

* Re: [PATCH v3 1/7] dt-bindings: mailbox: mediatek: Add MT8196 support for gce-mailbox
  2025-01-20  6:46     ` Chen-Yu Tsai
@ 2025-01-20 16:56       ` Jassi Brar
  2025-01-22  2:34         ` Jason-JH Lin (林睿祥)
  0 siblings, 1 reply; 21+ messages in thread
From: Jassi Brar @ 2025-01-20 16:56 UTC (permalink / raw)
  To: Chen-Yu Tsai
  Cc: AngeloGioacchino Del Regno, Jason-JH.Lin, Chun-Kuang Hu,
	Rob Herring, Krzysztof Kozlowski, Conor Dooley, Matthias Brugger,
	Mauro Carvalho Chehab, David Airlie, Simona Vetter, linux-kernel,
	devicetree, dri-devel, linux-mediatek, linux-arm-kernel,
	linux-media, Singo Chang, Nancy Lin, Moudy Ho, Xavier Chang,
	Project_Global_Chrome_Upstream_Group

On Mon, Jan 20, 2025 at 12:46 AM Chen-Yu Tsai <wenst@chromium.org> wrote:
>
> On Sun, Jan 19, 2025 at 5:24 AM Jassi Brar <jassisinghbrar@gmail.com> wrote:
> >
> > On Thu, Dec 19, 2024 at 11:08 AM Jason-JH.Lin <jason-jh.lin@mediatek.com> wrote:
> > >
> > > 1. Add compatible name and iommus property to mediatek,gce-mailbox.yaml
> > >    for MT8196.
> > >
> > >    - The compatible name "mediatek,mt8196-gce-mailbox" is added to
> > >      ensure that the device tree can correctly identify and configure
> > >      the GCE mailbox for the MT8196 SoC.
> > >
> > >    - The iommus property is added to specify the IOMMU configuration
> > >      for the GCE mailbox, ensuring proper memory management and access
> > >      control.
> > >
> > > 2. Add the Global Command Engine (GCE) binding header to define the
> > >    abstrct symbol binding to the GCE hardware settings of GCE Thread
> > >    Priority, GCE Subsys ID and GCE Event for MT8196.
> > >
> > >    - GCE Thread Priority: Defined to configure the priority level for
> > >      each GCE hardware thread. This is necessary for proper scheduling
> > >      and execution of commands in the GCE.
> > >
> > >    - GCE Subsys ID: Defined to specify the subsystem ID for GCE clients.
> > >      This is used to correctly address and access different subsystems
> > >      within the GCE.
> > >
> > >    - GCE Event: Defined to specify the events that the GCE can handle.
> > >      These events are used by the driver to synchronize and manage
> > >      hardware operations.
> > >
> > >    Examples of the binding usage in the driver code:
> > >    1) GCE Thread Priority:
> > >    - Defined in the header file: `#define CMDQ_THR_PRIO_4 4`
> > >    - Used in the Device Tree: `mboxes = <&gce0 0 CMDQ_THR_PRIO_4>;`
> > >    - Parsed and used in the driver to set thread priority:
> > >      ```c
> > >      static struct mbox_chan *cmdq_xlate(struct mbox_controller *mbox,i
> > >                                          const struct of_phandle_args *sp)
> > >      {
> > >         thread->priority = sp->args[1];
> > >      }
> > >      // set GCE thread priority to the priority level 4 for GCE thread 0
> > >      writel(thread->priority, thread->base + CMDQ_THR_PRIORITY);
> > >      ```
> > >
> > >    2) GCE Subsys ID:
> > >    - Defined in the header file: `#define SUBSYS_1c00XXXX 3`
> > >    - Used in the Device Tree:
> > >         `mediatek,gce-client-reg = <&gce SUBSYS_1c00XXXX 0x0000 0x1000>;`
> > >    - Parsed and used in the driver to configure subsys ID:
> > >      ```c
> > >      int cmdq_dev_get_client_reg(struct device *dev,
> > >                                  struct cmdq_client_reg *client_reg,
> > >                                  int idx)
> > >      {
> > >         client_reg->subsys = (u8)spec.args[0];
> > >         client_reg->offset = (u16)spec.args[1];
> > >      }
> > >      // GCE write the value to the register 0x1c000000 + 0x0000 + offset
> > >      cmdq_pkt_write(cmdq_handle, client_reg->subsys,
> > >                     client_reg->offset + offset, value);
> > >      ```
> > >
> > >    3) GCE Event:
> > >    - Defined in the header file:
> > >         `#define CMDQ_EVENT_VDO0_DISP_STREAM_DONE_0 574`
> > >    - Used in the Device Tree:
> > >         `mediatek,gce-events = <CMDQ_EVENT_VDO0_DISP_STREAM_DONE_0>;`
> > >    - Parsed and used in the driver to handle events:
> > >      ```c
> > >      int mtk_crtc_create(struct drm_device *drm_dev,
> > >                          const unsigned int *path,
> > >                          unsigned int path_len, int priv_data_index,
> > >                          const struct mtk_drm_route *conn_routes,
> > >                          unsigned int num_conn_routes)
> > >      {
> > >         of_property_read_u32_index(priv->mutex_node,
> > >                                    "mediatek,gce-events", i,
> > >                                    &mtk_crtc->cmdq_event);
> > >      }
> > >      // GCE clear the STREAM_DONE event sent from DISP_MUTEX hardware
> > >      cmdq_pkt_clear_event(cmdq_handle, mtk_crtc->cmdq_event);
> > >      ```
> > >
> > > Signed-off-by: Jason-JH.Lin <jason-jh.lin@mediatek.com>
> > > ---
> > >  .../mailbox/mediatek,gce-mailbox.yaml         |    4 +
> > >  .../dt-bindings/mailbox/mediatek,mt8196-gce.h | 1415 +++++++++++++++++
> > >  2 files changed, 1419 insertions(+)
> > >  create mode 100644 include/dt-bindings/mailbox/mediatek,mt8196-gce.h
> > >
> > > diff --git a/Documentation/devicetree/bindings/mailbox/mediatek,gce-mailbox.yaml b/Documentation/devicetree/bindings/mailbox/mediatek,gce-mailbox.yaml
> > > index cef9d7601398..73d6db34d64a 100644
> > > --- a/Documentation/devicetree/bindings/mailbox/mediatek,gce-mailbox.yaml
> > > +++ b/Documentation/devicetree/bindings/mailbox/mediatek,gce-mailbox.yaml
> > > @@ -25,6 +25,7 @@ properties:
> > >            - mediatek,mt8188-gce
> > >            - mediatek,mt8192-gce
> > >            - mediatek,mt8195-gce
> > > +          - mediatek,mt8196-gce
> > >        - items:
> > >            - const: mediatek,mt6795-gce
> > >            - const: mediatek,mt8173-gce
> > > @@ -49,6 +50,9 @@ properties:
> > >      items:
> > >        - const: gce
> > >
> > > +  iommus:
> > > +    maxItems: 1
> > > +
> > >  required:
> > >    - compatible
> > >    - "#mbox-cells"
> > > diff --git a/include/dt-bindings/mailbox/mediatek,mt8196-gce.h b/include/dt-bindings/mailbox/mediatek,mt8196-gce.h
> > > new file mode 100644
> > > index 000000000000..9e0700236033
> > > --- /dev/null
> > > +++ b/include/dt-bindings/mailbox/mediatek,mt8196-gce.h
> > > @@ -0,0 +1,1415 @@
> >
> > 1415 ?  90% seem unnecessary.
> >
> > > +
> > > +/* GCE thread priority */
> > > +#define CMDQ_THR_PRIO_LOWEST   0
> > > +#define CMDQ_THR_PRIO_1                1
> > > +#define CMDQ_THR_PRIO_2                2
> > > +#define CMDQ_THR_PRIO_3                3
> > > +#define CMDQ_THR_PRIO_4                4
> > > +#define CMDQ_THR_PRIO_5                5
> > > +#define CMDQ_THR_PRIO_6                6
> > > +#define CMDQ_THR_PRIO_HIGHEST  7
> > >
> >  Only need to HIGHEST maybe
>
> Or maybe we could just get rid of them and describe the valid values
> and ordering in the YAML part?
>
> > > +
> > > +/* GCE subsys table */
> > > +#define SUBSYS_1300XXXX                0
> > > +#define SUBSYS_1400XXXX                1
> > > +#define SUBSYS_1401XXXX                2
> > > +#define SUBSYS_1402XXXX                3
> > > +#define SUBSYS_1502XXXX                4
> > > +#define SUBSYS_1880XXXX                5
> > > +#define SUBSYS_1881XXXX                6
> > > +#define SUBSYS_1882XXXX                7
> > > +#define SUBSYS_1883XXXX                8
> > > +#define SUBSYS_1884XXXX                9
> > > +#define SUBSYS_1000XXXX                10
> > > +#define SUBSYS_1001XXXX                11
> > > +#define SUBSYS_1002XXXX                12
> > > +#define SUBSYS_1003XXXX                13
> > > +#define SUBSYS_1004XXXX                14
> > > +#define SUBSYS_1005XXXX                15
> > > +#define SUBSYS_1020XXXX                16
> > > +#define SUBSYS_1028XXXX                17
> > > +#define SUBSYS_1700XXXX                18
> > > +#define SUBSYS_1701XXXX                19
> > > +#define SUBSYS_1702XXXX                20
> > > +#define SUBSYS_1703XXXX                21
> > > +#define SUBSYS_1800XXXX                22
> > > +#define SUBSYS_1801XXXX                23
> > > +#define SUBSYS_1802XXXX                24
> > > +#define SUBSYS_1804XXXX                25
> > > +#define SUBSYS_1805XXXX                26
> > > +#define SUBSYS_1808XXXX                27
> > > +#define SUBSYS_180aXXXX                28
> > > +#define SUBSYS_180bXXXX                29
> > > +#define SUBSYS_NO_SUPPORT      99
> > > +
> > Keep only that you use now or plan in  the near future. But ok.
> >
> > > +/* GCE-D hardware events */
> > > +#define CMDQ_EVENT_DISP0_STREAM_SOF0                                           0
> > > +#define CMDQ_EVENT_DISP0_STREAM_SOF1                                           1
> > > +#define CMDQ_EVENT_DISP0_STREAM_SOF2                                           2
> > > +#define CMDQ_EVENT_DISP0_STREAM_SOF3                                           3
> > > +#define CMDQ_EVENT_DISP0_STREAM_SOF4                                           4
> > > +#define CMDQ_EVENT_DISP0_STREAM_SOF5                                           5
> > > +#define CMDQ_EVENT_DISP0_STREAM_SOF6                                           6
> > > +#define CMDQ_EVENT_DISP0_STREAM_SOF7                                           7
> > > +#define CMDQ_EVENT_DISP0_STREAM_SOF8                                           8
> > > +#define CMDQ_EVENT_DISP0_STREAM_SOF9                                           9
> > > +#define CMDQ_EVENT_DISP0_STREAM_SOF10                                          10
> > > +#define CMDQ_EVENT_DISP0_STREAM_SOF11                                          11
> > > +#define CMDQ_EVENT_DISP0_STREAM_SOF12                                          12
> > > +#define CMDQ_EVENT_DISP0_STREAM_SOF13                                          13
> > > +#define CMDQ_EVENT_DISP0_STREAM_SOF14                                          14
> > > +#define CMDQ_EVENT_DISP0_STREAM_SOF15                                          15
> > >
> >  you mean
> >   #define CMDQ_EVENT_DISP0_STREAM_SOF(n)  n
> >
> > > +#define CMDQ_EVENT_DISP0_FRAME_DONE_SEL0                                       16
> > > +#define CMDQ_EVENT_DISP0_FRAME_DONE_SEL1                                       17
> > > +#define CMDQ_EVENT_DISP0_FRAME_DONE_SEL2                                       18
> > > +#define CMDQ_EVENT_DISP0_FRAME_DONE_SEL3                                       19
> > > +#define CMDQ_EVENT_DISP0_FRAME_DONE_SEL4                                       20
> > > +#define CMDQ_EVENT_DISP0_FRAME_DONE_SEL5                                       21
> > > +#define CMDQ_EVENT_DISP0_FRAME_DONE_SEL6                                       22
> > > +#define CMDQ_EVENT_DISP0_FRAME_DONE_SEL7                                       23
> > > +#define CMDQ_EVENT_DISP0_FRAME_DONE_SEL8                                       24
> > > +#define CMDQ_EVENT_DISP0_FRAME_DONE_SEL9                                       25
> > > +#define CMDQ_EVENT_DISP0_FRAME_DONE_SEL10                                      26
> > > +#define CMDQ_EVENT_DISP0_FRAME_DONE_SEL11                                      27
> > > +#define CMDQ_EVENT_DISP0_FRAME_DONE_SEL12                                      28
> > > +#define CMDQ_EVENT_DISP0_FRAME_DONE_SEL13                                      29
> > > +#define CMDQ_EVENT_DISP0_FRAME_DONE_SEL14                                      30
> > > +#define CMDQ_EVENT_DISP0_FRAME_DONE_SEL15                                      31
> >
> >    #define CMDQ_EVENT_DISP0_FRAME_DONE_SEL(n)
> >             (16 + n)
> >
> > > +#define CMDQ_EVENT_DISP0_DISP_WDMA0_TARGET_LINE_END_ENG_EVENT                  32
> > > +#define CMDQ_EVENT_DISP0_DISP_WDMA0_SW_RST_DONE_ENG_EVENT                      33
> > > +#define CMDQ_EVENT_DISP0_DISP_POSTMASK1_RST_DONE_ENG_EVENT                     34
> > > +#define CMDQ_EVENT_DISP0_DISP_POSTMASK0_RST_DONE_ENG_EVENT                     35
> > > +#define CMDQ_EVENT_DISP0_DISP_MUTEX0_TIMEOUT_ENG_EVENT                         36
> > > +#define CMDQ_EVENT_DISP0_DISP_MUTEX0_REG_UPDATE_ENG_EVENT0                     37
> > > +#define CMDQ_EVENT_DISP0_DISP_MUTEX0_REG_UPDATE_ENG_EVENT1                     38
> > > +#define CMDQ_EVENT_DISP0_DISP_MUTEX0_REG_UPDATE_ENG_EVENT2                     39
> > > +#define CMDQ_EVENT_DISP0_DISP_MUTEX0_REG_UPDATE_ENG_EVENT3                     40
> > > +#define CMDQ_EVENT_DISP0_DISP_MUTEX0_REG_UPDATE_ENG_EVENT4                     41
> > > +#define CMDQ_EVENT_DISP0_DISP_MUTEX0_REG_UPDATE_ENG_EVENT5                     42
> > > +#define CMDQ_EVENT_DISP0_DISP_MUTEX0_REG_UPDATE_ENG_EVENT6                     43
> > > +#define CMDQ_EVENT_DISP0_DISP_MUTEX0_REG_UPDATE_ENG_EVENT7                     44
> > > +#define CMDQ_EVENT_DISP0_DISP_MUTEX0_REG_UPDATE_ENG_EVENT8                     45
> > > +#define CMDQ_EVENT_DISP0_DISP_MUTEX0_REG_UPDATE_ENG_EVENT9                     46
> > > +#define CMDQ_EVENT_DISP0_DISP_MUTEX0_REG_UPDATE_ENG_EVENT10                    47
> > > +#define CMDQ_EVENT_DISP0_DISP_MUTEX0_REG_UPDATE_ENG_EVENT11                    48
> > > +#define CMDQ_EVENT_DISP0_DISP_MUTEX0_REG_UPDATE_ENG_EVENT12                    49
> > > +#define CMDQ_EVENT_DISP0_DISP_MUTEX0_REG_UPDATE_ENG_EVENT13                    50
> > > +#define CMDQ_EVENT_DISP0_DISP_MUTEX0_REG_UPDATE_ENG_EVENT14                    51
> > > +#define CMDQ_EVENT_DISP0_DISP_MUTEX0_REG_UPDATE_ENG_EVENT15                    52
> > > +#define CMDQ_EVENT_DISP0_DISP_MUTEX0_GET_RELEASE_ENG_EVENT                     53
> > > +#define CMDQ_EVENT_DISP0_DISP_MDP_RDMA0_SW_RST_DONE_ENG_EVENT                  54
> > > +
> >  keep only the used ones and use
>
> This is the only publicly available table of the numbers. Having
> the complete table somewhere would be nice. OOTH the numbers being
> like IRQ or DRQ numbers, don't actually get used in the driver.
> So maybe we could keep the full list but move it under the dts directory?
>
Why introduce bloat in the kernel? We shouldn't be carrying what are
basically 'addition' tables, not even 'multiplication' ;)
The same knowledge can be represented concisely by the formula
  #define CMDQ_EVENT_DISP0_DISP_MUTEX0_REG_UPDATE_ENG_EVENT(n)  (n + 37)
especially for ~50 char defines

thnx

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

* Re: [PATCH v3 1/7] dt-bindings: mailbox: mediatek: Add MT8196 support for gce-mailbox
  2025-01-20 16:56       ` Jassi Brar
@ 2025-01-22  2:34         ` Jason-JH Lin (林睿祥)
  0 siblings, 0 replies; 21+ messages in thread
From: Jason-JH Lin (林睿祥) @ 2025-01-22  2:34 UTC (permalink / raw)
  To: jassisinghbrar@gmail.com, wenst@chromium.org
  Cc: Project_Global_Chrome_Upstream_Group, robh@kernel.org,
	linux-media@vger.kernel.org, simona@ffwll.ch, mchehab@kernel.org,
	AngeloGioacchino Del Regno, linux-kernel@vger.kernel.org,
	dri-devel@lists.freedesktop.org, conor+dt@kernel.org,
	linux-mediatek@lists.infradead.org, chunkuang.hu@kernel.org,
	devicetree@vger.kernel.org, krzk+dt@kernel.org,
	Singo Chang (張興國),
	Nancy Lin (林欣螢),
	linux-arm-kernel@lists.infradead.org, airlied@gmail.com,
	matthias.bgg@gmail.com, Xavier Chang (張獻文),
	Moudy Ho (何宗原)

Hi Jassi,

Thanks for the reviews.

[snip]


> > > > diff --git a/include/dt-bindings/mailbox/mediatek,mt8196-gce.h
> > > > b/include/dt-bindings/mailbox/mediatek,mt8196-gce.h
> > > > new file mode 100644
> > > > index 000000000000..9e0700236033
> > > > --- /dev/null
> > > > +++ b/include/dt-bindings/mailbox/mediatek,mt8196-gce.h

From the previous discussion with Krzysztof:
https://lore.kernel.org/all/42def68200b28b5bea3cbf091907343976482132.camel@mediatek.com/

We'll drop this dt-binding header, ad move it to the dts folder.

> > > > @@ -0,0 +1,1415 @@
> > > 
> > > 1415 ?  90% seem unnecessary.
> > > 
> > > > +
> > > > +/* GCE thread priority */
> > > > +#define CMDQ_THR_PRIO_LOWEST   0
> > > > +#define CMDQ_THR_PRIO_1                1
> > > > +#define CMDQ_THR_PRIO_2                2
> > > > +#define CMDQ_THR_PRIO_3                3
> > > > +#define CMDQ_THR_PRIO_4                4
> > > > +#define CMDQ_THR_PRIO_5                5
> > > > +#define CMDQ_THR_PRIO_6                6
> > > > +#define CMDQ_THR_PRIO_HIGHEST  7
> > > > 
> > >  Only need to HIGHEST maybe
> > 
> > Or maybe we could just get rid of them and describe the valid
> > values
> > and ordering in the YAML part?

But actually, even if we describe this in the YAML, most of the GCE
users still won't know what is the meaning of each mbox-cells.

So I think if we can keep these define to make dts more readable.
What do you think?

> > 
> > > > +
> > > > +/* GCE subsys table */
> > > > +#define SUBSYS_1300XXXX                0
> > > > +#define SUBSYS_1400XXXX                1
> > > > +#define SUBSYS_1401XXXX                2
> > > > +#define SUBSYS_1402XXXX                3
> > > > +#define SUBSYS_1502XXXX                4
> > > > +#define SUBSYS_1880XXXX                5
> > > > +#define SUBSYS_1881XXXX                6
> > > > +#define SUBSYS_1882XXXX                7
> > > > +#define SUBSYS_1883XXXX                8
> > > > +#define SUBSYS_1884XXXX                9
> > > > +#define SUBSYS_1000XXXX                10
> > > > +#define SUBSYS_1001XXXX                11
> > > > +#define SUBSYS_1002XXXX                12
> > > > +#define SUBSYS_1003XXXX                13
> > > > +#define SUBSYS_1004XXXX                14
> > > > +#define SUBSYS_1005XXXX                15
> > > > +#define SUBSYS_1020XXXX                16
> > > > +#define SUBSYS_1028XXXX                17
> > > > +#define SUBSYS_1700XXXX                18
> > > > +#define SUBSYS_1701XXXX                19
> > > > +#define SUBSYS_1702XXXX                20
> > > > +#define SUBSYS_1703XXXX                21
> > > > +#define SUBSYS_1800XXXX                22
> > > > +#define SUBSYS_1801XXXX                23
> > > > +#define SUBSYS_1802XXXX                24
> > > > +#define SUBSYS_1804XXXX                25
> > > > +#define SUBSYS_1805XXXX                26
> > > > +#define SUBSYS_1808XXXX                27
> > > > +#define SUBSYS_180aXXXX                28
> > > > +#define SUBSYS_180bXXXX                29
> > > > +#define SUBSYS_NO_SUPPORT      99
> > > > +
> > > Keep only that you use now or plan in  the near future. But ok.

I think we can drop this in MT8196 because GCE hardware designer didn't
change these subsys id from the previous SoCs.

Almost all of the device register are over 0x3000_0000, so it's no
longer to use in MT8196.

> > > 
> > > > +/* GCE-D hardware events */
> > > > +#define
> > > > CMDQ_EVENT_DISP0_STREAM_SOF0                                   
> > > >         0
> > > > +#define
> > > > CMDQ_EVENT_DISP0_STREAM_SOF1                                   
> > > >         1
> > > > +#define
> > > > CMDQ_EVENT_DISP0_STREAM_SOF2                                   
> > > >         2
> > > > +#define
> > > > CMDQ_EVENT_DISP0_STREAM_SOF3                                   
> > > >         3
> > > > +#define
> > > > CMDQ_EVENT_DISP0_STREAM_SOF4                                   
> > > >         4
> > > > +#define
> > > > CMDQ_EVENT_DISP0_STREAM_SOF5                                   
> > > >         5
> > > > +#define
> > > > CMDQ_EVENT_DISP0_STREAM_SOF6                                   
> > > >         6
> > > > +#define
> > > > CMDQ_EVENT_DISP0_STREAM_SOF7                                   
> > > >         7
> > > > +#define
> > > > CMDQ_EVENT_DISP0_STREAM_SOF8                                   
> > > >         8
> > > > +#define
> > > > CMDQ_EVENT_DISP0_STREAM_SOF9                                   
> > > >         9
> > > > +#define
> > > > CMDQ_EVENT_DISP0_STREAM_SOF10                                  
> > > >         10
> > > > +#define
> > > > CMDQ_EVENT_DISP0_STREAM_SOF11                                  
> > > >         11
> > > > +#define
> > > > CMDQ_EVENT_DISP0_STREAM_SOF12                                  
> > > >         12
> > > > +#define
> > > > CMDQ_EVENT_DISP0_STREAM_SOF13                                  
> > > >         13
> > > > +#define
> > > > CMDQ_EVENT_DISP0_STREAM_SOF14                                  
> > > >         14
> > > > +#define
> > > > CMDQ_EVENT_DISP0_STREAM_SOF15                                  
> > > >         15
> > > > 
> > >  you mean
> > >   #define CMDQ_EVENT_DISP0_STREAM_SOF(n)  n

Yes, it's the same meaning.

[snip]

> > > > +#define
> > > > CMDQ_EVENT_DISP0_DISP_WDMA0_TARGET_LINE_END_ENG_EVENT          
> > > >         32
> > > > +#define
> > > > CMDQ_EVENT_DISP0_DISP_WDMA0_SW_RST_DONE_ENG_EVENT              
> > > >         33
> > > > +#define
> > > > CMDQ_EVENT_DISP0_DISP_POSTMASK1_RST_DONE_ENG_EVENT             
> > > >         34
> > > > +#define
> > > > CMDQ_EVENT_DISP0_DISP_POSTMASK0_RST_DONE_ENG_EVENT             
> > > >         35
> > > > +#define
> > > > CMDQ_EVENT_DISP0_DISP_MUTEX0_TIMEOUT_ENG_EVENT                 
> > > >         36
> > > > +#define
> > > > CMDQ_EVENT_DISP0_DISP_MUTEX0_REG_UPDATE_ENG_EVENT0             
> > > >         37
> > > > +#define
> > > > CMDQ_EVENT_DISP0_DISP_MUTEX0_REG_UPDATE_ENG_EVENT1             
> > > >         38
> > > > +#define
> > > > CMDQ_EVENT_DISP0_DISP_MUTEX0_REG_UPDATE_ENG_EVENT2             
> > > >         39
> > > > +#define
> > > > CMDQ_EVENT_DISP0_DISP_MUTEX0_REG_UPDATE_ENG_EVENT3             
> > > >         40
> > > > +#define
> > > > CMDQ_EVENT_DISP0_DISP_MUTEX0_REG_UPDATE_ENG_EVENT4             
> > > >         41
> > > > +#define
> > > > CMDQ_EVENT_DISP0_DISP_MUTEX0_REG_UPDATE_ENG_EVENT5             
> > > >         42
> > > > +#define
> > > > CMDQ_EVENT_DISP0_DISP_MUTEX0_REG_UPDATE_ENG_EVENT6             
> > > >         43
> > > > +#define
> > > > CMDQ_EVENT_DISP0_DISP_MUTEX0_REG_UPDATE_ENG_EVENT7             
> > > >         44
> > > > +#define
> > > > CMDQ_EVENT_DISP0_DISP_MUTEX0_REG_UPDATE_ENG_EVENT8             
> > > >         45
> > > > +#define
> > > > CMDQ_EVENT_DISP0_DISP_MUTEX0_REG_UPDATE_ENG_EVENT9             
> > > >         46
> > > > +#define
> > > > CMDQ_EVENT_DISP0_DISP_MUTEX0_REG_UPDATE_ENG_EVENT10            
> > > >         47
> > > > +#define
> > > > CMDQ_EVENT_DISP0_DISP_MUTEX0_REG_UPDATE_ENG_EVENT11            
> > > >         48
> > > > +#define
> > > > CMDQ_EVENT_DISP0_DISP_MUTEX0_REG_UPDATE_ENG_EVENT12            
> > > >         49
> > > > +#define
> > > > CMDQ_EVENT_DISP0_DISP_MUTEX0_REG_UPDATE_ENG_EVENT13            
> > > >         50
> > > > +#define
> > > > CMDQ_EVENT_DISP0_DISP_MUTEX0_REG_UPDATE_ENG_EVENT14            
> > > >         51
> > > > +#define
> > > > CMDQ_EVENT_DISP0_DISP_MUTEX0_REG_UPDATE_ENG_EVENT15            
> > > >         52
> > > > +#define
> > > > CMDQ_EVENT_DISP0_DISP_MUTEX0_GET_RELEASE_ENG_EVENT             
> > > >         53
> > > > +#define
> > > > CMDQ_EVENT_DISP0_DISP_MDP_RDMA0_SW_RST_DONE_ENG_EVENT          
> > > >         54
> > > > +
> > >  keep only the used ones and use
> > 
> > This is the only publicly available table of the numbers. Having
> > the complete table somewhere would be nice. OOTH the numbers being
> > like IRQ or DRQ numbers, don't actually get used in the driver.
> > So maybe we could keep the full list but move it under the dts
> > directory?
> > 
> Why introduce bloat in the kernel? We shouldn't be carrying what are
> basically 'addition' tables, not even 'multiplication' ;)
> The same knowledge can be represented concisely by the formula
>   #define CMDQ_EVENT_DISP0_DISP_MUTEX0_REG_UPDATE_ENG_EVENT(n)  (n +
> 37)
> especially for ~50 char defines
> 
> thnx

I agree with you, I'll simplify the define with post-fixed numbers, and
move it to dts folder once the mt8196.dtsi with gce node is submitted.

Thanks for your suggestion.

Regards,
Jason-JH Lin

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

end of thread, other threads:[~2025-01-22  2:35 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-12-19 17:07 [PATCH v3 0/7] Add GCE support for MT8196 Jason-JH.Lin
2024-12-19 17:07 ` [PATCH v3 1/7] dt-bindings: mailbox: mediatek: Add MT8196 support for gce-mailbox Jason-JH.Lin
2024-12-27  8:11   ` Krzysztof Kozlowski
2024-12-30  2:25     ` Jason-JH Lin (林睿祥)
2024-12-27  8:13   ` Krzysztof Kozlowski
2024-12-30  9:23     ` Jason-JH Lin (林睿祥)
2025-01-03 17:04       ` Krzysztof Kozlowski
2025-01-07  2:42         ` Jason-JH Lin (林睿祥)
2025-01-07  6:16           ` Krzysztof Kozlowski
2025-01-07  7:26             ` Jason-JH Lin (林睿祥)
2025-01-18 21:24   ` Jassi Brar
2025-01-20  6:46     ` Chen-Yu Tsai
2025-01-20 16:56       ` Jassi Brar
2025-01-22  2:34         ` Jason-JH Lin (林睿祥)
2024-12-19 17:07 ` [PATCH v3 2/7] mailbox: mtk-cmdq: Add driver data to support for MT8196 Jason-JH.Lin
2024-12-19 17:07 ` [PATCH v3 3/7] soc: mediatek: mtk-cmdq: Add pa_base parsing for unsupported subsys ID hardware Jason-JH.Lin
2024-12-19 17:07 ` [PATCH v3 4/7] soc: mediatek: mtk-cmdq: Add mminfra_offset compatibility for DRAM address Jason-JH.Lin
2024-12-19 17:07 ` [PATCH v3 5/7] soc: mediatek: Add programming flow for unsupported subsys ID hardware Jason-JH.Lin
2024-12-19 17:07 ` [PATCH v3 6/7] drm/mediatek: " Jason-JH.Lin
2024-12-24  5:21   ` CK Hu (胡俊光)
2024-12-19 17:08 ` [PATCH v3 7/7] media: mediatek: mdp3: " Jason-JH.Lin

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