From patchwork Thu Jul 5 13:03:41 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stanimir Varbanov X-Patchwork-Id: 141143 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp1928559ljj; Thu, 5 Jul 2018 06:14:20 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcKxvuFQexKPG+Tw/e0sjvoNBqEBrvH7h3sDOKORNrj4sQib87y6ipQ8ILPC7U2svZqpzK4 X-Received: by 2002:aa7:82d9:: with SMTP id f25-v6mr6363488pfn.218.1530796460433; Thu, 05 Jul 2018 06:14:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530796460; cv=none; d=google.com; s=arc-20160816; b=Em4ZQsvLDUCKtf4RDXdrOosTJISr3gsGrJh6DACSErFuNrktOmYVmTWjLnZi+ShIXe PXLgs4QYbsv9fap/VoYVFbnwLR92nu+TVpOS1HmykLu0QK+hmTajScGPETH7DHu071/V k3XFb7dz5sYzdM/bogk3uaAYZx6lujgYIjeUYMeTQcogdu+DB3MPuC8B8hKtfhtnZdm+ 9OwKf7eqHp1ntLoE25rhyPxvQyT6q555TY5QK7J+3CH6Rvs+sauII+nxGp1vpEhRUoQ1 Govlq6FwcqX5wr5wehbG40QNW3gDTzeUHR8Tef0UkzmkGLiDNsyStVQv99STwUGuVZil drKw== 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=KEU8A7rBnpwRrZeJDhuhNNHTxOxbYDpN/yhpkLtIIgo=; b=jiZUWZrZkwcGpA3CBoBJXpRytTQ3r9ZcU7boJhB63/y8Tzk+PJVlrQKjpbsu70WrCQ WwtFbnbDRW7+32VlPM1C62lkLwn/i8FQYKt3L3HofS7ykBXmmSVlJU9xqaPRU04vC8UQ 0+9Xol8RZqd7Slnz6++89IODkuj3KirK4uKmuNj13DSnfpzL0mYNJdtesbTDykOmhAT0 Gzr88Ys+NUuPv7+fb14Pch5vRTKdtcBpL6nTTPY2RqLhvwDTzE3Zf6OwQfBC+MeKOV// aDfIC0cDphVOLYBy9aHHnUXevfbwcKkgKcbfPrlFl3P66SVaG/DEyH2sdTqK7U2NVPu6 pOEg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=i7BLU1+i; spf=pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=fail (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 d2-v6si5250377pgv.562.2018.07.05.06.14.20; Thu, 05 Jul 2018 06:14:20 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=i7BLU1+i; spf=pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754456AbeGENOS (ORCPT + 13 others); Thu, 5 Jul 2018 09:14:18 -0400 Received: from mail-wm0-f67.google.com ([74.125.82.67]:55007 "EHLO mail-wm0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754304AbeGENFP (ORCPT ); Thu, 5 Jul 2018 09:05:15 -0400 Received: by mail-wm0-f67.google.com with SMTP id i139-v6so10960884wmf.4 for ; Thu, 05 Jul 2018 06:05: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=JTs56AHvy6n4KWdfQCk5+mkf+fJThH/BkJrEXFnLkOk=; b=i7BLU1+i6u6aYm292awS7/VVhRt8OUoCtcevBsE+dyXgQk1Vr9nxm++Db6twC+VBsU 5Od0HbxpM7l/gnd76vfvWocAmNB4lhbcal1ok6mNj8U/QSEkiw8w1UNNn73qAz0rBtkh vCZoqwPi5K4KVj6HJ/fa0K4rkseK6RWgYcWsk= 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=JTs56AHvy6n4KWdfQCk5+mkf+fJThH/BkJrEXFnLkOk=; b=PuXPIIOc5Y0wAryccSoRIy0uWNI1WotzSam25BxuJ9ACsw31b5uy02orHIY9isqzL2 KGt1YttYkjG9KKCU+ggEAfqnO5nRBdubGO4UhfcveFb2EVVpqGrTrHChp8JNiaCRd73O Qksup5vetM9ZocQOxx0SBNMZKVut/DRCpz0+9GPxKa8GLDzjkn9KGSVN3O9dWtSOpTjm v8Y30ayxNrmFgIZNOH9+styQBBfiHPgoCaxZB9eTOECc4WXNoz/CkTP166S9cSiCJ65w cLAvCHM00uQ5AKm7zWZHg9t98VB0YEWEZqo3J6C7nx3bkqfX6FVzlj7kqIStnsaENzqY 7QpA== X-Gm-Message-State: APt69E0Wy+P88JHhNdpNPKK7rck8Y7dZFVPqy4JJoe7OxWw3Y5heAEfj 1XxsdrHp9b5cMyt9Mh0CE8jETQ== X-Received: by 2002:a1c:ac03:: with SMTP id v3-v6mr3962769wme.100.1530795914473; Thu, 05 Jul 2018 06:05:14 -0700 (PDT) Received: from mms-0440.qualcomm.mm-sol.com ([37.157.136.206]) by smtp.gmail.com with ESMTPSA id 11-v6sm2109102wrw.67.2018.07.05.06.05.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 05 Jul 2018 06:05:13 -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 , Tomasz Figa , Alexandre Courbot , Stanimir Varbanov Subject: [PATCH v5 07/27] venus: hfi_venus: add halt AXI support for Venus 4xx Date: Thu, 5 Jul 2018 16:03:41 +0300 Message-Id: <20180705130401.24315-8-stanimir.varbanov@linaro.org> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20180705130401.24315-1-stanimir.varbanov@linaro.org> References: <20180705130401.24315-1-stanimir.varbanov@linaro.org> Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@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 | 18 ++++++++++++++++++ drivers/media/platform/qcom/venus/hfi_venus_io.h | 2 ++ 2 files changed, 20 insertions(+) -- 2.14.1 -- To unsubscribe from this list: send the line "unsubscribe linux-arm-msm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/media/platform/qcom/venus/hfi_venus.c b/drivers/media/platform/qcom/venus/hfi_venus.c index 734ce11b0ed0..784b3ad1a9f6 100644 --- a/drivers/media/platform/qcom/venus/hfi_venus.c +++ b/drivers/media/platform/qcom/venus/hfi_venus.c @@ -532,6 +532,24 @@ static int venus_halt_axi(struct venus_hfi_device *hdev) u32 val; int ret; + if (IS_V4(hdev->core)) { + val = venus_readl(hdev, WRAPPER_CPU_AXI_HALT); + val |= WRAPPER_CPU_AXI_HALT_HALT; + venus_writel(hdev, WRAPPER_CPU_AXI_HALT, val); + + ret = readl_poll_timeout(base + WRAPPER_CPU_AXI_HALT_STATUS, + val, + val & WRAPPER_CPU_AXI_HALT_STATUS_IDLE, + 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; diff --git a/drivers/media/platform/qcom/venus/hfi_venus_io.h b/drivers/media/platform/qcom/venus/hfi_venus_io.h index d327b5cea334..c0b18de1e396 100644 --- a/drivers/media/platform/qcom/venus/hfi_venus_io.h +++ b/drivers/media/platform/qcom/venus/hfi_venus_io.h @@ -104,7 +104,9 @@ #define WRAPPER_CPU_CLOCK_CONFIG (WRAPPER_BASE + 0x2000) #define WRAPPER_CPU_AXI_HALT (WRAPPER_BASE + 0x2008) +#define WRAPPER_CPU_AXI_HALT_HALT BIT(16) #define WRAPPER_CPU_AXI_HALT_STATUS (WRAPPER_BASE + 0x200c) +#define WRAPPER_CPU_AXI_HALT_STATUS_IDLE BIT(24) #define WRAPPER_CPU_CGC_DIS (WRAPPER_BASE + 0x2010) #define WRAPPER_CPU_STATUS (WRAPPER_BASE + 0x2014)