From patchwork Fri Mar 12 17:30:26 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: 399659 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 92345C4332B for ; Fri, 12 Mar 2021 17:30:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7221A64F6F for ; Fri, 12 Mar 2021 17:30:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232520AbhCLR3z (ORCPT ); Fri, 12 Mar 2021 12:29:55 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41786 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232679AbhCLR3Z (ORCPT ); Fri, 12 Mar 2021 12:29:25 -0500 Received: from mail-wm1-x32d.google.com (mail-wm1-x32d.google.com [IPv6:2a00:1450:4864:20::32d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2C909C061574 for ; Fri, 12 Mar 2021 09:29:25 -0800 (PST) Received: by mail-wm1-x32d.google.com with SMTP id b2-20020a7bc2420000b029010be1081172so15627573wmj.1 for ; Fri, 12 Mar 2021 09:29:25 -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=pMvvR9R2ZY/KspoYguO/+u7gFaAXLGd8hg1+vgHTtsY=; b=X5wYU4ge26MdLzXoFs1urHNZ7Lhjs9xCvtZSW1f4Uz49J1inaMy+51pG0wXFA4AMA5 tE+A5DQ1Pvy3HBXCp7ckBQ9mjPXmORBeHYpp+mJm8xisZlosaMmZzYdqo6IboUQifYXk QNJ2vPBsuEbzcEn1YUqvCLH4tK85DHIminc6urDrRiJrt439cIJj5KSjCElw0O6MOYl7 trvf8AdmCMX6qG5aGy4JrQRcK4Vgw9ewQKb0/z3hb52wG/9w4Jfnm8ucA/u2rRjh2qwE wBQxmIwii+2bXppZrZzJj38Ktrm3OcSaDdvqr8CyJCLrTIepbwswwVeN+jpzMhDxMmE2 AOmg== 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=pMvvR9R2ZY/KspoYguO/+u7gFaAXLGd8hg1+vgHTtsY=; b=NbgsFNvSs1a8s+HDQ1sdGx97z/VtIP15GZ3GGTyz1veGelfv2D9AsZrQZlbxYfvz20 lkIsSpoacrWTYAokmHWpSxWF7GvPSJPWxrxMuAnF4oQnh1ouTgv825ndGr7QB6l0nfBa kkasVz+92yb74VqkH2AaetF8gB1AMnp9iezckQvGEGEUNB5DIm9mnVe1+WgQyZkoCyRQ 7ClZt5eArW7DuS+tmxMcTrviZHFVUw+uFjN/rATN0fMp69o0CQZ3ylcTRpJ+rl+j2FJg aNPOeu+jX9rsoaiuFn2Blyo/ZSHdrZmB5PoWcC7MeaYeA1r0hpgWBe1Bu85fe6BZrB/t eHHQ== X-Gm-Message-State: AOAM532yfyVG5v4ESf5iH5/lpw83IVoDk6iRj3gIVNzYKmu0vZjfaiRb 8brEDHAm4WM/kg2PsD4VuOViPA== X-Google-Smtp-Source: ABdhPJyel6pzyM+/0IHk3FsXOfcAkvKJFveqBHEwLt0s9p5roIwo5gMiqU/T/ujj3g3iU1SKcEzQgA== X-Received: by 2002:a1c:2016:: with SMTP id g22mr14268893wmg.137.1615570163938; Fri, 12 Mar 2021 09:29:23 -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.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Mar 2021 09:29:23 -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 12/25] media: venus: hfi: Add a 6xx boot logic Date: Fri, 12 Mar 2021 17:30:26 +0000 Message-Id: <20210312173039.1387617-13-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 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 --- drivers/media/platform/qcom/venus/hfi_venus.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) 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; }