Skip to contentSkip to conversation

Introduce AMD Seattle platform support

PATCH Superseded [email protected] 4 participants 13 messages Oct 1, 2014 – Oct 2, 2014

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

v2 cover Introduce AMD Seattle platform support

From: Suravee Suthikulpanit <[email protected]>

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 does supports system_off and system_reset from PSCI-0.2. The firmware will support full PSCI-0.2 supports (except MIGRATION) in the future.

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

Changes from V1:
* Remove dependency of system_off/reset of the Seattle platform from PSCI subsystem.
* PSCI stuff is not re-submitted as a separate patch series.

Suravee Suthikulpanit (3):
gicv2: Add compatibility id for gic-400 amd/seattle: Add early printk message for the platform 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 | 69 ++++++++++++++++++++++++++++++++++++++++
 xen/include/asm-arm/gic.h        |  4 ++-
 5 files changed, 79 insertions(+), 1 deletion(-)
 create mode 100644 xen/arch/arm/platforms/seattle.c
Signature · 1 line
1.9.3
#1 lore raw

PATCH v2 1/3 gicv2: Add compatibility id for gic-400

From: Suravee Suthikulpanit <[email protected]>

---
 xen/arch/arm/gic-v2.c     | 1 +
 xen/include/asm-arm/gic.h | 4 +++-
 2 files changed, 4 insertions(+), 1 deletion(-)
xen/arch/arm/gic-v2.c +1 -0
index f053b5d..faad1ff 100644
@@ -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
 };
 
xen/include/asm-arm/gic.h +3 -1
index 51a0a26..187dc46 100644
@@ -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"
 
Signature · 1 line
1.9.3
#2 lore raw

PATCH v2 2/3 amd/seattle: Add early printk message for the platform

In reply to [email protected]

From: Suravee Suthikulpanit <[email protected]>

---
 xen/arch/arm/Rules.mk | 5 +++++
 1 file changed, 5 insertions(+)
xen/arch/arm/Rules.mk +5 -0
index 26fafa2..35b6253 100644
@@ -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
Signature · 1 line
1.9.3
#3 lore raw

Re: [V2 2/3] amd/seattle: Add early printk message for the platform

Hi Suravee,

Quoted 8 lines · On 10/01/2014 08:51 PM, [email protected] wrote:

From: Suravee Suthikulpanit <[email protected]>

---
 xen/arch/arm/Rules.mk | 5 +++++
 1 file changed, 5 insertions(+)

Just noticed, could you update docs/misc/arm/early-printk.txt to add an entry for your board?

Thanks,

Quoted 17 lines
xen/arch/arm/Rules.mk +5 -0
index 26fafa2..35b6253 100644
@@ -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
Signature · 1 line
Julien Grall
#4 lore raw

Re: [V2 2/3] amd/seattle: Add early printk message for the platform

Quoted 13 lines · Julien Grall

Hi Suravee,

Quoted 8 lines · On 10/01/2014 08:51 PM, [email protected] wrote:

From: Suravee Suthikulpanit <[email protected]>

---
  xen/arch/arm/Rules.mk | 5 +++++
  1 file changed, 5 insertions(+)
Quoted 5 lines

Just noticed, could you update docs/misc/arm/early-printk.txt to add an entry for your board?

Thanks,

Done.

Suravee

#5 lore raw

PATCH v2 3/3 amd/seattle: Initial revision of AMD Seattle support

In reply to [email protected]

From: Suravee Suthikulpanit <[email protected]>

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.

---
 xen/arch/arm/platforms/Makefile  |  1 +
 xen/arch/arm/platforms/seattle.c | 69 ++++++++++++++++++++++++++++++++++++++++
 2 files changed, 70 insertions(+)
 create mode 100644 xen/arch/arm/platforms/seattle.c
xen/arch/arm/platforms/Makefile +1 -0
index 680364f..03e7a14 100644
@@ -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
xen/arch/arm/platforms/seattle.c new file +69 -0

69 lines not on this page · raw message

Signature · 1 line
1.9.3
#6 lore raw

Re: [V2 3/3] amd/seattle: Initial revision of AMD Seattle support

Hi Suravee,

Quoted 8 lines · On 10/01/2014 08:51 PM, [email protected] wrote:

