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: 134101 Delivered-To: patch@linaro.org Received: by 10.46.151.6 with SMTP id r6csp2199851lji; Tue, 24 Apr 2018 05:54:46 -0700 (PDT) X-Google-Smtp-Source: AB8JxZopnnnF6g3oUuL5J/n+lE9F/nBaom1JQuXYl37ewh2//t3VkGQlqey/MIHG+wB93UyBDkuq X-Received: by 2002:a17:902:3e5:: with SMTP id d92-v6mr364400pld.104.1524574486323; Tue, 24 Apr 2018 05:54:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524574486; cv=none; d=google.com; s=arc-20160816; b=D1Cd1eRgQC0PZFFbS1mvGlW9CNcC4b4ZwGP1/3Ur/e6FnZBS6XO72Qw3Zhf6K8rN0N RyJHu43nub2xLVCKbcOphZX4AfwTLVbyYprycHvEscW0cCQrGKSVROIlxsIDE42+b216 9wknm9cihVBIGGExasWHQOKKzyVmVZ/Gw+RiKNFQDDMKizTM5dVy9U9mQp8y50bvF2BB z4zLvAUEPHw+jLT9TJao6qq4ci7XIOP7tDiq/iXPluXe9w3leJO7ClVOyQKYlw1i/l6w Y58KkKVFlz0y5a+DTO1+pp8QWJWoXHHDFe0DUZMyzBlCCEIpNYvI5WjdWk5pHUpAbOE2 QwvQ== 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=f7yDqBeSHJEzcRxduEO+5lhuJzJI036MDpdH2NPvmrdgwo3qikdKUnF0E/k0iKcsbf pv7zihEYEStVRoqUYS1PNoaHBtAcGKDpFSsHWqQiCrrk0sytVE5Rpvp+e2uKYcGvYv4Y S7TONwCAgCMhyfxkeZX/opovSuTkAx1IaekeHbmYMTrDzD9gZ5EHjIZLrlnHeBVMwH7n qIh3FrGAD/y9iijmah0ixzqi6MThUfxYNNbtZ6jbPV54bA4b0OVdfUcXVoV+g/R3ubqX /Ezo/xXFgKHtE/JRC/Tjb4ODYrtDy8KqGUkFaDI4OJHD4nNWMV64ev7hpIIW8DJ3y33H ZbXA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=PR96pTEl; 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 b11-v6si13883763pls.145.2018.04.24.05.54.46; Tue, 24 Apr 2018 05:54:46 -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=PR96pTEl; 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 S933323AbeDXMyn (ORCPT + 29 others); Tue, 24 Apr 2018 08:54:43 -0400 Received: from mail-wm0-f67.google.com ([74.125.82.67]:55517 "EHLO mail-wm0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757814AbeDXMpP (ORCPT ); Tue, 24 Apr 2018 08:45:15 -0400 Received: by mail-wm0-f67.google.com with SMTP id a8so693267wmg.5 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=pfx0MWIj+YMlYFPv/xamcywVzhaW9ObKZmK41TCqVifz5M2K1CuHF3E8biteHosZ/6 ru6LQHmCtXIHW+SHCsPd7o+39pDilsS9tPzTj6XI1WyCDMbMNrOpCkTdLbYOfHfXiQDj r2ODq3mkPbSz2nLYBBz/KXlmayNhxHzJnM2sR8OawH6Cbgf8U1EKAhOu6uFbHhSzl1pO zlbyfDMmMAYkZ6biHjaAIs23VBjw8VkWDgmOrasL/YRYR34OhhR4g9AputFnRGvyfzqw lU7BLHutF6+kL+zy3Z8y9+OvF4keAK+7PFmDBtpK3iVVocXLlt1sbCGQ8+NRsrS/VRtU dIzg== X-Gm-Message-State: ALQs6tCnQ3lAqVu1k5/W7I49Af2XuWrNxfBzyJviG6cbxwVo6VVoTr0U 8+BSDbMxA+wJgsnH5uTwbADS5g== 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-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;