All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/4] Introduce AMD Seattle platform support
@ 2014-10-01  8:07 suravee.suthikulpanit
  2014-10-01  8:07 ` [PATCH 1/4] gicv2: Add compatibility id for gic-400 suravee.suthikulpanit
                   ` (3 more replies)
  0 siblings, 4 replies; 19+ messages in thread
From: suravee.suthikulpanit @ 2014-10-01  8:07 UTC (permalink / raw)
  To: stefano.stabellini, julien.grall, ian.campbell
  Cc: Suravee Suthikulpanit, xen-devel

From: Suravee Suthikulpanit <Suravee.Suthikulpanit@amd.com>

This patch series introduce minimal support for AMD Seattle system.
This has been tested to boot into dom0 and domU.

The is platform currently using spintable as multi-core booting protocol.
However, it supports only system_off and system_reset from PSCI-0.2.

It also defines GIC-400 device-tree matching string.

Suravee Suthikulpanit (4):
  gicv2: Add compatibility id for gic-400
  amd/seattle: Add early printk message for the platform
  xen/arm: Add PSCI system_off and system_reset support
  amd/seattle: Initial revision of AMD Seattle support

 xen/arch/arm/Rules.mk            |  5 ++++
 xen/arch/arm/gic-v2.c            |  1 +
 xen/arch/arm/platforms/Makefile  |  1 +
 xen/arch/arm/platforms/seattle.c | 50 ++++++++++++++++++++++++++++++++++++++++
 xen/arch/arm/psci.c              | 10 ++++++++
 xen/arch/arm/shutdown.c          | 16 ++++++++-----
 xen/include/asm-arm/gic.h        |  4 +++-
 xen/include/asm-arm/psci.h       |  2 ++
 8 files changed, 82 insertions(+), 7 deletions(-)
 create mode 100644 xen/arch/arm/platforms/seattle.c

-- 
1.9.3

^ permalink raw reply	[flat|nested] 19+ messages in thread

* [PATCH 1/4] gicv2: Add compatibility id for gic-400
  2014-10-01  8:07 [PATCH 0/4] Introduce AMD Seattle platform support suravee.suthikulpanit
@ 2014-10-01  8:07 ` suravee.suthikulpanit
  2014-10-01  9:54   ` Stefano Stabellini
  2014-10-01 14:41   ` Julien Grall
  2014-10-01  8:07 ` [PATCH 2/4] amd/seattle: Add early printk message for the platform suravee.suthikulpanit
                   ` (2 subsequent siblings)
  3 siblings, 2 replies; 19+ messages in thread
From: suravee.suthikulpanit @ 2014-10-01  8:07 UTC (permalink / raw)
  To: stefano.stabellini, julien.grall, ian.campbell
  Cc: Suravee Suthikulpanit, xen-devel

From: Suravee Suthikulpanit <Suravee.Suthikulpanit@amd.com>

Introducing "arm,gic-400" device-tree matching string

Signed-off-by: Suravee Suthikulpanit <Suravee.Suthikulpanit@amd.com>
---
 xen/arch/arm/gic-v2.c     | 1 +
 xen/include/asm-arm/gic.h | 4 +++-
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/xen/arch/arm/gic-v2.c b/xen/arch/arm/gic-v2.c
index f053b5d..faad1ff 100644
--- a/xen/arch/arm/gic-v2.c
+++ b/xen/arch/arm/gic-v2.c
@@ -768,6 +768,7 @@ static const char * const gicv2_dt_compat[] __initconst =
 {
     DT_COMPAT_GIC_CORTEX_A15,
     DT_COMPAT_GIC_CORTEX_A7,
+    DT_COMPAT_GIC_400,
     NULL
 };
 
diff --git a/xen/include/asm-arm/gic.h b/xen/include/asm-arm/gic.h
index 51a0a26..187dc46 100644
--- a/xen/include/asm-arm/gic.h
+++ b/xen/include/asm-arm/gic.h
@@ -152,11 +152,13 @@
 #include <xen/irq.h>
 #include <asm-arm/vgic.h>
 
+#define DT_COMPAT_GIC_400            "arm,gic-400"
 #define DT_COMPAT_GIC_CORTEX_A15     "arm,cortex-a15-gic"
 #define DT_COMPAT_GIC_CORTEX_A7      "arm,cortex-a7-gic"
 
 #define DT_MATCH_GIC_V2 DT_MATCH_COMPATIBLE(DT_COMPAT_GIC_CORTEX_A15), \
-                        DT_MATCH_COMPATIBLE(DT_COMPAT_GIC_CORTEX_A7)
+                        DT_MATCH_COMPATIBLE(DT_COMPAT_GIC_CORTEX_A7), \
+                        DT_MATCH_COMPATIBLE(DT_COMPAT_GIC_400)
 
 #define DT_COMPAT_GIC_V3             "arm,gic-v3"
 
-- 
1.9.3

^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [PATCH 2/4] amd/seattle: Add early printk message for the platform
  2014-10-01  8:07 [PATCH 0/4] Introduce AMD Seattle platform support suravee.suthikulpanit
  2014-10-01  8:07 ` [PATCH 1/4] gicv2: Add compatibility id for gic-400 suravee.suthikulpanit
