From patchwork Wed Jun 13 15:07: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: 138483 Delivered-To: patch@linaro.org Received: by 2002:a2e:970d:0:0:0:0:0 with SMTP id r13-v6csp847602lji; Wed, 13 Jun 2018 08:09:23 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKFDTcMIHd55OXRtxLna2bRnjPh01KH0MBO5WCfaYY1vYQLGuORUp+a5RIm/PyytbfHBnO4 X-Received: by 2002:a63:951c:: with SMTP id p28-v6mr4436698pgd.318.1528902563751; Wed, 13 Jun 2018 08:09:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528902563; cv=none; d=google.com; s=arc-20160816; b=M2zIJ9BqD0O57bJK6bcBfJzwiHTUtCXE8zJ6g3aFxV/wMFl0jo/jdb5MfEiFr1TUFU JaJR2YeGoK8lSTMtKMc3UqqlGxWRa8iJ4XyaeOYWO5ITcTvjD1GovQQn8peY2vUE6nRC UjVuI2AsQzbUNh4P6cr/QKGSoHOs7i5OsmtYrvJj7Ujv7QEP+5RjqetmyK2ofmkGbMWm Kx49tBWq+NOBhNWB/ABX6HRAGJ06mxjMZfXUrSkIV8HP+l2ZncAvMdEBMROvZycbrHW1 dfbAL/pitxYVf71XoLONVnGZ+QWHJk32D5fheKSpnNJNdbp1HSI2v4oi79mY1S+rZFW5 sRpA== 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=JTs56AHvy6n4KWdfQCk5+mkf+fJThH/BkJrEXFnLkOk=; b=p5oXE5i6hF/q2b9MXBTucS4VUKKlRt7Y2kl3cey40IhB3gwkWrmnVDynRLOGx+UX0T Pd/TbjfErNfgYztD6WRC9AB6j5Zo/L02mmmoVPfLA2TodfPAyRpdYraWvghoUbF73qwx MGCtnFI4RBNb9Tp7G8IKAFcLXPdz3SfNZqqOImRxHF7rpSWpVYm+E9vIm1DLdNS9s2rk smUZQizGo3renB41idDnVKOpRv/y/1QqZapoLmwVf4O6p6oCOF+Qp7YyqL6NA/UaK/Uz 5UqVO8cCGt9mt3Uxe0LoXqEbCif+6B95YHYx9vBirrAUywzmJ/ecBF7keKsjMAp6Al7s mUfw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=YoDC2T97; 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 h33-v6si3271727plh.124.2018.06.13.08.09.23; Wed, 13 Jun 2018 08:09:23 -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=YoDC2T97; 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 S935972AbeFMPJV (ORCPT + 30 others); Wed, 13 Jun 2018 11:09:21 -0400 Received: from mail-wr0-f194.google.com ([209.85.128.194]:35518 "EHLO mail-wr0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935956AbeFMPJQ (ORCPT ); Wed, 13 Jun 2018 11:09:16 -0400 Received: by mail-wr0-f194.google.com with SMTP id l10-v6so3163721wrn.2 for ; Wed, 13 Jun 2018 08:09: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=YoDC2T97GMSTnDtT1J5RA8dxlqoBLa65csQZd7HMtglZjLp8Et/bXB8KhPwkhNejD3 Mj81L36jR68fKP6AIbwsY5u9emz5NVxP3ZDod6SdVur87rhZeRY8X5VqCgBbzNAXL7GJ JyVUtHFINcPWD3rfzwP2FeuaKrwqC6il7eyLQ= 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=SZOR7JnkTXcaYTVOAvP0xQKHVf7p9nowuGywnoWVKE5mhml7CABcoye0UglQHutV8U v6IyY6bHnKT+j44Zx4h7JU7lAYIU6WP707mE64jrdag+fEp9RQcLWAT51IszLPFOJ4Xj dPg674P3DI3vsYru5NBtxNWTJtF1nmrghaWZalCewjYMKDK7xBzAeZzsuYBkXejqd5kd IR1WeA3l0DKp6g890KypMD+Kdzi0IX9uHAs0CU43xreX6swPFRrqm3a6mLbwSFFZ2WKr bU7TOYN3mp9AIIfNzezF2VaVDZzrIsuylEYUIPWBtSl10tR0E/iuiyWHaMzgOs4Ok0yR x9Eg== X-Gm-Message-State: APt69E0PQ8UYIopu7t2WOGAiVPD4I8bnEieZpUIvLl6850qUCtvhGhaw 7US5WChf9uIYodkbolrc2dQIMQ== X-Received: by 2002:adf:86ae:: with SMTP id 43-v6mr4158751wrx.281.1528902555195; Wed, 13 Jun 2018 08:09:15 -0700 (PDT) Received: from mms-0440.qualcomm.mm-sol.com ([37.157.136.206]) by smtp.gmail.com with ESMTPSA id e13-v6sm2886548wrm.45.2018.06.13.08.09.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 13 Jun 2018 08:09: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 , Tomasz Figa , Stanimir Varbanov Subject: [PATCH v3 07/27] venus: hfi_venus: add halt AXI support for Venus 4xx Date: Wed, 13 Jun 2018 18:07:41 +0300 Message-Id: <20180613150801.11702-8-stanimir.varbanov@linaro.org> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20180613150801.11702-1-stanimir.varbanov@linaro.org> References: <20180613150801.11702-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 | 18 ++++++++++++++++++ drivers/media/platform/qcom/venus/hfi_venus_io.h | 2 ++ 2 files changed, 20 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..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)