18c2ecf20Sopenharmony_ciMediaTek GCE 28c2ecf20Sopenharmony_ci=============== 38c2ecf20Sopenharmony_ci 48c2ecf20Sopenharmony_ciThe Global Command Engine (GCE) is used to help read/write registers with 58c2ecf20Sopenharmony_cicritical time limitation, such as updating display configuration during the 68c2ecf20Sopenharmony_civblank. The GCE can be used to implement the Command Queue (CMDQ) driver. 78c2ecf20Sopenharmony_ci 88c2ecf20Sopenharmony_ciCMDQ driver uses mailbox framework for communication. Please refer to 98c2ecf20Sopenharmony_cimailbox.txt for generic information about mailbox device-tree bindings. 108c2ecf20Sopenharmony_ci 118c2ecf20Sopenharmony_ciRequired properties: 128c2ecf20Sopenharmony_ci- compatible: can be "mediatek,mt8173-gce", "mediatek,mt8183-gce" or 138c2ecf20Sopenharmony_ci "mediatek,mt6779-gce". 148c2ecf20Sopenharmony_ci- reg: Address range of the GCE unit 158c2ecf20Sopenharmony_ci- interrupts: The interrupt signal from the GCE block 168c2ecf20Sopenharmony_ci- clock: Clocks according to the common clock binding 178c2ecf20Sopenharmony_ci- clock-names: Must be "gce" to stand for GCE clock 188c2ecf20Sopenharmony_ci- #mbox-cells: Should be 2. 198c2ecf20Sopenharmony_ci <&phandle channel priority> 208c2ecf20Sopenharmony_ci phandle: Label name of a gce node. 218c2ecf20Sopenharmony_ci channel: Channel of mailbox. Be equal to the thread id of GCE. 228c2ecf20Sopenharmony_ci priority: Priority of GCE thread. 238c2ecf20Sopenharmony_ci 248c2ecf20Sopenharmony_ciRequired properties for a client device: 258c2ecf20Sopenharmony_ci- mboxes: Client use mailbox to communicate with GCE, it should have this 268c2ecf20Sopenharmony_ci property and list of phandle, mailbox specifiers. 278c2ecf20Sopenharmony_ciOptional properties for a client device: 288c2ecf20Sopenharmony_ci- mediatek,gce-client-reg: Specify the sub-system id which is corresponding 298c2ecf20Sopenharmony_ci to the register address, it should have this property and list of phandle, 308c2ecf20Sopenharmony_ci sub-system specifiers. 318c2ecf20Sopenharmony_ci <&phandle subsys_number start_offset size> 328c2ecf20Sopenharmony_ci phandle: Label name of a gce node. 338c2ecf20Sopenharmony_ci subsys_number: specify the sub-system id which is corresponding 348c2ecf20Sopenharmony_ci to the register address. 358c2ecf20Sopenharmony_ci start_offset: the start offset of register address that GCE can access. 368c2ecf20Sopenharmony_ci size: the total size of register address that GCE can access. 378c2ecf20Sopenharmony_ci 388c2ecf20Sopenharmony_ciSome vaules of properties are defined in 'dt-bindings/gce/mt8173-gce.h', 398c2ecf20Sopenharmony_ci'dt-binding/gce/mt8183-gce.h' or 'dt-bindings/gce/mt6779-gce.h'. Such as 408c2ecf20Sopenharmony_cisub-system ids, thread priority, event ids. 418c2ecf20Sopenharmony_ci 428c2ecf20Sopenharmony_ciExample: 438c2ecf20Sopenharmony_ci 448c2ecf20Sopenharmony_ci gce: gce@10212000 { 458c2ecf20Sopenharmony_ci compatible = "mediatek,mt8173-gce"; 468c2ecf20Sopenharmony_ci reg = <0 0x10212000 0 0x1000>; 478c2ecf20Sopenharmony_ci interrupts = <GIC_SPI 135 IRQ_TYPE_LEVEL_LOW>; 488c2ecf20Sopenharmony_ci clocks = <&infracfg CLK_INFRA_GCE>; 498c2ecf20Sopenharmony_ci clock-names = "gce"; 508c2ecf20Sopenharmony_ci #mbox-cells = <2>; 518c2ecf20Sopenharmony_ci }; 528c2ecf20Sopenharmony_ci 538c2ecf20Sopenharmony_ciExample for a client device: 548c2ecf20Sopenharmony_ci 558c2ecf20Sopenharmony_ci mmsys: clock-controller@14000000 { 568c2ecf20Sopenharmony_ci compatible = "mediatek,mt8173-mmsys"; 578c2ecf20Sopenharmony_ci mboxes = <&gce 0 CMDQ_THR_PRIO_LOWEST>, 588c2ecf20Sopenharmony_ci <&gce 1 CMDQ_THR_PRIO_LOWEST>; 598c2ecf20Sopenharmony_ci mutex-event-eof = <CMDQ_EVENT_MUTEX0_STREAM_EOF 608c2ecf20Sopenharmony_ci CMDQ_EVENT_MUTEX1_STREAM_EOF>; 618c2ecf20Sopenharmony_ci mediatek,gce-client-reg = <&gce SUBSYS_1400XXXX 0x3000 0x1000>, 628c2ecf20Sopenharmony_ci <&gce SUBSYS_1401XXXX 0x2000 0x100>; 638c2ecf20Sopenharmony_ci ... 648c2ecf20Sopenharmony_ci }; 65