@ 2014-10-01  8:07 ` suravee.suthikulpanit
  2014-10-01  9:55   ` Stefano Stabellini
  2014-10-01 14:43   ` Julien Grall
  2014-10-01  8:07 ` [PATCH 3/4] xen/arm: Add PSCI system_off and system_reset support suravee.suthikulpanit
  2014-10-01  8:07 ` [PATCH 4/4] amd/seattle: Initial revision of AMD Seattle support suravee.suthikulpanit
  3 siblings, 2 replies; 19+ messages in thread
From: suravee.suthikulpanit @ 2014-10-01  8:07 UTC (permalink / raw)
  To: stefano.stabellini, julien.grall, ian.campbell
  Cc: Suravee Suthikulpanit, xen-devel

From: Suravee Suthikulpanit <Suravee.Suthikulpanit@amd.com>

Signed-off-by: Suravee Suthikulpanit <Suravee.Suthikulpanit@amd.com>
---
 xen/arch/arm/Rules.mk | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/xen/arch/arm/Rules.mk b/xen/arch/arm/Rules.mk
index 26fafa2..35b6253 100644
--- a/xen/arch/arm/Rules.mk
+++ b/xen/arch/arm/Rules.mk
@@ -100,6 +100,11 @@ EARLY_PRINTK_INC := pl011
 EARLY_PRINTK_BAUD := 115200
 EARLY_UART_BASE_ADDRESS := 0x7ff80000
 endif
+ifeq ($(CONFIG_EARLY_PRINTK), seattle)
+EARLY_PRINTK_INC := pl011
+EARLY_PRINTK_BAUD := 115200
+EARLY_UART_BASE_ADDRESS := 0xe1010000
+endif
 
 ifneq ($(EARLY_PRINTK_INC),)
 EARLY_PRINTK := y
-- 
1.9.3

^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [PATCH 3/4] xen/arm: Add PSCI system_off and system_reset support
  2014-10-01  8:07 [PATCH 0/4] Introduce AMD Seattle platform support suravee.suthikulpanit
  2014-10-01  8:07 ` [PATCH 1/4] gicv2: Add compatibility id for gic-400 suravee.suthikulpanit
  2014-10-01  8:07 ` [PATCH 2/4] amd/seattle: Add early printk message for the platform suravee.suthikulpanit
@ 2014-10-01  8:07 ` suravee.suthikulpanit
  2014-10-01 10:07   ` Stefano Stabellini
  2014-10-01  8:07 ` [PATCH 4/4] amd/seattle: Initial revision of AMD Seattle support suravee.suthikulpanit
  3 siblings, 1 reply; 19+ messages in thread
From: suravee.suthikulpanit @ 2014-10-01  8:07 UTC (permalink / raw)
  To: stefano.stabellini, julien.grall, ian.campbell
  Cc: Suravee Suthikulpanit, xen-devel

From: Suravee Suthikulpanit <Suravee.Suthikulpanit@amd.com>

This patch adds SMC calls to suport PSCI-0.2 system_off and system_reset,
It also adds a call to platform_power_off in machine_halt(). This would
allow platform, which implements PSCI-0.2 to properly handle system off
and reset.

Signed-off-by: Suravee Suthikulpanit <Suravee.Suthikulpanit@amd.com>
---
 xen/arch/arm/psci.c        | 10 ++++++++++
 xen/arch/arm/shutdown.c    | 16 ++++++++++------
 xen/include/asm-arm/psci.h |  2 ++
 3 files changed, 22 insertions(+), 6 deletions(-)

diff --git a/xen/arch/arm/psci.c b/xen/arch/arm/psci.c
index b6360d5..b0d94a8 100644
--- a/xen/arch/arm/psci.c
+++ b/xen/arch/arm/psci.c
@@ -58,6 +58,16 @@ int call_psci_cpu_on(int cpu)
                                 cpu_logical_map(cpu), __pa(init_secondary), 0);
 }
 