From: Suravee Suthikulpanit <[email protected]>

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.

s/sytem-reset/system-reset/

I find "the boot protocol" not clear, I guess you are talking about CPU bring up. Maybe something like "CPU management ..." will be better?

Quoted 13 lines
---
 xen/arch/arm/platforms/Makefile  |  1 +
 xen/arch/arm/platforms/seattle.c | 69 ++++++++++++++++++++++++++++++++++++++++
 2 files changed, 70 insertions(+)
 create mode 100644 xen/arch/arm/platforms/seattle.c
xen/arch/arm/platforms/Makefile +0 -0
index 680364f..03e7a14 100644

xen/arch/arm/platforms/Makefile obj-$(CONFIG_ARM_32) += midway.o · line 7

Quoted 4 lines
xen/arch/arm/platforms/Makefile +1 -0
@@ -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

NIT: Could we order the platform name alphabetically? i.e move "seattle.o" just above "xgene-storm.o".

Quoted 21 lines
xen/arch/arm/platforms/seattle.c new file +15 -0
new file mode 100644
index 0000000..06d4e99
@@ -0,0 +1,69 @@
+/*
+ * xen/arch/arm/seattle.c
+ *
+ * AMD Seattle specific settings
+ *
+ * Suravee Suthikulpanit <[email protected]>
+ * 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

xen/arch/arm/platforms/seattle.c line 24

Quoted 10 lines
xen/arch/arm/platforms/seattle.c new file +9 -0
+ * 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>

I don't think those 4 includes are required here.

Quoted 10 lines
xen/arch/arm/platforms/seattle.c new file +10 -0
+#include <asm/psci.h>
+
+static const char * const seattle_dt_compat[] __initconst =
+{
+    "amd,seattle",
+    NULL
+};
+
+/* Seattle firmware only implements PSCI handler for
+ * system off and system reset at this point.

xen/arch/arm/platforms/seattle.c line 44

Quoted 10 lines
xen/arch/arm/platforms/seattle.c new file +10 -0
+ * This is temporary until full PSCI-0.2 is supported.
+ * Then, these function will be removed.
+ */
+static noinline void seattle_smc_psci(register_t func_id)
+{
+    asm volatile(
+        "smc #0"
+        : "+r" (func_id)
+        :);
+}

We already have multiple implementation of smc in different place. Can we provide a common function rather than adding another one?

Quoted 1 line

+static noinline void seattle_system_reset(void)

noinline is not necessary here.

xen/arch/arm/platforms/seattle.c line 51

Quoted 5 lines
xen/arch/arm/platforms/seattle.c new file +5 -0
+{
+    seattle_smc_psci(PSCI_0_2_FN_SYSTEM_RESET);
+}
+
+static noinline void seattle_system_off(void)

ditto

Quoted 9 lines
xen/arch/arm/platforms/seattle.c new file +8 -0
+{
+    seattle_smc_psci(PSCI_0_2_FN_SYSTEM_OFF);
+}
+
+PLATFORM_START(seattle, "SEATTLE")
+    .compatible = seattle_dt_compat,
+    .reset      = seattle_system_reset,
+    .poweroff   = seattle_system_off,

xen/arch/arm/platforms/seattle.c line 69

Quoted 10 lines
xen/arch/arm/platforms/seattle.c new file +10 -0
+PLATFORM_END
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * End:
+ */

Regards,

Signature · 1 line
Julien Grall
#7 lore raw

Re: [V2 3/3] amd/seattle: Initial revision of AMD Seattle support

Please see comments inline below.

Quoted 5 lines · Julien Grall

Hi Suravee,

Quoted 2 lines · On 10/01/2014 08:51 PM, [email protected] wrote:

From: Suravee Suthikulpanit <[email protected]>

Quoted 8 lines
Quoted 6 lines

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.

s/sytem-reset/system-reset/

Ah... Thanks

Quoted 4 lines

I find "the boot protocol" not clear, I guess you are talking about CPU bring up. Maybe something like "CPU management ..." will be better?

Reword to: "The mechanism for bring up auxiliary processors is still using spin-table."

