From patchwork Wed May 8 17:34:20 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacopo Mondi X-Patchwork-Id: 10936301 X-Patchwork-Delegate: kieran@bingham.xyz Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 08E2714DB for ; Wed, 8 May 2019 17:33:57 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E6391285E2 for ; Wed, 8 May 2019 17:33:56 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DADFB28610; Wed, 8 May 2019 17:33:56 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8BE1B285E2 for ; Wed, 8 May 2019 17:33:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728917AbfEHRdp (ORCPT ); Wed, 8 May 2019 13:33:45 -0400 Received: from relay8-d.mail.gandi.net ([217.70.183.201]:48035 "EHLO relay8-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728655AbfEHRdp (ORCPT ); Wed, 8 May 2019 13:33:45 -0400 X-Originating-IP: 93.56.79.2 Received: from uno.localdomain (unknown [93.56.79.2]) (Authenticated sender: jacopo@jmondi.org) by relay8-d.mail.gandi.net (Postfix) with ESMTPSA id C14371BF20C; Wed, 8 May 2019 17:33:42 +0000 (UTC) From: Jacopo Mondi To: laurent.pinchart@ideasonboard.com, linux-renesas-soc@vger.kernel.org Cc: Jacopo Mondi , VenkataRajesh.Kalakodima@in.bosch.com, Harsha.ManjulaMallikarjun@in.bosch.com, Jacopo Mondi Subject: [RFC 1/9] dt-bindings: display: renesas,cmm: Add R-Car CMM documentation Date: Wed, 8 May 2019 19:34:20 +0200 Message-Id: <20190508173428.22054-2-jacopo+renesas@jmondi.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190508173428.22054-1-jacopo+renesas@jmondi.org> References: <20190508173428.22054-1-jacopo+renesas@jmondi.org> MIME-Version: 1.0 Sender: linux-renesas-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Add device tree bindings documentation for the Renesas R-Car Display Unit Color Management Module. CMM is the image enhancement module available on each R-Car DU video channel. Signed-off-by: Jacopo Mondi --- .../bindings/display/renesas,cmm.txt | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 Documentation/devicetree/bindings/display/renesas,cmm.txt diff --git a/Documentation/devicetree/bindings/display/renesas,cmm.txt b/Documentation/devicetree/bindings/display/renesas,cmm.txt new file mode 100644 index 000000000000..d7674417edb4 --- /dev/null +++ b/Documentation/devicetree/bindings/display/renesas,cmm.txt @@ -0,0 +1,24 @@ +* Renesas R-Car Color Management Unit (CMM) + +Renesas R-Car image enhancement module connected to R-Car DU video channels. + +Required properties: + - compatible: shall be: + - "renesas,cmm" + + - reg: the address base and length of the memory area where CMM control + registers are mapped to. + + - clocks: phandle and clock-specifier pair to the CMM functional clock + supplier. + +Example: +-------- + + cmm0: cmm@fea40000 { + compatible = "renesas,cmm"; + reg = <0 0xfea40000 0 0x1000>; + power-domains = <&sysc R8A7796_PD_ALWAYS_ON>; + clocks = <&cpg CPG_MOD 711>; + resets = <&cpg 711>; + }; From patchwork Wed May 8 17:34:21 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacopo Mondi X-Patchwork-Id: 10936287 X-Patchwork-Delegate: kieran@bingham.xyz Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 9690414B6 for ; Wed, 8 May 2019 17:33:53 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 81150285D8 for ; Wed, 8 May 2019 17:33:53 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 727DE28942; Wed, 8 May 2019 17:33:53 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7FDA4285D8 for ; Wed, 8 May 2019 17:33:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728952AbfEHRdr (ORCPT ); Wed, 8 May 2019 13:33:47 -0400 Received: from relay8-d.mail.gandi.net ([217.70.183.201]:60319 "EHLO relay8-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728655AbfEHRdr (ORCPT ); Wed, 8 May 2019 13:33:47 -0400 X-Originating-IP: 93.56.79.2 Received: from uno.localdomain (unknown [93.56.79.2]) (Authenticated sender: jacopo@jmondi.org) by relay8-d.mail.gandi.net (Postfix) with ESMTPSA id AF1891BF20D; Wed, 8 May 2019 17:33:44 +0000 (UTC) From: Jacopo Mondi To: laurent.pinchart@ideasonboard.com, linux-renesas-soc@vger.kernel.org Cc: Jacopo Mondi , VenkataRajesh.Kalakodima@in.bosch.com, Harsha.ManjulaMallikarjun@in.bosch.com, Jacopo Mondi Subject: [RFC 2/9] dt-bindings: display, renesas,du: Document cmms property Date: Wed, 8 May 2019 19:34:21 +0200 Message-Id: <20190508173428.22054-3-jacopo+renesas@jmondi.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190508173428.22054-1-jacopo+renesas@jmondi.org> References: <20190508173428.22054-1-jacopo+renesas@jmondi.org> MIME-Version: 1.0 Sender: linux-renesas-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Document the newly added 'cmms' property which accepts a list of phandle and channel index pairs that point to the CMM units available for each Display Unit output video channel. Signed-off-by: Jacopo Mondi --- Documentation/devicetree/bindings/display/renesas,du.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Documentation/devicetree/bindings/display/renesas,du.txt b/Documentation/devicetree/bindings/display/renesas,du.txt index aedb22b4d161..2ccf78bf9a18 100644 --- a/Documentation/devicetree/bindings/display/renesas,du.txt +++ b/Documentation/devicetree/bindings/display/renesas,du.txt @@ -44,6 +44,10 @@ Required Properties: instance that serves the DU channel, and the channel index identifies the LIF instance in that VSP. + - cmms: A list of phandle and channel index tuples to the CMM modules + connected to DU channels. The phandle identifies the CMM instance that + serves the DU channel identified by the index. + Required nodes: The connections to the DU output video ports are modeled using the OF graph From patchwork Wed May 8 17:34:22 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacopo Mondi X-Patchwork-Id: 10936293 X-Patchwork-Delegate: kieran@bingham.xyz Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 56F7014DB for ; Wed, 8 May 2019 17:33:55 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 429A32862D for ; Wed, 8 May 2019 17:33:55 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 36CB528610; Wed, 8 May 2019 17:33:55 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 797CB2862D for ; Wed, 8 May 2019 17:33:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728982AbfEHRdu (ORCPT ); Wed, 8 May 2019 13:33:50 -0400 Received: from relay8-d.mail.gandi.net ([217.70.183.201]:58361 "EHLO relay8-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728655AbfEHRdt (ORCPT ); Wed, 8 May 2019 13:33:49 -0400 X-Originating-IP: 93.56.79.2 Received: from uno.localdomain (unknown [93.56.79.2]) (Authenticated sender: jacopo@jmondi.org) by relay8-d.mail.gandi.net (Postfix) with ESMTPSA id E09FA1BF203; Wed, 8 May 2019 17:33:46 +0000 (UTC) From: Jacopo Mondi To: laurent.pinchart@ideasonboard.com, linux-renesas-soc@vger.kernel.org Cc: Jacopo Mondi , VenkataRajesh.Kalakodima@in.bosch.com, Harsha.ManjulaMallikarjun@in.bosch.com, Jacopo Mondi Subject: [RFC 3/9] [TODO] drm: rcar-du: Add basic support for CMM Date: Wed, 8 May 2019 19:34:22 +0200 Message-Id: <20190508173428.22054-4-jacopo+renesas@jmondi.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190508173428.22054-1-jacopo+renesas@jmondi.org> References: <20190508173428.22054-1-jacopo+renesas@jmondi.org> MIME-Version: 1.0 Sender: linux-renesas-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Add a driver skeleton for the R-Car Display Unit Color Correction Module. Each DU output channel is provided with a CMM unit to perform image enhancement and color correction. Add support for CMM through a skeleton driver to be later expanded to support setting color correction tables through the DRM/KMS properties framework. As of now, the driver is only useful to demonstrate the integration with the DU driver. Not-Yet-Signed-off-by: Jacopo Mondi --- drivers/gpu/drm/rcar-du/Kconfig | 7 +++ drivers/gpu/drm/rcar-du/Makefile | 1 + drivers/gpu/drm/rcar-du/rcar_du_cmm.c | 78 +++++++++++++++++++++++++++ drivers/gpu/drm/rcar-du/rcar_du_cmm.h | 23 ++++++++ 4 files changed, 109 insertions(+) create mode 100644 drivers/gpu/drm/rcar-du/rcar_du_cmm.c create mode 100644 drivers/gpu/drm/rcar-du/rcar_du_cmm.h diff --git a/drivers/gpu/drm/rcar-du/Kconfig b/drivers/gpu/drm/rcar-du/Kconfig index 1529849e217e..820f2b85a073 100644 --- a/drivers/gpu/drm/rcar-du/Kconfig +++ b/drivers/gpu/drm/rcar-du/Kconfig @@ -13,6 +13,13 @@ config DRM_RCAR_DU Choose this option if you have an R-Car chipset. If M is selected the module will be called rcar-du-drm. +config DRM_RCAR_CMM + bool "R-Car DU Color Correction Module Support" + depends on DRM && OF + depends on DRM_RCAR_DU && ARCH_RCAR_GEN3 + help + Enable support for R-Car Gen3 Color Correction Module (CMM). + config DRM_RCAR_DW_HDMI tristate "R-Car DU Gen3 HDMI Encoder Support" depends on DRM && OF diff --git a/drivers/gpu/drm/rcar-du/Makefile b/drivers/gpu/drm/rcar-du/Makefile index 6c2ed9c46467..ae26d465d421 100644 --- a/drivers/gpu/drm/rcar-du/Makefile +++ b/drivers/gpu/drm/rcar-du/Makefile @@ -15,6 +15,7 @@ rcar-du-drm-$(CONFIG_DRM_RCAR_LVDS) += rcar_du_of.o \ rcar-du-drm-$(CONFIG_DRM_RCAR_VSP) += rcar_du_vsp.o rcar-du-drm-$(CONFIG_DRM_RCAR_WRITEBACK) += rcar_du_writeback.o +obj-$(CONFIG_DRM_RCAR_CMM) += rcar_du_cmm.o obj-$(CONFIG_DRM_RCAR_DU) += rcar-du-drm.o obj-$(CONFIG_DRM_RCAR_DW_HDMI) += rcar_dw_hdmi.o obj-$(CONFIG_DRM_RCAR_LVDS) += rcar_lvds.o diff --git a/drivers/gpu/drm/rcar-du/rcar_du_cmm.c b/drivers/gpu/drm/rcar-du/rcar_du_cmm.c new file mode 100644 index 000000000000..63f545830bb9 --- /dev/null +++ b/drivers/gpu/drm/rcar-du/rcar_du_cmm.c @@ -0,0 +1,78 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * rcar_du_cmm.c -- R-Car Display Unit Color Management Module + * + * Copyright (C) 2019 Jacopo Mondi + */ + +#include +#include +#include +#include +#include + +#include "rcar_du_cmm.h" +#include "rcar_du_crtc.h" + +struct rcar_cmm { + struct clk *clk; + void __iomem *base; +}; + +int rcar_du_cmm_setup(struct platform_device *pdev, struct rcar_du_crtc *rcrtc) +{ + struct rcar_cmm *rcmm = platform_get_drvdata(pdev); + int ret; + + ret = clk_prepare_enable(rcmm->clk); + if (ret) + return ret; + + return 0; +} + +static int rcar_cmm_probe(struct platform_device *pdev) +{ + struct rcar_cmm *rcmm; + struct resource *res; + + rcmm = devm_kzalloc(&pdev->dev, sizeof(*rcmm), GFP_KERNEL); + if (!rcmm) + return -ENOMEM; + + platform_set_drvdata(pdev, rcmm); + + res = platform_get_resource(pdev, IORESOURCE_MEM, 0); + rcmm->base = devm_ioremap_resource(&pdev->dev, res); + if (IS_ERR(rcmm->base)) + return PTR_ERR(rcmm->base); + + rcmm->clk = devm_clk_get(&pdev->dev, NULL); + if (IS_ERR(rcmm->clk)) { + dev_err(&pdev->dev, "Failed to get CMM clock"); + return PTR_ERR(rcmm->clk); + } + + return 0; +} + +static const struct of_device_id rcar_cmm_of_table[] = { + { .compatible = "renesas,cmm" }, + { }, +}; + +MODULE_DEVICE_TABLE(of, rcar_cmm_of_table); + +static struct platform_driver rcar_cmm_platform_driver = { + .probe = rcar_cmm_probe, + .driver = { + .name = "rcar-cmm", + .of_match_table = rcar_cmm_of_table, + }, +}; + +module_platform_driver(rcar_cmm_platform_driver); + +MODULE_AUTHOR("Jacopo Mondi + */ + +#ifndef __RCAR_DU_CMM_H_ +#define __RCAR_DU_CMM_H_ + +#include +#include + +struct rcar_du_crtc; + +struct rcar_du_cmm { + struct device_node *np; + unsigned int crtc; +}; + +int rcar_du_cmm_setup(struct platform_device *, struct rcar_du_crtc *); + +#endif /* __RCAR_DU_CMM_H_ */ From patchwork Wed May 8 17:34:23 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacopo Mondi X-Patchwork-Id: 10936291 X-Patchwork-Delegate: kieran@bingham.xyz Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 2282B112C for ; Wed, 8 May 2019 17:33:55 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0D81A285D8 for ; Wed, 8 May 2019 17:33:55 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 02066285E8; Wed, 8 May 2019 17:33:54 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0A9B328675 for ; Wed, 8 May 2019 17:33:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729002AbfEHRdv (ORCPT ); Wed, 8 May 2019 13:33:51 -0400 Received: from relay8-d.mail.gandi.net ([217.70.183.201]:57131 "EHLO relay8-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728887AbfEHRdv (ORCPT ); Wed, 8 May 2019 13:33:51 -0400 X-Originating-IP: 93.56.79.2 Received: from uno.localdomain (unknown [93.56.79.2]) (Authenticated sender: jacopo@jmondi.org) by relay8-d.mail.gandi.net (Postfix) with ESMTPSA id 31D361BF20A; Wed, 8 May 2019 17:33:48 +0000 (UTC) From: Jacopo Mondi To: laurent.pinchart@ideasonboard.com, linux-renesas-soc@vger.kernel.org Cc: Jacopo Mondi , VenkataRajesh.Kalakodima@in.bosch.com, Harsha.ManjulaMallikarjun@in.bosch.com, Jacopo Mondi Subject: [RFC 4/9] drm: rcar-du: kms: Create CMM instances Date: Wed, 8 May 2019 19:34:23 +0200 Message-Id: <20190508173428.22054-5-jacopo+renesas@jmondi.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190508173428.22054-1-jacopo+renesas@jmondi.org> References: <20190508173428.22054-1-jacopo+renesas@jmondi.org> MIME-Version: 1.0 Sender: linux-renesas-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Implement device tree parsing to collect the available CMM units and store them in the group to be later enabled at start up time. Define a new feature to let each SoC claim support for CMM. Signed-off-by: Jacopo Mondi --- drivers/gpu/drm/rcar-du/rcar_du_drv.h | 4 ++ drivers/gpu/drm/rcar-du/rcar_du_group.h | 2 + drivers/gpu/drm/rcar-du/rcar_du_kms.c | 68 +++++++++++++++++++++++++ 3 files changed, 74 insertions(+) diff --git a/drivers/gpu/drm/rcar-du/rcar_du_drv.h b/drivers/gpu/drm/rcar-du/rcar_du_drv.h index 1327cd0df90a..aac916a7a46c 100644 --- a/drivers/gpu/drm/rcar-du/rcar_du_drv.h +++ b/drivers/gpu/drm/rcar-du/rcar_du_drv.h @@ -13,6 +13,7 @@ #include #include +#include "rcar_du_cmm.h" #include "rcar_du_crtc.h" #include "rcar_du_group.h" #include "rcar_du_vsp.h" @@ -28,6 +29,7 @@ struct rcar_du_encoder; #define RCAR_DU_FEATURE_VSP1_SOURCE BIT(1) /* Has inputs from VSP1 */ #define RCAR_DU_FEATURE_INTERLACED BIT(2) /* HW supports interlaced */ #define RCAR_DU_FEATURE_TVM_SYNC BIT(3) /* Has TV switch/sync modes */ +#define RCAR_DU_FEATURE_CMM BIT(4) /* Has CCM */ #define RCAR_DU_QUIRK_ALIGN_128B BIT(0) /* Align pitches to 128 bytes */ @@ -69,6 +71,7 @@ struct rcar_du_device_info { #define RCAR_DU_MAX_CRTCS 4 #define RCAR_DU_MAX_GROUPS DIV_ROUND_UP(RCAR_DU_MAX_CRTCS, 2) +#define RCAR_DU_MAX_CMMS 4 #define RCAR_DU_MAX_VSPS 4 struct rcar_du_device { @@ -85,6 +88,7 @@ struct rcar_du_device { struct rcar_du_encoder *encoders[RCAR_DU_OUTPUT_MAX]; struct rcar_du_group groups[RCAR_DU_MAX_GROUPS]; + struct rcar_du_cmm cmms[RCAR_DU_MAX_CMMS]; struct rcar_du_vsp vsps[RCAR_DU_MAX_VSPS]; struct { diff --git a/drivers/gpu/drm/rcar-du/rcar_du_group.h b/drivers/gpu/drm/rcar-du/rcar_du_group.h index 87950c1f6a52..b0c1466593a3 100644 --- a/drivers/gpu/drm/rcar-du/rcar_du_group.h +++ b/drivers/gpu/drm/rcar-du/rcar_du_group.h @@ -22,6 +22,7 @@ struct rcar_du_device; * @mmio_offset: registers offset in the device memory map * @index: group index * @channels_mask: bitmask of populated DU channels in this group + * @cmms_mask: bitmask of enabled CMMs in this group * @num_crtcs: number of CRTCs in this group (1 or 2) * @use_count: number of users of the group (rcar_du_group_(get|put)) * @used_crtcs: number of CRTCs currently in use @@ -37,6 +38,7 @@ struct rcar_du_group { unsigned int index; unsigned int channels_mask; + unsigned int cmms_mask; unsigned int num_crtcs; unsigned int use_count; unsigned int used_crtcs; diff --git a/drivers/gpu/drm/rcar-du/rcar_du_kms.c b/drivers/gpu/drm/rcar-du/rcar_du_kms.c index adbc4f5d8fc5..684a60feac5c 100644 --- a/drivers/gpu/drm/rcar-du/rcar_du_kms.c +++ b/drivers/gpu/drm/rcar-du/rcar_du_kms.c @@ -614,6 +614,64 @@ static int rcar_du_vsps_init(struct rcar_du_device *rcdu) return ret; } +static int rcar_du_cmm_init(struct rcar_du_device *rcdu) +{ + const struct device_node *np = rcdu->dev->of_node; + unsigned int cells; + unsigned int i; + int ret; + + /* + * Make sure the DT 'cmms' property is well formed and populate + * the list of enabled CMM. + */ + cells = of_property_count_u32_elems(np, "cmms"); + if (cells % 2 || cells > rcdu->num_crtcs * 2) { + dev_err(rcdu->dev, "invalid 'cmms' property format\n"); + return -EINVAL; + } + + for (i = 0; i < cells / 2; ++i) { + struct of_phandle_args args; + struct rcar_du_group *rgrp; + unsigned int crtc; + + ret = of_parse_phandle_with_fixed_args(np, "cmms", 1, i, + &args); + if (ret < 0) { + dev_err(rcdu->dev, "failed to parse 'cmms' property\n"); + goto error; + } + + crtc = args.args[0]; + if (crtc >= rcdu->num_crtcs || + !(rcdu->info->channels_mask & BIT(crtc))) { + dev_err(rcdu->dev, + "invalid DU channel %u in 'cmms' property\n", + crtc); + goto error; + } + + rcdu->cmms[i].np = args.np; + rcdu->cmms[i].crtc = crtc; + + /* + * CMMs are activated by the DU group: store the active CMMs + * indexes in the group. + */ + rgrp = &rcdu->groups[crtc / 2]; + rgrp->cmms_mask |= BIT(crtc % 2); + } + + return 0; + +error: + for (; i > 0; --i) + of_node_put(rcdu->cmms[i - 1].np); + + return ret; +} + int rcar_du_modeset_init(struct rcar_du_device *rcdu) { static const unsigned int mmio_offsets[] = { @@ -680,6 +738,9 @@ int rcar_du_modeset_init(struct rcar_du_device *rcdu) & GENMASK(1, 0); rgrp->num_crtcs = hweight8(rgrp->channels_mask); + /* The active CMMs mask will be later populated. */ + rgrp->cmms_mask = 0; + /* * If we have more than one CRTCs in this group pre-associate * the low-order planes with CRTC 0 and the high-order planes @@ -704,6 +765,13 @@ int rcar_du_modeset_init(struct rcar_du_device *rcdu) return ret; } + /* Initialize the Color Management Modules. */ + if (rcar_du_has(rcdu, RCAR_DU_FEATURE_CMM)) { + ret = rcar_du_cmm_init(rcdu); + if (ret < 0) + return ret; + } + /* Create the CRTCs. */ for (swindex = 0, hwindex = 0; swindex < rcdu->num_crtcs; ++hwindex) { struct rcar_du_group *rgrp; From patchwork Wed May 8 17:34:24 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacopo Mondi X-Patchwork-Id: 10936289 X-Patchwork-Delegate: kieran@bingham.xyz Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 07EEA112C for ; Wed, 8 May 2019 17:33:54 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E84E0286C6 for ; Wed, 8 May 2019 17:33:53 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DCF2B28999; Wed, 8 May 2019 17:33:53 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4DF7F286C6 for ; Wed, 8 May 2019 17:33:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728887AbfEHRdw (ORCPT ); Wed, 8 May 2019 13:33:52 -0400 Received: from relay8-d.mail.gandi.net ([217.70.183.201]:54847 "EHLO relay8-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728655AbfEHRdv (ORCPT ); Wed, 8 May 2019 13:33:51 -0400 X-Originating-IP: 93.56.79.2 Received: from uno.localdomain (unknown [93.56.79.2]) (Authenticated sender: jacopo@jmondi.org) by relay8-d.mail.gandi.net (Postfix) with ESMTPSA id 6BEFE1BF20F; Wed, 8 May 2019 17:33:49 +0000 (UTC) From: Jacopo Mondi To: laurent.pinchart@ideasonboard.com, linux-renesas-soc@vger.kernel.org Cc: Jacopo Mondi , VenkataRajesh.Kalakodima@in.bosch.com, Harsha.ManjulaMallikarjun@in.bosch.com, Jacopo Mondi Subject: [RFC 5/9] drm: rcar-du: Add CMM support for M3-W Date: Wed, 8 May 2019 19:34:24 +0200 Message-Id: <20190508173428.22054-6-jacopo+renesas@jmondi.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190508173428.22054-1-jacopo+renesas@jmondi.org> References: <20190508173428.22054-1-jacopo+renesas@jmondi.org> MIME-Version: 1.0 Sender: linux-renesas-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP R-Car M3-W provides a CMM for each of it's DU output channel. Add CMM as a supported feature for the SoC. Temporary commit to be later expanded to all Gen3 SoCs V3H/M apart. Signed-off-by: Jacopo Mondi Reviewed-by: Laurent Pinchart --- drivers/gpu/drm/rcar-du/rcar_du_drv.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/rcar-du/rcar_du_drv.c b/drivers/gpu/drm/rcar-du/rcar_du_drv.c index 75ab17af13a9..984553342b1f 100644 --- a/drivers/gpu/drm/rcar-du/rcar_du_drv.c +++ b/drivers/gpu/drm/rcar-du/rcar_du_drv.c @@ -280,7 +280,8 @@ static const struct rcar_du_device_info rcar_du_r8a7796_info = { .features = RCAR_DU_FEATURE_CRTC_IRQ_CLOCK | RCAR_DU_FEATURE_VSP1_SOURCE | RCAR_DU_FEATURE_INTERLACED - | RCAR_DU_FEATURE_TVM_SYNC, + | RCAR_DU_FEATURE_TVM_SYNC + | RCAR_DU_FEATURE_CMM, .channels_mask = BIT(2) | BIT(1) | BIT(0), .routes = { /* From patchwork Wed May 8 17:34:25 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacopo Mondi X-Patchwork-Id: 10936297 X-Patchwork-Delegate: kieran@bingham.xyz Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B9A9814B6 for ; Wed, 8 May 2019 17:33:55 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A5E7B285D8 for ; Wed, 8 May 2019 17:33:55 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9AB5028675; Wed, 8 May 2019 17:33:55 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 20D11285D8 for ; Wed, 8 May 2019 17:33:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729021AbfEHRdy (ORCPT ); Wed, 8 May 2019 13:33:54 -0400 Received: from relay8-d.mail.gandi.net ([217.70.183.201]:34763 "EHLO relay8-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729008AbfEHRdx (ORCPT ); Wed, 8 May 2019 13:33:53 -0400 X-Originating-IP: 93.56.79.2 Received: from uno.localdomain (unknown [93.56.79.2]) (Authenticated sender: jacopo@jmondi.org) by relay8-d.mail.gandi.net (Postfix) with ESMTPSA id A73491BF20C; Wed, 8 May 2019 17:33:50 +0000 (UTC) From: Jacopo Mondi To: laurent.pinchart@ideasonboard.com, linux-renesas-soc@vger.kernel.org Cc: Jacopo Mondi , VenkataRajesh.Kalakodima@in.bosch.com, Harsha.ManjulaMallikarjun@in.bosch.com, Jacopo Mondi Subject: [RFC 6/9] drm: rcar-du: crtc: Setup the CMM Date: Wed, 8 May 2019 19:34:25 +0200 Message-Id: <20190508173428.22054-7-jacopo+renesas@jmondi.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190508173428.22054-1-jacopo+renesas@jmondi.org> References: <20190508173428.22054-1-jacopo+renesas@jmondi.org> MIME-Version: 1.0 Sender: linux-renesas-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Save a reference to the CMM unit associated with the CRTC and set it up at rcar_du_crtc_setup() time, just after having enabled the compositor. Signed-off-by: Jacopo Mondi --- drivers/gpu/drm/rcar-du/rcar_du_crtc.c | 38 ++++++++++++++++++++++++-- drivers/gpu/drm/rcar-du/rcar_du_crtc.h | 2 ++ 2 files changed, 38 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/rcar-du/rcar_du_crtc.c b/drivers/gpu/drm/rcar-du/rcar_du_crtc.c index 2da46e3dc4ae..b5a9af8e4df0 100644 --- a/drivers/gpu/drm/rcar-du/rcar_du_crtc.c +++ b/drivers/gpu/drm/rcar-du/rcar_du_crtc.c @@ -9,6 +9,7 @@ #include #include +#include #include #include @@ -21,6 +22,7 @@ #include #include +#include "rcar_du_cmm.h" #include "rcar_du_crtc.h" #include "rcar_du_drv.h" #include "rcar_du_encoder.h" @@ -478,7 +480,7 @@ static void rcar_du_crtc_wait_page_flip(struct rcar_du_crtc *rcrtc) * Start/Stop and Suspend/Resume */ -static void rcar_du_crtc_setup(struct rcar_du_crtc *rcrtc) +static int rcar_du_crtc_setup(struct rcar_du_crtc *rcrtc) { /* Set display off and background to black */ rcar_du_crtc_write(rcrtc, DOOR, DOOR_RGB(0, 0, 0)); @@ -495,8 +497,24 @@ static void rcar_du_crtc_setup(struct rcar_du_crtc *rcrtc) if (rcar_du_has(rcrtc->dev, RCAR_DU_FEATURE_VSP1_SOURCE)) rcar_du_vsp_enable(rcrtc); + /* Enable CMM, if present. */ + if (rcrtc->cmm) { + struct platform_device *pdev; + int ret; + + pdev = of_find_device_by_node(rcrtc->cmm->np); + if (!pdev) + return PTR_ERR(pdev); + + ret = rcar_du_cmm_setup(pdev, rcrtc); + if (ret) + return ret; + } + /* Turn vertical blanking interrupt reporting on. */ drm_crtc_vblank_on(&rcrtc->crtc); + + return 0; } static int rcar_du_crtc_get(struct rcar_du_crtc *rcrtc) @@ -522,7 +540,10 @@ static int rcar_du_crtc_get(struct rcar_du_crtc *rcrtc) if (ret < 0) goto error_group; - rcar_du_crtc_setup(rcrtc); + ret = rcar_du_crtc_setup(rcrtc); + if (ret < 0) + goto error_group; + rcrtc->initialized = true; return 0; @@ -1182,6 +1203,19 @@ int rcar_du_crtc_create(struct rcar_du_group *rgrp, unsigned int swindex, rcrtc->index = hwindex; rcrtc->dsysr = (rcrtc->index % 2 ? 0 : DSYSR_DRES) | DSYSR_TVM_TVSYNC; + if (rcar_du_has(rcdu, RCAR_DU_FEATURE_CMM)) { + unsigned int i; + + for (i = 0; i < RCAR_DU_MAX_CMMS; ++i) { + struct rcar_du_cmm *cmm = &rcdu->cmms[i]; + + if (cmm->crtc != hwindex) + continue; + + rcrtc->cmm = cmm; + } + } + if (rcar_du_has(rcdu, RCAR_DU_FEATURE_VSP1_SOURCE)) primary = &rcrtc->vsp->planes[rcrtc->vsp_pipe].plane; else diff --git a/drivers/gpu/drm/rcar-du/rcar_du_crtc.h b/drivers/gpu/drm/rcar-du/rcar_du_crtc.h index 3b7fc668996f..8b31406bd11b 100644 --- a/drivers/gpu/drm/rcar-du/rcar_du_crtc.h +++ b/drivers/gpu/drm/rcar-du/rcar_du_crtc.h @@ -19,6 +19,7 @@ #include +struct rcar_du_cmm; struct rcar_du_group; struct rcar_du_vsp; @@ -64,6 +65,7 @@ struct rcar_du_crtc { unsigned int vblank_count; struct rcar_du_group *group; + struct rcar_du_cmm *cmm; struct rcar_du_vsp *vsp; unsigned int vsp_pipe; From patchwork Wed May 8 17:34:26 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacopo Mondi X-Patchwork-Id: 10936295 X-Patchwork-Delegate: kieran@bingham.xyz Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id AC734186E for ; Wed, 8 May 2019 17:33:55 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 970B8285E8 for ; Wed, 8 May 2019 17:33:55 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8BB932862D; Wed, 8 May 2019 17:33:55 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 41B582861C for ; Wed, 8 May 2019 17:33:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728999AbfEHRdz (ORCPT ); Wed, 8 May 2019 13:33:55 -0400 Received: from relay8-d.mail.gandi.net ([217.70.183.201]:54847 "EHLO relay8-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727351AbfEHRdx (ORCPT ); Wed, 8 May 2019 13:33:53 -0400 X-Originating-IP: 93.56.79.2 Received: from uno.localdomain (unknown [93.56.79.2]) (Authenticated sender: jacopo@jmondi.org) by relay8-d.mail.gandi.net (Postfix) with ESMTPSA id DF0F41BF205; Wed, 8 May 2019 17:33:51 +0000 (UTC) From: Jacopo Mondi To: laurent.pinchart@ideasonboard.com, linux-renesas-soc@vger.kernel.org Cc: Jacopo Mondi , VenkataRajesh.Kalakodima@in.bosch.com, Harsha.ManjulaMallikarjun@in.bosch.com, Jacopo Mondi Subject: [RFC 7/9] drm: rcar-du: group: Enable CMM unit Date: Wed, 8 May 2019 19:34:26 +0200 Message-Id: <20190508173428.22054-8-jacopo+renesas@jmondi.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190508173428.22054-1-jacopo+renesas@jmondi.org> References: <20190508173428.22054-1-jacopo+renesas@jmondi.org> MIME-Version: 1.0 Sender: linux-renesas-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Enable the CMM units present in the group through the display unit extensional function control group register DEFR7. Signed-off-by: Jacopo Mondi Reviewed-by: Laurent Pinchart --- drivers/gpu/drm/rcar-du/rcar_du_group.c | 8 ++++++++ drivers/gpu/drm/rcar-du/rcar_du_regs.h | 5 +++++ 2 files changed, 13 insertions(+) diff --git a/drivers/gpu/drm/rcar-du/rcar_du_group.c b/drivers/gpu/drm/rcar-du/rcar_du_group.c index 9eee47969e77..ce25e41b04bc 100644 --- a/drivers/gpu/drm/rcar-du/rcar_du_group.c +++ b/drivers/gpu/drm/rcar-du/rcar_du_group.c @@ -147,6 +147,14 @@ static void rcar_du_group_setup(struct rcar_du_group *rgrp) rcar_du_group_setup_pins(rgrp); + if (rgrp->cmms_mask) { + u32 defr7 = DEFR7_CODE; + defr7 |= rgrp->cmms_mask & BIT(1) ? DEFR7_CMME1 : 0; + defr7 |= rgrp->cmms_mask & BIT(0) ? DEFR7_CMME0 : 0; + + rcar_du_group_write(rgrp, DEFR7, defr7); + } + if (rcdu->info->gen >= 2) { rcar_du_group_setup_defr8(rgrp); rcar_du_group_setup_didsr(rgrp); diff --git a/drivers/gpu/drm/rcar-du/rcar_du_regs.h b/drivers/gpu/drm/rcar-du/rcar_du_regs.h index bc87f080b170..fb9964949368 100644 --- a/drivers/gpu/drm/rcar-du/rcar_du_regs.h +++ b/drivers/gpu/drm/rcar-du/rcar_du_regs.h @@ -197,6 +197,11 @@ #define DEFR6_MLOS1 (1 << 2) #define DEFR6_DEFAULT (DEFR6_CODE | DEFR6_TCNE1) +#define DEFR7 0x000ec +#define DEFR7_CODE (0x7779 << 16) +#define DEFR7_CMME1 BIT(6) +#define DEFR7_CMME0 BIT(4) + /* ----------------------------------------------------------------------------- * R8A7790-only Control Registers */ From patchwork Wed May 8 17:34:27 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacopo Mondi X-Patchwork-Id: 10936299 X-Patchwork-Delegate: geert@linux-m68k.org Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id AD5CD112C for ; Wed, 8 May 2019 17:33:56 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9820D285E8 for ; Wed, 8 May 2019 17:33:56 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8CA072861C; Wed, 8 May 2019 17:33:56 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3A1BB2862D for ; Wed, 8 May 2019 17:33:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729008AbfEHRd4 (ORCPT ); Wed, 8 May 2019 13:33:56 -0400 Received: from relay8-d.mail.gandi.net ([217.70.183.201]:51907 "EHLO relay8-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729018AbfEHRdz (ORCPT ); Wed, 8 May 2019 13:33:55 -0400 X-Originating-IP: 93.56.79.2 Received: from uno.localdomain (unknown [93.56.79.2]) (Authenticated sender: jacopo@jmondi.org) by relay8-d.mail.gandi.net (Postfix) with ESMTPSA id 2ADF31BF20A; Wed, 8 May 2019 17:33:53 +0000 (UTC) From: Jacopo Mondi To: laurent.pinchart@ideasonboard.com, linux-renesas-soc@vger.kernel.org Cc: Jacopo Mondi , VenkataRajesh.Kalakodima@in.bosch.com, Harsha.ManjulaMallikarjun@in.bosch.com, Jacopo Mondi Subject: [RFC 8/9] clk: renesas: r8a7796: Add CMM clocks Date: Wed, 8 May 2019 19:34:27 +0200 Message-Id: <20190508173428.22054-9-jacopo+renesas@jmondi.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190508173428.22054-1-jacopo+renesas@jmondi.org> References: <20190508173428.22054-1-jacopo+renesas@jmondi.org> MIME-Version: 1.0 Sender: linux-renesas-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Add clock defintions for CMM units on Renesas R-Car Gen3 M3-W. Signed-off-by: Jacopo Mondi Reviewed-by: Geert Uytterhoeven Reviewed-by: Laurent Pinchart --- drivers/clk/renesas/r8a7796-cpg-mssr.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/clk/renesas/r8a7796-cpg-mssr.c b/drivers/clk/renesas/r8a7796-cpg-mssr.c index 12c455859f2c..6044aeda0f83 100644 --- a/drivers/clk/renesas/r8a7796-cpg-mssr.c +++ b/drivers/clk/renesas/r8a7796-cpg-mssr.c @@ -179,6 +179,9 @@ static const struct mssr_mod_clk r8a7796_mod_clks[] __initconst = { DEF_MOD("ehci1", 702, R8A7796_CLK_S3D4), DEF_MOD("ehci0", 703, R8A7796_CLK_S3D4), DEF_MOD("hsusb", 704, R8A7796_CLK_S3D4), + DEF_MOD("cmm2", 709, R8A7796_CLK_S2D1), + DEF_MOD("cmm1", 710, R8A7796_CLK_S2D1), + DEF_MOD("cmm0", 711, R8A7796_CLK_S2D1), DEF_MOD("csi20", 714, R8A7796_CLK_CSI0), DEF_MOD("csi40", 716, R8A7796_CLK_CSI0), DEF_MOD("du2", 722, R8A7796_CLK_S2D1), From patchwork Wed May 8 17:34:28 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacopo Mondi X-Patchwork-Id: 10936303 X-Patchwork-Delegate: horms@verge.net.au Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A807E112C for ; Wed, 8 May 2019 17:33:57 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 92C05285D8 for ; Wed, 8 May 2019 17:33:57 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 86DAF285E8; Wed, 8 May 2019 17:33:57 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3382E285E2 for ; Wed, 8 May 2019 17:33:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729000AbfEHRd4 (ORCPT ); Wed, 8 May 2019 13:33:56 -0400 Received: from relay8-d.mail.gandi.net ([217.70.183.201]:34763 "EHLO relay8-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727351AbfEHRd4 (ORCPT ); Wed, 8 May 2019 13:33:56 -0400 X-Originating-IP: 93.56.79.2 Received: from uno.localdomain (unknown [93.56.79.2]) (Authenticated sender: jacopo@jmondi.org) by relay8-d.mail.gandi.net (Postfix) with ESMTPSA id 6B3F91BF208; Wed, 8 May 2019 17:33:54 +0000 (UTC) From: Jacopo Mondi To: laurent.pinchart@ideasonboard.com, linux-renesas-soc@vger.kernel.org Cc: Jacopo Mondi , VenkataRajesh.Kalakodima@in.bosch.com, Harsha.ManjulaMallikarjun@in.bosch.com, Jacopo Mondi Subject: [RFC 9/9] arm64: dts: renesas: r8a7796: Add CMM units Date: Wed, 8 May 2019 19:34:28 +0200 Message-Id: <20190508173428.22054-10-jacopo+renesas@jmondi.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190508173428.22054-1-jacopo+renesas@jmondi.org> References: <20190508173428.22054-1-jacopo+renesas@jmondi.org> MIME-Version: 1.0 Sender: linux-renesas-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Add CMM units to Renesas R-Car M3-W device tree and reference them from the Display Unit they are connected to. Signed-off-by: Jacopo Mondi Reviewed-by: Laurent Pinchart --- arch/arm64/boot/dts/renesas/r8a7796.dtsi | 25 ++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/arch/arm64/boot/dts/renesas/r8a7796.dtsi b/arch/arm64/boot/dts/renesas/r8a7796.dtsi index cdf784899cf8..b81c4711dce3 100644 --- a/arch/arm64/boot/dts/renesas/r8a7796.dtsi +++ b/arch/arm64/boot/dts/renesas/r8a7796.dtsi @@ -2503,6 +2503,30 @@ renesas,fcp = <&fcpf0>; }; + cmm0: cmm@fea40000 { + compatible = "renesas,cmm"; + reg = <0 0xfea40000 0 0x1000>; + clocks = <&cpg CPG_MOD 711>; + power-domains = <&sysc R8A7796_PD_ALWAYS_ON>; + resets = <&cpg 711>; + }; + + cmm1: cmm@fea50000 { + compatible = "renesas,cmm"; + reg = <0 0xfea50000 0 0x1000>; + clocks = <&cpg CPG_MOD 710>; + power-domains = <&sysc R8A7796_PD_ALWAYS_ON>; + resets = <&cpg 710>; + }; + + cmm2: cmm@fea60000 { + compatible = "renesas,cmm"; + reg = <0 0xfea60000 0 0x1000>; + clocks = <&cpg CPG_MOD 709>; + power-domains = <&sysc R8A7796_PD_ALWAYS_ON>; + resets = <&cpg 709>; + }; + fcpf0: fcp@fe950000 { compatible = "renesas,fcpf"; reg = <0 0xfe950000 0 0x200>; @@ -2763,6 +2787,7 @@ status = "disabled"; vsps = <&vspd0 &vspd1 &vspd2>; + cmms = <&cmm0 0 &cmm1 1 &cmm2 2>; ports { #address-cells = <1>;