Received: by 2002:ac0:a591:0:0:0:0:0 with SMTP id m17-v6csp619941imm; Thu, 5 Jul 2018 06:15:12 -0700 (PDT) X-Google-Smtp-Source: AAOMgpePtCMkI1Oq5IvnTHiohIASQ2o1FArNFZwIGttXmkKCwefwQAhcFv7urCrJFeKc1ujf7SUW X-Received: by 2002:a65:62ce:: with SMTP id m14-v6mr5561158pgv.407.1530796512657; Thu, 05 Jul 2018 06:15:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530796512; cv=none; d=google.com; s=arc-20160816; b=c7KLZZBtcTrujUJ4t1N2+CH2Lp4Pap7ye3/dxaDkwx+8bYidrroKXtNFLoDPLYGPp+ Eu8gCSQ+IrEskguLIKv9IQTBKLdcbhQlJ8i0NE2VHophxGuTyP2MPcq3JeMVj3kwMewM T5MrGdALHVmcq8eVmdYIcFxu4Z2RfP1JIGtXBHs63x3IhIp1pUe1cJ8NoBqB2+yybfsj HcCFw057Y+G5sMX06ZBLjfuVcyzS+Cl/ZYXEqiPSD7GwY8hDS5djSBG8btzpKxKP9ppr 0Y4NxHfjceEQCzcrvd2iopUJ2iPoeyEyg+H7ZzD5CiymEddXc3MNlKPLr0cWZ8c7in+i bWpQ== 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=SS0Eyk/bPL011gtZm38Ggglk4W0O8TWpao0TklVXm4JlrXO1ZmZkbnWi/vmqmyO7hw fIOtO7LBloY7W7K9DuN3chaC48yIxPJjA20pIbrIO6GAoM4iMZltePuXLc49i1qJm+W3 pZKq0Rt5dDYXxsr+itQ5FMEhJLCFiAKWq3aze18hT884jxuy6ab+MnJ5T4Edz6MPP5s9 wKDym7qGeKxxffoHRu5nW4B3pJ70SR18NZPhRb94BoKQ35xDZr8zDwUlTXjp4bJb54gc X268evGA/fBJ/dxFQ+PPmnbSyItcPFVr2wqdx3ER6mHA8fWZYsSGxj+phSZp189ts/zV /njw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=i7BLU1+i; 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 p35-v6si5657117pgl.202.2018.07.05.06.14.57; Thu, 05 Jul 2018 06:15:12 -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=i7BLU1+i; 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 S1754541AbeGENOS (ORCPT + 99 others); Thu, 5 Jul 2018 09:14:18 -0400 Received: from mail-wm0-f67.google.com ([74.125.82.67]:50214 "EHLO mail-wm0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754305AbeGENFP (ORCPT ); Thu, 5 Jul 2018 09:05:15 -0400 Received: by mail-wm0-f67.google.com with SMTP id v25-v6so11041607wmc.0 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=eOS0PsrFLVvx9Pl7yu8QmE65bt3vhhAeMN/Be68Ms97KZISeXSQNKe0saZ0usAiTkN vn8pFifYMOdChLlxj4cfPJ5Piga5kKQfqCQ2hpaGhBMkxGt7IF6gzNt7tPsqEoFjQ15S P8aE+hC/5v3yIGOCQHGkYOM1B7Cgm5/2l8MkDP5MFoUjp6NjOPiNU1kubHdHA/EbOzor igmNbb8aXgPNhLo+WX7F7KVQtl1xcdXckYxCmFWB5LnpRBBOeqiACqtOhitTL9oeDeq+ Pa0MB87c9EJbZtqoNHEWHTcGvyEFe1gwCl7X0UDTq8po9ZIBxgyeCkB4iqtsUkiwyP61 LxZg== X-Gm-Message-State: APt69E1k70ivynkaYYwnsYe2ew/rLEzwQkqFwsNT7bYWRlda745RTvLi qN0Hvj6ogXWSPx6RoY4Fl3Nt1g== 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-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(+) 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) -- 2.14.1