+void call_psci_system_off(void)
+{
+    __invoke_psci_fn_smc(PSCI_0_2_FN_SYSTEM_OFF, 0, 0, 0);
+}
+
+void call_psci_system_reset(void)
+{
+    __invoke_psci_fn_smc(PSCI_0_2_FN_SYSTEM_RESET, 0, 0, 0);
+}
+
 int __init psci_init(void)
 {
     const struct dt_device_node *psci;
diff --git a/xen/arch/arm/shutdown.c b/xen/arch/arm/shutdown.c
index adc0529..2f63674 100644
--- a/xen/arch/arm/shutdown.c
+++ b/xen/arch/arm/shutdown.c
@@ -6,11 +6,6 @@
 #include <xen/smp.h>
 #include <asm/platform.h>
 
-static void raw_machine_reset(void)
-{
-    platform_reset();
-}
-
 static void noreturn halt_this_cpu(void *arg)
 {
     stop_cpu();
@@ -18,10 +13,19 @@ static void noreturn halt_this_cpu(void *arg)
 
 void machine_halt(void)
 {
+    int timeout = 10;
+
     watchdog_disable();
     console_start_sync();
     local_irq_enable();
     smp_call_function(halt_this_cpu, NULL, 0);
+    local_irq_disable();
+
+    /* Wait at most another 10ms for all other CPUs to go offline. */
+    while ( (num_online_cpus() > 1) && (timeout-- > 0) )
+        mdelay(1);
+
+    platform_poweroff();
     halt_this_cpu(NULL);
 }
 
@@ -41,7 +45,7 @@ void machine_restart(unsigned int delay_millisecs)
 
     while ( 1 )
     {
-        raw_machine_reset();
+        platform_reset();
         mdelay(100);
     }
 }
diff --git a/xen/include/asm-arm/psci.h b/xen/include/asm-arm/psci.h
index 9777c03..de00ee2 100644
--- a/xen/include/asm-arm/psci.h
+++ b/xen/include/asm-arm/psci.h
@@ -17,6 +17,8 @@ extern bool_t psci_available;
 
 int psci_init(void);
 int call_psci_cpu_on(int cpu);
+void call_psci_system_off(void);
+void call_psci_system_reset(void);
 
 /* functions to handle guest PSCI requests */
 int32_t do_psci_cpu_on(uint32_t vcpuid, register_t entry_point);
-- 
1.9.3

^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [PATCH 4/4] amd/seattle: Initial revision of AMD Seattle support
  2014-10-01  8:07 [PATCH 0/4] Introduce AMD Seattle platform support suravee.suthikulpanit
                   ` (2 preceding siblings ...)
  2014-10-01  8:07 ` [PATCH 3/4] xen/arm: Add PSCI system_off and system_reset support suravee.suthikulpanit
@ 2014-10-01  8:07 ` suravee.suthikulpanit
  2014-10-01 10:10   ` Stefano Stabellini
  3 siblings, 1 reply; 19+ messages in thread
From: suravee.suthikulpanit @ 2014-10-01  8:07 UTC (permalink / raw)
  To: stefano.stabellini, julien.grall, ian.campbell
  Cc: Suravee Suthikulpanit, xen-devel

From: Suravee Suthikulpanit <Suravee.Suthikulpanit@amd.com>

This patch add inital (minimal) platform support for AMD Seattle,
which mainly just define the matching ID, and specify system_off,
and sytem_reset mechanism.

Initially, the firmware only support a subset of PSCI-0.2 functions,
system-off and sytem-reset. The boot protocol is still using spin-table.

Signed-off-by: Suravee Suthikulpanit <Suravee.Suthikulpanit@amd.com>
---
 xen/arch/arm/platforms/Makefile  |  1 +
 xen/arch/arm/platforms/seattle.c | 50 ++++++++++++++++++++++++++++++++++++++++
 2 files changed, 51 insertions(+)
 create mode 100644 xen/arch/arm/platforms/seattle.c

diff --git a/xen/arch/arm/platforms/Makefile b/xen/arch/arm/platforms/Makefile
index 680364f..03e7a14 100644
--- a/xen/arch/arm/platforms/Makefile
+++ b/xen/arch/arm/platforms/Makefile
@@ -4,3 +4,4 @@ obj-$(CONFIG_ARM_32) += midway.o
 obj-$(CONFIG_ARM_32) += omap5.o
 obj-$(CONFIG_ARM_32) += sunxi.o
 obj-$(CONFIG_ARM_64) += xgene-storm.o
+obj-$(CONFIG_ARM_64) += seattle.o
diff --git a/xen/arch/arm/platforms/seattle.c b/xen/arch/arm/platforms/seattle.c
new file mode 100644
index 0000000..e9a5ecf
--- /dev/null
+++ b/xen/arch/arm/platforms/seattle.c
@@ -0,0 +1,50 @@
+/*
+ * xen/arch/arm/seattle.c
+ *
+ * AMD Seattle specific settings
+ *
+ * Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
+ * Copyright (c) 2014 Advance Micro Devices Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ */
+
+#include <asm/platform.h>
+#include <xen/mm.h>
+#include <xen/vmap.h>
+#include <asm/io.h>
+#include <asm/gic.h>
+#include <asm/psci.h>
+
+static const char * const seattle_dt_compat[] __initconst =
+{
+    "amd,seattle",
+    NULL
+};
+
+/* Seattle firmware only implement PSCI handler for
+ * system off and system reset. This is temporary
+ * until full PSCI-0.2 is supported.
+ */
+PLATFORM_START(seattle, "SEATTLE")
+    .compatible = seattle_dt_compat,
+    .reset      = call_psci_system_reset,
+    .poweroff   = call_psci_system_off,
+PLATFORM_END
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
-- 
1.9.3

^ permalink raw reply related	[flat|nested] 19+ messages in thread

* Re: [PATCH 1/4] gicv2: Add compatibility id for gic-400
  2014-10-01  8:07 ` [PATCH 1/4] gicv2: Add compatibility id for gic-400 suravee.suthikulpanit
@ 2014-10-01  9:54   ` Stefano Stabellini
  2014-10-01 14:41   ` Julien Grall
  1 sibling, 0 replies; 19+ messages in thread
From: Stefano Stabellini @ 2014-10-01  9:54 UTC (permalink / raw)
  To: Suravee Suthikulpanit
  Cc: julien.grall, xen-devel, ian.campbell, stefano.stabellini

On Wed, 1 Oct 2014, suravee.suthikulpanit@amd.com wrote:
> From: Suravee Suthikulpanit <Suravee.Suthikulpanit@amd.com>
> 
> Introducing "arm,gic-400" device-tree matching string
> 
> Signed-off-by: Suravee Suthikulpanit <Suravee.Suthikulpanit@amd.com>

Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>


>  xen/arch/arm/gic-v2.c     | 1 +
>  xen/include/asm-arm/gic.h | 4 +++-
>  2 files changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/xen/arch/arm/gic-v2.c b/xen/arch/arm/gic-v2.c
> index f053b5d..faad1ff 100644
> --- a/xen/arch/arm/gic-v2.c
> +++ b/xen/arch/arm/gic-v2.c
> @@ -768,6 +768,7 @@ static const char * const gicv2_dt_compat[] __initconst =
>  {
>      DT_COMPAT_GIC_CORTEX_A15,
>      DT_COMPAT_GIC_CORTEX_A7,
> +    DT_COMPAT_GIC_400,
>      NULL
>  };
>  
> diff --git a/xen/include/asm-arm/gic.h b/xen/include/asm-arm/gic.h
> index 51a0a26..187dc46 100644
> --- a/xen/include/asm-arm/gic.h
> +++ b/xen/include/asm-arm/gic.h
> @@ -152,11 +152,13 @@
>  #include <xen/irq.h>
>  #include <asm-arm/vgic.h>
>  
> +#define DT_COMPAT_GIC_400            "arm,gic-400"
>  #define DT_COMPAT_GIC_CORTEX_A15     "arm,cortex-a15-gic"
>  #define DT_COMPAT_GIC_CORTEX_A7      "arm,cortex-a7-gic"
>  
>  #define DT_MATCH_GIC_V2 DT_MATCH_COMPATIBLE(DT_COMPAT_GIC_CORTEX_A15), \
> -                        DT_MATCH_COMPATIBLE(DT_COMPAT_GIC_CORTEX_A7)
> +                        DT_MATCH_COMPATIBLE(DT_COMPAT_GIC_CORTEX_A7), \
> +                        DT_MATCH_COMPATIBLE(DT_COMPAT_GIC_400)
>  
>  #define DT_COMPAT_GIC_V3             "arm,gic-v3"
>  
> -- 
> 1.9.3
> 

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH 2/4] amd/seattle: Add early printk message for the platform
  2014-10-01  8:07 ` [PATCH 2/4] amd/seattle: Add early printk message for the platform suravee.suthikulpanit
@ 2014-10-01  9:55   ` Stefano Stabellini
  2014-10-01 14:43   ` Julien Grall
  1 sibling, 0 replies; 19+ messages in thread
From: Stefano Stabellini @ 2014-10-01  9:55 UTC (permalink / raw)
  To: Suravee Suthikulpanit
  Cc: julien.grall, xen-devel, ian.campbell, stefano.stabellini

On Wed, 1 Oct 2014, suravee.suthikulpanit@amd.com wrote:
> From: Suravee Suthikulpanit <Suravee.Suthikulpanit@amd.com>
> 
> Signed-off-by: Suravee Suthikulpanit <Suravee.Suthikulpanit@amd.com>

Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>


>  xen/arch/arm/Rules.mk | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/xen/arch/arm/Rules.mk b/xen/arch/arm/Rules.mk
> index 26fafa2..35b6253 100644
> --- a/xen/arch/arm/Rules.mk
> +++ b/xen/arch/arm/Rules.mk
> @@ -100,6 +100,11 @@ EARLY_PRINTK_INC := pl011
>  EARLY_PRINTK_BAUD := 115200
>  EARLY_UART_BASE_ADDRESS := 0x7ff80000
>  endif
> +ifeq ($(CONFIG_EARLY_PRINTK), seattle)
> +EARLY_PRINTK_INC := pl011
> +EARLY_PRINTK_BAUD := 115200
> +EARLY_UART_BASE_ADDRESS := 0xe1010000
> +endif
>  
>  ifneq ($(EARLY_PRINTK_INC),)
>  EARLY_PRINTK := y
> -- 
> 1.9.3
> 

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH 3/4] xen/arm: Add PSCI system_off and system_reset support
  2014-10-01  8:07 ` [PATCH 3/4] xen/arm: Add PSCI system_off and system_reset support suravee.suthikulpanit
@ 2014-10-01 10:07   ` Stefano Stabellini
  2014-10-01 10:26     ` Ian Campbell
  2014-10-01 14:04     ` Ian Campbell
  0 siblings, 2 replies; 19+ messages in thread
