All of lore.kernel.org
 help / color / mirror / Atom feed
From: Scott Wood <oss@buserror.net>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 6/9] ARM: ARMv7: PSCI: ls102xa: Verify CPU ID for CPU_ON
Date: Mon, 18 Jan 2016 17:01:06 -0600	[thread overview]
Message-ID: <1453158066.19133.68.camel@buserror.net> (raw)
In-Reply-To: <1453091251-17433-7-git-send-email-dongsheng.wang@nxp.com>

On Mon, 2016-01-18 at 12:27 +0800, Dongsheng Wang wrote:
> From: Wang Dongsheng <dongsheng.wang@nxp.com>
> 
> Add validation code to make sure target cpu ID is valid.
> 
> Signed-off-by: Wang Dongsheng <dongsheng.wang@nxp.com>
> ---
>  arch/arm/cpu/armv7/ls102xa/psci.S | 27 ++++++++++++++++++++++++---
>  1 file changed, 24 insertions(+), 3 deletions(-)
> 
> diff --git a/arch/arm/cpu/armv7/ls102xa/psci.S
> b/arch/arm/cpu/armv7/ls102xa/psci.S
> index 461b785..3091362 100644
> --- a/arch/arm/cpu/armv7/ls102xa/psci.S
> +++ b/arch/arm/cpu/armv7/ls102xa/psci.S
> @@ -25,13 +25,34 @@
>  #define	ONE_MS		(GENERIC_TIMER_CLK / 1000)
>  #define	RESET_WAIT	(30 * ONE_MS)
>  
> +#define AFFINITY_LEVEL_PROCESSOR_SHIFT		8
>  @ Expect target CPU in r1, return the target cpu number in R0
>  .globl	psci_get_target_cpu_id
>  psci_get_target_cpu_id:
> -	@ Clear and Get the correct CPU number
> -	and	r1, r1, #0xff
> -	mov	r0, r1
> +	@ Get the CPU number
> +	and	r0, r1, #0xff
>  
> +	@ Verify bit[31:24], bits must be zero.
> +	tst	r1, #0xff000000
> +	bne	out_psci_get_target_cpu_id
> +
> +	@ Verify Affinity level 2: Cluster, only one cluster in LS1021xa
> SoC.
> +	tst	r1, #0xff0000
> +	bne	out_psci_get_target_cpu_id
> +
> +	@ Verify Affinity level 1: Processors, should in 0xf00 processor.
> +	lsr	r1, r1, #AFFINITY_LEVEL_PROCESSOR_SHIFT
> +	teq	r1, #0xf
> +	bne	out_psci_get_target_cpu_id
> +
> +	@ Verify CPU, Affinity level 0: Only 0, 1 is effective value.
> +	cmp	r0, #2
> +	bge	out_psci_get_target_cpu_id
> +
> +	bx	lr
> +
> +out_psci_get_target_cpu_id:
> +	mov	r0, #PSCI_RET_INVALID_PARAMS
>  	bx	lr


Where do you check for ALREADY_ON or ON_PENDING?

-Scott

  reply	other threads:[~2016-01-18 23:01 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-18  4:27 [U-Boot] [PATCH 0/9] ARM: ARMv7: PSCI: add PSCI v1.0 support Dongsheng Wang
2016-01-18  4:27 ` [U-Boot] [PATCH 1/9] ARM: PSCI: Change function ID base value Dongsheng Wang
2016-01-18  4:27 ` [U-Boot] [PATCH 2/9] ARM: PSCI: Change PSCI related macro definition style Dongsheng Wang
2016-01-18  4:27 ` [U-Boot] [PATCH 3/9] ARM: ARMv7: PSCI: move target PC in each CPU stack no longer is shared Dongsheng Wang
2016-03-16  7:04   ` Chenhui Zhao
2016-03-16  8:29     ` Hongbo Zhang
     [not found]     ` <DB3PR04MB0812BFF5181A4DDE5FE8267A848A0@DB3PR04MB0812.eurprd04.prod.outlook.com>
2016-03-16  8:29       ` Wang Dongsheng
2016-01-18  4:27 ` [U-Boot] [PATCH 4/9] ARM: ARMv7: PSCI: Factor out reusable psci_cpu_on_common Dongsheng Wang
2016-01-18  4:27 ` [U-Boot] [PATCH 5/9] ARM: ARMv7: PSCI: Pass contextID to target CPU Dongsheng Wang
2016-01-18  4:27 ` [U-Boot] [PATCH 6/9] ARM: ARMv7: PSCI: ls102xa: Verify CPU ID for CPU_ON Dongsheng Wang
2016-01-18 23:01   ` Scott Wood [this message]
2016-01-19  6:31     ` Dongsheng Wang
2016-01-18  4:27 ` [U-Boot] [PATCH 7/9] ARM: ARMv7: PSCI: Add PSCI 1.0 version support Dongsheng Wang
2016-01-18 22:30   ` Scott Wood
2016-01-19  5:52     ` Dongsheng Wang
2016-01-18  4:27 ` [U-Boot] [PATCH 8/9] ARM: ARMv7: PSCI: ls102xa: add psci functions implemention Dongsheng Wang
2016-01-18 22:52   ` Scott Wood
2016-01-19  6:28     ` Dongsheng Wang
2016-01-21 22:56       ` Scott Wood
2016-01-22  2:46         ` Dongsheng Wang
2016-03-03  3:54         ` Dongsheng Wang
2016-01-18  4:27 ` [U-Boot] [PATCH 9/9] ARM: ARMv7: PSCI: ls102xa: put secure text section into OCRAM Dongsheng Wang
2016-03-03  3:51 ` [U-Boot] [PATCH 0/9] ARM: ARMv7: PSCI: add PSCI v1.0 support Dongsheng Wang

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=1453158066.19133.68.camel@buserror.net \
    --to=oss@buserror.net \
    --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.