From patchwork Fri Apr 2 10:06:27 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: 414329 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp1283890jai; Fri, 2 Apr 2021 03:06:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzOj6QmIJgSbUhLV6k28q5yrs0NgmJ7IvSgm6foHPTohbDgBle7TothYwHZfs8qVMhQay4w X-Received: by 2002:a05:6e02:e52:: with SMTP id l18mr10422386ilk.217.1617357960959; Fri, 02 Apr 2021 03:06:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617357960; cv=none; d=google.com; s=arc-20160816; b=usQVo6qDQUiwuolQGl4U05dGcOr6BYG/vAKXSN2jhdacP2FnpRSMUBTHNhF51sw91d Vk9HJPMV3MY7CAwCp0RxGWzblVSma6BDgovqa/Ggd90TJikizyLvzTUOWvXvuqdFhsUM VSI5yRVeUdAADuMNMjF42dCxwdLgXB8qDCNU7SnHuelEdEcojuZ4RYE23u3ASz5cs8IC v4Eea366Ff6wyVSeI7rvB2rnJGhFdoq99c7Yoc4hprMROrmUlX4cHNUkr9amfctXfE9E aIycg3nFjz9/47kYU6sJ1v9H4z5OwBuz/Y1mEY9X8eZk4eJUOItl0RHrDTPeAwwKSRSH GvhA== 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=A0Hq1qWM/ZGzT0LfPQuVO+plwGRyfpUWLhKq3EzQLwo=; b=LvaYtuQLTF+BHplijwFLasvLui76QL/itKO+UfeHhxZDLe0m6mCi4M04Q22i3ycwb7 VkMlEpTFrvy0CZUnVG/dlSR7FD7qLkwTxe2tFf19tOaZFBxDpNBf70/A0e3Q/+0KrfTo q7Vtu9lL55LvlRawKd/Uo1JVGSkDF61UgRq4vtH3Np8hkjR/PEMn1MGcw+cTRecaVnq/ vMtk7q9wLjNBoE8qwMsM6YvpZMz/CLHtZElDNyhcc4OyAS6PAtrsvIUeq4KvdaGPjazV E4WRwhLzNV70xu6eOQWzgVVzoBSmC7/OHOP46iPgy6ChcbALmuVSsD2doam87lga/y+O n3mA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=gx0vj+Cb; 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.00; Fri, 02 Apr 2021 03:06:00 -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=gx0vj+Cb; 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 S229605AbhDBKF3 (ORCPT + 17 others); Fri, 2 Apr 2021 06:05:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45444 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229722AbhDBKF2 (ORCPT ); Fri, 2 Apr 2021 06:05:28 -0400 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 4CFCCC0617A9 for ; Fri, 2 Apr 2021 03:05:22 -0700 (PDT) Received: by mail-wr1-x42f.google.com with SMTP id v4so4284163wrp.13 for ; Fri, 02 Apr 2021 03:05:22 -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=A0Hq1qWM/ZGzT0LfPQuVO+plwGRyfpUWLhKq3EzQLwo=; b=gx0vj+Cb7GJceD7yM+mWTFbnO26QQ0DPpby/H2lEi7XnZ6r5fh68y95oYwYJdSFoTX nuUEKL9b4N1JUqoj0kffvhY+jR4Oa/eCMDHL097q6IbALlqA+pB0XG3jdGoWKsoaRyKL wVb/hPcAAaFAJc3iK9R7gnqQ3Jf4Yr9MfPvLuwDmFMRNU4E6mmZXGTyWHsm3NJwMqNq0 ZciiCOH5SOBkDThfFLlwGq+FjrNr64diilzvIhSWrEr4GmDK7GOCjhb4aZKCDUHu7Trw AP/QUHsDHJWeFp1/SD+LmRhfjDaxxM5auqnyeW8XPLCL0ssTfd8k08LnSvqaQTBSQSwe b1/g== 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=A0Hq1qWM/ZGzT0LfPQuVO+plwGRyfpUWLhKq3EzQLwo=; b=WoAa0I0Jj8fAWrhL8/HPUULPuKj6syURQdVGTknhNEpTTmqvDM4iLfT6oimab7dmOG B0JF9ZKa+SA6qBhgjnS1VHSqbiNZaPp8n8GwIiPUhg9EYyOaVQtKy/Q7gQoCZd5J2kyA mB5lSkjC0jmo1O7jC95m0Nuk5BkQMs/yNmCvgfjKSWwdEZAx6ehHS68lbz6ZwIkbYFGi +PlodNeYdwgTHaaJE4z6pJsSe8GFO0hraqTWO9dym3u/xYRWd4FQhp0xkQzjd8bl7gXI QA+1KczgjUepvKO2sk5NF/w8ibJCTHig3DFqig5AehnCxkxSJUOIrxades0qCutdlt8i TuCg== X-Gm-Message-State: AOAM5339LMSnixzL90civOrePDJ+PBa74u4GIJKOcUC4Yf5b7Kk2vxCg UbK3358GMp8Pu5HfJjBTkIOHww== X-Received: by 2002:adf:f307:: with SMTP id i7mr14570306wro.142.1617357920991; Fri, 02 Apr 2021 03:05:20 -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.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Apr 2021 03:05:20 -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 04/25] media: venus: core: Add io base variables for each block Date: Fri, 2 Apr 2021 11:06:27 +0100 Message-Id: <20210402100648.1815854-5-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 New silicon means that the pre-determined offsets we have been using in this driver no longer hold. Existing blocks of registers can exist at different offsets relative to the IO base address. This commit adds a routine to assign the IO base hooks a subsequent commit will convert from absolute to relative addressing. Signed-off-by: Bryan O'Donoghue Acked-by: Stanimir Varbanov --- drivers/media/platform/qcom/venus/core.c | 12 ++++++++++++ drivers/media/platform/qcom/venus/core.h | 10 ++++++++++ 2 files changed, 22 insertions(+) -- 2.30.1 diff --git a/drivers/media/platform/qcom/venus/core.c b/drivers/media/platform/qcom/venus/core.c index 68358a9f3cda..7124d9111001 100644 --- a/drivers/media/platform/qcom/venus/core.c +++ b/drivers/media/platform/qcom/venus/core.c @@ -23,6 +23,7 @@ #include "core.h" #include "firmware.h" #include "pm_helpers.h" +#include "hfi_venus_io.h" static void venus_coredump(struct venus_core *core) { @@ -207,6 +208,15 @@ static int venus_enumerate_codecs(struct venus_core *core, u32 type) return ret; } +static void venus_assign_register_offsets(struct venus_core *core) +{ + core->vbif_base = core->base + VBIF_BASE; + core->cpu_base = core->base + CPU_BASE; + core->cpu_cs_base = core->base + CPU_CS_BASE; + core->cpu_ic_base = core->base + CPU_IC_BASE; + core->wrapper_base = core->base + WRAPPER_BASE; +} + static int venus_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; @@ -273,6 +283,8 @@ static int venus_probe(struct platform_device *pdev) if (ret) goto err_core_put; + venus_assign_register_offsets(core); + ret = v4l2_device_register(dev, &core->v4l2_dev); if (ret) goto err_core_deinit; diff --git a/drivers/media/platform/qcom/venus/core.h b/drivers/media/platform/qcom/venus/core.h index 0a90cd79104b..110287279f05 100644 --- a/drivers/media/platform/qcom/venus/core.h +++ b/drivers/media/platform/qcom/venus/core.h @@ -90,6 +90,11 @@ struct venus_format { * struct venus_core - holds core parameters valid for all instances * * @base: IO memory base address + * @vbif_base IO memory vbif base address + * @cpu_base IO memory cpu base address + * @cpu_cs_base IO memory cpu_cs base address + * @cpu_ic_base IO memory cpu_ic base address + * @wrapper_base IO memory wrapper base address * @irq: Venus irq * @clks: an array of struct clk pointers * @vcodec0_clks: an array of vcodec0 struct clk pointers @@ -122,6 +127,11 @@ struct venus_format { */ struct venus_core { void __iomem *base; + void __iomem *vbif_base; + void __iomem *cpu_base; + void __iomem *cpu_cs_base; + void __iomem *cpu_ic_base; + void __iomem *wrapper_base; int irq; struct clk *clks[VIDC_CLKS_NUM_MAX]; struct clk *vcodec0_clks[VIDC_VCODEC_CLKS_NUM_MAX];