From: Stefano Stabellini @ 2014-10-01 10:07 UTC (permalink / raw)
  To: Suravee Suthikulpanit
  Cc: julien.grall, xen-devel, ian.campbell, stefano.stabellini

On Wed, 1 Oct 2014, suravee.suthikulpanit@amd.com wrote:
> From: Suravee Suthikulpanit <Suravee.Suthikulpanit@amd.com>
> 
> This patch adds SMC calls to suport PSCI-0.2 system_off and system_reset,
> It also adds a call to platform_power_off in machine_halt(). This would
> allow platform, which implements PSCI-0.2 to properly handle system off
> and reset.
> 
> Signed-off-by: Suravee Suthikulpanit <Suravee.Suthikulpanit@amd.com>
> ---
>  xen/arch/arm/psci.c        | 10 ++++++++++
>  xen/arch/arm/shutdown.c    | 16 ++++++++++------
>  xen/include/asm-arm/psci.h |  2 ++
>  3 files changed, 22 insertions(+), 6 deletions(-)
> 
> diff --git a/xen/arch/arm/psci.c b/xen/arch/arm/psci.c
> index b6360d5..b0d94a8 100644
> --- a/xen/arch/arm/psci.c
> +++ b/xen/arch/arm/psci.c
> @@ -58,6 +58,16 @@ int call_psci_cpu_on(int cpu)
>                                  cpu_logical_map(cpu), __pa(init_secondary), 0);
>  }
>  
> +void call_psci_system_off(void)
> +{
> +    __invoke_psci_fn_smc(PSCI_0_2_FN_SYSTEM_OFF, 0, 0, 0);
> +}
> +
> +void call_psci_system_reset(void)
> +{
> +    __invoke_psci_fn_smc(PSCI_0_2_FN_SYSTEM_RESET, 0, 0, 0);
> +}

This assumes PSCI 0.2 but actually the cpu_on function is still reading
the id from device tree.
Could you please change that too for uniformity?


