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: 9496379 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 065E2606DD for ; Wed, 4 Jan 2017 09:58:16 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id ED17127DC2 for ; Wed, 4 Jan 2017 09:58:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E0C0527E15; Wed, 4 Jan 2017 09:58:15 +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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 757D927DC2 for ; Wed, 4 Jan 2017 09:58:15 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1cOiJQ-0001tt-8V; Wed, 04 Jan 2017 09:56:52 +0000 Received: from mail-wm0-x22b.google.com ([2a00:1450:400c:c09::22b]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1cOiJ8-0001o4-TI for linux-arm-kernel@lists.infradead.org; Wed, 04 Jan 2017 09:56:37 +0000 Received: by mail-wm0-x22b.google.com with SMTP id a197so403975996wmd.0 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=UFd5RP0rWT6LRr1We9ws8618Stw3fbQbg3Jat35xWa79vAypNug1d9JJjJOx+hXzzL Z7OfcD5MV8ViTBJfvZ4hBJXZ95zyCum4pb+lusCGMt5pVmHAktOaDHomixJ1Y9kBHThY 5GfEu7ArEKSLBJeveXTTxYYEKiaqDV7xKlhjMClm91ft8VNO7RkNZchssvuP2q3IGjX4 LAM+aEQWdAVAS4aR3cl9uz2G5bZ5enQzKwA/YPYM8yVCHmTsMYGxyxPfyxUPrM5LtNYL HhU9tcJqFih3wzhqq/JmChKiFFO+ct11V6OeAsGBA6xMA9+uBQqaTiPI9YJxH7H/BiEY TeGw== X-Gm-Message-State: AIkVDXIGJscwi2g4I2EmsHH83KefKAMR0V4ObfvvVtesRdeGjQSRXmtx6u9lVOa7dtsHZ5Bt 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> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170104_015635_161026_A87E20AF X-CRM114-Status: GOOD ( 12.08 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-amlogic@lists.infradead.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, dri-devel@lists.freedesktop.org, Neil Armstrong MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org 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));