From patchwork Mon Feb 22 16:02:48 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: 385793 Delivered-To: patch@linaro.org Received: by 2002:a02:290e:0:0:0:0:0 with SMTP id p14csp1396620jap; Mon, 22 Feb 2021 08:04:54 -0800 (PST) X-Google-Smtp-Source: ABdhPJxqfVGkkkwdxA5bXSs+qS4Oh4U199jEc7XiY7Y06gHhwycCle90dUU9nltQFf4RStNga2HB X-Received: by 2002:aa7:cb8f:: with SMTP id r15mr23600011edt.130.1614009894886; Mon, 22 Feb 2021 08:04:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614009894; cv=none; d=google.com; s=arc-20160816; b=jU/GvC9VhFLaY+X3lSLgXI6BKK+ME+Ka3DgRHY2fbYSFMszH5eSmcRF108NmS5SoAk y4GhB9Xe4F9Hq/j+qTNMiwsGku1rWN/47/2UMYhy4MCGVaxA8Z87+6qqcLEJHN/ptfRt Hsqj/EA8v114gDP99Kgv2h5oSfImFE1Jzc5Ft6WU/C/QUKNgg9kV2A8u2BBPQUinvdkk dpRGNlKLQowe8k/nHLdDfKGATQTpV+7JKB1m72jcKbwWcARXQQEF5c55Hn6KX+/xggXC yU66MTd/7dgSgAZ7AGX7hyhsHhFN7d+Musczp/vVveVIgd/7JJUf/rUf78t8/WHZ/EJK VGYg== 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=jfi93nFRMIEbqzHdYrViv9hk2pcCCjRBia6kkKbplN8=; b=ayU4SmuGi43qnfjasL7QoWwoUSnuOM2KK+1lT3rw4Th30NIjDR2gTeFeJC6GgvuSZJ SJpDDtzEUi3V54vZV2DeIhVhXJcr2iD9dYhiTO+9eNNLKhoFYX/h8tYj+mshPQW7JxIn KFW2Cl2AHtQ+3QYJs6PKq+FXPIMV/51Vqyo2GagRThtDw/x0T3VJF/RVN7p5z2DRyb9c Btc1z+1fOjmZoX3cEMr3Nb34laTM22/h7eN1f97CaYvrY5Fh6FSoskOMbiXGJA2KGCW8 x2Uvmf/cAAArWtWMI51+vkFjlPcS+xAre8CeqFuzlX5Cbw0hBMYj0gDk/tYXymaGhUYu +bLA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="k4mt+/Ck"; spf=pass (google.com: domain of linux-media-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-media-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.54; Mon, 22 Feb 2021 08:04:54 -0800 (PST) Received-SPF: pass (google.com: domain of linux-media-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="k4mt+/Ck"; spf=pass (google.com: domain of linux-media-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-media-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 S231354AbhBVQDm (ORCPT + 3 others); Mon, 22 Feb 2021 11:03:42 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50688 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231232AbhBVQDV (ORCPT ); Mon, 22 Feb 2021 11:03:21 -0500 Received: from mail-wr1-x42f.google.com (mail-wr1-x42f.google.com [IPv6:2a00:1450:4864:20::42f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 68623C0611BD for ; Mon, 22 Feb 2021 08:01:51 -0800 (PST) Received: by mail-wr1-x42f.google.com with SMTP id d11so268769wrj.7 for ; Mon, 22 Feb 2021 08:01:51 -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=jfi93nFRMIEbqzHdYrViv9hk2pcCCjRBia6kkKbplN8=; b=k4mt+/CkI0yvDUHJI5esU/1596Y7r5+y5rSLw0s0YDXm9RrCOxLtykT3PXpXm1/AA+ TZ6gDjjtpDlsMzgN0JgNvt/gRjqdVBovSPLXWwPzOOFm4ntmBF8wuihira7J/SaS6hpi hGbYSQ6BBX0+g6bVUBVOVBfPV5GnMZinC+vPN4sejkMFVwKjVCAJ9AJb+9/rxhnDXeSB lCVDQppjHt5kdWZdTpj1aYuw5l3u3soxXpD7Jk1m0yt/OYbmA8KOS/BJSbMxCpclZZQq DWVVu3rmLNiudW7kmK3tKI4TmlRxSVzhWLahApabKGQmWB1ObvAA8bHHC3YfPTntXGUu mJfg== 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=jfi93nFRMIEbqzHdYrViv9hk2pcCCjRBia6kkKbplN8=; b=BIonclIAlixoym7l7UI+kSjkKhDZJHjTsegysjQPVxoVA+wH19ubQRksuWoWfb39/V ZOZ5cwCHPARcF7ZjzI8WJ7oB1ievjORBTL6cyBgU7IEgsL8+0dwlvDukFqXSBAxbtskT UEKmj1wQu9IoNy4d6zyZUSD6131FQENfFFb6KMS7mr3ClmbIrY7mWnGDy51yxGk/7yvJ zECbYnTS7W64HvP8Jb91zTZtXxcq5pADzxtT/x7GORPhzXMITCOvRpnTPRUJdqUoLS8Y 0BZKXTTj2FCdjtRXvlz09iF+bOYeu8yiqFCxCeXtDd5Tmkb5Z3l3hvIlDBs1isQBtAVP x7Cg== X-Gm-Message-State: AOAM530F/mxNZDbmJz/wsFT5oGPsKOCtQBSJqm4IGdR0iEIIYaydngzK ACapwHpJB3QL/ZsD1RV5X6YCSRmGw4E+7Q== X-Received: by 2002:adf:dcd2:: with SMTP id x18mr22031726wrm.355.1614009710240; Mon, 22 Feb 2021 08:01:50 -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.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Feb 2021 08:01:49 -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 13/25] media: venus: hfi: Add a 6xx boot logic Date: Mon, 22 Feb 2021 16:02:48 +0000 Message-Id: <20210222160300.1811121-14-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-media@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(-) -- 2.29.2 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; }