From patchwork Mon Feb 22 16:02:53 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: 385796 Delivered-To: patch@linaro.org Received: by 2002:a02:290e:0:0:0:0:0 with SMTP id p14csp1396654jap; Mon, 22 Feb 2021 08:04:56 -0800 (PST) X-Google-Smtp-Source: ABdhPJzlYXJc8yM/EFKN8ci+L9X0eQfQxNAv/yO0XnOFsrFE1v6GmrKGkCIy3AvQwApwDT1HwA8+ X-Received: by 2002:a17:906:2488:: with SMTP id e8mr21380818ejb.121.1614009896490; Mon, 22 Feb 2021 08:04:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614009896; cv=none; d=google.com; s=arc-20160816; b=KNKRyBqsc7pYiiMdSZg1XXSvuIeR2iFdAWEZN0V5Rwt8UZuQZPYFgYe5dsoMR3KoD4 NajDk6AG2M5lfChSFbol9yCVUvQXQ/qmSLdIKWThgYCa7PBJv/58DTl11sNz8tbSUie4 E+Q9vF+Z6tfQTCBw4sv64xWJMh3yLrGDjqAY7Z9e85pKUrkPxMJNyCr+7Vmgz95AaClL 1sZsPZPRjhY69O3maa/SnouHcj20CiJxDcKowEgnD6VeKmqua//Ns5vWsl3HNO1MYtnK t8uzYth9RxRKZz1pOep+MTRNhnOrf/sXZaGdzbk8EXCH+k7tiqj4+lgqzzMicCdq+/fh l2pw== 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=enj8xcGxi5Ilg6e5Y2toHN1/uzGSCB2GzovsHLJELfo=; b=jd3MvOMyM5jGZLFLUIl8rIA04UD92m3elUgbORD19lqbeu0tzPvsZAhsR2IWBEL/52 6sxpE59naLEF2ZQcIN63NqGZzPCXC1fmt2PXspq3+E8I/KUze6nBuDqUNLNg1uQennk7 Ub8SjpjJ0S4WkwlPfdQPyQ0qikp/W3zM2hZ3bGbL090pxJLGMxQbuWdC6scMeMIMYePm dpGkCK2a4/x1xmQ6ht4c4wl08zJY4flisryBuAOO8aqH5bOznDJ29K3lToTjFsApnRlT VmFrK9MfrAGFOlBqhSg16R1TDmbe/I9i1I7kqf1Ri4SW91SbicdzbTK1GvBUF5LyRBnH M79w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=BNqcpR7U; 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 s13si12459169edj.330.2021.02.22.08.04.56; Mon, 22 Feb 2021 08:04:56 -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=BNqcpR7U; 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 S231169AbhBVQE0 (ORCPT + 16 others); Mon, 22 Feb 2021 11:04:26 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50674 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231293AbhBVQDi (ORCPT ); Mon, 22 Feb 2021 11:03:38 -0500 Received: from mail-wm1-x332.google.com (mail-wm1-x332.google.com [IPv6:2a00:1450:4864:20::332]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 87680C061A30 for ; Mon, 22 Feb 2021 08:01:56 -0800 (PST) Received: by mail-wm1-x332.google.com with SMTP id n10so14875224wmq.0 for ; Mon, 22 Feb 2021 08:01:56 -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=enj8xcGxi5Ilg6e5Y2toHN1/uzGSCB2GzovsHLJELfo=; b=BNqcpR7UH7IooZSMfPQPKzXh8VupQJkQqPzbC3V5vull8v8+HugN/UfS5G3at5GKeV y2Thn50sV5S3wom8gnQcYnx4nEGbsFNmk5vzhrMpBfs3YBetc+9YsdhUHvrNPX/BekDf qxP8lGG1mkvh69eOfmUoBzz9X382eSShSts4UY2k7qzXbzIzagRsblB6+JGFAXOR8Frn eWuJbqaUtJbswGRM5d3ygh0cRzpUNFQ74UC2DfJv6s9BVQyk031hn/q1vWZDJBcF6U7a m+kjLCzMb12PZrp4SwagYy9mLvQCxI1P0nnczSXDGA1wNQZeVZ8p+t7hJqmwnEbohwJ7 CxYA== 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=enj8xcGxi5Ilg6e5Y2toHN1/uzGSCB2GzovsHLJELfo=; b=ZK1WDxQjFcnjimHBQLUP4x6+rIMp4RIWFlSSqr2U/G91/f7GmKkB6XL9or1hwEIzpI rwRbTnhGYLMwqfuVu+pMyspTQoJ+9cumiVdvSgiSASnrZbidyhRaOIS4ObIqKiyeYHtK Sq8VHVPzmcrk+T5dQbmuTJU5zCKfWmsMdR4345HgHXRDfoyF6BY4J/oGR/f2yRICuHKJ NtSHbzegLVfxT+SaDKDisH3ovBpWRW+8z30Y0KR6Jld7I+EYRRKaDiIPrKQmldE9G1bc F380aMlhy4tHrP5reo3V7CAgLp+ixZaqkFH1/szij8Isn/UICn+KBPQgnrDC/30r0HjL exRg== X-Gm-Message-State: AOAM53312ovkfZ6CsWMjTqNx7uYnDR/EAscou/zQDvWQvNmW0ekMrbzH 9vqM7/FW9d21FKglGcJjOReROQ== X-Received: by 2002:a05:600c:35c2:: with SMTP id r2mr19396665wmq.54.1614009715270; Mon, 22 Feb 2021 08:01:55 -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 c3sm7373697wrw.80.2021.02.22.08.01.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Feb 2021 08:01:54 -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 18/25] media: venus: hfi: Add 6xx AXI halt logic Date: Mon, 22 Feb 2021 16:02:53 +0000 Message-Id: <20210222160300.1811121-19-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210222160300.1811121-1-bryan.odonoghue@linaro.org> References: <20210222160300.1811121-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() Converted LPI update timeout to dev_dbg. In practice this register never appears to update with the value 0x07. Discussing with contacts in qcom video team, this toggle only pertains to low-power mode. Keeping the write for the sake of fidelity with downstream. 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 | 45 +++++++++++++++++++ 1 file changed, 45 insertions(+) -- 2.29.2 diff --git a/drivers/media/platform/qcom/venus/hfi_venus.c b/drivers/media/platform/qcom/venus/hfi_venus.c index 24cf20f76e7f..01c100db07d3 100644 --- a/drivers/media/platform/qcom/venus/hfi_venus.c +++ b/drivers/media/platform/qcom/venus/hfi_venus.c @@ -541,10 +541,55 @@ 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) { + dev_err(dev, "NOC not in qaccept status %x\n", val); + return -ETIMEDOUT; + } + + /* HPG 6.1.2 Step 3, debug bridge to low power */ + mask_val = (BIT(2) | BIT(1) | BIT(0)); + writel(mask_val, wrapper_base + WRAPPER_DEBUG_BRIDGE_LPI_CONTROL_V6); + + ret = readl_poll_timeout(wrapper_base + WRAPPER_DEBUG_BRIDGE_LPI_STATUS_V6, + val, + (val & mask_val) == mask_val, + POLL_INTERVAL_US, + VBIF_AXI_HALT_ACK_TIMEOUT_US); + + if (ret) + dev_dbg(dev, "DBLP Set: status %x\n", val); + + /* HPG 6.1.2 Step 4, debug bridge to lpi release */ + 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;