]> xenbits.xensource.com Git - xen.git/commitdiff
xen/arm: introduce platform_smc
authorEdgar E. Iglesias <edgar.iglesias@xilinx.com>
Tue, 18 Dec 2018 23:32:45 +0000 (15:32 -0800)
committerJulien Grall <julien.grall@arm.com>
Wed, 19 Dec 2018 13:48:51 +0000 (13:48 +0000)
Introduce platform_smc as a way to handle firmware calls that Xen does
not know about in a platform specific way. This is particularly useful
for implementing the SiP (SoC implementation specific) service calls.

Signed-off-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
Signed-off-by: Stefano Stabellini <stefanos@xilinx.com>
Acked-by: Julien Grall <julien.grall@arm.com>
xen/arch/arm/platform.c
xen/arch/arm/vsmc.c
xen/include/asm-arm/platform.h

index 0ba200164f91f8532c34f25bdafedca059bad556..8eb0b6e57a5a784f9ca6ff8e199e024382594963 100644 (file)
@@ -127,6 +127,14 @@ void platform_poweroff(void)
         platform->poweroff();
 }
 
+bool platform_smc(struct cpu_user_regs *regs)
+{
+    if ( likely(platform && platform->smc) )
+        return platform->smc(regs);
+
+    return false;
+}
+
 bool platform_has_quirk(uint32_t quirk)
 {
     uint32_t quirks = 0;
index c4ccae603052965aab9408c93411b4e914183c8c..c72b9a04ff767972b26868afec5103b5cb5f7422 100644 (file)
@@ -25,6 +25,7 @@
 #include <asm/smccc.h>
 #include <asm/traps.h>
 #include <asm/vpsci.h>
+#include <asm/platform.h>
 
 /* Number of functions currently supported by Hypervisor Service. */
 #define XEN_SMCCC_FUNCTION_COUNT 3
@@ -272,6 +273,9 @@ static bool vsmccc_handle_call(struct cpu_user_regs *regs)
         case ARM_SMCCC_OWNER_STANDARD:
             handled = handle_sssc(regs);
             break;
+        case ARM_SMCCC_OWNER_SIP:
+            handled = platform_smc(regs);
+            break;
         }
     }
 
index bf9258156c4324798aa96a26b49d8913ff72eb22..ed4d30a1be7cb1b30101ad70a28db4acfdbea25a 100644 (file)
@@ -25,6 +25,8 @@ struct platform_desc {
     void (*reset)(void);
     /* Platform power-off */
     void (*poweroff)(void);
+    /* Platform specific SMC handler */
+    bool (*smc)(struct cpu_user_regs *regs);
     /*
      * Platform quirks
      * Defined has a function because a platform can support multiple
@@ -54,6 +56,7 @@ int platform_cpu_up(int cpu);
 #endif
 void platform_reset(void);
 void platform_poweroff(void);
+bool platform_smc(struct cpu_user_regs *regs);
 bool platform_has_quirk(uint32_t quirk);
 bool platform_device_is_blacklisted(const struct dt_device_node *node);