Quoted 8 lines
Quoted 8 lines
---
  xen/arch/arm/platforms/Makefile  |  1 +
  xen/arch/arm/platforms/seattle.c | 69 ++++++++++++++++++++++++++++++++++++++++
  2 files changed, 70 insertions(+)

create mode 100644 xen/arch/arm/platforms/seattle.c

Quoted 12 lines

xen/arch/arm/platforms/Makefile obj-$(CONFIG_ARM_32) += midway.o · line 7

Quoted 9 lines
xen/arch/arm/platforms/Makefile +1 -0
index 680364f..03e7a14 100644
@@ -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

NIT: Could we order the platform name alphabetically? i.e move "seattle.o" just above "xgene-storm.o".

Done

Quoted 27 lines
Quoted 26 lines
xen/arch/arm/platforms/seattle.c new file +20 -0
new file mode 100644
index 0000000..06d4e99
@@ -0,0 +1,69 @@
+/*
+ * xen/arch/arm/seattle.c
+ *
+ * AMD Seattle specific settings
+ *
+ * Suravee Suthikulpanit <[email protected]>
+ * 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>
Quoted 6 lines

xen/arch/arm/platforms/seattle.c line 24

Quoted 4 lines
xen/arch/arm/platforms/seattle.c new file +4 -0
+#include <xen/mm.h>
+#include <xen/vmap.h>
+#include <asm/io.h>
+#include <asm/gic.h>

I don't think those 4 includes are required here.

Done.

Quoted 15 lines
Quoted 15 lines
xen/arch/arm/platforms/seattle.c new file +15 -0
+#include <asm/psci.h>
+
+static const char * const seattle_dt_compat[] __initconst =
+{
+    "amd,seattle",
+    NULL
+};
+
+/* Seattle firmware only implements PSCI handler for
+ * system off and system reset at this point.
+ * This is temporary until full PSCI-0.2 is supported.
+ * Then, these function will be removed.
+ */
+static noinline void seattle_smc_psci(register_t func_id)
+{
Quoted 8 lines

xen/arch/arm/platforms/seattle.c line 44

Quoted 5 lines
xen/arch/arm/platforms/seattle.c new file +5 -0
+    asm volatile(
+        "smc #0"
+        : "+r" (func_id)
+        :);
+}

We already have multiple implementation of smc in different place. Can we provide a common function rather than adding another one?

The only place I found this is in the arch/arm/psci.c, which is used mainly for the PSCI stuff. I can declare that one as non-static, and use it here in the seattle.c.

Suravee

#8 lore raw

Re: [V2 3/3] amd/seattle: Initial revision of AMD Seattle support

Quoted 24 lines · Suravee Suthikulpanit
Quoted 15 lines
Quoted 15 lines
xen/arch/arm/platforms/seattle.c new file +15 -0
+#include <asm/psci.h>
+
+static const char * const seattle_dt_compat[] __initconst =
+{
+    "amd,seattle",
+    NULL
+};
+
+/* Seattle firmware only implements PSCI handler for
+ * system off and system reset at this point.
+ * This is temporary until full PSCI-0.2 is supported.
+ * Then, these function will be removed.
+ */
+static noinline void seattle_smc_psci(register_t func_id)
+{
Quoted 8 lines

xen/arch/arm/platforms/seattle.c line 44

Quoted 5 lines
xen/arch/arm/platforms/seattle.c new file +5 -0
+    asm volatile(
+        "smc #0"
+        : "+r" (func_id)
+        :);
+}

We already have multiple implementation of smc in different place. Can we provide a common function rather than adding another one?

Quoted 5 lines

The only place I found this is in the arch/arm/psci.c, which is used mainly for the PSCI stuff. I can declare that one as non-static, and use it here in the seattle.c.

Suravee

Julien,

Actually, think about this again, I would rather keep this independent from the other PSCI patch series, which might not make it into 4.5. It is small enough and probably not too terrible to keep this.

Thanks,

Suravee

#9 lore raw

Re: [V2 3/3] amd/seattle: Initial revision of AMD Seattle support

Quoted 6 lines · Suravee Suthikulpanit
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

+ * This is temporary until full PSCI-0.2 is supported.
+ * Then, these function will be removed.

Actually, think about this again, I would rather keep this independent from the other PSCI patch series, which might not make it into 4.5. It is small enough and probably not too terrible to keep this.

