diff mbox

[U-Boot,v3,5/5] ARMv8: LS1043A: Enable LS1043A default PSCI support

Message ID 1478492034-17912-6-git-send-email-hongbo.zhang@nxp.com
State Superseded
Delegated to: York Sun
Headers show

Commit Message

macro.wave.z@gmail.com Nov. 7, 2016, 4:13 a.m. UTC
From: Hongbo Zhang <hongbo.zhang@nxp.com>

A most basic PSCI implementation with only one psci_version is added for
LS1043A, this can verify the generic PSCI framework, and more platform specific
implementation will be added later.

Signed-off-by: Hongbo Zhang <hongbo.zhang@nxp.com>
---
 arch/arm/cpu/armv8/fsl-layerscape/Makefile       |  1 +
 arch/arm/cpu/armv8/fsl-layerscape/ls1043a_psci.S | 20 ++++++++++++++++++++
 board/freescale/ls1043ardb/Kconfig               |  9 +++++++++
 configs/ls1043ardb_defconfig                     |  3 +++
 4 files changed, 33 insertions(+)
 create mode 100644 arch/arm/cpu/armv8/fsl-layerscape/ls1043a_psci.S

Comments

Tom Rini Nov. 11, 2016, 4:07 p.m. UTC | #1
On Mon, Nov 07, 2016 at 12:13:54PM +0800, macro.wave.z@gmail.com wrote:

> From: Hongbo Zhang <hongbo.zhang@nxp.com>
> 
> A most basic PSCI implementation with only one psci_version is added for
> LS1043A, this can verify the generic PSCI framework, and more platform specific
> implementation will be added later.
> 
> Signed-off-by: Hongbo Zhang <hongbo.zhang@nxp.com>

Reviewed-by: Tom Rini <trini@konsulko.com>
York Sun Nov. 14, 2016, 6:12 p.m. UTC | #2
On 11/06/2016 08:14 PM, macro.wave.z@gmail.com wrote:
> From: Hongbo Zhang <hongbo.zhang@nxp.com>
>
> A most basic PSCI implementation with only one psci_version is added for
> LS1043A, this can verify the generic PSCI framework, and more platform specific
> implementation will be added later.
>
> Signed-off-by: Hongbo Zhang <hongbo.zhang@nxp.com>
> ---
>  arch/arm/cpu/armv8/fsl-layerscape/Makefile       |  1 +
>  arch/arm/cpu/armv8/fsl-layerscape/ls1043a_psci.S | 20 ++++++++++++++++++++
>  board/freescale/ls1043ardb/Kconfig               |  9 +++++++++
>  configs/ls1043ardb_defconfig                     |  3 +++
>  4 files changed, 33 insertions(+)
>  create mode 100644 arch/arm/cpu/armv8/fsl-layerscape/ls1043a_psci.S
>
> diff --git a/arch/arm/cpu/armv8/fsl-layerscape/Makefile b/arch/arm/cpu/armv8/fsl-layerscape/Makefile
> index 51c1cee..423b4b3 100644
> --- a/arch/arm/cpu/armv8/fsl-layerscape/Makefile
> +++ b/arch/arm/cpu/armv8/fsl-layerscape/Makefile
> @@ -28,6 +28,7 @@ endif
>
>  ifneq ($(CONFIG_LS1043A),)
>  obj-$(CONFIG_SYS_HAS_SERDES) += ls1043a_serdes.o
> +obj-$(CONFIG_ARMV8_PSCI) += ls1043a_psci.o
>  endif
>
>  ifneq ($(CONFIG_ARCH_LS1012A),)
> diff --git a/arch/arm/cpu/armv8/fsl-layerscape/ls1043a_psci.S b/arch/arm/cpu/armv8/fsl-layerscape/ls1043a_psci.S
> new file mode 100644
> index 0000000..86045ac
> --- /dev/null
> +++ b/arch/arm/cpu/armv8/fsl-layerscape/ls1043a_psci.S
> @@ -0,0 +1,20 @@
> +/*
> + * Copyright 2016 Freescale Semiconductor, Inc.
> + * Author: Hongbo Zhang <hongbo.zhang@nxp.com>
> + *
> + * SPDX-License-Identifier:	GPL-2.0+
> + * This file implements LS102X platform PSCI SYSTEM-SUSPEND function
> + */
> +
> +#include <config.h>
> +#include <linux/linkage.h>
> +#include <asm/psci.h>
> +
> +	.pushsection ._secure.text, "ax"
> +
> +.globl	psci_version
> +psci_version:
> +	ldr	w0, =0x00010000		/* PSCI v1.0 */
> +	ret
> +
> +	.popsection
> diff --git a/board/freescale/ls1043ardb/Kconfig b/board/freescale/ls1043ardb/Kconfig
> index 51818ec..0c596f9 100644
> --- a/board/freescale/ls1043ardb/Kconfig
> +++ b/board/freescale/ls1043ardb/Kconfig
> @@ -13,4 +13,13 @@ config SYS_SOC
>  config SYS_CONFIG_NAME
>  	default "ls1043ardb"
>
> +config SYS_HAS_ARMV8_SECURE_BASE
> +	bool "Enable secure RAM for PSCI image"
> +	depends on ARMV8_PSCI
> +	default y
> +	help
> +	  PSCI image can be re-located to secure RAM.
> +	  If enabled, please also define the value for ARMV8_SECURE_BASE,
> +	  for LS1043ARDB, it is address in OCRAM.
> +
>  endif
> diff --git a/configs/ls1043ardb_defconfig b/configs/ls1043ardb_defconfig
> index 79a4eb2..cb189f3 100644
> --- a/configs/ls1043ardb_defconfig
> +++ b/configs/ls1043ardb_defconfig
> @@ -28,3 +28,6 @@ CONFIG_DM_USB=y
>  CONFIG_USB_XHCI_HCD=y
>  CONFIG_USB_XHCI_DWC3=y
>  CONFIG_USB_STORAGE=y
> +CONFIG_ARMV8_PSCI=y
> +CONFIG_ARMV8_PSCI_CPUS_PER_CLUSTER=4
> +CONFIG_ARMV8_SECURE_BASE=0x10010000
>