>  int __init psci_init(void)
>  {
>      const struct dt_device_node *psci;
> diff --git a/xen/arch/arm/shutdown.c b/xen/arch/arm/shutdown.c
> index adc0529..2f63674 100644
> --- a/xen/arch/arm/shutdown.c
> +++ b/xen/arch/arm/shutdown.c
> @@ -6,11 +6,6 @@
>  #include <xen/smp.h>
>  #include <asm/platform.h>
>  
> -static void raw_machine_reset(void)
> -{
> -    platform_reset();
> -}

Please mention this change in the commit message.


>  static void noreturn halt_this_cpu(void *arg)
>  {
>      stop_cpu();
> @@ -18,10 +13,19 @@ static void noreturn halt_this_cpu(void *arg)
>  
>  void machine_halt(void)
>  {
> +    int timeout = 10;
> +
>      watchdog_disable();
>      console_start_sync();
>      local_irq_enable();
>      smp_call_function(halt_this_cpu, NULL, 0);
> +    local_irq_disable();
> +
> +    /* Wait at most another 10ms for all other CPUs to go offline. */
> +    while ( (num_online_cpus() > 1) && (timeout-- > 0) )
> +        mdelay(1);
> +
> +    platform_poweroff();
>      halt_this_cpu(NULL);
>  }
>  
> @@ -41,7 +45,7 @@ void machine_restart(unsigned int delay_millisecs)
>  
>      while ( 1 )
>      {
> -        raw_machine_reset();
> +        platform_reset();
>          mdelay(100);
>      }
>  }
> diff --git a/xen/include/asm-arm/psci.h b/xen/include/asm-arm/psci.h
> index 9777c03..de00ee2 100644
> --- a/xen/include/asm-arm/psci.h
> +++ b/xen/include/asm-arm/psci.h
> @@ -17,6 +17,8 @@ extern bool_t psci_available;
>  
>  int psci_init(void);
>  int call_psci_cpu_on(int cpu);
> +void call_psci_system_off(void);
> +void call_psci_system_reset(void);
>  
>  /* functions to handle guest PSCI requests */
>  int32_t do_psci_cpu_on(uint32_t vcpuid, register_t entry_point);
> -- 
> 1.9.3
> 

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH 4/4] amd/seattle: Initial revision of AMD Seattle support
  2014-10-01  8:07 ` [PATCH 4/4] amd/seattle: Initial revision of AMD Seattle support suravee.suthikulpanit
@ 2014-10-01 10:10   ` Stefano Stabellini
  2014-10-01 19:21     ` Suravee Suthikulanit
  0 siblings, 1 reply; 19+ messages in thread
From: Stefano Stabellini @ 2014-10-01 10:10 UTC (permalink / raw)
  To: Suravee Suthikulpanit
  Cc: julien.grall, xen-devel, ian.campbell, stefano.stabellini

On Wed, 1 Oct 2014, suravee.suthikulpanit@amd.com wrote:
> From: Suravee Suthikulpanit <Suravee.Suthikulpanit@amd.com>
> 
> This patch add inital (minimal) platform support for AMD Seattle,
> which mainly just define the matching ID, and specify system_off,
> and sytem_reset mechanism.
> 
> Initially, the firmware only support a subset of PSCI-0.2 functions,
> system-off and sytem-reset. The boot protocol is still using spin-table.

In that case, aren't you missing

cpu_up = cpu_up_send_sgi

?

Or are you just going to assume that the firmware is going to be updated
to support full PSCI 0.2?


> Signed-off-by: Suravee Suthikulpanit <Suravee.Suthikulpanit@amd.com>
> 
>  xen/arch/arm/platforms/Makefile  |  1 +
>  xen/arch/arm/platforms/seattle.c | 50 ++++++++++++++++++++++++++++++++++++++++
>  2 files changed, 51 insertions(+)
>  create mode 100644 xen/arch/arm/platforms/seattle.c
> 
> diff --git a/xen/arch/arm/platforms/Makefile b/xen/arch/arm/platforms/Makefile
> index 680364f..03e7a14 100644
> --- a/xen/arch/arm/platforms/Makefile
> +++ b/xen/arch/arm/platforms/Makefile
> @@ -4,3 +4,4 @@ obj-$(CONFIG_ARM_32) += midway.o
>  obj-$(CONFIG_ARM_32) += omap5.o
>  obj-$(CONFIG_ARM_32) += sunxi.o
>  obj-$(CONFIG_ARM_64) += xgene-storm.o
> +obj-$(CONFIG_ARM_64) += seattle.o
> diff --git a/xen/arch/arm/platforms/seattle.c b/xen/arch/arm/platforms/seattle.c
> new file mode 100644
> index 0000000..e9a5ecf
> --- /dev/null
> +++ b/xen/arch/arm/platforms/seattle.c
> @@ -0,0 +1,50 @@
> +/*
> + * xen/arch/arm/seattle.c
> + *
> + * AMD Seattle specific settings
> + *
> + * Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
> + * Copyright (c) 2014 Advance Micro Devices Inc.
> + *
> + * This program is free software; you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License as published by
> + * the Free Software Foundation; either version 2 of the License, or
> + * (at your option) any later version.
> + *
> + * This program is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> + * GNU General Public License for more details.
> + */
> +
> +#include <asm/platform.h>
> +#include <xen/mm.h>
> +#include <xen/vmap.h>
> +#include <asm/io.h>
> +#include <asm/gic.h>
> +#include <asm/psci.h>
> +
> +static const char * const seattle_dt_compat[] __initconst =
> +{
> +    "amd,seattle",
> +    NULL
> +};
> +
> +/* Seattle firmware only implement PSCI handler for
> + * system off and system reset. This is temporary
> + * until full PSCI-0.2 is supported.
> + */
> +PLATFORM_START(seattle, "SEATTLE")
> +    .compatible = seattle_dt_compat,
> +    .reset      = call_psci_system_reset,
> +    .poweroff   = call_psci_system_off,
> +PLATFORM_END
> +
> +/*
> + * Local variables:
> + * mode: C
> + * c-file-style: "BSD"
> + * c-basic-offset: 4
> + * indent-tabs-mode: nil
> + * End:
> + */
> -- 
> 1.9.3
> 

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH 3/4] xen/arm: Add PSCI system_off and system_reset support
  2014-10-01 10:07   ` Stefano Stabellini
@ 2014-10-01 10:26     ` Ian Campbell
  2014-10-01 14:15       ` Suravee Suthikulpanit
  2014-10-01 14:04     ` Ian Campbell
  1 sibling, 1 reply; 19+ messages in thread
From: Ian Campbell @ 2014-10-01 10:26 UTC (permalink / raw)
  To: Stefano Stabellini; +Cc: julien.grall, Suravee Suthikulpanit, xen-devel

On Wed, 2014-10-01 at 11:07 +0100, Stefano Stabellini wrote:
> > diff --git a/xen/arch/arm/psci.c b/xen/arch/arm/psci.c
> > index b6360d5..b0d94a8 100644
> > --- a/xen/arch/arm/psci.c
> > +++ b/xen/arch/arm/psci.c
> > @@ -58,6 +58,16 @@ int call_psci_cpu_on(int cpu)
> >                                  cpu_logical_map(cpu), __pa(init_secondary), 0);
> >  }
> >  
> > +void call_psci_system_off(void)
> > +{
> > +    __invoke_psci_fn_smc(PSCI_0_2_FN_SYSTEM_OFF, 0, 0, 0);
> > +}
> > +
> > +void call_psci_system_reset(void)
> > +{
> > +    __invoke_psci_fn_smc(PSCI_0_2_FN_SYSTEM_RESET, 0, 0, 0);
> > +}
> 
> This assumes PSCI 0.2 but actually the cpu_on function is still reading
> the id from device tree.
> Could you please change that too for uniformity?

There's actually quite a bit more required, detecting the DT compat
string for v0.2 and following the updated bindings for that case.

Having done that we need to use the 0.2 function ids for the existing
calls too. And these new calls need to check that 0.2 is present and
fail on 0.1.

Ian.

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH 3/4] xen/arm: Add PSCI system_off and system_reset support
  2014-10-01 10:07   ` Stefano Stabellini
  2014-10-01 10:26     ` Ian Campbell
@ 2014-10-01 14:04     ` Ian Campbell
  1 sibling, 0 replies; 19+ messages in thread
