From mboxrd@z Thu Jan 1 00:00:00 1970 From: Zhiqiang Hou Date: Thu, 23 Jun 2016 03:56:13 +0000 Subject: [U-Boot] [PATCHv6 4/6] ARMv8/Layerscape: switch SMP method accordingly In-Reply-To: References: <1466566259-33431-1-git-send-email-Zhiqiang.Hou@nxp.com> <1466566259-33431-4-git-send-email-Zhiqiang.Hou@nxp.com> Message-ID: List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hi York, Thanks for your comments! > -----Original Message----- > From: york sun > Sent: 2016?6?23? 0:22 > To: Zhiqiang Hou ; u-boot at lists.denx.de; > albert.u.boot at aribaud.net; scottwood at freescale.com; > Mingkai.hu at freescale.com; yorksun at freescale.com; leoli at freescale.com; > prabhakar at freescale.com; bhupesh.sharma at freescale.com > Subject: Re: [PATCHv6 4/6] ARMv8/Layerscape: switch SMP method accordingly > > On 06/21/2016 08:45 PM, Zhiqiang Hou wrote: > > From: Hou Zhiqiang > > > > If the PSCI and PPA is ready, skip the fixup for spin-table and waking > > secondary cores. Otherwise, change SMP method to spin-table, and the > > device node of PSCI will be removed. > > > > Signed-off-by: Hou Zhiqiang > > --- > > V6: > > - no change > > > > 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 | 34 > +++++++++++++++++++++++++++++++++ > > 2 files changed, 48 insertions(+), 3 deletions(-) > > > > diff --git a/arch/arm/cpu/armv8/fsl-layerscape/cpu.c > > b/arch/arm/cpu/armv8/fsl-layerscape/cpu.c > > index d5bcf67..f284b77 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 > > #endif > > +#ifdef CONFIG_ARMV8_SEC_FIRMWARE_SUPPORT #include > > + #endif > > > > DECLARE_GLOBAL_DATA_PTR; > > > > @@ -622,6 +625,7 @@ int arch_early_init_r(void) > > { > > #ifdef CONFIG_MP > > int rv = 1; > > + bool psci_support = false; > > #endif > > > > #ifdef CONFIG_SYS_FSL_ERRATUM_A009635 @@ -629,9 +633,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 = sec_firmware_support_psci_version() != 0xffffffff ? > > + true : false; > > If the only error code is 0xffffffff, you can delete the "? true : > false" part. The logical operation results "true" or "false" already. > Yes, will fix it. > > +#endif > > + if (!psci_support) { > > + rv = fsl_layerscape_wake_seconday_cores(); > > + if (rv) > > + printf("Did not wake secondary cores\n"); > > + } > > #endif > > Thanks, Zhiqiang