How do you decide the CONFIG_ARMV8_SECURE_BASE?

Zhiqiang,

Does this patch set interfere with existing PPA support?

York
macro.wave.z@gmail.com Nov. 15, 2016, 2:11 a.m. UTC | #3
On Tue, Nov 15, 2016 at 2:12 AM, york sun <york.sun@nxp.com> wrote:
> On 11/06/2016 08:14 PM, macro.wave.z@gmail.com wrote:
>> From: Hongbo Zhang <hongbo.zhang@nxp.com>
>>
>> A most basic PSCI implementation with only one psci_version is added for
>> LS1043A, this can verify the generic PSCI framework, and more platform specific
>> implementation will be added later.
>>
>> Signed-off-by: Hongbo Zhang <hongbo.zhang@nxp.com>
>> ---
>>  arch/arm/cpu/armv8/fsl-layerscape/Makefile       |  1 +
>>  arch/arm/cpu/armv8/fsl-layerscape/ls1043a_psci.S | 20 ++++++++++++++++++++
>>  board/freescale/ls1043ardb/Kconfig               |  9 +++++++++
>>  configs/ls1043ardb_defconfig                     |  3 +++
>>  4 files changed, 33 insertions(+)
>>  create mode 100644 arch/arm/cpu/armv8/fsl-layerscape/ls1043a_psci.S
>>
>> diff --git a/arch/arm/cpu/armv8/fsl-layerscape/Makefile b/arch/arm/cpu/armv8/fsl-layerscape/Makefile
>> index 51c1cee..423b4b3 100644
>> --- a/arch/arm/cpu/armv8/fsl-layerscape/Makefile
>> +++ b/arch/arm/cpu/armv8/fsl-layerscape/Makefile
>> @@ -28,6 +28,7 @@ endif
>>
>>  ifneq ($(CONFIG_LS1043A),)
>>  obj-$(CONFIG_SYS_HAS_SERDES) += ls1043a_serdes.o
>> +obj-$(CONFIG_ARMV8_PSCI) += ls1043a_psci.o
>>  endif
>>
>>  ifneq ($(CONFIG_ARCH_LS1012A),)
>> diff --git a/arch/arm/cpu/armv8/fsl-layerscape/ls1043a_psci.S b/arch/arm/cpu/armv8/fsl-layerscape/ls1043a_psci.S
>> new file mode 100644
>> index 0000000..86045ac
>> --- /dev/null
>> +++ b/arch/arm/cpu/armv8/fsl-layerscape/ls1043a_psci.S
>> @@ -0,0 +1,20 @@
>> +/*
>> + * Copyright 2016 Freescale Semiconductor, Inc.
>> + * Author: Hongbo Zhang <hongbo.zhang@nxp.com>
>> + *
>> + * SPDX-License-Identifier:  GPL-2.0+
>> + * This file implements LS102X platform PSCI SYSTEM-SUSPEND function
>> + */
>> +
>> +#include <config.h>
>> +#include <linux/linkage.h>
>> +#include <asm/psci.h>
>> +
>> +     .pushsection ._secure.text, "ax"
>> +
>> +.globl       psci_version
>> +psci_version:
>> +     ldr     w0, =0x00010000         /* PSCI v1.0 */
>> +     ret
>> +
>> +     .popsection
>> diff --git a/board/freescale/ls1043ardb/Kconfig b/board/freescale/ls1043ardb/Kconfig
>> index 51818ec..0c596f9 100644
>> --- a/board/freescale/ls1043ardb/Kconfig
>> +++ b/board/freescale/ls1043ardb/Kconfig
>> @@ -13,4 +13,13 @@ config SYS_SOC
>>  config SYS_CONFIG_NAME
>>       default "ls1043ardb"
>>
>> +config SYS_HAS_ARMV8_SECURE_BASE
>> +     bool "Enable secure RAM for PSCI image"
>> +     depends on ARMV8_PSCI
>> +     default y
>> +     help
>> +       PSCI image can be re-located to secure RAM.
>> +       If enabled, please also define the value for ARMV8_SECURE_BASE,
>> +       for LS1043ARDB, it is address in OCRAM.
>> +
>>  endif
>> diff --git a/configs/ls1043ardb_defconfig b/configs/ls1043ardb_defconfig
>> index 79a4eb2..cb189f3 100644
>> --- a/configs/ls1043ardb_defconfig
>> +++ b/configs/ls1043ardb_defconfig
>> @@ -28,3 +28,6 @@ CONFIG_DM_USB=y
>>  CONFIG_USB_XHCI_HCD=y
>>  CONFIG_USB_XHCI_DWC3=y
>>  CONFIG_USB_STORAGE=y
>> +CONFIG_ARMV8_PSCI=y
>> +CONFIG_ARMV8_PSCI_CPUS_PER_CLUSTER=4
>> +CONFIG_ARMV8_SECURE_BASE=0x10010000
>>
>
> How do you decide the CONFIG_ARMV8_SECURE_BASE?
>

