Skip to contentSkip to conversation

Mediatek MT8173 CMDQ support

RFC Superseded HS Liao 2 participants 5 messages Mar 1, 2016 – Mar 5, 2016

Subsystems (2)

v2 of 20 Superseded Latest is v20 →

lore
Share & tools
lore

HS Liao

author
#0 lore raw

v2 cover Mediatek MT8173 CMDQ support

Hi,

This is Mediatek MT8173 Command Queue(CMDQ) driver. The CMDQ is used to help read/write registers with critical time limitation, such as updating display configuration during the vblank. It controls Global Command Engine (GCE) hardware to achieve this requirement.

These patches have a build dependency on top of v4.5-rc1.

Changes since v1:
- update device tree binding doc
- use void* for base address
- use size_t for "size in bytes"
- use cmdq_thread instead of thread id
- use flags instead of scenarios
- call cmdq_event_reset() in suitable places
- use ktime instead of sched_clock
- use struct device instead of struct platform_device if possible
- rename recorder to record
- correct some typos and remove some useless code

Best regards,
HS Liao

HS Liao (3):
dt-bindings: soc: Add documentation for the MediaTek GCE unit
arm64: dts: mt8173: Add GCE node
CMDQ: Mediatek CMDQ driver

 .../devicetree/bindings/soc/mediatek/gce.txt       |   34 +
 arch/arm64/boot/dts/mediatek/mt8173.dtsi           |    8 +
 drivers/soc/mediatek/Kconfig                       |   10 +
 drivers/soc/mediatek/Makefile                      |    1 +
 drivers/soc/mediatek/mtk-cmdq.c                    | 2788 ++++++++++++++++++++
 include/soc/mediatek/cmdq.h                        |  211 ++
 6 files changed, 3052 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/soc/mediatek/gce.txt
 create mode 100644 drivers/soc/mediatek/mtk-cmdq.c
 create mode 100644 include/soc/mediatek/cmdq.h
Signature · 1 line
1.9.1
author
#1 lore raw

RFC v2 1/3 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.

---
 .../devicetree/bindings/soc/mediatek/gce.txt       |   34 ++++++++++++++++++++
 1 file changed, 34 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/soc/mediatek/gce.txt
Documentation/devicetree/bindings/soc/mediatek/gce.txt new file +34 -0
new file mode 100644
index 0000000..eff07e2
@@ -0,0 +1,34 @@
+MediaTek GCE
+===============
+
+The Global Command Engine (GCE) is used to help read/write registers with
+critical time limitation, such as updating display configuration during the
+vblank. The GCE can be used to implement the Command Queue (CMDQ) driver.
+
+Required properties:
+- compatible: Must be "mediatek,mt8173-gce"
+- reg: Address range of the GCE unit
+- interrupts: The interrupt signal from the GCE block
+- clock: Clocks according to the common clock binding
+- clock-names: Must be "gce" to stand for GCE clock
+
+Required properties for a client device:
+- mediatek,gce: Should point to the respective GCE block
+
+Example:
+
+	gce: gce at 10212000 {
+		compatible = "mediatek,mt8173-gce";
+		reg = <0 0x10212000 0 0x1000>;
+		interrupts = <GIC_SPI 135 IRQ_TYPE_LEVEL_LOW>;
+		clocks = <&infracfg CLK_INFRA_GCE>;
+		clock-names = "gce";
+	};
+
+Example for a client device:
+
+	mmsys: clock-controller at 14000000 {
+		compatible = "mediatek,mt8173-mmsys";
+		mediatek,gce = <&gce>;
+		...
+	};
Signature · 1 line
1.7.9.5
author
#3 lore raw

RFC v2 2/3 arm64: dts: mt8173: Add GCE node

In reply to HS Liao

This patch adds the device node of the GCE hardware for CMDQ module.

---
 arch/arm64/boot/dts/mediatek/mt8173.dtsi |    8 ++++++++
 1 file changed, 8 insertions(+)
