From patchwork Tue May 15 07:58:37 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stanimir Varbanov X-Patchwork-Id: 135854 Delivered-To: patch@linaro.org Received: by 2002:a2e:9706:0:0:0:0:0 with SMTP id r6-v6csp681099lji; Tue, 15 May 2018 01:12:38 -0700 (PDT) X-Google-Smtp-Source: AB8JxZr5TxYg3Z9vwYVZyFGJe4mzFCWQaqHaO8KZtJtRBB3Wu7xdhYrplll/CysFg7iJXvoiNWjs X-Received: by 2002:a17:902:a717:: with SMTP id w23-v6mr13300051plq.130.1526371958437; Tue, 15 May 2018 01:12:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526371958; cv=none; d=google.com; s=arc-20160816; b=Et5f77KqjOUMkLA8HcHs6sxj5wLyV1CtpKPLPfKlD4Rpb7SE6UP9uE/av+jR9fqf9N j9WYFsQambprmT0imHE4vMYuXy69HzaooHV1tvqYsQWsuM4xgeq6pVk+CU1JYGrZwZyp 60x3HhW2BZ6+JIhlId3fmHrNowFvfn697vBj86Z0uLP1YQnAH/Pm/dr5BmphyMQzafjQ fzG5hSlDEk+sSYWGOLpfAKfCzaxYA5RDGAk5thWitb9eKJpNS/9ElAHpRlbfbfo2R/vy ZEgZuafDJXc7iYKYtgtZG6JO0pNqn2Qm7mmgus4NneP1hCW+rBcTT46KZIuldITfh1FN 1TXQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=zuQ1SjEcsKyg6eckkbc65vVKHJNFHgpP18aBxBMCet0=; b=nw7wZXxzk8QVyV93+sbEv/VFpag+iPUiPHOfMiBZ38Hi3hlLcMeA/wWUpkijnTqoif +FIOuhmx7JIBofTS6P+OdCUCjmqDE+xWh4EmWDr+V6uUkEoZCqlpedG39LzZ41pn0c5P xB4kpaXYk/UsoG7zsk2j97U22izZnPLi/O7FRaa6qDq19hIb9eAL8dpyaO+0gIpybgds 04Br+eizNSxfZuuuCmIPxcEk5yK0HIzlazvb3M6Akat2Ps9NwL4ezpBTkROWRNelpJks YoEfBw5a2I00ISMQcwl5ZGlxX1RjeISCBlLUvBFgiKOTPXH4CcXoKRVNG8h/ltl97ucm Vf8Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=BUraEchV; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d1-v6si12009525plr.410.2018.05.15.01.12.38; Tue, 15 May 2018 01:12:38 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=BUraEchV; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752633AbeEOIMQ (ORCPT + 29 others); Tue, 15 May 2018 04:12:16 -0400 Received: from mail-wm0-f66.google.com ([74.125.82.66]:35031 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752506AbeEOH7g (ORCPT ); Tue, 15 May 2018 03:59:36 -0400 Received: by mail-wm0-f66.google.com with SMTP id o78-v6so19723294wmg.0 for ; Tue, 15 May 2018 00:59:35 -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=BUraEchVvckvYps8Tg8xqmU4mz0xhWovqODgLrZdUjz/sddwuF3mEGfIKwRlYK8iXw XueQ33HoSsI3VXM1c4ue9Cb3pQjGiHKJJyR6Pw5ZTlKKeJ1uucZvwxSosmDa+ao0eNOc th4w7B++JW+OzYGxzEQWZFV3Cp7BLvFyQUzK8= 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=p0RiMew+ojzqySZ3yApo7cdspfy0ufTVeTUjolGKyo/Z/7mmbhxpYsZZwijOUvCLnb EcxAY0KeOHsn9ffjrnjV2+hKl+iF7e/tljYsg4ThAPwSAP4UZOHy1RGex+Hmta5WrnUW uKDVWQllUFm2PjNGbmnboa0wi0THmtJ+4tO+O9vGzNFEVYFCHxaA4kvGDZPKuOgy55kf 2WiHq8hAqw4FqH74RF5r0PkhlJXSle/cM2w6xu8YgBcSNpgdAaE7BRflNs3bRCW/YGOc N9AVm7SY0HGDHZSXCkB2SuQq7Q2E8aDbEHIs/t1p6HA+yKZOqn1Bb69gfrePM5xUoby3 8y8w== X-Gm-Message-State: ALKqPwdiPFIBwlynexRsIQJzVbm3ckNGHyjo0O6snmRlhCxLvBYNpQNd +2Fp7SitTzJVRFhhhWsRmjOm8w== X-Received: by 2002:a1c:a750:: with SMTP id q77-v6mr6885237wme.111.1526371174839; Tue, 15 May 2018 00:59:34 -0700 (PDT) Received: from mms-0440.qualcomm.mm-sol.com ([37.157.136.206]) by smtp.gmail.com with ESMTPSA id 4-v6sm10918510wmg.40.2018.05.15.00.59.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 15 May 2018 00:59:34 -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 v2 07/29] venus: hfi_venus: add halt AXI support for Venus 4xx Date: Tue, 15 May 2018 10:58:37 +0300 Message-Id: <20180515075859.17217-8-stanimir.varbanov@linaro.org> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20180515075859.17217-1-stanimir.varbanov@linaro.org> References: <20180515075859.17217-1-stanimir.varbanov@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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(+) -- 2.14.1 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;