It is OCRAM1, just like ARMv7 LS1021.

> Zhiqiang,
>
> Does this patch set interfere with existing PPA support?
>
> York
Z.Q. Hou Nov. 15, 2016, 3:37 a.m. UTC | #4
Hi York

> -----Original Message-----

> From: york sun

> Sent: 2016年11月15日 2:12

> To: macro.wave.z@gmail.com; u-boot@lists.denx.de; trini@konsulko.com;

> Z.Q. Hou <zhiqiang.hou@nxp.com>

> Cc: wens@csie.org; H.B. Zhang <hongbo.zhang@nxp.com>

> Subject: Re: [PATCH v3 5/5] ARMv8: LS1043A: Enable LS1043A default PSCI

> support

> 

> On 11/06/2016 08:14 PM, macro.wave.z@gmail.com wrote:

> > From: Hongbo Zhang <hongbo.zhang@nxp.com>

> >

> > A most basic PSCI implementation with only one psci_version is added

> > for LS1043A, this can verify the generic PSCI framework, and more

> > platform specific implementation will be added later.

> >

> > Signed-off-by: Hongbo Zhang <hongbo.zhang@nxp.com>

> > ---

> >  arch/arm/cpu/armv8/fsl-layerscape/Makefile       |  1 +

> >  arch/arm/cpu/armv8/fsl-layerscape/ls1043a_psci.S | 20

> ++++++++++++++++++++

> >  board/freescale/ls1043ardb/Kconfig               |  9 +++++++++

> >  configs/ls1043ardb_defconfig                     |  3 +++

> >  4 files changed, 33 insertions(+)

> >  create mode 100644 arch/arm/cpu/armv8/fsl-layerscape/ls1043a_psci.S

> >

> > diff --git a/arch/arm/cpu/armv8/fsl-layerscape/Makefile

> > b/arch/arm/cpu/armv8/fsl-layerscape/Makefile

> > index 51c1cee..423b4b3 100644

> > --- a/arch/arm/cpu/armv8/fsl-layerscape/Makefile

> > +++ b/arch/arm/cpu/armv8/fsl-layerscape/Makefile

> > @@ -28,6 +28,7 @@ endif

> >

> >  ifneq ($(CONFIG_LS1043A),)

> >  obj-$(CONFIG_SYS_HAS_SERDES) += ls1043a_serdes.o

> > +obj-$(CONFIG_ARMV8_PSCI) += ls1043a_psci.o

> >  endif

> >

> >  ifneq ($(CONFIG_ARCH_LS1012A),)

> > diff --git a/arch/arm/cpu/armv8/fsl-layerscape/ls1043a_psci.S

> > b/arch/arm/cpu/armv8/fsl-layerscape/ls1043a_psci.S

> > new file mode 100644

> > index 0000000..86045ac

> > --- /dev/null

> > +++ b/arch/arm/cpu/armv8/fsl-layerscape/ls1043a_psci.S

> > @@ -0,0 +1,20 @@

> > +/*

> > + * Copyright 2016 Freescale Semiconductor, Inc.

> > + * Author: Hongbo Zhang <hongbo.zhang@nxp.com>

> > + *

> > + * SPDX-License-Identifier:	GPL-2.0+

> > + * This file implements LS102X platform PSCI SYSTEM-SUSPEND function

> > +*/

> > +

> > +#include <config.h>

> > +#include <linux/linkage.h>

> > +#include <asm/psci.h>

> > +

> > +	.pushsection ._secure.text, "ax"

> > +

> > +.globl	psci_version

> > +psci_version:

> > +	ldr	w0, =0x00010000		/* PSCI v1.0 */

> > +	ret

> > +

> > +	.popsection

> > diff --git a/board/freescale/ls1043ardb/Kconfig

> > b/board/freescale/ls1043ardb/Kconfig

> > index 51818ec..0c596f9 100644

> > --- a/board/freescale/ls1043ardb/Kconfig

> > +++ b/board/freescale/ls1043ardb/Kconfig

> > @@ -13,4 +13,13 @@ config SYS_SOC

> >  config SYS_CONFIG_NAME

> >  	default "ls1043ardb"

> >

> > +config SYS_HAS_ARMV8_SECURE_BASE

> > +	bool "Enable secure RAM for PSCI image"

> > +	depends on ARMV8_PSCI

> > +	default y

> > +	help

> > +	  PSCI image can be re-located to secure RAM.

> > +	  If enabled, please also define the value for ARMV8_SECURE_BASE,

> > +	  for LS1043ARDB, it is address in OCRAM.

> > +

> >  endif

