[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Minios-devel] [UNIKRAFT PATCHv4 34/43] plat/common: Implement PSCI despatch functions for arm64


  • To: <minios-devel@xxxxxxxxxxxxxxxxxxxx>, <simon.kuenzer@xxxxxxxxx>
  • From: Wei Chen <Wei.Chen@xxxxxxx>
  • Date: Fri, 6 Jul 2018 09:03:47 +0000
  • Authentication-results: spf=fail (sender IP is 40.67.248.234) smtp.mailfrom=arm.com; lists.xenproject.org; dkim=none (message not signed) header.d=none;lists.xenproject.org; dmarc=none action=none header.from=arm.com;
  • Cc: Kaly.Xin@xxxxxxx, nd@xxxxxxx, wei.chen@xxxxxxx
  • Delivery-date: Fri, 06 Jul 2018 09:05:58 +0000
  • List-id: Mini-os development list <minios-devel.lists.xenproject.org>
  • Nodisclaimer: True
  • Spamdiagnosticmetadata: NSPM
  • Spamdiagnosticoutput: 1:99

Implement PSCI despatch functions for different conduits.
The platforms can select correct despatch function as the
PSCI conduit they are using.

Signed-off-by: Wei Chen <Wei.Chen@xxxxxxx>
---
 plat/common/arm/psci_arm64.S             | 20 ++++++++++++++++++++
 plat/common/include/arm/arm64/cpu.h      |  5 +++++
 plat/common/include/arm/arm64/cpu_defs.h | 14 ++++++++++++++
 3 files changed, 39 insertions(+)
 create mode 100644 plat/common/arm/psci_arm64.S

diff --git a/plat/common/arm/psci_arm64.S b/plat/common/arm/psci_arm64.S
new file mode 100644
index 0000000..eb3b7ac
--- /dev/null
+++ b/plat/common/arm/psci_arm64.S
@@ -0,0 +1,20 @@
+#include <uk/arch/limits.h>
+#include <arm/cpu_defs.h>
+
+/*
+ * Use HVC to call PSCI functions:
+ * uint64_t psci_hvc_call(uint64_t psci_func_id);
+ */
+ENTRY(psci_hvc_call)
+       hvc #0
+       ret
+END(psci_hvc_call)
+
+/*
+ * Use SMC to call PSCI functions:
+ * uint64_t psci_smc_call(uint64_t psci_func_id);
+ */
+ENTRY(psci_smc_call)
+       smc #0
+       ret
+END(psci_smc_call)
diff --git a/plat/common/include/arm/arm64/cpu.h 
b/plat/common/include/arm/arm64/cpu.h
index cf0f6a2..397c81f 100644
--- a/plat/common/include/arm/arm64/cpu.h
+++ b/plat/common/include/arm/arm64/cpu.h
@@ -72,6 +72,11 @@
                                        : : "r" ((uint64_t)(val)))
 
 
+/* PSCI conduit method to call functions */
+extern int psci_method;
+uint64_t psci_hvc_call(uint64_t psci_func_id);
+uint64_t psci_smc_call(uint64_t psci_func_id);
+
 /* PSCI conduit types */
 #define PSCI_METHOD_NONE       0x0
 #define PSCI_METHOD_HVC                0x1
diff --git a/plat/common/include/arm/arm64/cpu_defs.h 
b/plat/common/include/arm/arm64/cpu_defs.h
index 591d632..315d027 100644
--- a/plat/common/include/arm/arm64/cpu_defs.h
+++ b/plat/common/include/arm/arm64/cpu_defs.h
@@ -105,6 +105,20 @@ END(name)
 #define PSR_N          0x80000000
 #define PSR_FLAGS      0xf0000000
 
+/*
+ * Power State Coordination Interface (PSCI v0.2) function codes
+ */
+#define PSCI_FNID_VERSION              0x84000000
+#define PSCI_FNID_CPU_SUSPEND          0xc4000001
+#define PSCI_FNID_CPU_OFF              0x84000002
+#define PSCI_FNID_CPU_ON               0xc4000003
+#define PSCI_FNID_AFFINITY_INFO                0xc4000004
+#define PSCI_FNID_MIGRATE              0xc4000005
+#define PSCI_FNID_MIGRATE_INFO_TYPE    0x84000006
+#define PSCI_FNID_MIGRATE_INFO_UP_CPU  0xc4000007
+#define PSCI_FNID_SYSTEM_OFF           0x84000008
+#define PSCI_FNID_SYSTEM_RESET         0x84000009
+
 /*
  * The supported virtual address bits.
  * We will do 1:1 VA to PA Mapping, so we define the same address size
-- 
2.17.1


_______________________________________________
Minios-devel mailing list
Minios-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/minios-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.