From: Ian Campbell @ 2014-10-01 14:04 UTC (permalink / raw)
  To: Stefano Stabellini; +Cc: julien.grall, Suravee Suthikulpanit, xen-devel

On Wed, 2014-10-01 at 11:07 +0100, Stefano Stabellini wrote:
> > diff --git a/xen/arch/arm/shutdown.c b/xen/arch/arm/shutdown.c
> > index adc0529..2f63674 100644
> > --- a/xen/arch/arm/shutdown.c
> > +++ b/xen/arch/arm/shutdown.c
> > @@ -6,11 +6,6 @@
> >  #include <xen/smp.h>
> >  #include <asm/platform.h>
> >  
> > -static void raw_machine_reset(void)
> > -{
> > -    platform_reset();
> > -}
> 
> Please mention this change in the commit message.

Actually, since this is going to need a freeze exception I think it
would be good to split into individual commits which separately:
        Refactor raw_machine_reset
        (Re)Implement machine_halt
        Introduce whatever PSCI stuff is needed.

That'll make it easier to reason about and make an argument for.

BTW I'm in favour of trying to get this stuff in for 4.5.

Ian.

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH 3/4] xen/arm: Add PSCI system_off and system_reset support
  2014-10-01 10:26     ` Ian Campbell
@ 2014-10-01 14:15       ` Suravee Suthikulpanit
  2014-10-01 14:46         ` Ian Campbell
  0 siblings, 1 reply; 19+ messages in thread
From: Suravee Suthikulpanit @ 2014-10-01 14:15 UTC (permalink / raw)
  To: Ian Campbell, Stefano Stabellini; +Cc: julien.grall, xen-devel



On 10/01/2014 05:26 AM, Ian Campbell wrote:
> On Wed, 2014-10-01 at 11:07 +0100, Stefano Stabellini wrote:
>>> diff --git a/xen/arch/arm/psci.c b/xen/arch/arm/psci.c
>>> index b6360d5..b0d94a8 100644
>>> --- a/xen/arch/arm/psci.c
>>> +++ b/xen/arch/arm/psci.c
>>> @@ -58,6 +58,16 @@ int call_psci_cpu_on(int cpu)
>>>                                   cpu_logical_map(cpu), __pa(init_secondary), 0);
>>>   }
>>>
>>> +void call_psci_system_off(void)
>>> +{
>>> +    __invoke_psci_fn_smc(PSCI_0_2_FN_SYSTEM_OFF, 0, 0, 0);
>>> +}
>>> +
>>> +void call_psci_system_reset(void)
>>> +{
>>> +    __invoke_psci_fn_smc(PSCI_0_2_FN_SYSTEM_RESET, 0, 0, 0);
>>> +}
>>
>> This assumes PSCI 0.2 but actually the cpu_on function is still reading
>> the id from device tree.
>> Could you please change that too for uniformity?

Sure, I can add that.

>
> There's actually quite a bit more required, detecting the DT compat
> string for v0.2 and following the updated bindings for that case.
>
> Having done that we need to use the 0.2 function ids for the existing
> calls too. And these new calls need to check that 0.2 is present and
> fail on 0.1.
>
> Ian.
>

So, it seems that minimally, we would need support for all PSCI-0.2 
functions except MIGRATION. Also, once the system uses "arm,psci-0.2", 
the power_off and reset code path should hook into the PSCI interface by 
default.Does this sound right?

However, for Seattle, I would still need to provide the 
"platform.[reset|poweroff] ops since it's not full PSCI-0.2 (yet).

Suravee

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH 1/4] gicv2: Add compatibility id for gic-400
  2014-10-01  8:07 ` [PATCH 1/4] gicv2: Add compatibility id for gic-400 suravee.suthikulpanit
  2014-10-01  9:54   ` Stefano Stabellini
@ 2014-10-01 14:41   ` Julien Grall
  1 sibling, 0 replies; 19+ messages in thread
From: Julien Grall @ 2014-10-01 14:41 UTC (permalink / raw)
  To: suravee.suthikulpanit, stefano.stabellini, ian.campbell; +Cc: xen-devel

Hi Suravee,

On 10/01/2014 09:07 AM, suravee.suthikulpanit@amd.com wrote:
> From: Suravee Suthikulpanit <Suravee.Suthikulpanit@amd.com>
> 
> Introducing "arm,gic-400" device-tree matching string
> 
> Signed-off-by: Suravee Suthikulpanit <Suravee.Suthikulpanit@amd.com>
Reviewed-by: Julien Grall <julien.grall@linaro.org>

Regards,

-- 
Julien Grall

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH 2/4] amd/seattle: Add early printk message for the platform
  2014-10-01  8:07 ` [PATCH 2/4] amd/seattle: Add early printk message for the platform suravee.suthikulpanit
  2014-10-01  9:55   ` Stefano Stabellini
@ 2014-10-01 14:43   ` Julien Grall
  1 sibling, 0 replies; 19+ messages in thread
From: Julien Grall @ 2014-10-01 14:43 UTC (permalink / raw)
  To: suravee.suthikulpanit, stefano.stabellini, ian.campbell; +Cc: xen-devel

Hi Suravee,

On 10/01/2014 09:07 AM, suravee.suthikulpanit@amd.com wrote:
> From: Suravee Suthikulpanit <Suravee.Suthikulpanit@amd.com>
> 
> Signed-off-by: Suravee Suthikulpanit <Suravee.Suthikulpanit@amd.com>

Reviewed-by: Julien Grall <julien.grall@linaro.org>

Regards,

-- 
Julien Grall

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH 3/4] xen/arm: Add PSCI system_off and system_reset support
  2014-10-01 14:15       ` Suravee Suthikulpanit
