From patchwork Thu May 20 15:03:41 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxime Ripard X-Patchwork-Id: 443467 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CAE06C433B4 for ; Thu, 20 May 2021 15:04:03 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A664B613E2 for ; Thu, 20 May 2021 15:04:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241851AbhETPFX (ORCPT ); Thu, 20 May 2021 11:05:23 -0400 Received: from wnew2-smtp.messagingengine.com ([64.147.123.27]:44137 "EHLO wnew2-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240413AbhETPFS (ORCPT ); Thu, 20 May 2021 11:05:18 -0400 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailnew.west.internal (Postfix) with ESMTP id 971491618; Thu, 20 May 2021 11:03:55 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Thu, 20 May 2021 11:03:56 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cerno.tech; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm2; bh=2thoq06TT4N3h i9RRmUNxgrAVfVdF+93RckPU2uHJgU=; b=bTJv4oN/ATSvtzQ3xHanmd1ZqIbLw tfovHDgG4btu7Xn+kQKsCsLDAl8ORqZX24kGHQK+aQG99+mzMVRb9EWSQyQ8Tq2U NxnQZtoH+Z7+HYybX+krXePhSSPscV+pcW/yrSQoN0nO0zzSHomzU2Huwe+osIog qsA9OlIBd0iQE7mJd3VQwGjFu+sPLSlq3xr+AI3k8qt1w1t0jJCmwNdCu3Ju/wVu cV3JE0OvzsTfQdR28SJArsI9x2hg31rR7Yo3SYEJNpdpXeg/SymERRIjvCmublae dXr4kMp1U3/Ygb3wpVxYeQEYgZhbHdrzGZxEUHYDBLzvM31QhqwebB6Aw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; bh=2thoq06TT4N3hi9RRmUNxgrAVfVdF+93RckPU2uHJgU=; b=BXMu0zkg xVAXepK60dX8DJ/L5MZZzgpM6H7/FnZyOD5uEsCOcxDqO0UJzger3KNDFYC7m0YR YmUs+47L2XXo4Nd9n+id0bpIinBZhoIu9W3dM4z0xOthk56qqxJhCSyURrQpeIpb xkJqhdrxCuHsx8T5hgeNTwYooCJUU9Wchz/b+KKdbVwwK82zRjUSic+otoedvAFt UdM/SHEVPSFNR3BJw36HM5BHYHLbb+ATSkDCjaSUY7Da+LvXC94nkc/IARlxcgRi jJKQ5Xc3iF9BZb3jsl0sB9TMJUDDLIOkrK9JoESvr716PIsfwNxZ//Pd5bChUW3z GMcmkgyzQZonJQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrvdejuddgkeegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpeforgigihhm vgcutfhiphgrrhguuceomhgrgihimhgvsegtvghrnhhordhtvggthheqnecuggftrfgrth htvghrnhepvdekleevfeffkeejhfffueelteelfeduieefheduudfggffhhfffheevveeh hedvnecukfhppeeltddrkeelrdeikedrjeeinecuvehluhhsthgvrhfuihiivgeptdenuc frrghrrghmpehmrghilhhfrhhomhepmhgrgihimhgvsegtvghrnhhordhtvggthh X-ME-Proxy: Received: from localhost (lfbn-tou-1-1502-76.w90-89.abo.wanadoo.fr [90.89.68.76]) by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 20 May 2021 11:03:52 -0400 (EDT) From: Maxime Ripard To: dri-devel@lists.freedesktop.org, Daniel Vetter , David Airlie , Maarten Lankhorst , Thomas Zimmermann , Maxime Ripard Cc: Florian Fainelli , Maxime Ripard , Eric Anholt , bcm-kernel-feedback-list@broadcom.com, Ray Jui , devicetree@vger.kernel.org, Scott Branden , linux-kernel@vger.kernel.org, Daniel Vetter , Rob Herring , linux-rpi-kernel@lists.infradead.org, Nicolas Saenz Julienne , linux-arm-kernel@lists.infradead.org, Mateusz Kwiatkowski Subject: [PATCH 1/4] drm/vc4: Fix clock source for VEC PixelValve on BCM2711 Date: Thu, 20 May 2021 17:03:41 +0200 Message-Id: <20210520150344.273900-2-maxime@cerno.tech> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210520150344.273900-1-maxime@cerno.tech> References: <20210520150344.273900-1-maxime@cerno.tech> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org From: Mateusz Kwiatkowski On the BCM2711 (Raspberry Pi 4), the VEC is actually connected to output 2 of pixelvalve3. NOTE: This contradicts the Broadcom docs, but has been empirically tested and confirmed by Raspberry Pi firmware devs. Signed-off-by: Mateusz Kwiatkowski Signed-off-by: Maxime Ripard --- drivers/gpu/drm/vc4/vc4_crtc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/vc4/vc4_crtc.c b/drivers/gpu/drm/vc4/vc4_crtc.c index 76657dcdf9b0..665ddf8f347f 100644 --- a/drivers/gpu/drm/vc4/vc4_crtc.c +++ b/drivers/gpu/drm/vc4/vc4_crtc.c @@ -994,7 +994,7 @@ static const struct vc4_pv_data bcm2711_pv3_data = { .fifo_depth = 64, .pixels_per_clock = 1, .encoder_types = { - [0] = VC4_ENCODER_TYPE_VEC, + [PV_CONTROL_CLK_SELECT_VEC] = VC4_ENCODER_TYPE_VEC, }, }; From patchwork Thu May 20 15:03:42 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxime Ripard X-Patchwork-Id: 444869 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 13151C43460 for ; Thu, 20 May 2021 15:04:12 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id ED7DC613AE for ; Thu, 20 May 2021 15:04:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241634AbhETPFc (ORCPT ); Thu, 20 May 2021 11:05:32 -0400 Received: from wnew2-smtp.messagingengine.com ([64.147.123.27]:54829 "EHLO wnew2-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241515AbhETPFX (ORCPT ); Thu, 20 May 2021 11:05:23 -0400 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailnew.west.internal (Postfix) with ESMTP id 588D9166E; Thu, 20 May 2021 11:04:00 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Thu, 20 May 2021 11:04:01 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cerno.tech; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm2; bh=c9IF6P5wnuFym bdczqDQeCFlSep2T99rt9vuVR0ESnk=; b=Lmqzn9Elo/uUedACjdQ22QFnQ9IQW Uz1NuHxWDXTQ4cd501lHJXWCFFcvGI9wzR6YtQ/2P08Vw7GF/kCoeOs1jH+tiarZ z0ffYxZzmX3vxMq0ypiREKm2RZdrN91wKngv6GZrA+m1ocI6Ja2p4kVksAWcwmSs yIeDQkJqKEsLX0jF4218YzAYdoWDbjRcLAPMaNe+ojgAV/FG+YYy910Sxy8HB5Pc zfpERBGyNnBl7dnAHwFFk77Couf9/Caayk4auYtMehmIZ8isjAyrrBaDXhC69qH7 bt1E4+Q5YPR5tKbrrNd/Fz6dZEYoMEyGAZoA7p5VOb9aPx4mL/5ivje0Q== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; bh=c9IF6P5wnuFymbdczqDQeCFlSep2T99rt9vuVR0ESnk=; b=PgzrtvFR FWg7bGrxGXLE9zdN8guDLFPk7QWY89DJHtPnyHYYo1jbi1SGMkPd+0L+CGe+plXS jbmBIobm/YFxULbyIM6yjjBkh4imRcnhQFGJNiybXXRNewT2nDhg4W3DHUmqgQ9k 4jU+HnnwajVnDmNAzE0hzOUxq7JdDb7ZWe5UlBnVb/5EAigflOK76JIyn3YbID1B oKsjcd35cNEMljtYZKXFSzokPj2hFuHx4cy+9TiuME7uJPG6CRIoCnzFmTTwJAua zIgOY+0SKQlXBzXWaVpzmnPmD64S1meknpsiGSAa320hXi910TfIz0kuSzlLU2Xn uLl1Emg7l5xDFQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrvdejuddgkeegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpeforgigihhm vgcutfhiphgrrhguuceomhgrgihimhgvsegtvghrnhhordhtvggthheqnecuggftrfgrth htvghrnhepvdekleevfeffkeejhfffueelteelfeduieefheduudfggffhhfffheevveeh hedvnecukfhppeeltddrkeelrdeikedrjeeinecuvehluhhsthgvrhfuihiivgepudenuc frrghrrghmpehmrghilhhfrhhomhepmhgrgihimhgvsegtvghrnhhordhtvggthh X-ME-Proxy: Received: from localhost (lfbn-tou-1-1502-76.w90-89.abo.wanadoo.fr [90.89.68.76]) by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 20 May 2021 11:03:59 -0400 (EDT) From: Maxime Ripard To: dri-devel@lists.freedesktop.org, Daniel Vetter , David Airlie , Maarten Lankhorst , Thomas Zimmermann , Maxime Ripard Cc: Florian Fainelli , Maxime Ripard , Eric Anholt , bcm-kernel-feedback-list@broadcom.com, Ray Jui , devicetree@vger.kernel.org, Scott Branden , linux-kernel@vger.kernel.org, Daniel Vetter , Rob Herring , linux-rpi-kernel@lists.infradead.org, Nicolas Saenz Julienne , linux-arm-kernel@lists.infradead.org, Mateusz Kwiatkowski Subject: [PATCH 2/4] dt-bindings: display: bcm2835-vec: Add BCM2711 compatible Date: Thu, 20 May 2021 17:03:42 +0200 Message-Id: <20210520150344.273900-3-maxime@cerno.tech> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210520150344.273900-1-maxime@cerno.tech> References: <20210520150344.273900-1-maxime@cerno.tech> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org From: Mateusz Kwiatkowski The BCM2711 VEC uses a slightly different, incompatible, setup than the one used for the earlier SoC. Add a new compatible for it. Signed-off-by: Mateusz Kwiatkowski Signed-off-by: Maxime Ripard --- .../devicetree/bindings/display/brcm,bcm2835-vec.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/display/brcm,bcm2835-vec.yaml b/Documentation/devicetree/bindings/display/brcm,bcm2835-vec.yaml index d900cc57b4ec..9b24081a0dbd 100644 --- a/Documentation/devicetree/bindings/display/brcm,bcm2835-vec.yaml +++ b/Documentation/devicetree/bindings/display/brcm,bcm2835-vec.yaml @@ -11,7 +11,9 @@ maintainers: properties: compatible: - const: brcm,bcm2835-vec + enum: + - brcm,bcm2711-vec + - brcm,bcm2835-vec reg: maxItems: 1 From patchwork Thu May 20 15:03:43 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxime Ripard X-Patchwork-Id: 443466 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 803D6C433B4 for ; Thu, 20 May 2021 15:04:18 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6620760FE8 for ; Thu, 20 May 2021 15:04:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241751AbhETPFi (ORCPT ); Thu, 20 May 2021 11:05:38 -0400 Received: from wnew2-smtp.messagingengine.com ([64.147.123.27]:57619 "EHLO wnew2-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242236AbhETPF3 (ORCPT ); Thu, 20 May 2021 11:05:29 -0400 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailnew.west.internal (Postfix) with ESMTP id 84D72166B; Thu, 20 May 2021 11:04:05 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Thu, 20 May 2021 11:04:07 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cerno.tech; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm2; bh=Zpxq5v0tG5hhw jgR/68xsWJDvi1qsDN0rRHvdVKecSI=; b=cOE0gGWm+YXq7PJ24EQ5s0nbWAw3K /wPun/Q6aKKiQEvhpobORLkJGW3BbRAzw6ZKQ5a/XHcNN9hlKNYdFLrEvxYbxLuu +lRw1pfQK1n3J6YYLfrF6alKW9Y9xY2z28uqXGAMxhgIXj+JurmTg4cN6fdIAFD+ X9mRjRgIHgyhNGen61EdXSDXRxNjpIg69bFdO63dHoMeYR7f+52lFM0UbSyR5VNp U6f1znSwk10eWQtj+0aZH0X+wZmK/wWzO3LoFue4eWXCUzgjY15c7FXA0u03RreC VKGSCXT6FADi7T1inzGSDGgV2QeQS4Au0xskBybD7lA3xwUYZ+sGNkqOQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; bh=Zpxq5v0tG5hhwjgR/68xsWJDvi1qsDN0rRHvdVKecSI=; b=Hd/wCaiq MLec/uU5imBmeM76062oHI1KiWc4yTR2cb/Arx3xFYwSs4ERr7OdRoVzpFCfDcV9 5YHI2BrqdaibvsLrVpHOOJ2LCaTaV6kt5NH8+bTPA1/9L5oUd7bBKG6P/15nScsK uHiqE79r/dbMKMd91M/iOjh1NatMfbECqolORVyfaEXS2BKOq0yqVmbREmAdzOgE k+Tfpf15hIfdANyC79vj5dcKPsV2U0Y1TMTkFRZ6Bejanqrlr322ga2IAfnJppNP vfxhkgdmsVaqDy+n1zGFu0wiZWmBSX2YY2rSyH4AIFbJH648kWCyL6i+Sw11vjTM i2A0NuI3zm3D2A== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrvdejuddgkeehucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpeforgigihhm vgcutfhiphgrrhguuceomhgrgihimhgvsegtvghrnhhordhtvggthheqnecuggftrfgrth htvghrnhepvdekleevfeffkeejhfffueelteelfeduieefheduudfggffhhfffheevveeh hedvnecukfhppeeltddrkeelrdeikedrjeeinecuvehluhhsthgvrhfuihiivgeptdenuc frrghrrghmpehmrghilhhfrhhomhepmhgrgihimhgvsegtvghrnhhordhtvggthh X-ME-Proxy: Received: from localhost (lfbn-tou-1-1502-76.w90-89.abo.wanadoo.fr [90.89.68.76]) by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 20 May 2021 11:04:03 -0400 (EDT) From: Maxime Ripard To: dri-devel@lists.freedesktop.org, Daniel Vetter , David Airlie , Maarten Lankhorst , Thomas Zimmermann , Maxime Ripard Cc: Florian Fainelli , Maxime Ripard , Eric Anholt , bcm-kernel-feedback-list@broadcom.com, Ray Jui , devicetree@vger.kernel.org, Scott Branden , linux-kernel@vger.kernel.org, Daniel Vetter , Rob Herring , linux-rpi-kernel@lists.infradead.org, Nicolas Saenz Julienne , linux-arm-kernel@lists.infradead.org, Mateusz Kwiatkowski Subject: [PATCH 3/4] drm/vc4: Separate VEC compatible variants Date: Thu, 20 May 2021 17:03:43 +0200 Message-Id: <20210520150344.273900-4-maxime@cerno.tech> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210520150344.273900-1-maxime@cerno.tech> References: <20210520150344.273900-1-maxime@cerno.tech> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org From: Mateusz Kwiatkowski The VEC's DAC on BCM2711 is slightly different compared to the one on BCM283x and needs different configuration. In particular, bit 3 (mask 0x8) switches the BCM2711 DAC input to "self-test input data", which makes the output unusable. Separating two compatible variants in devicetrees and the DRM driver was therefore necessary. The configurations used for both variants have been borrowed from Raspberry Pi (model 3B for BCM283x, 4B for BCM2711) firmware defaults. Signed-off-by: Mateusz Kwiatkowski Signed-off-by: Maxime Ripard --- drivers/gpu/drm/vc4/vc4_vec.c | 27 ++++++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/vc4/vc4_vec.c b/drivers/gpu/drm/vc4/vc4_vec.c index bd5b8eb58b18..a467ceba75e4 100644 --- a/drivers/gpu/drm/vc4/vc4_vec.c +++ b/drivers/gpu/drm/vc4/vc4_vec.c @@ -154,9 +154,14 @@ #define VEC_DAC_MISC_DAC_RST_N BIT(0) +struct vc4_vec_variant { + u32 dac_config; +}; + /* General VEC hardware state. */ struct vc4_vec { struct platform_device *pdev; + const struct vc4_vec_variant *variant; struct drm_encoder *encoder; struct drm_connector *connector; @@ -451,10 +456,7 @@ static void vc4_vec_encoder_enable(struct drm_encoder *encoder) VEC_WRITE(VEC_CONFIG2, VEC_CONFIG2_UV_DIG_DIS | VEC_CONFIG2_RGB_DIG_DIS); VEC_WRITE(VEC_CONFIG3, VEC_CONFIG3_HORIZ_LEN_STD); - VEC_WRITE(VEC_DAC_CONFIG, - VEC_DAC_CONFIG_DAC_CTRL(0xc) | - VEC_DAC_CONFIG_DRIVER_CTRL(0xc) | - VEC_DAC_CONFIG_LDO_BIAS_CTRL(0x46)); + VEC_WRITE(VEC_DAC_CONFIG, vec->variant->dac_config); /* Mask all interrupts. */ VEC_WRITE(VEC_MASK0, 0); @@ -507,8 +509,21 @@ static const struct drm_encoder_helper_funcs vc4_vec_encoder_helper_funcs = { .atomic_mode_set = vc4_vec_encoder_atomic_mode_set, }; +static const struct vc4_vec_variant bcm2835_vec_variant = { + .dac_config = VEC_DAC_CONFIG_DAC_CTRL(0xc) | + VEC_DAC_CONFIG_DRIVER_CTRL(0xc) | + VEC_DAC_CONFIG_LDO_BIAS_CTRL(0x46) +}; + +static const struct vc4_vec_variant bcm2711_vec_variant = { + .dac_config = VEC_DAC_CONFIG_DAC_CTRL(0x0) | + VEC_DAC_CONFIG_DRIVER_CTRL(0x80) | + VEC_DAC_CONFIG_LDO_BIAS_CTRL(0x61) +}; + static const struct of_device_id vc4_vec_dt_match[] = { - { .compatible = "brcm,bcm2835-vec", .data = NULL }, + { .compatible = "brcm,bcm2835-vec", .data = &bcm2835_vec_variant }, + { .compatible = "brcm,bcm2711-vec", .data = &bcm2711_vec_variant }, { /* sentinel */ }, }; @@ -546,6 +561,8 @@ static int vc4_vec_bind(struct device *dev, struct device *master, void *data) vec->encoder = &vc4_vec_encoder->base.base; vec->pdev = pdev; + vec->variant = (const struct vc4_vec_variant *) + of_device_get_match_data(dev); vec->regs = vc4_ioremap_regs(pdev, 0); if (IS_ERR(vec->regs)) return PTR_ERR(vec->regs); From patchwork Thu May 20 15:03:44 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxime Ripard X-Patchwork-Id: 444868 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 173D9C433B4 for ; Thu, 20 May 2021 15:04:30 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id F336F6135A for ; Thu, 20 May 2021 15:04:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242783AbhETPFr (ORCPT ); Thu, 20 May 2021 11:05:47 -0400 Received: from wnew2-smtp.messagingengine.com ([64.147.123.27]:40445 "EHLO wnew2-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231464AbhETPFf (ORCPT ); Thu, 20 May 2021 11:05:35 -0400 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailnew.west.internal (Postfix) with ESMTP id 08C091656; Thu, 20 May 2021 11:04:11 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute6.internal (MEProxy); Thu, 20 May 2021 11:04:13 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cerno.tech; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm2; bh=vvhQSOUeUthBO 4iLrRAnd7BgS689N6pLnJOyMb4iqPk=; b=vIJJ0E5+tldPjmSpOGJ2w3NIF3Ehv Zw0BbasNN9jxyzU0YD6xbZp1U8u91mRxoaX6uahPQg1RlcJ9JbNUrUej4939NG8K otD3LCwtFd1EkzYMXztulVrQoMVF7qjbjhRQWbrKId3lWhMo76kIrxV04S4HDWr3 gR12bNbmFK6Nahc6N6c+XwrAwusk05/iKWQhYTnXtj4oOhMKHRkYMLJV87H1K4ET Oji891WTutZLJVgnqVIMffkRacCplKJG4JqUN4SDw9B9HQg7TMDWCcmm+9qDavMk gTU3Gy2JmHSh9UsWpMhta3loCZRgaVrOTByMV1rp4HaGLrZbLfLt9Ewvw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; bh=vvhQSOUeUthBO4iLrRAnd7BgS689N6pLnJOyMb4iqPk=; b=DQlz09Bf TR4EWvQvBHVQh081S8S57MnTEGIgP8qJsidLtXtTzRO7mqnGfPihauWeqjEzVoiv cwwZbtJXa2R7TNkUdbYtNFq8fnuTOvbrRQ+nApe1BAdGVM2kzjs+blIjAohhdOZY O8T387fxypMXR1tZxCjwwIHRWN2Hu9M8O/NzLkj9DA/zPkAYSqWwtCMxCxi6/QrC v1MFOQo+9YwYtfyW6PGGEtOckTpckJhnLsOZxX+pf9BNKK+Wei8wqtgAYe7K9D7N XdxXq6VUpHft+V/zFUs1ib25Xbg/gT80dv68L0CB35tR2VZH6t1IrRi9tlUrmeZ2 eJDju8Np+8QmqQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrvdejuddgkeegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpeforgigihhm vgcutfhiphgrrhguuceomhgrgihimhgvsegtvghrnhhordhtvggthheqnecuggftrfgrth htvghrnhepvdekleevfeffkeejhfffueelteelfeduieefheduudfggffhhfffheevveeh hedvnecukfhppeeltddrkeelrdeikedrjeeinecuvehluhhsthgvrhfuihiivgeptdenuc frrghrrghmpehmrghilhhfrhhomhepmhgrgihimhgvsegtvghrnhhordhtvggthh X-ME-Proxy: Received: from localhost (lfbn-tou-1-1502-76.w90-89.abo.wanadoo.fr [90.89.68.76]) by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 20 May 2021 11:04:09 -0400 (EDT) From: Maxime Ripard To: dri-devel@lists.freedesktop.org, Daniel Vetter , David Airlie , Maarten Lankhorst , Thomas Zimmermann , Maxime Ripard Cc: Florian Fainelli , Maxime Ripard , Eric Anholt , bcm-kernel-feedback-list@broadcom.com, Ray Jui , devicetree@vger.kernel.org, Scott Branden , linux-kernel@vger.kernel.org, Daniel Vetter , Rob Herring , linux-rpi-kernel@lists.infradead.org, Nicolas Saenz Julienne , linux-arm-kernel@lists.infradead.org, Mateusz Kwiatkowski Subject: [PATCH 4/4] ARM: boot: dts: bcm2711: Add BCM2711 VEC compatible Date: Thu, 20 May 2021 17:03:44 +0200 Message-Id: <20210520150344.273900-5-maxime@cerno.tech> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210520150344.273900-1-maxime@cerno.tech> References: <20210520150344.273900-1-maxime@cerno.tech> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org From: Mateusz Kwiatkowski The BCM2711 has a slightly different VEC than the one found in the older SoCs. Now that we support the new variant, add its compatible to the device tree. Signed-off-by: Mateusz Kwiatkowski Signed-off-by: Maxime Ripard --- arch/arm/boot/dts/bcm2711.dtsi | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm/boot/dts/bcm2711.dtsi b/arch/arm/boot/dts/bcm2711.dtsi index 720beec54d61..0b6900815d19 100644 --- a/arch/arm/boot/dts/bcm2711.dtsi +++ b/arch/arm/boot/dts/bcm2711.dtsi @@ -1087,5 +1087,6 @@ &usb { }; &vec { + compatible = "brcm,bcm2711-vec"; interrupts = ; };