public inbox for linux-omap@vger.kernel.org
 help / color / mirror / Atom feed
From: Lokesh Vutla <lokeshvutla@ti.com>
To: "Andrew F. Davis" <afd@ti.com>, Tony Lindgren <tony@atomide.com>
Cc: linux-omap@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3 2/4] ARM: OMAP2+: Introduce check for OP-TEE in omap_secure_init()
Date: Tue, 31 Dec 2019 12:02:41 +0530	[thread overview]
Message-ID: <b4773b91-9893-830d-7b1b-b63eb4077cf7@ti.com> (raw)
In-Reply-To: <20191230185004.32279-3-afd@ti.com>



On 31/12/19 12:20 AM, Andrew F. Davis wrote:
> This check and associated flag can be used to signal the presence
> of OP-TEE on the platform. This can be used to determine which
> SMC calls to make to perform secure operations.
> 
> Signed-off-by: Andrew F. Davis <afd@ti.com>
> ---
>  arch/arm/mach-omap2/omap-secure.c | 14 ++++++++++++++
>  arch/arm/mach-omap2/omap-secure.h |  3 +++
>  2 files changed, 17 insertions(+)
> 
> diff --git a/arch/arm/mach-omap2/omap-secure.c b/arch/arm/mach-omap2/omap-secure.c
> index e936732cdc4f..39d8070aede6 100644
> --- a/arch/arm/mach-omap2/omap-secure.c
> +++ b/arch/arm/mach-omap2/omap-secure.c
> @@ -12,6 +12,7 @@
>  #include <linux/init.h>
>  #include <linux/io.h>
>  #include <linux/memblock.h>
> +#include <linux/of.h>
>  
>  #include <asm/cacheflush.h>
>  #include <asm/memblock.h>
> @@ -20,6 +21,18 @@
>  
>  static phys_addr_t omap_secure_memblock_base;
>  
> +bool optee_available;
> +
> +static void __init omap_optee_init_check(void)
> +{
> +	struct device_node *np;
> +
> +	np = of_find_node_by_path("/firmware/optee");
> +	if (np && of_device_is_available(np))

This doesn't guarantee that optee driver is probed successfully or firmware
installed correctly. Isn't there a better way to detect? Doesn't tee core layer
exposes anything?

Thanks and regards,
Lokesh

> +		optee_available = true;
> +	of_node_put(np);
> +}
> +
>  /**
>   * omap_sec_dispatcher: Routine to dispatch low power secure
>   * service routines
> @@ -166,4 +179,5 @@ u32 rx51_secure_rng_call(u32 ptr, u32 count, u32 flag)
>  
>  void __init omap_secure_init(void)
>  {
> +	omap_optee_init_check();
>  }
> diff --git a/arch/arm/mach-omap2/omap-secure.h b/arch/arm/mach-omap2/omap-secure.h
> index 9aeeb236a224..78a1c4f04bbe 100644
> --- a/arch/arm/mach-omap2/omap-secure.h
> +++ b/arch/arm/mach-omap2/omap-secure.h
> @@ -10,6 +10,8 @@
>  #ifndef OMAP_ARCH_OMAP_SECURE_H
>  #define OMAP_ARCH_OMAP_SECURE_H
>  
> +#include <linux/types.h>
> +
>  /* Monitor error code */
>  #define  API_HAL_RET_VALUE_NS2S_CONVERSION_ERROR	0xFFFFFFFE
>  #define  API_HAL_RET_VALUE_SERVICE_UNKNWON		0xFFFFFFFF
> @@ -72,6 +74,7 @@ extern u32 rx51_secure_dispatcher(u32 idx, u32 process, u32 flag, u32 nargs,
>  extern u32 rx51_secure_update_aux_cr(u32 set_bits, u32 clear_bits);
>  extern u32 rx51_secure_rng_call(u32 ptr, u32 count, u32 flag);
>  
> +extern bool optee_available;
>  void omap_secure_init(void);
>  
>  #ifdef CONFIG_SOC_HAS_REALTIME_COUNTER
> 

  reply	other threads:[~2019-12-31  6:32 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-30 18:50 [PATCH v3 0/4] Use ARM SMC Calling Convention when OP-TEE is available Andrew F. Davis
2019-12-30 18:50 ` [PATCH v3 1/4] ARM: OMAP2+: Add omap_secure_init callback hook for secure initialization Andrew F. Davis
2019-12-30 18:50 ` [PATCH v3 2/4] ARM: OMAP2+: Introduce check for OP-TEE in omap_secure_init() Andrew F. Davis
2019-12-31  6:32   ` Lokesh Vutla [this message]
2019-12-31 14:15     ` Andrew F. Davis
2020-01-02 17:14       ` Tony Lindgren
2020-01-02 17:24         ` Andrew F. Davis
2019-12-30 18:50 ` [PATCH v3 3/4] ARM: OMAP2+: Use ARM SMC Calling Convention when OP-TEE is available Andrew F. Davis
2019-12-30 18:50 ` [PATCH v3 4/4] ARM: OMAP2+: sleep43xx: Call secure suspend/resume handlers Andrew F. Davis
2019-12-31  6:20   ` Lokesh Vutla
2019-12-31 14:17     ` Andrew F. Davis
2020-01-02  5:02       ` Lokesh Vutla

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=b4773b91-9893-830d-7b1b-b63eb4077cf7@ti.com \
    --to=lokeshvutla@ti.com \
    --cc=afd@ti.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=tony@atomide.com \
    /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