> > diff --git a/configs/ls1043ardb_defconfig

> > b/configs/ls1043ardb_defconfig index 79a4eb2..cb189f3 100644

> > --- a/configs/ls1043ardb_defconfig

> > +++ b/configs/ls1043ardb_defconfig

> > @@ -28,3 +28,6 @@ CONFIG_DM_USB=y

> >  CONFIG_USB_XHCI_HCD=y

> >  CONFIG_USB_XHCI_DWC3=y

> >  CONFIG_USB_STORAGE=y

> > +CONFIG_ARMV8_PSCI=y

> > +CONFIG_ARMV8_PSCI_CPUS_PER_CLUSTER=4

> > +CONFIG_ARMV8_SECURE_BASE=0x10010000

> >

> 

> How do you decide the CONFIG_ARMV8_SECURE_BASE?

> 

> Zhiqiang,

> 

> Does this patch set interfere with existing PPA support?


Tried Hongbo's patches with PPA enabled on ls1043ardb, kernel boot failed.
I guess hongbo's u-boot psci setup triggered an exception, because when PPA is initialized u-boot will execute on EL2.

Hongbo, how did you process this circumstance? Another problem, if PPA is disabled, u-boot will go through the spin-table process to wake up secondary cores, will this affect u-boot psci?

Thanks,
Zhiqiang
macro.wave.z@gmail.com Nov. 15, 2016, 10:28 a.m. UTC | #5
On Tue, Nov 15, 2016 at 11:37 AM, Z.Q. Hou <zhiqiang.hou@nxp.com> wrote:
> Hi York
>
>> -----Original Message-----
>> From: york sun
>> Sent: 2016年11月15日 2:12
>> To: macro.wave.z@gmail.com; u-boot@lists.denx.de; trini@konsulko.com;
>> Z.Q. Hou <zhiqiang.hou@nxp.com>
>> Cc: wens@csie.org; H.B. Zhang <hongbo.zhang@nxp.com>
>> Subject: Re: [PATCH v3 5/5] ARMv8: LS1043A: Enable LS1043A default PSCI
>> support
>>
>> On 11/06/2016 08:14 PM, macro.wave.z@gmail.com wrote:
>> > From: Hongbo Zhang <hongbo.zhang@nxp.com>
>> >
>> > A most basic PSCI implementation with only one psci_version is added
>> > for LS1043A, this can verify the generic PSCI framework, and more
>> > platform specific implementation will be added later.
>> >
>> > Signed-off-by: Hongbo Zhang <hongbo.zhang@nxp.com>
>> > ---
>> >  arch/arm/cpu/armv8/fsl-layerscape/Makefile       |  1 +
>> >  arch/arm/cpu/armv8/fsl-layerscape/ls1043a_psci.S | 20
>> ++++++++++++++++++++
>> >  board/freescale/ls1043ardb/Kconfig               |  9 +++++++++
>> >  configs/ls1043ardb_defconfig                     |  3 +++
>> >  4 files changed, 33 insertions(+)
>> >  create mode 100644 arch/arm/cpu/armv8/fsl-layerscape/ls1043a_psci.S
>> >
>> > diff --git a/arch/arm/cpu/armv8/fsl-layerscape/Makefile
>> > b/arch/arm/cpu/armv8/fsl-layerscape/Makefile
>> > index 51c1cee..423b4b3 100644
>> > --- a/arch/arm/cpu/armv8/fsl-layerscape/Makefile
>> > +++ b/arch/arm/cpu/armv8/fsl-layerscape/Makefile
>> > @@ -28,6 +28,7 @@ endif
>> >
>> >  ifneq ($(CONFIG_LS1043A),)
>> >  obj-$(CONFIG_SYS_HAS_SERDES) += ls1043a_serdes.o
>> > +obj-$(CONFIG_ARMV8_PSCI) += ls1043a_psci.o
>> >  endif
>> >
>> >  ifneq ($(CONFIG_ARCH_LS1012A),)
>> > diff --git a/arch/arm/cpu/armv8/fsl-layerscape/ls1043a_psci.S
>> > b/arch/arm/cpu/armv8/fsl-layerscape/ls1043a_psci.S
>> > new file mode 100644
>> > index 0000000..86045ac
>> > --- /dev/null
>> > +++ b/arch/arm/cpu/armv8/fsl-layerscape/ls1043a_psci.S
>> > @@ -0,0 +1,20 @@
>> > +/*
>> > + * Copyright 2016 Freescale Semiconductor, Inc.
>> > + * Author: Hongbo Zhang <hongbo.zhang@nxp.com>
>> > + *
>> > + * SPDX-License-Identifier:        GPL-2.0+
>> > + * This file implements LS102X platform PSCI SYSTEM-SUSPEND function
>> > +*/
>> > +
>> > +#include <config.h>
>> > +#include <linux/linkage.h>
>> > +#include <asm/psci.h>
>> > +
>> > +   .pushsection ._secure.text, "ax"
>> > +
>> > +.globl     psci_version
>> > +psci_version:
>> > +   ldr     w0, =0x00010000         /* PSCI v1.0 */
>> > +   ret
>> > +
>> > +   .popsection
>> > diff --git a/board/freescale/ls1043ardb/Kconfig
>> > b/board/freescale/ls1043ardb/Kconfig
>> > index 51818ec..0c596f9 100644
>> > --- a/board/freescale/ls1043ardb/Kconfig
>> > +++ b/board/freescale/ls1043ardb/Kconfig
>> > @@ -13,4 +13,13 @@ config SYS_SOC
>> >  config SYS_CONFIG_NAME
>> >     default "ls1043ardb"
>> >
>> > +config SYS_HAS_ARMV8_SECURE_BASE
>> > +   bool "Enable secure RAM for PSCI image"
>> > +   depends on ARMV8_PSCI
>> > +   default y
>> > +   help
>> > +     PSCI image can be re-located to secure RAM.
>> > +     If enabled, please also define the value for ARMV8_SECURE_BASE,
>> > +     for LS1043ARDB, it is address in OCRAM.
>> > +
>> >  endif
>> > diff --git a/configs/ls1043ardb_defconfig
>> > b/configs/ls1043ardb_defconfig index 79a4eb2..cb189f3 100644
>> > --- a/configs/ls1043ardb_defconfig
>> > +++ b/configs/ls1043ardb_defconfig
>> > @@ -28,3 +28,6 @@ CONFIG_DM_USB=y
>> >  CONFIG_USB_XHCI_HCD=y
>> >  CONFIG_USB_XHCI_DWC3=y
>> >  CONFIG_USB_STORAGE=y
>> > +CONFIG_ARMV8_PSCI=y
>> > +CONFIG_ARMV8_PSCI_CPUS_PER_CLUSTER=4
>> > +CONFIG_ARMV8_SECURE_BASE=0x10010000
>> >
>>
>> How do you decide the CONFIG_ARMV8_SECURE_BASE?
>>
>> Zhiqiang,
>>
>> Does this patch set interfere with existing PPA support?
>
> Tried Hongbo's patches with PPA enabled on ls1043ardb, kernel boot failed.
> I guess hongbo's u-boot psci setup triggered an exception, because when PPA is initialized u-boot will execute on EL2.
>
> Hongbo, how did you process this circumstance? Another problem, if PPA is disabled, u-boot will go through the spin-table process to wake up secondary cores, will this affect u-boot psci?

