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: 9496375 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 E1FD9606DD for ; Wed, 4 Jan 2017 09:57:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D6A4327D8D for ; Wed, 4 Jan 2017 09:57:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CB66E27DCD; Wed, 4 Jan 2017 09:57:22 +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 8B80127DC2 for ; Wed, 4 Jan 2017 09:57:22 +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 1cOiJn-00021D-Ia; Wed, 04 Jan 2017 09:57:15 +0000 Received: from mail-wm0-x22c.google.com ([2a00:1450:400c:c09::22c]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1cOiJ8-0001o3-UZ for linux-amlogic@lists.infradead.org; Wed, 04 Jan 2017 09:56:37 +0000 Received: by mail-wm0-x22c.google.com with SMTP id t79so451573862wmt.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=RnJnzy3AlQf5BXX5IyUFNEAe12RBllSFlDCZ4CrUrSq5z0FZ5A2ZF3IPxZBqjOInwU sduXY8hXJTS9tDYlwMSTOqooFu+gcX/bnsNg9utHqxGjP4Y2Xw+ihayj5YktwqU31roL YE7WB2pQ7BsFVZchA2iZuVL4umCU7w/oYrnFzV/eFcsUbOQjJg1j7OVvk3HLi1oBB5UM +rVLB/WL820LiGznaeVsD+A5C1uwLTRdPmM3iBCqkffzfU5z+MZaLAp4kFPKcvb+m7kE 7AbxvwqN2T54liEJE6liyTOzOrSAhchDrvarts1iMi5enJNKvM6EaWJmj2vJMxtctB9f YYVA== X-Gm-Message-State: AIkVDXK3UlrJQhmaikFnnnar77lqmZtkl8heqHo6VhHCdaZ3e45nNCGCfPTH7w7Zf2dK/zza 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_231903_A5188509 X-CRM114-Status: GOOD ( 10.63 ) X-BeenThere: linux-amlogic@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-amlogic" Errors-To: linux-amlogic-bounces+patchwork-linux-amlogic=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));