@ 2014-10-01 14:46         ` Ian Campbell
  2014-10-01 17:58           ` Suravee Suthikulanit
  0 siblings, 1 reply; 19+ messages in thread
From: Ian Campbell @ 2014-10-01 14:46 UTC (permalink / raw)
  To: Suravee Suthikulpanit; +Cc: julien.grall, xen-devel, Stefano Stabellini

On Wed, 2014-10-01 at 09:15 -0500, Suravee Suthikulpanit wrote:
> 
> On 10/01/2014 05:26 AM, Ian Campbell wrote:
> > On Wed, 2014-10-01 at 11:07 +0100, Stefano Stabellini wrote:
> >>> diff --git a/xen/arch/arm/psci.c b/xen/arch/arm/psci.c
> >>> index b6360d5..b0d94a8 100644
> >>> --- a/xen/arch/arm/psci.c
> >>> +++ b/xen/arch/arm/psci.c
> >>> @@ -58,6 +58,16 @@ int call_psci_cpu_on(int cpu)
> >>>                                   cpu_logical_map(cpu), __pa(init_secondary), 0);
> >>>   }
> >>>
> >>> +void call_psci_system_off(void)
> >>> +{
> >>> +    __invoke_psci_fn_smc(PSCI_0_2_FN_SYSTEM_OFF, 0, 0, 0);
> >>> +}
> >>> +
> >>> +void call_psci_system_reset(void)
> >>> +{
> >>> +    __invoke_psci_fn_smc(PSCI_0_2_FN_SYSTEM_RESET, 0, 0, 0);
> >>> +}
> >>
> >> This assumes PSCI 0.2 but actually the cpu_on function is still reading
> >> the id from device tree.
> >> Could you please change that too for uniformity?
> 
> Sure, I can add that.
> 
> >
> > There's actually quite a bit more required, detecting the DT compat
> > string for v0.2 and following the updated bindings for that case.
> >
> > Having done that we need to use the 0.2 function ids for the existing
> > calls too. And these new calls need to check that 0.2 is present and
> > fail on 0.1.
> >
> > Ian.
> >
> 
> So, it seems that minimally, we would need support for all PSCI-0.2 
> functions except MIGRATION. Also, once the system uses "arm,psci-0.2", 
> the power_off and reset code path should hook into the PSCI interface by 
> default.Does this sound right?

Yes.

> However, for Seattle, I would still need to provide the 
> "platform.[reset|poweroff] ops since it's not full PSCI-0.2 (yet).

OOI is it also PSCI-0.1 compatible? 

Implementing the full PSCI 0.2 support is the thing I'm more worried
about wrt the release, since it is likely to be the large bit of new
work and it might not meet with Release Manager approval.

Ian.

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH 3/4] xen/arm: Add PSCI system_off and system_reset support
  2014-10-01 14:46         ` Ian Campbell
@ 2014-10-01 17:58           ` Suravee Suthikulanit
  2014-10-02  8:28             ` Ian Campbell
  0 siblings, 1 reply; 19+ messages in thread
From: Suravee Suthikulanit @ 2014-10-01 17:58 UTC (permalink / raw)
  To: Ian Campbell; +Cc: julien.grall, xen-devel, Stefano Stabellini

On 10/1/2014 9:46 AM, Ian Campbell wrote:
> On Wed, 2014-10-01 at 09:15 -0500, Suravee Suthikulpanit wrote:
>>
>> On 10/01/2014 05:26 AM, Ian Campbell wrote:
>>> On Wed, 2014-10-01 at 11:07 +0100, Stefano Stabellini wrote:
>>>>> diff --git a/xen/arch/arm/psci.c b/xen/arch/arm/psci.c
>>>>> index b6360d5..b0d94a8 100644
>>>>> --- a/xen/arch/arm/psci.c
>>>>> +++ b/xen/arch/arm/psci.c
>>>>> @@ -58,6 +58,16 @@ int call_psci_cpu_on(int cpu)
>>>>>                                    cpu_logical_map(cpu), __pa(init_secondary), 0);
>>>>>    }
>>>>>
>>>>> +void call_psci_system_off(void)
>>>>> +{
>>>>> +    __invoke_psci_fn_smc(PSCI_0_2_FN_SYSTEM_OFF, 0, 0, 0);
>>>>> +}
>>>>> +
>>>>> +void call_psci_system_reset(void)
>>>>> +{
>>>>> +    __invoke_psci_fn_smc(PSCI_0_2_FN_SYSTEM_RESET, 0, 0, 0);
>>>>> +}
>>>>
>>>> This assumes PSCI 0.2 but actually the cpu_on function is still reading
>>>> the id from device tree.
>>>> Could you please change that too for uniformity?
>>
>> Sure, I can add that.
>>
>>>
>>> There's actually quite a bit more required, detecting the DT compat
>>> string for v0.2 and following the updated bindings for that case.
>>>
>>> Having done that we need to use the 0.2 function ids for the existing
>>> calls too. And these new calls need to check that 0.2 is present and
>>> fail on 0.1.
>>>
>>> Ian.
>>>
>>
>> So, it seems that minimally, we would need support for all PSCI-0.2
>> functions except MIGRATION. Also, once the system uses "arm,psci-0.2",
>> the power_off and reset code path should hook into the PSCI interface by
>> default.Does this sound right?
>
> Yes.
>
>> However, for Seattle, I would still need to provide the
>> "platform.[reset|poweroff] ops since it's not full PSCI-0.2 (yet).
>
> OOI is it also PSCI-0.1 compatible?
>
> Implementing the full PSCI 0.2 support is the thing I'm more worried
> about wrt the release, since it is likely to be the large bit of new
> work and it might not meet with Release Manager approval.
>
> Ian.
>
No, the only functions the firmware handles are just the system_off / 
system_reset (work in progress).

If you concern about changes to the PSCI subsystem, I could probably 
just making SMC call directly the platforms/seattle.c, until we have 
full PSCI-0.2 support ready in the arch/arm/psci.c

Suravee

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH 4/4] amd/seattle: Initial revision of AMD Seattle support
  2014-10-01 10:10   ` Stefano Stabellini