arch/arm64/boot/dts/mediatek/mt8173.dtsi +8 -0
index ec135ea..6089095 100644
@@ -283,6 +283,14 @@
 			#clock-cells = <1>;
 		};
 
+		gce: gce at 10212000 {
+			compatible = "mediatek,mt8173-gce";
+			reg = <0 0x10212000 0 0x1000>;
+			interrupts = <GIC_SPI 135 IRQ_TYPE_LEVEL_LOW>;
+			clocks = <&infracfg CLK_INFRA_GCE>;
+			clock-names = "gce";
+		};
+
 		gic: interrupt-controller at 10220000 {
 			compatible = "arm,gic-400";
 			#interrupt-cells = <3>;
Signature · 1 line
1.7.9.5
author
#4 lore raw

RFC v2 3/3 CMDQ: Mediatek CMDQ driver

In reply to HS Liao

This patch is first version of Mediatek Command Queue(CMDQ) driver. The CMDQ is used to help read/write registers with critical time limitation, such as updating display configuration during the vblank. It controls Global Command Engine (GCE) hardware to achieve this requirement. Currently, CMDQ only supports display related hardwares, but we expect it can be extended to other hardwares for future requirements.

---
 drivers/soc/mediatek/Kconfig    |   10 +
 drivers/soc/mediatek/Makefile   |    1 +
 drivers/soc/mediatek/mtk-cmdq.c | 2788 +++++++++++++++++++++++++++++++++++++++
 include/soc/mediatek/cmdq.h     |  211 +++
 4 files changed, 3010 insertions(+)
 create mode 100644 drivers/soc/mediatek/mtk-cmdq.c
 create mode 100644 include/soc/mediatek/cmdq.h
drivers/soc/mediatek/Kconfig +10 -0
index 0a4ea80..c4ad75c 100644
@@ -1,6 +1,16 @@
 #
 # MediaTek SoC drivers
 #
+config MTK_CMDQ
+	bool "MediaTek CMDQ Support"
+	depends on ARCH_MEDIATEK || COMPILE_TEST
+	select MTK_INFRACFG
+	help
+	  Say yes here to add support for the MediaTek Command Queue (CMDQ)
+	  driver. The CMDQ is used to help read/write registers with critical
+	  time limitation, such as updating display configuration during the
+	  vblank.
+
 config MTK_INFRACFG
 	bool "MediaTek INFRACFG Support"
 	depends on ARCH_MEDIATEK || COMPILE_TEST
drivers/soc/mediatek/Makefile +1 -0
index 12998b0..f7397ef 100644
@@ -1,3 +1,4 @@
+obj-$(CONFIG_MTK_CMDQ) += mtk-cmdq.o
 obj-$(CONFIG_MTK_INFRACFG) += mtk-infracfg.o
 obj-$(CONFIG_MTK_PMIC_WRAP) += mtk-pmic-wrap.o
 obj-$(CONFIG_MTK_SCPSYS) += mtk-scpsys.o
drivers/soc/mediatek/mtk-cmdq.c new file +2788 -0

2,788 lines not on this page · raw message

include/soc/mediatek/cmdq.h new file +211 -0

192 lines not on this page · raw message

The rest of this diff is not shown. View the raw message.

Signature · 1 line
1.7.9.5

Part of the diff is not shown here. View the raw message.

maintainer Acked-by on v2 1/3
#2 lore raw

Re: [RFC v2 1/3] dt-bindings: soc: Add documentation for the MediaTek GCE unit

In reply to HS Liao
Quoted 8 lines · HS Liao

This adds documentation for the MediaTek Global Command Engine (GCE) unit found in MT8173 SoCs.

---
 .../devicetree/bindings/soc/mediatek/gce.txt       |   34 ++++++++++++++++++++
 1 file changed, 34 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/soc/mediatek/gce.txt