aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHoulong Wei <houlong.wei@mediatek.com>2018-07-24 21:26:39 -0400
committerJassi Brar <jaswinder.singh@linaro.org>2018-08-03 10:22:14 -0400
commit1c82407aa302774b24bf619e56973aa97cbf25bd (patch)
tree1daa665747a50d0a8c88eea4da5266755f61d804
parenta2b79838b891718dd4f0caf86dfa193af789245d (diff)
dt-bindings: soc: Add documentation for the MediaTek GCE unit
This adds documentation for the MediaTek Global Command Engine (GCE) unit found in MT8173 SoCs. Signed-off-by: Houlong Wei <houlong.wei@mediatek.com> Signed-off-by: HS Liao <hs.liao@mediatek.com> Reviewed-by: Rob Herring <robh@kernel.org> Signed-off-by: Jassi Brar <jaswinder.singh@linaro.org>
-rw-r--r--Documentation/devicetree/bindings/mailbox/mtk-gce.txt57
-rw-r--r--include/dt-bindings/gce/mt8173-gce.h44
2 files changed, 101 insertions, 0 deletions
diff --git a/Documentation/devicetree/bindings/mailbox/mtk-gce.txt b/Documentation/devicetree/bindings/mailbox/mtk-gce.txt
new file mode 100644
index 000000000000..7d72b21c9e94
--- /dev/null
+++ b/Documentation/devicetree/bindings/mailbox/mtk-gce.txt
@@ -0,0 +1,57 @@
1MediaTek GCE
2===============
3
4The Global Command Engine (GCE) is used to help read/write registers with
5critical time limitation, such as updating display configuration during the
6vblank. The GCE can be used to implement the Command Queue (CMDQ) driver.
7
8CMDQ driver uses mailbox framework for communication. Please refer to
9mailbox.txt for generic information about mailbox device-tree bindings.
10
11Required properties:
12- compatible: Must be "mediatek,mt8173-gce"
13- reg: Address range of the GCE unit
14- interrupts: The interrupt signal from the GCE block
15- clock: Clocks according to the common clock binding
16- clock-names: Must be "gce" to stand for GCE clock
17- #mbox-cells: Should be 3.
18 <&phandle channel priority atomic_exec>
19 phandle: Label name of a gce node.
20 channel: Channel of mailbox. Be equal to the thread id of GCE.
21 priority: Priority of GCE thread.
22 atomic_exec: GCE processing continuous packets of commands in atomic
23 way.
24
25Required properties for a client device:
26- mboxes: Client use mailbox to communicate with GCE, it should have this
27 property and list of phandle, mailbox specifiers.
28- mediatek,gce-subsys: u32, specify the sub-system id which is corresponding
29 to the register address.
30
31Some vaules of properties are defined in 'dt-bindings/gce/mt8173-gce.h'. Such as
32sub-system ids, thread priority, event ids.
33
34Example:
35
36 gce: gce@10212000 {
37 compatible = "mediatek,mt8173-gce";
38 reg = <0 0x10212000 0 0x1000>;
39 interrupts = <GIC_SPI 135 IRQ_TYPE_LEVEL_LOW>;
40 clocks = <&infracfg CLK_INFRA_GCE>;
41 clock-names = "gce";
42 thread-num = CMDQ_THR_MAX_COUNT;
43 #mbox-cells = <3>;
44 };
45
46Example for a client device:
47
48 mmsys: clock-controller@14000000 {
49 compatible = "mediatek,mt8173-mmsys";
50 mboxes = <&gce 0 CMDQ_THR_PRIO_LOWEST 1>,
51 <&gce 1 CMDQ_THR_PRIO_LOWEST 1>;
52 mediatek,gce-subsys = <SUBSYS_1400XXXX>;
53 mutex-event-eof = <CMDQ_EVENT_MUTEX0_STREAM_EOF
54 CMDQ_EVENT_MUTEX1_STREAM_EOF>;
55
56 ...
57 };
diff --git a/include/dt-bindings/gce/mt8173-gce.h b/include/dt-bindings/gce/mt8173-gce.h
new file mode 100644
index 000000000000..ffcf94ba96c6
--- /dev/null
+++ b/include/dt-bindings/gce/mt8173-gce.h
@@ -0,0 +1,44 @@
1/* SPDX-License-Identifier: GPL-2.0 */
2/*
3 * Copyright (c) 2018 MediaTek Inc.
4 * Author: Houlong Wei <houlong.wei@mediatek.com>
5 *
6 */
7
8#ifndef _DT_BINDINGS_GCE_MT8173_H
9#define _DT_BINDINGS_GCE_MT8173_H
10
11/* GCE HW thread priority */
12#define CMDQ_THR_PRIO_LOWEST 0
13#define CMDQ_THR_PRIO_HIGHEST 1
14
15/* GCE SUBSYS */
16#define SUBSYS_1400XXXX 1
17#define SUBSYS_1401XXXX 2
18#define SUBSYS_1402XXXX 3
19
20/* GCE HW EVENT */
21#define CMDQ_EVENT_DISP_OVL0_SOF 11
22#define CMDQ_EVENT_DISP_OVL1_SOF 12
23#define CMDQ_EVENT_DISP_RDMA0_SOF 13
24#define CMDQ_EVENT_DISP_RDMA1_SOF 14
25#define CMDQ_EVENT_DISP_RDMA2_SOF 15
26#define CMDQ_EVENT_DISP_WDMA0_SOF 16
27#define CMDQ_EVENT_DISP_WDMA1_SOF 17
28#define CMDQ_EVENT_DISP_OVL0_EOF 39
29#define CMDQ_EVENT_DISP_OVL1_EOF 40
30#define CMDQ_EVENT_DISP_RDMA0_EOF 41
31#define CMDQ_EVENT_DISP_RDMA1_EOF 42
32#define CMDQ_EVENT_DISP_RDMA2_EOF 43
33#define CMDQ_EVENT_DISP_WDMA0_EOF 44
34#define CMDQ_EVENT_DISP_WDMA1_EOF 45
35#define CMDQ_EVENT_MUTEX0_STREAM_EOF 53
36#define CMDQ_EVENT_MUTEX1_STREAM_EOF 54
37#define CMDQ_EVENT_MUTEX2_STREAM_EOF 55
38#define CMDQ_EVENT_MUTEX3_STREAM_EOF 56
39#define CMDQ_EVENT_MUTEX4_STREAM_EOF 57
40#define CMDQ_EVENT_DISP_RDMA0_UNDERRUN 63
41#define CMDQ_EVENT_DISP_RDMA1_UNDERRUN 64
42#define CMDQ_EVENT_DISP_RDMA2_UNDERRUN 65
43
44#endif