From patchwork Fri Apr 2 10:06:41 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: 414342 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp1285202jai; Fri, 2 Apr 2021 03:07:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwPYM3joChjo+BaSMXF6WwiRVEy3gEZo4t9fICR+J6NPUeyc8cgexyJO6ejA0cKmyV0/dr5 X-Received: by 2002:a5d:93c2:: with SMTP id j2mr10629157ioo.166.1617358078087; Fri, 02 Apr 2021 03:07:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617358078; cv=none; d=google.com; s=arc-20160816; b=zfy/WNGpFtEYq/2IN/qMQLACcA0u6SFYiz6HLj9TYl8tBnNL/1EIYFf8xqB+oEIFf7 mr5JhVkF3ef4IuQXo4asHnffjRUHFtPgwKMyWP6LkId689b172KSCg8J/ahNw/Q/IqW2 XPCevOpe6jrY/MgIr/aHBGA5Xrd1rAMjCovsCj1KRpxXqPH/Q8dHw33JO5mELDgY/wX/ KLQknLqAo5SJi8a8Y+XupYKCiTTpbrBX1HrZ0D62J7rNUjHVvmf7PceA0jdLeVHiDs26 jvXz18pOPIMpw5MTFiacBCcSxE+0jFbTQh/4l2HVKvUqeDdPbio7zyWRIOZIKePWGnvn pueA== 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=wwMK9AHuxVFl4rBHOIBcFYLquE5ubyLXDobeIx8iDE4=; b=X6KqbaGGxMov4kNVPPBy+mvC2kJzyDdxQak5fXu/vGWfmBPkqL+t4YgAvh19xTULbi 9EOFI75sQ3wv8AvMFPR6aLshdQ1GldiFvubaYD2EVShalE2z8iTsu3tQbE/qczrnd3cR Ts0JPN/90aF9r5Z2ltb+dsU4QESoVgyM3BIPKdLsA44a/sdXeuSfCxYcrt+TrkDfR1n9 3TBiILNG3xg904hJbUnfm23KR6Giz0j3j5jPTnUCNNOq/7aigi1M6K0gyCoRVeW5BUmh o+7ZjLl3/WJwOCHYJLZ6ObKHkqtX4okFYwREzhEv5sqbyr0hBmGyy4fkixmX8DHC/R1n XJWA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=qtjyYNff; 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 g2si6942838ile.30.2021.04.02.03.07.57; Fri, 02 Apr 2021 03:07:58 -0700 (PDT) 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=qtjyYNff; 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 S234869AbhDBKFn (ORCPT + 17 others); Fri, 2 Apr 2021 06:05:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45510 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234904AbhDBKFh (ORCPT ); Fri, 2 Apr 2021 06:05:37 -0400 Received: from mail-wr1-x42e.google.com (mail-wr1-x42e.google.com [IPv6:2a00:1450:4864:20::42e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 986EAC06178C for ; Fri, 2 Apr 2021 03:05:36 -0700 (PDT) Received: by mail-wr1-x42e.google.com with SMTP id o16so4331625wrn.0 for ; Fri, 02 Apr 2021 03:05:36 -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 :mime-version:content-transfer-encoding; bh=wwMK9AHuxVFl4rBHOIBcFYLquE5ubyLXDobeIx8iDE4=; b=qtjyYNffeMR/onwCNWN0NjOoxsTnpqHlfM3QZ2mMtGM4kVS3KntXkL9vmsMWq9ryrI 2xEVE7GLSAdSu/4VAcevx7HxxmPbllLSjgF1FXkpAJ3nEJikh6mRWNbic/0+VDZQIhZm RSnuYJjWkFUiKutcY/wHT25l6p4X+ess4A7eFUCIE9/BhX2FPxAqGnmToDyxyx6XFVj8 0T3KXnLmK5zbPbiH4m+iF+0uyXRzTKp1h+yGlqaKU7hlZFzm3gOgPJPJhTFvqN+JJke0 9efP25hfg9iFGvW08gTPJ62Y0vvhLIzDvDJR5FcKiVPtIeHitGIyDXcxieYDJAsCFzdU 8Abg== 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=wwMK9AHuxVFl4rBHOIBcFYLquE5ubyLXDobeIx8iDE4=; b=BUhx6REIiJwbHjpDtWJsD2f07SL8w96Ptec8wlXBjKTSr7HosyK5bdDLSuSyVbq9sU tiOa+sDdv0Zk6TYClgo/4311BKRXy3f6uFsDatjeMSrmw9YRbw2L2y8xPBQrCpvGqnVf Vsr3PhzhJeGeLLg5V1olaUe/6hHuKQcM8LxUJObo6nUNf2nNRERBxX8OVxglS8qZM34V +S6+oTOcFsz5GBYwUftn67OOEdJUp1n5uMEMN038mH5KIIL6tQ/Zh7JgYgWieizPDe8w UqEEisg1YwOkOY1FI1nSEePcEr/wu4x2jz8+WuUUH3/BanIAFSUEdv9MzSnXAUCLevDe A4KQ== X-Gm-Message-State: AOAM532Fy24XUDLTwGiYXqn8K/BmN2baOGPSlPcwb5iVQLDUbSTeaSxG acTof1FsmYrUuCEpvYsRlB6qUA== X-Received: by 2002:adf:e4c7:: with SMTP id v7mr14579458wrm.245.1617357935339; Fri, 02 Apr 2021 03:05:35 -0700 (PDT) Received: from sagittarius-a.chello.ie (188-141-3-169.dynamic.upc.ie. [188.141.3.169]) by smtp.gmail.com with ESMTPSA id v18sm15466618wrf.41.2021.04.02.03.05.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Apr 2021 03:05:34 -0700 (PDT) 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 v3 18/25] media: venus: hfi: Add 6xx AXI halt logic Date: Fri, 2 Apr 2021 11:06:41 +0100 Message-Id: <20210402100648.1815854-19-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210402100648.1815854-1-bryan.odonoghue@linaro.org> References: <20210402100648.1815854-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 Acked-by: Stanimir Varbanov --- 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;