My psci setup doesn't trigger any exception at all.
and about secondary core booting, currently my psci doesn't cover
this, it is planned next.

>
> Thanks,
> Zhiqiang
Z.Q. Hou Nov. 16, 2016, 3:53 a.m. UTC | #6
Hi Hongbo,

> -----Original Message-----

> From: Hongbo Zhang [mailto:macro.wave.z@gmail.com]

> Sent: 2016年11月15日 18:29

> To: Z.Q. Hou <zhiqiang.hou@nxp.com>

> Cc: york sun <york.sun@nxp.com>; u-boot@lists.denx.de; trini@konsulko.com;

> wens@csie.org; H.B. Zhang <hongbo.zhang@nxp.com>

> Subject: Re: [PATCH v3 5/5] ARMv8: LS1043A: Enable LS1043A default PSCI

> support

> 

> On Tue, Nov 15, 2016 at 11:37 AM, Z.Q. Hou <zhiqiang.hou@nxp.com> wrote:

> > Hi York

> >

> >> -----Original Message-----

> >> From: york sun

> >> Sent: 2016年11月15日 2:12

> >> To: macro.wave.z@gmail.com; u-boot@lists.denx.de; trini@konsulko.com;

> >> Z.Q. Hou <zhiqiang.hou@nxp.com>

> >> Cc: wens@csie.org; H.B. Zhang <hongbo.zhang@nxp.com>

> >> Subject: Re: [PATCH v3 5/5] ARMv8: LS1043A: Enable LS1043A default

> >> PSCI support

> >>

> >> On 11/06/2016 08:14 PM, macro.wave.z@gmail.com wrote:

> >> > From: Hongbo Zhang <hongbo.zhang@nxp.com>

> >> >

> >> > A most basic PSCI implementation with only one psci_version is

> >> > added for LS1043A, this can verify the generic PSCI framework, and

> >> > more platform specific implementation will be added later.

> >> >

> >> > Signed-off-by: Hongbo Zhang <hongbo.zhang@nxp.com>

> >> > ---

> >> >  arch/arm/cpu/armv8/fsl-layerscape/Makefile       |  1 +

> >> >  arch/arm/cpu/armv8/fsl-layerscape/ls1043a_psci.S | 20

> >> ++++++++++++++++++++

> >> >  board/freescale/ls1043ardb/Kconfig               |  9 +++++++++

> >> >  configs/ls1043ardb_defconfig                     |  3 +++

> >> >  4 files changed, 33 insertions(+)

> >> >  create mode 100644

> >> > arch/arm/cpu/armv8/fsl-layerscape/ls1043a_psci.S

> >> >

> >> > diff --git a/arch/arm/cpu/armv8/fsl-layerscape/Makefile

> >> > b/arch/arm/cpu/armv8/fsl-layerscape/Makefile

> >> > index 51c1cee..423b4b3 100644

> >> > --- a/arch/arm/cpu/armv8/fsl-layerscape/Makefile

> >> > +++ b/arch/arm/cpu/armv8/fsl-layerscape/Makefile

