From patchwork Fri Apr 2 10:06:35 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: 414336 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp1284774jai; Fri, 2 Apr 2021 03:07:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzdR+UY88pnbZixIr9ByXIw9CLSj4Z3bs9Ib9vAHSGLWcS19oSuTu+vqqgCSVo28yZwrO94 X-Received: by 2002:a05:6e02:85:: with SMTP id l5mr11146386ilm.182.1617358033146; Fri, 02 Apr 2021 03:07:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617358033; cv=none; d=google.com; s=arc-20160816; b=Fc7Px3PraxRdfZpBKKfTH6uASm264PZvTDH+vvC+uYGANVn8xhBezHB5PmV8636/Nm 7fxZBA45Ub23EGWmURBpoTjNMhevIGjhed95F/PAk6KPYGqyDqAegehlF5Ita5Gu32JL VZLlc4m/CEzhVFJPdKJPrlT/NVNY0q4SS+6dKcL/WlXEn4m/GyT6m2TC7TreQBjhQ9io p4xZIfQAD6UDWoEC+8Y31zC7H4aQUVs+y0l4tRRVaJrBK0My+4tkwTzotsXh0pOlgIgs /3L/OhOwb+chCNQEpkuH2uiFwSZHxHaPEbJEt1PQk+l47Y4jxErNvIfLQXNh7LKH6GhI ZESg== 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=Y/5HfECUb7Yb2RUuUn+bfs1jqYGDNUP7G7Wpew9vFFA=; b=s/Is83cVKyIBRaRTYeTBAlx48zWxyWbNVHnLPVv4tJx32i5GD4jMUp6O6xS1vamsqN CBChtbVLPlUeOIjonpFIvUHvs81MCrY9fOIYgJ3PPK7UKcY8eTtdZYw0uAAmmJKaPYjL K9ellVdVUGJAjQOoxYqOTbS9Q1xpKlWycRRwvlxDERz8duv90vC4r1aCuORXCsgNfim2 HNmnU4v/oQgTdTPQbdS6ug6wwCdCieep0CDygMyw+vRox2FsaJljVoJ0DrG4Jt0bptPr 8RKR3Ui+RaaMGri6eatRup+p8UefyPUR5va+jf8+pQgIhWOgS5Gv0hn0ch1wwK7sk4+e lZgg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=gdQmDDPy; 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.06.55; Fri, 02 Apr 2021 03:07:13 -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=gdQmDDPy; 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 S234506AbhDBKFj (ORCPT + 17 others); Fri, 2 Apr 2021 06:05:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45450 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234788AbhDBKFc (ORCPT ); Fri, 2 Apr 2021 06:05:32 -0400 Received: from mail-wr1-x430.google.com (mail-wr1-x430.google.com [IPv6:2a00:1450:4864:20::430]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 77EF0C06178C for ; Fri, 2 Apr 2021 03:05:30 -0700 (PDT) Received: by mail-wr1-x430.google.com with SMTP id x13so4292486wrs.9 for ; Fri, 02 Apr 2021 03:05:30 -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=Y/5HfECUb7Yb2RUuUn+bfs1jqYGDNUP7G7Wpew9vFFA=; b=gdQmDDPyhFcnp3uUBDYzVn83ViKI8Z4Ye2HgHK56Ur6xT20FSkkhtlL35e5I6+PIWc OHxrXLdkNNquMuREXDqwY+3Gmz4VCSB6TyhTK2Vpd49quPeqc9lyrrGXHjRAWCPACJE1 LahTuOr9hThntFaP1xrv3pFDPgyYwCngCgshnACdLk1gEHNlRx+62z/kCeeTGSK64vYq DiCCNyeq5KKe3Lok3AZPK+X1UaiDDWGY8BGSaL3BkV/PsNRO/KMDWaAruQKywAk9N1QZ v8kN4wBmqLBQEy5V4d9YVVa3BXcyLk+rFW2FkM6jLiSPH3N2GOVwhSJu5v8Dh9te/OE1 8d7w== 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=Y/5HfECUb7Yb2RUuUn+bfs1jqYGDNUP7G7Wpew9vFFA=; b=EP7CxCB2iLMv8SXYK616Bi1dMh8OjvhG4GRpamZsXmfo+BA1H2NMclYo56myHmz/+K SBOe75VQRxl+lX9MG4DvUMn95ZWJlM7wK9uQPrQiMRUqVfui8Yl2RAXlY7ekf3wCKlqU BdgLyfFN3P4zd9URam484Uh9ZFfHgqskckUiDBXV5anHpCP6k/hxgwHQO1JC2s2tRqm0 i6eHkFl9ABgyXQHMsqxTjHkPAj2H0+Q47qMJhj2vHCLpag+AS7NFAPx3mCEe2DLr5236 wztMkDYYIFJD3tGIaurgJzGpmXlbIcTpmYeATK8s6ERglv4FMiSrvyjmN0ewFx4SwKAP R1RQ== X-Gm-Message-State: AOAM532rSWaHaQ89HxYizvbZqAA7w5PkX7PG5bbVZKV5Wm6mNQ6ZR6SJ hTiBibtWDl2RYLgoTfcpr/LXug== X-Received: by 2002:adf:ebcc:: with SMTP id v12mr14121499wrn.389.1617357929260; Fri, 02 Apr 2021 03:05:29 -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.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Apr 2021 03:05:28 -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 12/25] media: venus: hfi: Add a 6xx boot logic Date: Fri, 2 Apr 2021 11:06:35 +0100 Message-Id: <20210402100648.1815854-13-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 adds a 6xx specific boot logic. The goal is to share as much code as possible between 3xx, 4xx and 6xx silicon. We need to do a different write to WRAPPER_INTR_MASK with an additional write to CPU_CS_H2XSOFTINTEN_V6 and CPU_CS_X2RPMh_V6. The other writes are the same for 6xx and non-6xx silicon albeit at different absolute relative locations to the base of the venus address space. Signed-off-by: Dikshita Agarwal Signed-off-by: Bryan O'Donoghue Acked-by: Stanimir Varbanov --- drivers/media/platform/qcom/venus/hfi_venus.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) -- 2.30.1 diff --git a/drivers/media/platform/qcom/venus/hfi_venus.c b/drivers/media/platform/qcom/venus/hfi_venus.c index f95cdd3d530c..5f9c8aa84cd0 100644 --- a/drivers/media/platform/qcom/venus/hfi_venus.c +++ b/drivers/media/platform/qcom/venus/hfi_venus.c @@ -442,14 +442,21 @@ static int venus_boot_core(struct venus_hfi_device *hdev) { struct device *dev = hdev->core->dev; static const unsigned int max_tries = 100; - u32 ctrl_status = 0; + u32 ctrl_status = 0, mask_val; unsigned int count = 0; void __iomem *cpu_cs_base = hdev->core->cpu_cs_base; void __iomem *wrapper_base = hdev->core->wrapper_base; int ret = 0; writel(BIT(VIDC_CTRL_INIT_CTRL_SHIFT), cpu_cs_base + VIDC_CTRL_INIT); - writel(WRAPPER_INTR_MASK_A2HVCODEC_MASK, wrapper_base + WRAPPER_INTR_MASK); + if (IS_V6(hdev->core)) { + mask_val = readl(wrapper_base + WRAPPER_INTR_MASK); + mask_val &= ~(WRAPPER_INTR_MASK_A2HWD_BASK_V6 | + WRAPPER_INTR_MASK_A2HCPU_MASK); + } else { + mask_val = WRAPPER_INTR_MASK_A2HVCODEC_MASK; + } + writel(mask_val, wrapper_base + WRAPPER_INTR_MASK); writel(1, cpu_cs_base + CPU_CS_SCIACMDARG3); while (!ctrl_status && count < max_tries) { @@ -467,6 +474,9 @@ static int venus_boot_core(struct venus_hfi_device *hdev) if (count >= max_tries) ret = -ETIMEDOUT; + if (IS_V6(hdev->core)) + writel(0x0, cpu_cs_base + CPU_CS_X2RPMH_V6); + return ret; }