From patchwork Wed Jun 1 09:19:12 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yakir Yang X-Patchwork-Id: 9146863 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 9BC2860761 for ; Wed, 1 Jun 2016 09:19:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8C8C51FFBD for ; Wed, 1 Jun 2016 09:19:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8140125819; Wed, 1 Jun 2016 09:19: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.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0D10A1FFBD for ; Wed, 1 Jun 2016 09:19:21 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id D4B156E904; Wed, 1 Jun 2016 09:19:19 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from lucky1.263xmail.com (lucky1.263xmail.com [211.157.147.135]) by gabe.freedesktop.org (Postfix) with ESMTPS id 22BDF6E930 for ; Wed, 1 Jun 2016 09:19:17 +0000 (UTC) Received: from ykk?rock-chips.com (unknown [192.168.167.192]) by lucky1.263xmail.com (Postfix) with SMTP id D95628F7; Wed, 1 Jun 2016 17:19:13 +0800 (CST) X-263anti-spam: KSV:0; X-MAIL-GRAY: 1 X-MAIL-DELIVERY: 0 X-KSVirus-check: 0 X-ABS-CHECKED: 4 X-ADDR-CHECKED: 0 Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.263.net (Postfix) with ESMTP id C8D8625256; Wed, 1 Jun 2016 17:19:05 +0800 (CST) X-RL-SENDER: ykk@rock-chips.com X-FST-TO: yzq@rock-chips.com X-SENDER-IP: 103.29.142.67 X-LOGIN-NAME: ykk@rock-chips.com X-UNIQUE-TAG: X-ATTACHMENT-NUM: 0 X-SENDER: ykk@rock-chips.com X-DNS-TYPE: 0 Received: from localhost.localdomain (unknown [103.29.142.67]) by smtp.263.net (Postfix) whith ESMTP id 14972F4IZAQ; Wed, 01 Jun 2016 17:19:07 +0800 (CST) From: Yakir Yang To: Mark Yao , Heiko Stuebner , tfiga@chromium.org Subject: [PATCH] drm/rockchip: vop: do axi reset in vop initial time Date: Wed, 1 Jun 2016 17:19:12 +0800 Message-Id: <1464772752-9808-1-git-send-email-ykk@rock-chips.com> X-Mailer: git-send-email 1.9.1 Cc: daniel.vetter@ffwll.ch, dianders@chromium.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, linux-rockchip@lists.infradead.org, Thierry Reding 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 There is a bug in RK3399 VOP, when bootloader/kernel only enable VOP Big or VOP Little to display, then VOP IOMMU would failed to reset at the initial time and VOP register couldn't write rightly. After do the pure reset of VOP module, then things back to right. Signed-off-by: Yakir Yang --- drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c index 1c4d5b5..4150323 100644 --- a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c +++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c @@ -1292,7 +1292,7 @@ static int vop_initial(struct vop *vop) { const struct vop_data *vop_data = vop->data; const struct vop_reg_data *init_table = vop_data->init_table; - struct reset_control *ahb_rst; + struct reset_control *ahb_rst, *axi_rst; int i, ret; vop->hclk = devm_clk_get(vop->dev, "hclk_vop"); @@ -1331,6 +1331,19 @@ static int vop_initial(struct vop *vop) } /* + * do aclk_reset, reset all vop registers. + */ + axi_rst = devm_reset_control_get(vop->dev, "axi"); + if (IS_ERR(axi_rst)) { + dev_err(vop->dev, "failed to get axi reset\n"); + ret = PTR_ERR(axi_rst); + goto err_disable_aclk; + } + reset_control_assert(axi_rst); + usleep_range(10, 20); + reset_control_deassert(axi_rst); + + /* * do hclk_reset, reset all vop registers. */ ahb_rst = devm_reset_control_get(vop->dev, "ahb");