linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tomasz Figa <tfiga@chromium.org>
To: vgarodia@codeaurora.org
Cc: Hans Verkuil <hverkuil@xs4all.nl>,
	Mauro Carvalho Chehab <mchehab@kernel.org>,
	Rob Herring <robh@kernel.org>,
	Mark Rutland <mark.rutland@arm.com>,
	andy.gross@linaro.org, bjorn.andersson@linaro.org,
	Stanimir Varbanov <stanimir.varbanov@linaro.org>,
	Linux Media Mailing List <linux-media@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	linux-arm-msm <linux-arm-msm@vger.kernel.org>,
	linux-soc@vger.kernel.org, devicetree@vger.kernel.org,
	Alexandre Courbot <acourbot@chromium.org>
Subject: Re: [PATCH v2 5/5] venus: register separate driver for firmware device
Date: Mon, 4 Jun 2018 22:18:34 +0900	[thread overview]
Message-ID: <CAAFQd5D39CkA=GucUs7YOHwsdj0gbk55BiY_gSvArY_RH4uDkg@mail.gmail.com> (raw)
In-Reply-To: <1527884768-22392-6-git-send-email-vgarodia@codeaurora.org>

Hi Vikash,

On Sat, Jun 2, 2018 at 5:27 AM Vikash Garodia <vgarodia@codeaurora.org> wrote:
>
> A separate child device is added for video firmware.
> This is needed to
> [1] configure the firmware context bank with the desired SID.
> [2] ensure that the iova for firmware region is from 0x0.
>
> Signed-off-by: Vikash Garodia <vgarodia@codeaurora.org>
> ---
>  .../devicetree/bindings/media/qcom,venus.txt       |  8 +++-
>  drivers/media/platform/qcom/venus/core.c           | 48 +++++++++++++++++++---
>  drivers/media/platform/qcom/venus/firmware.c       | 20 ++++++++-
>  drivers/media/platform/qcom/venus/firmware.h       |  2 +
>  4 files changed, 71 insertions(+), 7 deletions(-)
>
> diff --git a/Documentation/devicetree/bindings/media/qcom,venus.txt b/Documentation/devicetree/bindings/media/qcom,venus.txt
> index 00d0d1b..701cbe8 100644
> --- a/Documentation/devicetree/bindings/media/qcom,venus.txt
> +++ b/Documentation/devicetree/bindings/media/qcom,venus.txt
> @@ -53,7 +53,7 @@
>
>  * Subnodes
>  The Venus video-codec node must contain two subnodes representing
> -video-decoder and video-encoder.
> +video-decoder and video-encoder, one optional firmware subnode.
>
>  Every of video-encoder or video-decoder subnode should have:
>
> @@ -79,6 +79,8 @@ Every of video-encoder or video-decoder subnode should have:
>                     power domain which is responsible for collapsing
>                     and restoring power to the subcore.
>
> +The firmware sub node must contain the iommus specifiers for ARM9.

Please document the compatible string here as well.

