From patchwork Tue Apr 24 12:44:15 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stanimir Varbanov X-Patchwork-Id: 10359607 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 E612F601BE for ; Tue, 24 Apr 2018 12:54:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D923928D00 for ; Tue, 24 Apr 2018 12:54:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CE10928DAE; Tue, 24 Apr 2018 12:54:48 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8010028DBF for ; Tue, 24 Apr 2018 12:54:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933321AbeDXMyn (ORCPT ); Tue, 24 Apr 2018 08:54:43 -0400 Received: from mail-wm0-f65.google.com ([74.125.82.65]:54348 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757817AbeDXMpP (ORCPT ); Tue, 24 Apr 2018 08:45:15 -0400 Received: by mail-wm0-f65.google.com with SMTP id f6so687945wmc.4 for ; Tue, 24 Apr 2018 05:45:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=zuQ1SjEcsKyg6eckkbc65vVKHJNFHgpP18aBxBMCet0=; b=PR96pTEltpOFNciZ7IMovpepBv0egzcSmsrT5Lx+yxB9Jhzw23XLv5195utHOLpxAs Mc0QGBXlpvRCPogNmuT5Ga9T5xG4VcjrEjaXWDvhhQelW1b+jl5cGdmUYn1dp/wUPR+K bB5HTcGhD3xEtN3aO5sXx+83I+IufUBLpQ7A0= 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=zuQ1SjEcsKyg6eckkbc65vVKHJNFHgpP18aBxBMCet0=; b=f/bz2GDA/ppbZCX38HFr7k8NUmtcLFkM6Hc4Y9I4t4ivy7AozqSUl8kvuyVuesgJDF hH4qadUFN6n/dan/HWW54hpTuf67taJECdjaxThJvmoZsp/dLXXCK/F1pEVYh55RFKu8 +sIH7IwvWSHMmWCvscImuFy6panacW+TQSXyK4BKn+bKp6BAQlR3Dba1wC9vS/lSF89v Os/t+WVQBVBt1u1eNYXJWzKVPOqF7JF8mimElR4xzE0CdK6wOWNsiZRu5o5JmURXS7At ld7Kk5em52CD4t65UviyA8dY5KzTfOh/7xEhMIg148bT1rPbiWArbxWEd0u6oyoS1D+o HFgw== X-Gm-Message-State: ALQs6tD2Aq7NhVNape1VNOZ/yjfTTUAK96IFun5pydOX4kxHV4F1K+4U WinGJF7+2fodjeFg1tRpWosVjB4OCDg= X-Google-Smtp-Source: AB8JxZqv4BXkg9sducxE11SOuDGr3pC8Wpo7+9fFkFl6I0LFEek0AYPGWP7m4avIGWttQNJ6KybFZw== X-Received: by 10.28.91.209 with SMTP id p200mr11518923wmb.11.1524573914620; Tue, 24 Apr 2018 05:45:14 -0700 (PDT) Received: from localhost.localdomain ([37.157.136.206]) by smtp.gmail.com with ESMTPSA id n49-v6sm22666013wrn.50.2018.04.24.05.45.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 24 Apr 2018 05:45:14 -0700 (PDT) From: Stanimir Varbanov To: Mauro Carvalho Chehab , Hans Verkuil Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, Vikash Garodia , Stanimir Varbanov Subject: [PATCH 07/28] venus: hfi_venus: add halt AXI support for Venus 4xx Date: Tue, 24 Apr 2018 15:44:15 +0300 Message-Id: <20180424124436.26955-8-stanimir.varbanov@linaro.org> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20180424124436.26955-1-stanimir.varbanov@linaro.org> References: <20180424124436.26955-1-stanimir.varbanov@linaro.org> Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Add AXI halt support for version 4xx by using venus wrapper registers. Signed-off-by: Stanimir Varbanov --- drivers/media/platform/qcom/venus/hfi_venus.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/drivers/media/platform/qcom/venus/hfi_venus.c b/drivers/media/platform/qcom/venus/hfi_venus.c index 734ce11b0ed0..53546174aab8 100644 --- a/drivers/media/platform/qcom/venus/hfi_venus.c +++ b/drivers/media/platform/qcom/venus/hfi_venus.c @@ -532,6 +532,23 @@ static int venus_halt_axi(struct venus_hfi_device *hdev) u32 val; int ret; + if (hdev->core->res->hfi_version == HFI_VERSION_4XX) { + val = venus_readl(hdev, WRAPPER_CPU_AXI_HALT); + val |= BIT(16); + venus_writel(hdev, WRAPPER_CPU_AXI_HALT, val); + + ret = readl_poll_timeout(base + WRAPPER_CPU_AXI_HALT_STATUS, + val, val & BIT(24), + POLL_INTERVAL_US, + VBIF_AXI_HALT_ACK_TIMEOUT_US); + if (ret) { + dev_err(dev, "AXI bus port halt timeout\n"); + return ret; + } + + return 0; + } + /* Halt AXI and AXI IMEM VBIF Access */ val = venus_readl(hdev, VBIF_AXI_HALT_CTRL0); val |= VBIF_AXI_HALT_CTRL0_HALT_REQ;