> >> > @@ -28,6 +28,7 @@ endif

> >> >

> >> >  ifneq ($(CONFIG_LS1043A),)

> >> >  obj-$(CONFIG_SYS_HAS_SERDES) += ls1043a_serdes.o

> >> > +obj-$(CONFIG_ARMV8_PSCI) += ls1043a_psci.o

> >> >  endif

> >> >

> >> >  ifneq ($(CONFIG_ARCH_LS1012A),)

> >> > diff --git a/arch/arm/cpu/armv8/fsl-layerscape/ls1043a_psci.S

> >> > b/arch/arm/cpu/armv8/fsl-layerscape/ls1043a_psci.S

> >> > new file mode 100644

> >> > index 0000000..86045ac

> >> > --- /dev/null

> >> > +++ b/arch/arm/cpu/armv8/fsl-layerscape/ls1043a_psci.S

> >> > @@ -0,0 +1,20 @@

> >> > +/*

> >> > + * Copyright 2016 Freescale Semiconductor, Inc.

> >> > + * Author: Hongbo Zhang <hongbo.zhang@nxp.com>

> >> > + *

> >> > + * SPDX-License-Identifier:        GPL-2.0+

> >> > + * This file implements LS102X platform PSCI SYSTEM-SUSPEND

> >> > +function */

> >> > +

> >> > +#include <config.h>

> >> > +#include <linux/linkage.h>

> >> > +#include <asm/psci.h>

> >> > +

> >> > +   .pushsection ._secure.text, "ax"

> >> > +

> >> > +.globl     psci_version

> >> > +psci_version:

> >> > +   ldr     w0, =0x00010000         /* PSCI v1.0 */

> >> > +   ret

> >> > +

> >> > +   .popsection

> >> > diff --git a/board/freescale/ls1043ardb/Kconfig

> >> > b/board/freescale/ls1043ardb/Kconfig

> >> > index 51818ec..0c596f9 100644

> >> > --- a/board/freescale/ls1043ardb/Kconfig

> >> > +++ b/board/freescale/ls1043ardb/Kconfig

> >> > @@ -13,4 +13,13 @@ config SYS_SOC

> >> >  config SYS_CONFIG_NAME

> >> >     default "ls1043ardb"

> >> >

> >> > +config SYS_HAS_ARMV8_SECURE_BASE

> >> > +   bool "Enable secure RAM for PSCI image"

> >> > +   depends on ARMV8_PSCI

> >> > +   default y

> >> > +   help

> >> > +     PSCI image can be re-located to secure RAM.

> >> > +     If enabled, please also define the value for ARMV8_SECURE_BASE,

> >> > +     for LS1043ARDB, it is address in OCRAM.

> >> > +

> >> >  endif

> >> > diff --git a/configs/ls1043ardb_defconfig

> >> > b/configs/ls1043ardb_defconfig index 79a4eb2..cb189f3 100644

> >> > --- a/configs/ls1043ardb_defconfig

> >> > +++ b/configs/ls1043ardb_defconfig

> >> > @@ -28,3 +28,6 @@ CONFIG_DM_USB=y

> >> >  CONFIG_USB_XHCI_HCD=y

> >> >  CONFIG_USB_XHCI_DWC3=y

> >> >  CONFIG_USB_STORAGE=y

> >> > +CONFIG_ARMV8_PSCI=y

> >> > +CONFIG_ARMV8_PSCI_CPUS_PER_CLUSTER=4

> >> > +CONFIG_ARMV8_SECURE_BASE=0x10010000

> >> >

> >>

> >> How do you decide the CONFIG_ARMV8_SECURE_BASE?

> >>

> >> Zhiqiang,

> >>

> >> Does this patch set interfere with existing PPA support?

> >

> > Tried Hongbo's patches with PPA enabled on ls1043ardb, kernel boot failed.

> > I guess hongbo's u-boot psci setup triggered an exception, because when

> PPA is initialized u-boot will execute on EL2.

> >

> > Hongbo, how did you process this circumstance? Another problem, if PPA is

> disabled, u-boot will go through the spin-table process to wake up secondary

> cores, will this affect u-boot psci?

> 

> My psci setup doesn't trigger any exception at all.

> and about secondary core booting, currently my psci doesn't cover this, it is

> planned next.


Did you enabled PPA in your experiment? In my side, when PPA initialized the psci setup will trigger exception.

Thanks,
Zhiqiang
macro.wave.z@gmail.com Nov. 17, 2016, 6:58 a.m. UTC | #7
Then my previous v2 1/6 was right, I should not cancel it.
https://patchwork.ozlabs.org/patch/689804/

Tom, York,
I'll have to re-send this patch set with previous 1/6 included again,
with some updates Tom mentioned, e.g move the macros touched into
Kconfig although those configs were not created by me.

Comments are still welcome before I send patches out early next week.

Thanks all.