> +
>  * An Example
>         video-codec@1d00000 {
>                 compatible = "qcom,msm8916-venus";
> @@ -105,4 +107,8 @@ Every of video-encoder or video-decoder subnode should have:
>                         clock-names = "core";
>                         power-domains = <&mmcc VENUS_CORE1_GDSC>;
>                 };
> +               venus-firmware {
> +                       compatible = "qcom,venus-firmware-no-tz";

I don't think "-no-tz" should be mentioned here in DT, since it's a
firmware/software detail.

> +                       iommus = <&apps_smmu 0x10b2 0x0>;
> +               }
>         };
> diff --git a/drivers/media/platform/qcom/venus/core.c b/drivers/media/platform/qcom/venus/core.c
> index 101612b..5cfb3c2 100644
> --- a/drivers/media/platform/qcom/venus/core.c
> +++ b/drivers/media/platform/qcom/venus/core.c
> @@ -179,6 +179,19 @@ static u32 to_v4l2_codec_type(u32 codec)
>         }
>  }
>
> +static int store_firmware_dev(struct device *dev, void *data)
> +{
> +       struct venus_core *core = data;
> +
> +       if (!core)
> +               return -EINVAL;
> +

No need to check this AFAICT.

> +       if (of_device_is_compatible(dev->of_node, "qcom,venus-firmware-no-tz"))
> +               core->fw.dev = dev;
> +
> +       return 0;
> +}
> +
>  static int venus_enumerate_codecs(struct venus_core *core, u32 type)
>  {
>         const struct hfi_inst_ops dummy_ops = {};
> @@ -279,6 +292,13 @@ static int venus_probe(struct platform_device *pdev)
>         if (ret < 0)
>                 goto err_runtime_disable;
>
> +       ret = of_platform_populate(dev->of_node, NULL, NULL, dev);
> +       if (ret)
> +               goto err_runtime_disable;
> +
> +       /* Attempt to store firmware device */
> +       device_for_each_child(dev, core, store_firmware_dev);
> +
>         ret = venus_boot(core);
>         if (ret)
>                 goto err_runtime_disable;
> @@ -303,10 +323,6 @@ static int venus_probe(struct platform_device *pdev)
>         if (ret)
>                 goto err_core_deinit;
>
> -       ret = of_platform_populate(dev->of_node, NULL, NULL, dev);
> -       if (ret)
> -               goto err_dev_unregister;
> -
>         ret = pm_runtime_put_sync(dev);
>         if (ret)
>                 goto err_dev_unregister;
> @@ -483,7 +499,29 @@ static __maybe_unused int venus_runtime_resume(struct device *dev)
>                 .pm = &venus_pm_ops,
>         },
>  };
> -module_platform_driver(qcom_venus_driver);
> +
> +static int __init venus_init(void)
> +{
> +       int ret;
> +
> +       ret = platform_driver_register(&qcom_video_firmware_driver);
> +       if (ret)
> +               return ret;

Do we really need this firmware driver? As far as I can see, the
approach used here should work even without any driver bound to the
firmware device.

Best regards,
Tomasz

  parent reply	other threads:[~2018-06-04 13:18 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-01 20:26 [PATCH v2 0/5] Venus updates - PIL Vikash Garodia
2018-06-01 20:26 ` [PATCH v2 1/5] media: venus: add a routine to reset ARM9 Vikash Garodia
2018-06-01 22:15   ` Stanimir Varbanov
2018-06-05 10:57     ` Vinod
2018-06-06  1:34       ` Alexandre Courbot
2018-07-04  8:35     ` Vikash Garodia
2018-06-22 23:15   ` Bjorn Andersson
2018-06-01 20:26 ` [PATCH v2 2/5] media: venus: add a routine to set venus state Vikash Garodia
2018-06-01 21:21   ` Jordan Crouse
2018-06-04 12:54     ` Tomasz Figa
2018-07-04  7:59       ` Vikash Garodia
2018-07-04  9:00         ` Tomasz Figa
2018-07-04  9:41           ` Vikash Garodia
2018-07-04 10:08             ` Tomasz Figa
2018-06-04 13:50   ` Stanimir Varbanov
2018-07-04  8:08     ` Vikash Garodia
2018-06-05 11:03   ` Vinod
2018-06-01 20:26 ` [PATCH v2 3/5] venus: add check to make scm calls Vikash Garodia
2018-06-01 21:22   ` Jordan Crouse
2018-06-04 12:58   ` Tomasz Figa
2018-06-22 23:19     ` Bjorn Andersson
2018-06-01 20:26 ` [PATCH v2 4/5] media: venus: add no TZ boot and shutdown routine Vikash Garodia
2018-06-01 21:30   ` Jordan Crouse
2018-06-04 13:09   ` Tomasz Figa
2018-06-01 20:26 ` [PATCH v2 5/5] venus: register separate driver for firmware device Vikash Garodia
2018-06-01 21:32   ` Jordan Crouse
2018-06-04 13:18   ` Tomasz Figa [this message]
2018-06-04 13:56     ` Stanimir Varbanov
2018-06-05  4:08       ` Tomasz Figa
2018-06-05  8:45         ` Stanimir Varbanov
2018-06-06  5:41           ` Tomasz Figa
2018-06-06 16:46       ` Bjorn Andersson
2018-06-05 21:07   ` Rob Herring
2018-06-06  4:46     ` Tomasz Figa
2018-06-06 12:53       ` Rob Herring
2018-06-06 13:03       ` Vikash Garodia

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAAFQd5D39CkA=GucUs7YOHwsdj0gbk55BiY_gSvArY_RH4uDkg@mail.gmail.com' \
    --to=tfiga@chromium.org \
    --cc=acourbot@chromium.org \
    --cc=andy.gross@linaro.org \
    --cc=bjorn.andersson@linaro.org \
    --cc=devicetree@vger.kernel.org \
    --cc=hverkuil@xs4all.nl \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-soc@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=mchehab@kernel.org \
    --cc=robh@kernel.org \
    --cc=stanimir.varbanov@linaro.org \
    --cc=vgarodia@codeaurora.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).