All of lore.kernel.org
 help / color / mirror / Atom feed
From: Michal Simek <michal.simek@xilinx.com>
To: u-boot@lists.denx.de
Subject: [PATCH 3/8] spl: atf: provide a bl2_plat_get_bl31_params_default()
Date: Wed, 18 Nov 2020 15:23:33 +0100	[thread overview]
Message-ID: <89b88c5f-0f22-05b2-d940-df7bb9b3be5a@xilinx.com> (raw)
In-Reply-To: <20201116214731.29128-4-michael@walle.cc>



On 16. 11. 20 22:47, Michael Walle wrote:
> Move the actual implementation of the bl2_plat_get_bl31_params() to its
> own function. The weak function will just call the default
> implementation. This has the advantage that board code can still call
> the original implementation if it just want to modify minor things.
> 
> Signed-off-by: Michael Walle <michael@walle.cc>
> ---
>  common/spl/spl_atf.c | 14 +++++++++++---
>  include/spl.h        | 35 +++++++++++++++++++++++++++--------
>  2 files changed, 38 insertions(+), 11 deletions(-)
> 
> diff --git a/common/spl/spl_atf.c b/common/spl/spl_atf.c
> index df0a198d55..63af6a6207 100644
> --- a/common/spl/spl_atf.c
> +++ b/common/spl/spl_atf.c
> @@ -18,9 +18,9 @@
>  #include <spl.h>
>  #include <asm/cache.h>
>  
> -__weak struct bl31_params *bl2_plat_get_bl31_params(uintptr_t bl32_entry,
> -						    uintptr_t bl33_entry,
> -						    uintptr_t fdt_addr)
> +struct bl31_params *bl2_plat_get_bl31_params_default(uintptr_t bl32_entry,
> +						     uintptr_t bl33_entry,
> +						     uintptr_t fdt_addr)
>  {
>  	static struct bl2_to_bl31_params_mem bl31_params_mem;
>  	struct bl31_params *bl2_to_bl31_params;
> @@ -77,6 +77,14 @@ __weak struct bl31_params *bl2_plat_get_bl31_params(uintptr_t bl32_entry,
>  	return bl2_to_bl31_params;
>  }
>  
> +__weak struct bl31_params *bl2_plat_get_bl31_params(uintptr_t bl32_entry,
> +						    uintptr_t bl33_entry,
> +						    uintptr_t fdt_addr)
> +{
> +	return bl2_plat_get_bl31_params_default(bl32_entry, bl33_entry,
> +						fdt_addr);
> +}
> +
>  static inline void raw_write_daif(unsigned int daif)
>  {
>  	__asm__ __volatile__("msr DAIF, %0\n\t" : : "r" (daif) : "memory");
> diff --git a/include/spl.h b/include/spl.h
> index b72dfc7e3d..dccf515511 100644
> --- a/include/spl.h
> +++ b/include/spl.h
> @@ -526,18 +526,17 @@ int spl_ymodem_load_image(struct spl_image_info *spl_image,
>  void spl_invoke_atf(struct spl_image_info *spl_image);
>  
>  /**
> - * bl2_plat_get_bl31_params() - prepare params for bl31.
> + * bl2_plat_get_bl31_params() - return params for bl31.
>   * @bl32_entry	address of BL32 executable (secure)
>   * @bl33_entry	address of BL33 executable (non secure)
>   * @fdt_addr	address of Flat Device Tree
>   *
> - * This function assigns a pointer to the memory that the platform has kept
> - * aside to pass platform specific and trusted firmware related information
> - * to BL31. This memory is allocated by allocating memory to
> - * bl2_to_bl31_params_mem structure which is a superset of all the
> - * structure whose information is passed to BL31
> - * NOTE: This function should be called only once and should be done
> - * before generating params to BL31
> + * This is a weak function which might be overridden by the board code. By
> + * default it will just call bl2_plat_get_bl31_params_default().
> + *
> + * If you just want to manipulate or add some parameters, you can override
> + * this function, call bl2_plat_get_bl31_params_default and operate on the
> + * returned bl31 params.
>   *
>   * @return bl31 params structure pointer
>   */
> @@ -545,6 +544,26 @@ struct bl31_params *bl2_plat_get_bl31_params(uintptr_t bl32_entry,
>  					     uintptr_t bl33_entry,
>  					     uintptr_t fdt_addr);
>  
> +/**
> + * bl2_plat_get_bl31_params_default() - prepare params for bl31.
> + * @bl32_entry	address of BL32 executable (secure)
> + * @bl33_entry	address of BL33 executable (non secure)
> + * @fdt_addr	address of Flat Device Tree
> + *
> + * This is the default implementation of bl2_plat_get_bl31_params(). It assigns
> + * a pointer to the memory that the platform has kept aside to pass platform
> + * specific and trusted firmware related information to BL31. This memory is
> + * allocated by allocating memory to bl2_to_bl31_params_mem structure which is
> + * a superset of all the structure whose information is passed to BL31
> + *
> + * NOTE: The memory is statically allocated, thus this function should be
> + * called only once. All subsequent calls will overwrite any changes.
> + *
> + * @return bl31 params structure pointer
> + */
> +struct bl31_params *bl2_plat_get_bl31_params_default(uintptr_t bl32_entry,
> +						     uintptr_t bl33_entry,
> +						     uintptr_t fdt_addr);
>  /**
>   * spl_optee_entry - entry function for optee
>   *
> 

Last two functions. This is not kernel-doc format. Please fix it.
include/spl.h:529: info: Scanning doc for bl2_plat_get_bl31_params
include/spl.h:545: warning: Function parameter or member 'bl32_entry'
not described in 'bl2_plat_get_bl31_params'
include/spl.h:545: warning: Function parameter or member 'bl33_entry'
not described in 'bl2_plat_get_bl31_params'
include/spl.h:545: warning: Function parameter or member 'fdt_addr' not
described in 'bl2_plat_get_bl31_params'
include/spl.h:545: warning: No description found for return value of
'bl2_plat_get_bl31_params'
include/spl.h:548: info: Scanning doc for bl2_plat_get_bl31_params_default
include/spl.h:559: warning: contents before sections
include/spl.h:566: warning: Function parameter or member 'bl32_entry'
not described in 'bl2_plat_get_bl31_params_default'
include/spl.h:566: warning: Function parameter or member 'bl33_entry'
not described in 'bl2_plat_get_bl31_params_default'
include/spl.h:566: warning: Function parameter or member 'fdt_addr' not
described in 'bl2_plat_get_bl31_params_default'
include/spl.h:566: warning: No description found for return value of
'bl2_plat_get_bl31_params_default'


./scripts/kernel-doc -v -man  common/spl/spl_atf.c > /dev/null

M

  reply	other threads:[~2020-11-18 14:23 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-16 21:47 [PATCH 0/8] spl: atf: add support for LOAD_IMAGE_V2 Michael Walle
2020-11-16 21:47 ` [PATCH 1/8] treewide: use CONFIG_IS_ENABLED() for ARMV8_SEC_FIRMWARE_SUPPORT Michael Walle
2020-11-18 14:21   ` Michal Simek
2020-11-16 21:47 ` [PATCH 2/8] spl: atf: move storage for bl31_params into function Michael Walle
2020-11-18 14:07   ` Michal Simek
2020-11-16 21:47 ` [PATCH 3/8] spl: atf: provide a bl2_plat_get_bl31_params_default() Michael Walle
2020-11-18 14:23   ` Michal Simek [this message]
2020-11-18 14:24     ` Michal Simek
2020-11-16 21:47 ` [PATCH 4/8] spl: atf: remove helper structure from common header Michael Walle
2020-11-18 14:25   ` Michal Simek
2020-11-16 21:47 ` [PATCH 5/8] spl: atf: add support for LOAD_IMAGE_V2 Michael Walle
2020-11-18 14:26   ` Michal Simek
2020-11-16 21:47 ` [PATCH 6/8] armv8: layerscape: don't initialize GIC in SPL Michael Walle
2020-11-16 21:47 ` [PATCH 7/8] board: sl28: add ATF support (bl31) Michael Walle
2020-11-18 14:06   ` Michal Simek
2020-11-18 14:10     ` Michael Walle
2020-11-18 14:15       ` Michal Simek
2020-11-18 14:20         ` Michael Walle
2020-11-18 16:11         ` Michael Walle
2020-11-16 21:47 ` [PATCH 8/8] board: sl28: add OP-TEE Trusted OS support (bl32) Michael Walle

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=89b88c5f-0f22-05b2-d940-df7bb9b3be5a@xilinx.com \
    --to=michal.simek@xilinx.com \
    --cc=u-boot@lists.denx.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.