From patchwork Fri Mar 12 17:30:32 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bryan O'Donoghue X-Patchwork-Id: 398676 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp1383865jai; Fri, 12 Mar 2021 09:30:32 -0800 (PST) X-Google-Smtp-Source: ABdhPJw5l5rO7dYC1nPTUa9OBP4pbGl3SrTCtPvQ/7cai7UVPCgIwLgRFvFzdrBrd56vcdXU1kes X-Received: by 2002:a05:6402:22b5:: with SMTP id cx21mr15607591edb.27.1615570232449; Fri, 12 Mar 2021 09:30:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615570232; cv=none; d=google.com; s=arc-20160816; b=eC0V1WBiR9GmSyKw7NfqO2SmeBrOhHaR6upNqchcJ6PfdXqcZH9TaaaTtYpl/zM5i8 /unOY+eGofSCg75/1BvD6V6dOURugxX8Wq1zsNBbIY49PwuVA3VS9QNHWDlij9Z7MYx0 ONCPC7cXfgQGP4/3qSvfnzLr6chbOeuLjDCATWMKxzXsljDy0ROQNU33A1tkkArYk8T5 ufRSUPTTQU9d70Mw2f4AvBdxWqpW0NzEqidLSHWh09fq50K9nAhOxzFBZ68/n01Jrbfv NO/wwIJGHant7hBDMZl0lriLheVYJ9E2TU1EJqaLOubUtame8QjK2x/9GKcJJjGzSN1f x3VA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=igIfstulndJUDaEydUX1L/UHdeNF+qcRikxpyKWA0c4=; b=pOdiC6G86MqltbDzoQwoY+nzylziouG4vRTTu/KcWbgGQQ01Gt/d1rYG0KogKpWsOV UqmRTismAoEwqobLWtrHhD71F7Y6KuBuZwbo+ir6QP2sgHrofSnpxQntFZhFZ5z8WUwn be2w44s6fa+d/OpveNnXYGbw6+VaKOBD/X029U1eMo9sxnly85p/RHoxTwtKKthAkhWv kQPtxvXiKRldPn3p6aJsU4rN79W4KPyTFkyJfIDho+XOw5Euxq3OLnal7JjXOoAsCzmZ uQIdedFvxdij07jjoOdYC5ZC7X1yZd57QVpnXowwlDuKpfhIC+kEcfFuzGMzt3vdz+th VBgA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=CCg5Z+aW; spf=pass (google.com: domain of linux-arm-msm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-arm-msm-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. [23.128.96.18]) by mx.google.com with ESMTP id ot6si4540497ejb.337.2021.03.12.09.30.32; Fri, 12 Mar 2021 09:30:32 -0800 (PST) Received-SPF: pass (google.com: domain of linux-arm-msm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=CCg5Z+aW; spf=pass (google.com: domain of linux-arm-msm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-arm-msm-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 S232768AbhCLR35 (ORCPT + 16 others); Fri, 12 Mar 2021 12:29:57 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41832 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232797AbhCLR3b (ORCPT ); Fri, 12 Mar 2021 12:29:31 -0500 Received: from mail-wr1-x429.google.com (mail-wr1-x429.google.com [IPv6:2a00:1450:4864:20::429]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 08D0EC061761 for ; Fri, 12 Mar 2021 09:29:31 -0800 (PST) Received: by mail-wr1-x429.google.com with SMTP id o16so2206325wrn.0 for ; Fri, 12 Mar 2021 09:29:30 -0800 (PST) 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 :mime-version:content-transfer-encoding; bh=igIfstulndJUDaEydUX1L/UHdeNF+qcRikxpyKWA0c4=; b=CCg5Z+aWawW5CS+zYkb+0/PlVx3P/GQoS+JTCL6s3SDDYzYL9eU9pji03oc4esfeIY 75wf2ikW78ytoTJIfTodlVERmgkMVmoW0cObgT9Vvb7gD74OCZy/uPxomaGqzd9RNItx HlFSokszZb3ATFHdhpo/b7Lbx587GyOnXbx0vWbGTRQm41kAtg3vbuUWoBrmNwX3ojf2 Z0rA1azyVGZWvjHHkKbqKxnznRifApTiLcH1G4Z6M3aErVwoifWfqDle/Pb2TQOmBARv dRSEKIO4ZQyA1j3s/ULpxdZew6UOn7n/M06J80EzHQXW9KNu3qmuj5Y7L5asaofL/E7V EGRw== 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:mime-version:content-transfer-encoding; bh=igIfstulndJUDaEydUX1L/UHdeNF+qcRikxpyKWA0c4=; b=X8GvHzh0EhfbOVHhwE8LMoSEYRdDCvyNzk8V8BIBUHSZZ7HjjKk7IIHT4eXcOUHZgB s0CuGvFgHIb9Jt5hlIvk52ruIgfhnY6+ksKj7vnyLkPGSHpYppMh/B8kwOonw8Ht7SrX l8Pm/3nmJi4nnoPw8pHIhmNiYsT/+Z02ziOa86OiYUBj3KBkQybpyPTPNAWIVdI0EMxj 47wyNkMWU9cRqb7X1k4Y2Re11vFWs/h1gaH8GUEEXWuLBBHmcsFxzl3iHjPF1f0qNFrb K7MW0SuQ7deN3pgkoB2E2xD4ka6KqIgkVc3EIVbPaivhdhlpGBhVGvmCmWspehz3qMX+ uU7Q== X-Gm-Message-State: AOAM531u/NPkE1bG3d/dPFesfR30NMdMTISgtg0S61wtPvqsPYYNz7eE KlArnmlUV3ovMpeimj1OLy+NQA== X-Received: by 2002:adf:b1c9:: with SMTP id r9mr15498127wra.51.1615570169732; Fri, 12 Mar 2021 09:29:29 -0800 (PST) Received: from sagittarius-a.chello.ie (188-141-3-169.dynamic.upc.ie. [188.141.3.169]) by smtp.gmail.com with ESMTPSA id 18sm2876375wmj.21.2021.03.12.09.29.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Mar 2021 09:29:29 -0800 (PST) From: Bryan O'Donoghue To: stanimir.varbanov@linaro.org, agross@kernel.org, bjorn.andersson@linaro.org, mchehab@kernel.org, linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org Cc: bryan.odonoghue@linaro.org, dikshita@codeaurora.org, jonathan@marek.ca, vgarodia@codeaurora.org Subject: [PATCH v2 18/25] media: venus: hfi: Add 6xx AXI halt logic Date: Fri, 12 Mar 2021 17:30:32 +0000 Message-Id: <20210312173039.1387617-19-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210312173039.1387617-1-bryan.odonoghue@linaro.org> References: <20210312173039.1387617-1-bryan.odonoghue@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org From: Dikshita Agarwal This patch takes the downstream AXI halt routine and applies it when IS_V6() is true. bod: Converted to readl_poll_timeout() Removed poll timeout for LPI register, testing showed the value would always timeout and work, so the polling did nothing of value. Signed-off-by: Dikshita Agarwal Co-developed-by: Bryan O'Donoghue Signed-off-by: Bryan O'Donoghue --- drivers/media/platform/qcom/venus/hfi_venus.c | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) -- 2.30.1 diff --git a/drivers/media/platform/qcom/venus/hfi_venus.c b/drivers/media/platform/qcom/venus/hfi_venus.c index 24cf20f76e7f..cebb20cf371f 100644 --- a/drivers/media/platform/qcom/venus/hfi_venus.c +++ b/drivers/media/platform/qcom/venus/hfi_venus.c @@ -541,10 +541,42 @@ static int venus_halt_axi(struct venus_hfi_device *hdev) { void __iomem *wrapper_base = hdev->core->wrapper_base; void __iomem *vbif_base = hdev->core->vbif_base; + void __iomem *cpu_cs_base = hdev->core->cpu_cs_base; + void __iomem *aon_base = hdev->core->aon_base; struct device *dev = hdev->core->dev; u32 val; + u32 mask_val; int ret; + if (IS_V6(hdev->core)) { + writel(0x3, cpu_cs_base + CPU_CS_X2RPMH_V6); + + writel(0x1, aon_base + AON_WRAPPER_MVP_NOC_LPI_CONTROL); + ret = readl_poll_timeout(aon_base + AON_WRAPPER_MVP_NOC_LPI_STATUS, + val, + val & BIT(0), + POLL_INTERVAL_US, + VBIF_AXI_HALT_ACK_TIMEOUT_US); + if (ret) + return -ETIMEDOUT; + + mask_val = (BIT(2) | BIT(1) | BIT(0)); + writel(mask_val, wrapper_base + WRAPPER_DEBUG_BRIDGE_LPI_CONTROL_V6); + + writel(0x00, wrapper_base + WRAPPER_DEBUG_BRIDGE_LPI_CONTROL_V6); + ret = readl_poll_timeout(wrapper_base + WRAPPER_DEBUG_BRIDGE_LPI_STATUS_V6, + val, + val == 0, + POLL_INTERVAL_US, + VBIF_AXI_HALT_ACK_TIMEOUT_US); + + if (ret) { + dev_err(dev, "DBLP Release: lpi_status %x\n", val); + return -ETIMEDOUT; + } + return 0; + } + if (IS_V4(hdev->core)) { val = readl(wrapper_base + WRAPPER_CPU_AXI_HALT); val |= WRAPPER_CPU_AXI_HALT_HALT;