From patchwork Wed Jan 4 09:55:51 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Neil Armstrong X-Patchwork-Id: 9496367 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 6F796606A9 for ; Wed, 4 Jan 2017 09:56:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 65A0727D8D for ; Wed, 4 Jan 2017 09:56:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5A69E27DCD; Wed, 4 Jan 2017 09:56:37 +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=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 1056527D8D for ; Wed, 4 Jan 2017 09:56:37 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 9037A6E6D3; Wed, 4 Jan 2017 09:56:22 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wm0-x22e.google.com (mail-wm0-x22e.google.com [IPv6:2a00:1450:400c:c09::22e]) by gabe.freedesktop.org (Postfix) with ESMTPS id E5BC76E20C for ; Wed, 4 Jan 2017 09:56:14 +0000 (UTC) Received: by mail-wm0-x22e.google.com with SMTP id k184so256067321wme.1 for ; Wed, 04 Jan 2017 01:56:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=Xg/PFEEKGHhXiCQuPrqgLuckLBNt0MAxXyoTdNa47O0=; b=nG4ylAwlCro81gEsghtzoVFDN9yLwBSD8gZOipJUvFAm6dpAeKvHCSKtWn7o+FVIDG B+AOg5g97mJO7oQJVRdwrFaUvUzmf1gGZ1dVKBr/qiN6doJIJIoDaa4aJeIDI1hYeWbL dbEaGSJ96tJR9BvvvlETZQxjd5HSo7bVcoR1ehcvciI209DeSnTof7fwnscCbUx86veU kFG7jMHaE9bBH2zdhHuXI+M68PPK+Jbv/e4p2yq3q5PydgBPILnxUPWBfB/xiwVVCdeR 4UD/rdsjXf6ztSYOUhpukl7BBQFegD+mosFxgcTS1sIFi/KaDnEhrwDHtkk2/5nIlckP n0fg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=Xg/PFEEKGHhXiCQuPrqgLuckLBNt0MAxXyoTdNa47O0=; b=lrqZmQ6rvRXH/k4VVmFzzi4co0Cj9fMaYuusLs+gHUblMxKPmQ2Wu5GEHIUtXsak6k hxAFJdt8obqxAjTQYOgqaofoE6+f8KoeG5U70fqmig8qbpSa0QinGx0FDdif6e7LGCD2 KREu9hbiy//wz8LfdtgpYT3J/fbg1uEGeMSxBYzv5eRMN5R6teiySx5h6menMMNN3pjN cOSYx/A8Rf4r0PbXMslgBvBihDZNH8zt5zZcOwMcuFya7e+ONvdIu0YvecSd8dslL5df 4uNZGBhKIP3mSr8+Rj7fxPtJ9ts1hRRwzPijz83wEW4P4CQRqcXRccjQXQXtnpDEHHzC t60Q== X-Gm-Message-State: AIkVDXKAozJW4Ea96GqZG89WmxzvYGn+eiFQrse91XZe+YMptnG/TGbfXz5qLCp58sb8xkCj X-Received: by 10.28.8.12 with SMTP id 12mr55271292wmi.46.1483523772971; Wed, 04 Jan 2017 01:56:12 -0800 (PST) Received: from localhost.localdomain ([90.63.244.31]) by smtp.gmail.com with ESMTPSA id d184sm94697455wmd.8.2017.01.04.01.56.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 04 Jan 2017 01:56:12 -0800 (PST) From: Neil Armstrong To: airlied@linux.ie, daniel@ffwll.ch Subject: [PATCH 1/2] drm/meson: Fix CVBS initialization when HDMI is configured by bootloader Date: Wed, 4 Jan 2017 10:55:51 +0100 Message-Id: <1483523752-14705-2-git-send-email-narmstrong@baylibre.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1483523752-14705-1-git-send-email-narmstrong@baylibre.com> References: <1483523752-14705-1-git-send-email-narmstrong@baylibre.com> Cc: linux-amlogic@lists.infradead.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, dri-devel@lists.freedesktop.org, Neil Armstrong X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP When the HDMI output is configured by the bootloader, there is mismatch is the pipeline configuration and the Vsync interrupt fails to trigger. This commit disables the HDMI blocks in the probe phase. Fixes: bbbe775ec5b5 ("drm: Add support for Amlogic Meson Graphic Controller") Signed-off-by: Neil Armstrong --- drivers/gpu/drm/meson/meson_venc.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/drivers/gpu/drm/meson/meson_venc.c b/drivers/gpu/drm/meson/meson_venc.c index d836b22..f7c87017 100644 --- a/drivers/gpu/drm/meson/meson_venc.c +++ b/drivers/gpu/drm/meson/meson_venc.c @@ -38,6 +38,11 @@ * - TV Panel encoding via ENCT */ +/* HHI Registers */ +#define HHI_VDAC_CNTL0 0x2F4 /* 0xbd offset in data sheet */ +#define HHI_VDAC_CNTL1 0x2F8 /* 0xbe offset in data sheet */ +#define HHI_HDMI_PHY_CNTL0 0x3a0 /* 0xe8 offset in data sheet */ + struct meson_cvbs_enci_mode meson_cvbs_enci_pal = { .mode_tag = MESON_VENC_MODE_CVBS_PAL, .hso_begin = 3, @@ -242,6 +247,20 @@ void meson_venc_disable_vsync(struct meson_drm *priv) void meson_venc_init(struct meson_drm *priv) { + /* Disable CVBS VDAC */ + regmap_write(priv->hhi, HHI_VDAC_CNTL0, 0); + regmap_write(priv->hhi, HHI_VDAC_CNTL1, 8); + + /* Power Down Dacs */ + writel_relaxed(0xff, priv->io_base + _REG(VENC_VDAC_SETTING)); + + /* Disable HDMI PHY */ + regmap_write(priv->hhi, HHI_HDMI_PHY_CNTL0, 0); + + /* Disable HDMI */ + writel_bits_relaxed(0x3, 0, + priv->io_base + _REG(VPU_HDMI_SETTING)); + /* Disable all encoders */ writel_relaxed(0, priv->io_base + _REG(ENCI_VIDEO_EN)); writel_relaxed(0, priv->io_base + _REG(ENCP_VIDEO_EN));