On Wed, Nov 16, 2016 at 11:53 AM, Z.Q. Hou <zhiqiang.hou@nxp.com> wrote:
> Hi Hongbo,
>
>> -----Original Message-----
>> From: Hongbo Zhang [mailto:macro.wave.z@gmail.com]
>> Sent: 2016年11月15日 18:29
>> To: Z.Q. Hou <zhiqiang.hou@nxp.com>
>> Cc: york sun <york.sun@nxp.com>; u-boot@lists.denx.de; trini@konsulko.com;
>> wens@csie.org; H.B. Zhang <hongbo.zhang@nxp.com>
>> Subject: Re: [PATCH v3 5/5] ARMv8: LS1043A: Enable LS1043A default PSCI
>> support
>>
>> On Tue, Nov 15, 2016 at 11:37 AM, Z.Q. Hou <zhiqiang.hou@nxp.com> wrote:
>> > Hi York
>> >
>> >> -----Original Message-----
>> >> From: york sun
>> >> Sent: 2016年11月15日 2:12
>> >> To: macro.wave.z@gmail.com; u-boot@lists.denx.de; trini@konsulko.com;
>> >> Z.Q. Hou <zhiqiang.hou@nxp.com>
>> >> Cc: wens@csie.org; H.B. Zhang <hongbo.zhang@nxp.com>
>> >> Subject: Re: [PATCH v3 5/5] ARMv8: LS1043A: Enable LS1043A default
>> >> PSCI support
>> >>
>> >> On 11/06/2016 08:14 PM, macro.wave.z@gmail.com wrote:
>> >> > From: Hongbo Zhang <hongbo.zhang@nxp.com>
>> >> >
>> >> > A most basic PSCI implementation with only one psci_version is
>> >> > added for LS1043A, this can verify the generic PSCI framework, and
>> >> > more platform specific implementation will be added later.
>> >> >
>> >> > Signed-off-by: Hongbo Zhang <hongbo.zhang@nxp.com>
>> >> > ---
>> >> >  arch/arm/cpu/armv8/fsl-layerscape/Makefile       |  1 +
>> >> >  arch/arm/cpu/armv8/fsl-layerscape/ls1043a_psci.S | 20
>> >> ++++++++++++++++++++
>> >> >  board/freescale/ls1043ardb/Kconfig               |  9 +++++++++
>> >> >  configs/ls1043ardb_defconfig                     |  3 +++
>> >> >  4 files changed, 33 insertions(+)
>> >> >  create mode 100644
>> >> > arch/arm/cpu/armv8/fsl-layerscape/ls1043a_psci.S
>> >> >
>> >> > diff --git a/arch/arm/cpu/armv8/fsl-layerscape/Makefile
>> >> > b/arch/arm/cpu/armv8/fsl-layerscape/Makefile
>> >> > index 51c1cee..423b4b3 100644
>> >> > --- a/arch/arm/cpu/armv8/fsl-layerscape/Makefile
>> >> > +++ b/arch/arm/cpu/armv8/fsl-layerscape/Makefile
>> >> > @@ -28,6 +28,7 @@ endif
>> >> >
>> >> >  ifneq ($(CONFIG_LS1043A),)
>> >> >  obj-$(CONFIG_SYS_HAS_SERDES) += ls1043a_serdes.o
>> >> > +obj-$(CONFIG_ARMV8_PSCI) += ls1043a_psci.o
>> >> >  endif
>> >> >
>> >> >  ifneq ($(CONFIG_ARCH_LS1012A),)
>> >> > diff --git a/arch/arm/cpu/armv8/fsl-layerscape/ls1043a_psci.S
>> >> > b/arch/arm/cpu/armv8/fsl-layerscape/ls1043a_psci.S
>> >> > new file mode 100644
>> >> > index 0000000..86045ac
>> >> > --- /dev/null
>> >> > +++ b/arch/arm/cpu/armv8/fsl-layerscape/ls1043a_psci.S
>> >> > @@ -0,0 +1,20 @@
>> >> > +/*
>> >> > + * Copyright 2016 Freescale Semiconductor, Inc.
>> >> > + * Author: Hongbo Zhang <hongbo.zhang@nxp.com>
>> >> > + *
>> >> > + * SPDX-License-Identifier:        GPL-2.0+
>> >> > + * This file implements LS102X platform PSCI SYSTEM-SUSPEND
>> >> > +function */
>> >> > +
>> >> > +#include <config.h>
>> >> > +#include <linux/linkage.h>
>> >> > +#include <asm/psci.h>
>> >> > +
>> >> > +   .pushsection ._secure.text, "ax"
>> >> > +
>> >> > +.globl     psci_version
>> >> > +psci_version:
>> >> > +   ldr     w0, =0x00010000         /* PSCI v1.0 */
>> >> > +   ret
>> >> > +
>> >> > +   .popsection
>> >> > diff --git a/board/freescale/ls1043ardb/Kconfig
>> >> > b/board/freescale/ls1043ardb/Kconfig
>> >> > index 51818ec..0c596f9 100644
>> >> > --- a/board/freescale/ls1043ardb/Kconfig
>> >> > +++ b/board/freescale/ls1043ardb/Kconfig
>> >> > @@ -13,4 +13,13 @@ config SYS_SOC
>> >> >  config SYS_CONFIG_NAME
>> >> >     default "ls1043ardb"
>> >> >
>> >> > +config SYS_HAS_ARMV8_SECURE_BASE
>> >> > +   bool "Enable secure RAM for PSCI image"
>> >> > +   depends on ARMV8_PSCI
>> >> > +   default y
>> >> > +   help
>> >> > +     PSCI image can be re-located to secure RAM.
>> >> > +     If enabled, please also define the value for ARMV8_SECURE_BASE,
>> >> > +     for LS1043ARDB, it is address in OCRAM.
>> >> > +
>> >> >  endif
>> >> > diff --git a/configs/ls1043ardb_defconfig
>> >> > b/configs/ls1043ardb_defconfig index 79a4eb2..cb189f3 100644
>> >> > --- a/configs/ls1043ardb_defconfig
>> >> > +++ b/configs/ls1043ardb_defconfig
>> >> > @@ -28,3 +28,6 @@ CONFIG_DM_USB=y
>> >> >  CONFIG_USB_XHCI_HCD=y
>> >> >  CONFIG_USB_XHCI_DWC3=y
>> >> >  CONFIG_USB_STORAGE=y
>> >> > +CONFIG_ARMV8_PSCI=y
>> >> > +CONFIG_ARMV8_PSCI_CPUS_PER_CLUSTER=4
>> >> > +CONFIG_ARMV8_SECURE_BASE=0x10010000
>> >> >
>> >>
>> >> How do you decide the CONFIG_ARMV8_SECURE_BASE?
>> >>
>> >> Zhiqiang,
>> >>
>> >> Does this patch set interfere with existing PPA support?
>> >
>> > Tried Hongbo's patches with PPA enabled on ls1043ardb, kernel boot failed.
>> > I guess hongbo's u-boot psci setup triggered an exception, because when
>> PPA is initialized u-boot will execute on EL2.
>> >
>> > Hongbo, how did you process this circumstance? Another problem, if PPA is
>> disabled, u-boot will go through the spin-table process to wake up secondary
>> cores, will this affect u-boot psci?
>>
>> My psci setup doesn't trigger any exception at all.
>> and about secondary core booting, currently my psci doesn't cover this, it is
>> planned next.
>
> Did you enabled PPA in your experiment? In my side, when PPA initialized the psci setup will trigger exception.
>
> Thanks,
> Zhiqiang
diff mbox

