firmware: arm_sdei: use common SMCCC_CONDUIT_*
authorMark Rutland <mark.rutland@arm.com>
Fri, 9 Aug 2019 13:22:44 +0000 (14:22 +0100)
committerCatalin Marinas <catalin.marinas@arm.com>
Mon, 14 Oct 2019 09:55:14 +0000 (10:55 +0100)
Now that we have common definitions for SMCCC conduits, move the SDEI
code over to them, and remove the SDEI-specific definitions.

There should be no functional change as a result of this patch.

Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Acked-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Acked-by: James Morse <james.morse@arm.com>
Acked-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
arch/arm64/kernel/sdei.c
drivers/firmware/arm_sdei.c
include/linux/arm_sdei.h

index ea94cf8..d6259da 100644 (file)
@@ -2,6 +2,7 @@
 // Copyright (C) 2017 Arm Ltd.
 #define pr_fmt(fmt) "sdei: " fmt
 
+#include <linux/arm-smccc.h>
 #include <linux/arm_sdei.h>
 #include <linux/hardirq.h>
 #include <linux/irqflags.h>
@@ -161,7 +162,7 @@ unsigned long sdei_arch_get_entry_point(int conduit)
                        return 0;
        }
 
-       sdei_exit_mode = (conduit == CONDUIT_HVC) ? SDEI_EXIT_HVC : SDEI_EXIT_SMC;
+       sdei_exit_mode = (conduit == SMCCC_CONDUIT_HVC) ? SDEI_EXIT_HVC : SDEI_EXIT_SMC;
 
 #ifdef CONFIG_UNMAP_KERNEL_AT_EL0
        if (arm64_kernel_unmapped_at_el0()) {
index 9cd70d1..a479023 100644 (file)
@@ -967,29 +967,29 @@ static int sdei_get_conduit(struct platform_device *pdev)
        if (np) {
                if (of_property_read_string(np, "method", &method)) {
                        pr_warn("missing \"method\" property\n");
-                       return CONDUIT_INVALID;
+                       return SMCCC_CONDUIT_NONE;
                }
 
                if (!strcmp("hvc", method)) {
                        sdei_firmware_call = &sdei_smccc_hvc;
-                       return CONDUIT_HVC;
+                       return SMCCC_CONDUIT_HVC;
                } else if (!strcmp("smc", method)) {
                        sdei_firmware_call = &sdei_smccc_smc;
-                       return CONDUIT_SMC;
+                       return SMCCC_CONDUIT_SMC;
                }
 
                pr_warn("invalid \"method\" property: %s\n", method);
        } else if (IS_ENABLED(CONFIG_ACPI) && !acpi_disabled) {
                if (acpi_psci_use_hvc()) {
                        sdei_firmware_call = &sdei_smccc_hvc;
-                       return CONDUIT_HVC;
+                       return SMCCC_CONDUIT_HVC;
                } else {
                        sdei_firmware_call = &sdei_smccc_smc;
-                       return CONDUIT_SMC;
+                       return SMCCC_CONDUIT_SMC;
                }
        }
 
-       return CONDUIT_INVALID;
+       return SMCCC_CONDUIT_NONE;
 }
 
 static int sdei_probe(struct platform_device *pdev)
index 3305ea7..0a241c5 100644 (file)
@@ -5,12 +5,6 @@
 
 #include <uapi/linux/arm_sdei.h>
 
-enum sdei_conduit_types {
-       CONDUIT_INVALID = 0,
-       CONDUIT_SMC,
-       CONDUIT_HVC,
-};
-
 #include <acpi/ghes.h>
 
 #ifdef CONFIG_ARM_SDE_INTERFACE