Given the comment about the temporary nature it is IMHO fine to keep this as is until proper PSCI-0.2 support lands.

Ian.

#10 lore raw

Re: [V2 3/3] amd/seattle: Initial revision of AMD Seattle support

In reply to Suravee Suthikulpanit
Quoted 31 lines · Suravee Suthikulpanit
Quoted 28 lines · Suravee Suthikulpanit
Quoted 15 lines
Quoted 15 lines
xen/arch/arm/platforms/seattle.c new file +15 -0
+#include <asm/psci.h>
+
+static const char * const seattle_dt_compat[] __initconst =
+{
+    "amd,seattle",
+    NULL
+};
+
+/* Seattle firmware only implements PSCI handler for
+ * system off and system reset at this point.
+ * This is temporary until full PSCI-0.2 is supported.
+ * Then, these function will be removed.
+ */
+static noinline void seattle_smc_psci(register_t func_id)
+{
Quoted 8 lines

xen/arch/arm/platforms/seattle.c line 44

Quoted 5 lines
xen/arch/arm/platforms/seattle.c new file +5 -0
+    asm volatile(
+        "smc #0"
+        : "+r" (func_id)
+        :);
+}

We already have multiple implementation of smc in different place. Can we provide a common function rather than adding another one?

The only place I found this is in the arch/arm/psci.c, which is used mainly for the PSCI stuff. I can declare that one as non-static, and use it here in the seattle.c.

Quoted 7 lines
Quoted 1 line

Suravee

Julien,

Actually, think about this again, I would rather keep this independent from the other PSCI patch series, which might not make it into 4.5. It is small enough and probably not too terrible to keep this.

There is also one in xen/arch/arm/platforms/exynos.c (exynos_smc).

Moving this patch could be part of this series and I don't think it would be a showstopper for accepting it in 4.5.

Ian, any though?

Regards,

Signature · 1 line
Julien Grall
#11 lore raw
In reply to [email protected]

On Wed, 2014-10-01 at 14:51 -0500, [email protected] wrote:

Since we are post feature freeze this needs an ack from the release manager, Konrad CCd.

Konrad, this is similar to the bcm series in that the only damage it can do is to the new platform being added. I think we should take it for 4.5.

Quoted 30 lines

From: Suravee Suthikulpanit <[email protected]>

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 does supports system_off and system_reset from PSCI-0.2. The firmware will support full PSCI-0.2 supports (except MIGRATION) in the future.

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

Changes from V1:
* Remove dependency of system_off/reset of the Seattle platform from PSCI subsystem.
* PSCI stuff is not re-submitted as a separate patch series.

Suravee Suthikulpanit (3):
gicv2: Add compatibility id for gic-400 amd/seattle: Add early printk message for the platform 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 | 69 ++++++++++++++++++++++++++++++++++++++++
 xen/include/asm-arm/gic.h        |  4 ++-
 5 files changed, 79 insertions(+), 1 deletion(-)
 create mode 100644 xen/arch/arm/platforms/seattle.c
#12 lore raw
Quoted 8 lines · Ian Campbell

On Wed, 2014-10-01 at 14:51 -0500, [email protected] wrote:

Since we are post feature freeze this needs an ack from the release manager, Konrad CCd.

Konrad, this is similar to the bcm series in that the only damage it can do is to the new platform being added. I think we should take it for 4.5.

Quoted 33 lines
Quoted 31 lines

From: Suravee Suthikulpanit <[email protected]>

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 does supports system_off and system_reset from PSCI-0.2. The firmware will support full PSCI-0.2 supports (except MIGRATION) in the future.

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

Changes from V1:
* Remove dependency of system_off/reset of the Seattle platform from PSCI subsystem.
* PSCI stuff is not re-submitted as a separate patch series.

Suravee Suthikulpanit (3):
gicv2: Add compatibility id for gic-400 amd/seattle: Add early printk message for the platform 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 | 69 ++++++++++++++++++++++++++++++++++++++++
 xen/include/asm-arm/gic.h        |  4 ++-
 5 files changed, 79 insertions(+), 1 deletion(-)
 create mode 100644 xen/arch/arm/platforms/seattle.c