From patchwork Wed Jun 27 15:27:05 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stanimir Varbanov X-Patchwork-Id: 140332 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp1024405ljj; Wed, 27 Jun 2018 08:28:16 -0700 (PDT) X-Google-Smtp-Source: AAOMgpeagyuUJvFRN2mS2ElyzgQy6NuYpHABB8PopT8Xe/NGGpGC3bQROEzCAmbSRtPnulz8kvMZ X-Received: by 2002:a62:ca99:: with SMTP id y25-v6mr6277781pfk.187.1530113296160; Wed, 27 Jun 2018 08:28:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530113296; cv=none; d=google.com; s=arc-20160816; b=SbrFWkGJfna0y9YC0PzZKit3xjSdSP/Yd1fB3bO+AIjyY2YFjXD+CmYIS7UavWmpON E8l5d7J8c4SWh70RxnWPfiMtg6GzDZdxh8SuSx3qT0m/YSVgQ41xOAPL6f/7XAARb338 35yr5ATnZliqz7dP71ueAJIbikWBu3Y+jGxj7++3mlft+1VrPiCJOzdYJbLFZq+RrXb7 v5vbxxuLF22AGLRKh2JrrebEi7SqECAYZFeZKOSO9lCce7ONu9LZ9SZzMSGI5d0UB/K9 AbUyuILnck4Qg1Hj6bPUJR8AHyIwLZPL5hmElerrj2tn1VM9QBQZLkYlLhZFP/S43aTe TiPQ== 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=Zzwm6UcaclAMV+OlNRTMZnO8LLbY0kwOLUNTSkZ64WIILjnUY+SBVrQjG9hqEgPVXD 6a8NfWD537oKkbbvkxzy0P0QvFu7sAr2NTUVosUNv9imiBDAvDch01K29I7n/J79epm2 fvdpviGVLF4pXF1gp2e/HmCUyFVVOGbtUnKd5hvjaWjqHiNCdVl1yyfrnZn1r9TKOZQ4 38ccT+t1rBW0jOSLxyMV0gcrkxJD9adSaNjdDtyVgiq1exWyg55DKPj7A0tEzweKj1Jx ZA9+LZO+P5ZWI0s2fLBnXeit7thwmHe2/gvZtaynvT+ZZZ6Ma75kEf9y0hEDqbiLqg/i YJnw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=KIEUNa0Z; spf=pass (google.com: best guess record for domain of linux-media-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-media-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 h128-v6si4141015pfc.211.2018.06.27.08.28.15; Wed, 27 Jun 2018 08:28:16 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-media-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=KIEUNa0Z; spf=pass (google.com: best guess record for domain of linux-media-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-media-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 S934894AbeF0P2N (ORCPT + 4 others); Wed, 27 Jun 2018 11:28:13 -0400 Received: from mail-wm0-f66.google.com ([74.125.82.66]:40605 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934850AbeF0P2H (ORCPT ); Wed, 27 Jun 2018 11:28:07 -0400 Received: by mail-wm0-f66.google.com with SMTP id z13-v6so5958757wma.5 for ; Wed, 27 Jun 2018 08:28:06 -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=KIEUNa0Zj98zU6QZS9HRyNaM8Rm2DMHuM4kWqpNCFGn0qivw1VH6Um3baqHDfw3Fw0 31YKr11rvEQhst25ULi37Eb7tbUEFPGQ+lsr61tuic/MAMwtQDqN9NAMWg9QCikusPMO gKikJDIlFp2Xup/ytCo5IKE9r+HGVwltbXS4E= 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=tGRAW1N/uBjlI5xPBD0vd/sIrWTFnNvlJzvPvBvC6Ih2rlJYkbA4G8EcDJRQjp8V0o 4o0Asgy4o95yVM7r+xDdhq6IQBHa7oQ4r9sKtFWLEDnZJzFXdXgDXvLoigpSBIgJVYSA JjtDanujCpaiqhR2vkZNrulyzbMthzJ3L038xaL4mKULvDcN1kIi5frBFlbFfUYahYBZ M5b+hVpv7XwMOdUKm8WPI4cmfexaX4/IVUWn7zWR87ItvPp+xPoEDZuGsy7j0zAGqRok RrDpb2jqS9DPWdnMCbWolRoxm01bjqSMKR/3upsj38wCOfCuC41s95AFgQmC+uDVTrQz R/Kw== X-Gm-Message-State: APt69E3p/3vnLK34cGtgaXQvNm5+gFXD0wQy6uU0BePoV+2V7janYe4f CVufqDfUEDDkVy3X267IHTqfYQ== X-Received: by 2002:a1c:4a9d:: with SMTP id n29-v6mr5039453wmi.46.1530113285944; Wed, 27 Jun 2018 08:28:05 -0700 (PDT) Received: from mms-0440.qualcomm.mm-sol.com ([37.157.136.206]) by smtp.gmail.com with ESMTPSA id o203-v6sm2916075wmd.30.2018.06.27.08.28.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 27 Jun 2018 08:28:05 -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 v4 07/27] venus: hfi_venus: add halt AXI support for Venus 4xx Date: Wed, 27 Jun 2018 18:27:05 +0300 Message-Id: <20180627152725.9783-8-stanimir.varbanov@linaro.org> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20180627152725.9783-1-stanimir.varbanov@linaro.org> References: <20180627152725.9783-1-stanimir.varbanov@linaro.org> Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@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)