Patch

diff --git a/arch/arm/cpu/armv8/fsl-layerscape/Makefile b/arch/arm/cpu/armv8/fsl-layerscape/Makefile
index 51c1cee..423b4b3 100644
--- a/arch/arm/cpu/armv8/fsl-layerscape/Makefile
+++ b/arch/arm/cpu/armv8/fsl-layerscape/Makefile
@@ -28,6 +28,7 @@  endif
 
 ifneq ($(CONFIG_LS1043A),)
 obj-$(CONFIG_SYS_HAS_SERDES) += ls1043a_serdes.o
+obj-$(CONFIG_ARMV8_PSCI) += ls1043a_psci.o
 endif
 
 ifneq ($(CONFIG_ARCH_LS1012A),)
diff --git a/arch/arm/cpu/armv8/fsl-layerscape/ls1043a_psci.S b/arch/arm/cpu/armv8/fsl-layerscape/ls1043a_psci.S
new file mode 100644
index 0000000..86045ac
--- /dev/null
+++ b/arch/arm/cpu/armv8/fsl-layerscape/ls1043a_psci.S
@@ -0,0 +1,20 @@ 
+/*
+ * Copyright 2016 Freescale Semiconductor, Inc.
+ * Author: Hongbo Zhang <hongbo.zhang@nxp.com>
+ *
+ * SPDX-License-Identifier:	GPL-2.0+
+ * This file implements LS102X platform PSCI SYSTEM-SUSPEND function
+ */
+
+#include <config.h>
+#include <linux/linkage.h>
+#include <asm/psci.h>
+
+	.pushsection ._secure.text, "ax"
+
+.globl	psci_version
+psci_version:
+	ldr	w0, =0x00010000		/* PSCI v1.0 */
+	ret
+
+	.popsection
diff --git a/board/freescale/ls1043ardb/Kconfig b/board/freescale/ls1043ardb/Kconfig
index 51818ec..0c596f9 100644
--- a/board/freescale/ls1043ardb/Kconfig
+++ b/board/freescale/ls1043ardb/Kconfig
@@ -13,4 +13,13 @@  config SYS_SOC
 config SYS_CONFIG_NAME
 	default "ls1043ardb"
 
+config SYS_HAS_ARMV8_SECURE_BASE
+	bool "Enable secure RAM for PSCI image"
+	depends on ARMV8_PSCI
+	default y
+	help
+	  PSCI image can be re-located to secure RAM.
+	  If enabled, please also define the value for ARMV8_SECURE_BASE,
+	  for LS1043ARDB, it is address in OCRAM.
+
 endif
diff --git a/configs/ls1043ardb_defconfig b/configs/ls1043ardb_defconfig
index 79a4eb2..cb189f3 100644
--- a/configs/ls1043ardb_defconfig
+++ b/configs/ls1043ardb_defconfig
@@ -28,3 +28,6 @@  CONFIG_DM_USB=y
 CONFIG_USB_XHCI_HCD=y
 CONFIG_USB_XHCI_DWC3=y
 CONFIG_USB_STORAGE=y
+CONFIG_ARMV8_PSCI=y
+CONFIG_ARMV8_PSCI_CPUS_PER_CLUSTER=4
+CONFIG_ARMV8_SECURE_BASE=0x10010000