@ 2014-10-01 19:21     ` Suravee Suthikulanit
  2014-10-02  9:10       ` Stefano Stabellini
  0 siblings, 1 reply; 19+ messages in thread
From: Suravee Suthikulanit @ 2014-10-01 19:21 UTC (permalink / raw)
  To: Stefano Stabellini; +Cc: julien.grall, ian.campbell, xen-devel

On 10/1/2014 5:10 AM, Stefano Stabellini wrote:
> On Wed, 1 Oct 2014, suravee.suthikulpanit@amd.com wrote:
>> From: Suravee Suthikulpanit <Suravee.Suthikulpanit@amd.com>
>>
>> This patch add inital (minimal) platform support for AMD Seattle,
>> which mainly just define the matching ID, and specify system_off,
>> and sytem_reset mechanism.
>>
>> Initially, the firmware only support a subset of PSCI-0.2 functions,
>> system-off and sytem-reset. The boot protocol is still using spin-table.
>
> In that case, aren't you missing
>
> cpu_up = cpu_up_send_sgi
>
> ?
>
> Or are you just going to assume that the firmware is going to be updated
> to support full PSCI 0.2?

I thought the platform_cpu_up() is only called from the 
arch/arm/arm32/smpboot.c. Is it also used for ARM64?

And yes, the firmware will support full PSCI-0.2 eventually.

Thanks,

Suravee

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH 3/4] xen/arm: Add PSCI system_off and system_reset support
  2014-10-01 17:58           ` Suravee Suthikulanit
@ 2014-10-02  8:28             ` Ian Campbell
  0 siblings, 0 replies; 19+ messages in thread
From: Ian Campbell @ 2014-10-02  8:28 UTC (permalink / raw)
  To: Suravee Suthikulanit; +Cc: julien.grall, xen-devel, Stefano Stabellini

On Wed, 2014-10-01 at 12:58 -0500, Suravee Suthikulanit wrote:
> No, the only functions the firmware handles are just the system_off / 
> system_reset (work in progress).
> 
> If you concern about changes to the PSCI subsystem, I could probably 
> just making SMC call directly the platforms/seattle.c, until we have 
> full PSCI-0.2 support ready in the arch/arm/psci.c

Having glanced at your newer series with stuff split out I'm much less
worried than I was. I'll try and have a proper look today.

Ian.

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH 4/4] amd/seattle: Initial revision of AMD Seattle support
  2014-10-01 19:21     ` Suravee Suthikulanit
@ 2014-10-02  9:10       ` Stefano Stabellini
  0 siblings, 0 replies; 19+ messages in thread
From: Stefano Stabellini @ 2014-10-02  9:10 UTC (permalink / raw)
  To: Suravee Suthikulanit
  Cc: julien.grall, xen-devel, ian.campbell, Stefano Stabellini

On Wed, 1 Oct 2014, Suravee Suthikulanit wrote:
> On 10/1/2014 5:10 AM, Stefano Stabellini wrote:
> > On Wed, 1 Oct 2014, suravee.suthikulpanit@amd.com wrote:
> > > From: Suravee Suthikulpanit <Suravee.Suthikulpanit@amd.com>
> > > 
> > > This patch add inital (minimal) platform support for AMD Seattle,
> > > which mainly just define the matching ID, and specify system_off,
> > > and sytem_reset mechanism.
> > > 
> > > Initially, the firmware only support a subset of PSCI-0.2 functions,
> > > system-off and sytem-reset. The boot protocol is still using spin-table.
> > 
> > In that case, aren't you missing
> > 
> > cpu_up = cpu_up_send_sgi
> > 
> > ?
> > 
> > Or are you just going to assume that the firmware is going to be updated
> > to support full PSCI 0.2?
> 
> I thought the platform_cpu_up() is only called from the
> arch/arm/arm32/smpboot.c. Is it also used for ARM64?

You are right, on arm64 we just look at enable-method



> And yes, the firmware will support full PSCI-0.2 eventually.
> 
> Thanks,
> 
> Suravee
> 
>

^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2014-10-02  9:10 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-10-01  8:07 [PATCH 0/4] Introduce AMD Seattle platform support suravee.suthikulpanit
2014-10-01  8:07 ` [PATCH 1/4] gicv2: Add compatibility id for gic-400 suravee.suthikulpanit
2014-10-01  9:54   ` Stefano Stabellini
2014-10-01 14:41   ` Julien Grall
2014-10-01  8:07 ` [PATCH 2/4] amd/seattle: Add early printk message for the platform suravee.suthikulpanit
2014-10-01  9:55   ` Stefano Stabellini
2014-10-01 14:43   ` Julien Grall
2014-10-01  8:07 ` [PATCH 3/4] xen/arm: Add PSCI system_off and system_reset support suravee.suthikulpanit
2014-10-01 10:07   ` Stefano Stabellini
2014-10-01 10:26     ` Ian Campbell
2014-10-01 14:15       ` Suravee Suthikulpanit
2014-10-01 14:46         ` Ian Campbell
2014-10-01 17:58           ` Suravee Suthikulanit
2014-10-02  8:28             ` Ian Campbell
2014-10-01 14:04     ` Ian Campbell
2014-10-01  8:07 ` [PATCH 4/4] amd/seattle: Initial revision of AMD Seattle support suravee.suthikulpanit
2014-10-01 10:10   ` Stefano Stabellini
2014-10-01 19:21     ` Suravee Suthikulanit
2014-10-02  9:10       ` Stefano Stabellini

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.