public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: York Sun <york.sun@nxp.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCHV5 4/6] ARMv8/Layerscape: switch SMP method accordingly
Date: Tue, 7 Jun 2016 17:50:56 -0700	[thread overview]
Message-ID: <57576BF0.8090403@nxp.com> (raw)
In-Reply-To: <1465108175-35114-4-git-send-email-Zhiqiang.Hou@nxp.com>

On 06/04/2016 11:40 PM, Zhiqiang Hou wrote:
> From: Hou Zhiqiang <Zhiqiang.Hou@nxp.com>
> 
> If the PSCI and PPA is ready, skip the fixup for spin-table and
> waking secondary cores. If not, change SMP method to spin-table,
> and the device node of PSCI will be removed.
> 
> Signed-off-by: Hou Zhiqiang <Zhiqiang.Hou@nxp.com>
> ---
> V5:
>  - Changed the checking if the PSCI feature is ready to read the psci version.
> 
> V4:
>  - Reordered this patch.
> 
>  arch/arm/cpu/armv8/fsl-layerscape/cpu.c | 17 +++++++++++++---
>  arch/arm/cpu/armv8/fsl-layerscape/fdt.c | 36 +++++++++++++++++++++++++++++++++
>  2 files changed, 50 insertions(+), 3 deletions(-)
> 
> diff --git a/arch/arm/cpu/armv8/fsl-layerscape/cpu.c b/arch/arm/cpu/armv8/fsl-layerscape/cpu.c
> index 672a453..eb566cd 100644
> --- a/arch/arm/cpu/armv8/fsl-layerscape/cpu.c
> +++ b/arch/arm/cpu/armv8/fsl-layerscape/cpu.c
> @@ -23,6 +23,9 @@
>  #ifdef CONFIG_FSL_ESDHC
>  #include <fsl_esdhc.h>
>  #endif
> +#ifdef CONFIG_ARMV8_SEC_FIRMWARE_SUPPORT
> +#include <asm/armv8/sec_firmware.h>
> +#endif
>  
>  DECLARE_GLOBAL_DATA_PTR;
>  
> @@ -618,6 +621,7 @@ int arch_early_init_r(void)
>  {
>  #ifdef CONFIG_MP
>  	int rv = 1;
> +	bool psci_support = false;
>  #endif
>  
>  #ifdef CONFIG_SYS_FSL_ERRATUM_A009635
> @@ -625,9 +629,16 @@ int arch_early_init_r(void)
>  #endif
>  
>  #ifdef CONFIG_MP
> -	rv = fsl_layerscape_wake_seconday_cores();
> -	if (rv)
> -		printf("Did not wake secondary cores\n");
> +#if defined(CONFIG_ARMV8_SEC_FIRMWARE_SUPPORT) && defined(CONFIG_ARMV8_PSCI)
> +	/* Check the psci version to determine if the psci is supported */
> +	psci_support = (int)sec_firmware_support_psci_version() > 0 ?
> +			true : false;
> +#endif
> +	if (!psci_support) {
> +		rv = fsl_layerscape_wake_seconday_cores();
> +		if (rv)
> +			printf("Did not wake secondary cores\n");
> +	}
>  #endif
>  

Zhiqiang,

Here you presume the psci version returned by
sec_firmware_support_psci_version() is a proof of a functional psci. I think
that is flawed. This sec_firmware_support_psci_version() can return a positive
number as far as the image in specified location is valid. It doesn't guarantee
the image is running. The only place you would know the result of loading such
image is by calling sec_firmware_init() in board_init() in your 6th patch. But
you didn't check the return. That means you blindly believe a valid image would
be successfully loaded and started to run. Later when you need to decide to use
spin-table or PSCI for secondary cores, you don't know if such image is running.

I wonder if you can make a psci call to return the version number.

York

  reply	other threads:[~2016-06-08  0:50 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-05  6:29 [U-Boot] [PATCHV5 1/6] armv8: fsl-layerscape: add i/d-cache enable function to enable_caches Zhiqiang Hou
2016-06-05  6:29 ` [U-Boot] [PATCHV5 2/6] ARMv8: add the secure monitor firmware framework Zhiqiang Hou
2016-06-05  6:29 ` [U-Boot] [PATCHV5 3/6] ARMv8/layerscape: Add FSL PPA support Zhiqiang Hou
2016-06-08  0:51   ` York Sun
2016-06-12  3:53     ` Zhiqiang Hou
2016-06-05  6:29 ` [U-Boot] [PATCHV5 4/6] ARMv8/Layerscape: switch SMP method accordingly Zhiqiang Hou
2016-06-08  0:50   ` York Sun [this message]
2016-06-12  3:49     ` Zhiqiang Hou
2016-06-12  3:53       ` york sun
2016-06-08  0:56   ` York Sun
2016-06-12  3:58     ` Zhiqiang Hou
2016-06-12  4:06       ` york sun
2016-06-12  4:30         ` Zhiqiang Hou
2016-06-13  8:30         ` Zhiqiang Hou
2016-06-13 16:04           ` york sun
2016-06-12  4:09       ` Scott Wood
2016-06-12  4:33         ` Zhiqiang Hou
2016-06-05  6:29 ` [U-Boot] [PATCHV5 5/6] ARMv8/PSCI: Fixup the device tree for PSCI Zhiqiang Hou
2016-06-05  6:29 ` [U-Boot] [PATCHV5 6/6] ARMv8/ls1043ardb: Integrate FSL PPA Zhiqiang Hou

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=57576BF0.8090403@nxp.com \
    --to=york.sun@nxp.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox