Skip to contentSkip to conversation

Introduce AMD Seattle platform support

PATCH In review [email protected] 3 participants 9 messages Oct 2, 2014 – Oct 3, 2014

lore
Share & tools
lore
#0 lore raw

v3 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 in V3:
* PATCH 2/3:
- Add "seattle" in the docs/misc/arm/early-printk.txt (per Julien's request)
* PATCH 3/3:
- Misc clean up. No logic changed. (per Julien's request)

Changes in V2:
* 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

 docs/misc/arm/early-printk.txt   |  1 +
 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 | 65 ++++++++++++++++++++++++++++++++++++++++
 xen/include/asm-arm/gic.h        |  4 ++-
 6 files changed, 76 insertions(+), 1 deletion(-)
 create mode 100644 xen/arch/arm/platforms/seattle.c
Signature · 1 line
1.9.3
#1 lore raw

PATCH v3 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 v3 2/3 amd/seattle: Add early printk message for the platform

In reply to [email protected]

From: Suravee Suthikulpanit <[email protected]>

---
 docs/misc/arm/early-printk.txt | 1 +
 xen/arch/arm/Rules.mk          | 5 +++++
 2 files changed, 6 insertions(+)
docs/misc/arm/early-printk.txt +1 -0
index 1431751..f74e5cc 100644
@@ -16,6 +16,7 @@ where mach is the name of the machine:
   - omap5432: printk with UART3 on TI OMAP5432 processors
   - sun6i: printk with 8250 on Allwinner A31 processors
   - sun7i: printk with 8250 on Allwinner A20 processors
+  - seattle: printk with pl011 for AMD Seattle processor
 
 The base address and baud rate is hardcoded in xen/arch/arm/Rules.mk,
 see there when adding support for new machines.
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

PATCH v3 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 system_reset mechanism.

Initially, the firmware only support a subset of PSCI-0.2 functions, system-off and sytem-reset. The mechanism for bring up auxiliary processors is still using spin-table.

---
 xen/arch/arm/platforms/Makefile  |  1 +
 xen/arch/arm/platforms/seattle.c | 65 ++++++++++++++++++++++++++++++++++++++++
 2 files changed, 66 insertions(+)
 create mode 100644 xen/arch/arm/platforms/seattle.c
xen/arch/arm/platforms/Makefile +1 -0
index 680364f..e1fde6e 100644
@@ -3,4 +3,5 @@ obj-$(CONFIG_ARM_32) += exynos5.o
 obj-$(CONFIG_ARM_32) += midway.o
 obj-$(CONFIG_ARM_32) += omap5.o
 obj-$(CONFIG_ARM_32) += sunxi.o
+obj-$(CONFIG_ARM_64) += seattle.o
 obj-$(CONFIG_ARM_64) += xgene-storm.o
xen/arch/arm/platforms/seattle.c new file +65 -0

65 lines not on this page · raw message

Signature · 1 line
1.9.3
Reviewed-by on v3 3/3
#4 lore raw

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

Hi Suravee,

Quoted 11 lines · On 02/10/2014 22:25, [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 system_reset mechanism.

Initially, the firmware only support a subset of PSCI-0.2 functions, system-off and sytem-reset. The mechanism for bring up auxiliary processors is still using spin-table.

I let you decide for the smc call... So:

Regards,

Quoted 88 lines
---
  xen/arch/arm/platforms/Makefile  |  1 +
  xen/arch/arm/platforms/seattle.c | 65 ++++++++++++++++++++++++++++++++++++++++
  2 files changed, 66 insertions(+)

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

xen/arch/arm/platforms/Makefile +1 -0
index 680364f..e1fde6e 100644
@@ -3,4 +3,5 @@ obj-$(CONFIG_ARM_32) += exynos5.o
  obj-$(CONFIG_ARM_32) += midway.o
  obj-$(CONFIG_ARM_32) += omap5.o
  obj-$(CONFIG_ARM_32) += sunxi.o
+obj-$(CONFIG_ARM_64) += seattle.o
  obj-$(CONFIG_ARM_64) += xgene-storm.o
xen/arch/arm/platforms/seattle.c new file +65 -0
new file mode 100644
index 0000000..d298393
@@ -0,0 +1,65 @@
+/*
+ * 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>
+#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)
+{
+    asm volatile(
+        "smc #0"
+        : "+r" (func_id)
+        :);
+}
+
+static void seattle_system_reset(void)
+{
+    seattle_smc_psci(PSCI_0_2_FN_SYSTEM_RESET);
+}
+
+static void seattle_system_off(void)
+{
+    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,
+PLATFORM_END
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
Signature · 1 line
Julien Grall
#5 lore raw

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

In reply to [email protected]

Hi Suravee,

Quoted 9 lines · On 02/10/2014 22:25, [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 system_reset mechanism.

Initially, the firmware only support a subset of PSCI-0.2 functions, system-off and sytem-reset. The mechanism for bring up auxiliary processors is still using spin-table.

I forgot to ask, did you check that the grant-table mapping (by default mapped 0xb0000000-0xb0020000) doesn't overlap to the RAM or another device on your platform?

If it's the case I would define .dom0_gnttab_start and .dom0_gnttab_size.

Regards,

Quoted 89 lines
---
  xen/arch/arm/platforms/Makefile  |  1 +
  xen/arch/arm/platforms/seattle.c | 65 ++++++++++++++++++++++++++++++++++++++++
  2 files changed, 66 insertions(+)

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

xen/arch/arm/platforms/Makefile +1 -0
index 680364f..e1fde6e 100644
@@ -3,4 +3,5 @@ obj-$(CONFIG_ARM_32) += exynos5.o
  obj-$(CONFIG_ARM_32) += midway.o
  obj-$(CONFIG_ARM_32) += omap5.o
  obj-$(CONFIG_ARM_32) += sunxi.o
+obj-$(CONFIG_ARM_64) += seattle.o
  obj-$(CONFIG_ARM_64) += xgene-storm.o
xen/arch/arm/platforms/seattle.c new file +65 -0
new file mode 100644
index 0000000..d298393
@@ -0,0 +1,65 @@
+/*
+ * 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>
+#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)
+{
+    asm volatile(
+        "smc #0"
+        : "+r" (func_id)
+        :);
+}
+
+static void seattle_system_reset(void)
+{
+    seattle_smc_psci(PSCI_0_2_FN_SYSTEM_RESET);
+}
+
+static void seattle_system_off(void)
+{
+    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,
+PLATFORM_END
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
Signature · 1 line
Julien Grall
#6 lore raw

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

Quoted 7 lines · Julien Grall

I forgot to ask, did you check that the grant-table mapping (by default mapped 0xb0000000-0xb0020000) doesn't overlap to the RAM or another device on your platform?

If it's the case I would define .dom0_gnttab_start and .dom0_gnttab_size.

Regards,

Actually, the default mapping will be overlapped with where PCI MMIO region is supposed to be. Are there any restrictions on the location of this can be? (e.g below 4G, alignment, etc.)

Suravee

#7 lore raw

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

Quoted 6 lines · Suravee Suthikulpanit
Quoted 4 lines · Julien Grall

I forgot to ask, did you check that the grant-table mapping (by default mapped 0xb0000000-0xb0020000) doesn't overlap to the RAM or another device on your platform?

Quoted 7 lines
Quoted 3 lines

If it's the case I would define .dom0_gnttab_start and .dom0_gnttab_size.

Regards,

Actually, the default mapping will be overlapped with where PCI MMIO region is supposed to be. Are there any restrictions on the location of this can be? (e.g below 4G, alignment, etc.)

Not especially. Obviously it needs to be at an IPA which the guest can map, so if you expect to run 32-bit dom0 (or even if you don't expect but it is a possibility) then finding somewhere under 4GB would be nice to have.

Alignment can be whatever, but again it might be nice to make it somewhat naturally aligned.

We've got a plan to get rid of this annoying requirement to specify this manually in 4.6...

Ian.

#8 lore raw
In reply to [email protected]
Quoted 2 lines · On Thu, 2014-10-02 at 16:25 -0500, [email protected] wrote:

gicv2: Add compatibility id for gic-400 amd/seattle: Add early printk message for the platform

I acked + applied these two.

Quoted 1 line

amd/seattle: Initial revision of AMD Seattle support

This one LGTM but I thought it best to wait for the grant table address settings.

Ian.