linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Arve Hjønnevåg" <arve@android.com>
To: Sudeep Holla <sudeep.holla@arm.com>
Cc: Will Deacon <will@kernel.org>,
	devicetree@vger.kernel.org,
	linux-arm-kernel <linux-arm-kernel@lists.infradead.org>,
	LKML <linux-kernel@vger.kernel.org>,
	Marc Zyngier <maz@kernel.org>
Subject: Re: [RFC PATCH 2/3] firmware: Add support for PSA FF-A transport for VM partitions
Date: Thu, 9 Jul 2020 15:15:29 -0700	[thread overview]
Message-ID: <CAMP5XgdMqJSd6B+q+WpjEsnVXXMam12Ji7R2-szS2_miGzdNEg@mail.gmail.com> (raw)
In-Reply-To: <20200601094512.50509-3-sudeep.holla@arm.com>

On Mon, Jun 1, 2020 at 2:45 AM Sudeep Holla <sudeep.holla@arm.com> wrote:
>
> Initial support for PSA FF-A interface providing APIs for non-secure VM
> partitions.
>
...
> diff --git a/drivers/firmware/arm_psa_ffa/Kconfig b/drivers/firmware/arm_psa_ffa/Kconfig
> new file mode 100644
> index 000000000000..ba699ec68ec4
> --- /dev/null
> +++ b/drivers/firmware/arm_psa_ffa/Kconfig
> @@ -0,0 +1,15 @@
> +# SPDX-License-Identifier: GPL-2.0-only
> +config ARM_PSA_FFA_TRANSPORT
> +       tristate "Arm Platform Security Architecture Firmware Framework for Armv8-A"
> +       depends on ARM64 && HAVE_ARM_SMCCC_DISCOVERY

Most of this driver should be usable on any platform, so it would be
better to only depend on ARM64 in the component that has the arm64
specific implementation of your low level conduit.

...
> diff --git a/drivers/firmware/arm_psa_ffa/driver.c b/drivers/firmware/arm_psa_ffa/driver.c
> new file mode 100644
> index 000000000000..700bd5850746
> --- /dev/null
> +++ b/drivers/firmware/arm_psa_ffa/driver.c
...
> +
> +typedef struct arm_smccc_res
> +(arm_psa_ffa_fn)(unsigned long, unsigned long, unsigned long, unsigned long,
> +                unsigned long, unsigned long, unsigned long, unsigned long);
> +static arm_psa_ffa_fn *invoke_arm_psa_ffa_fn;
> +
...
> +struct arm_smccc_res
> +__arm_psa_ffa_fn_smc(unsigned long function_id,unsigned long arg0,
...
> +struct arm_smccc_res
> +__arm_psa_ffa_fn_hvc(unsigned long function_id,unsigned long arg0,

Can these two functions move out of this file so this driver only
depends on a function matching the arm_psa_ffa_fn type?

...
> +static int psa_ffa_probe(struct platform_device *pdev)
> +{
> +       int ret;
> +       enum arm_smccc_conduit conduit;
> +
> +       if (arm_smccc_get_version() < ARM_SMCCC_VERSION_1_2)
> +               return 0;
> +
> +       conduit = arm_smccc_1_1_get_conduit();

If you make this device a child device of the conduit, then you don't
need this here. Other conduits can be added to for instance support
other architectures without adding entries to this enum and modifying
this driver.

--
Arve Hjønnevåg

  reply	other threads:[~2020-07-09 22:15 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-01  9:45 [RFC PATCH 0/3] firmware: Add support for PSA FF-A interface Sudeep Holla
2020-06-01  9:45 ` [RFC PATCH 1/3] dt-bindings: Add ARM PSA FF binding for non-secure VM partitions Sudeep Holla
2020-06-09 22:35   ` Rob Herring
2020-06-10  7:43     ` Will Deacon
2020-06-10 13:56       ` Rob Herring
2020-06-11 15:46       ` Achin Gupta
2020-06-11 17:12         ` Will Deacon
2020-06-15  9:16           ` Achin Gupta
2020-06-15  9:51             ` Will Deacon
2020-06-15 11:42               ` Achin Gupta
2020-06-15 11:55                 ` Will Deacon
2020-06-15 16:48                   ` Achin Gupta
2020-06-10  8:32     ` Sudeep Holla
2020-06-01  9:45 ` [RFC PATCH 2/3] firmware: Add support for PSA FF-A transport for " Sudeep Holla
2020-07-09 22:15   ` Arve Hjønnevåg [this message]
2020-06-01  9:45 ` [RFC PATCH 3/3] firmware: Add example PSA FF-A non-secure VM partition Sudeep Holla
2020-06-04 13:37 ` [RFC PATCH 0/3] firmware: Add support for PSA FF-A interface Will Deacon
2020-06-09 17:41   ` Sudeep Holla
2020-06-10  7:57     ` Will Deacon
2020-06-10  8:10       ` Sudeep Holla
2020-06-15 11:38     ` Jens Wiklander

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=CAMP5XgdMqJSd6B+q+WpjEsnVXXMam12Ji7R2-szS2_miGzdNEg@mail.gmail.com \
    --to=arve@android.com \
    --cc=devicetree@vger.kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maz@kernel.org \
    --cc=sudeep.holla@arm.com \
    --cc=will@kernel.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).