]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commitdiff
ARM: trusted_foundations: Provide information about whether firmware is registered
authorDmitry Osipenko <digetx@gmail.com>
Sun, 17 Mar 2019 22:52:06 +0000 (01:52 +0300)
committerThierry Reding <treding@nvidia.com>
Tue, 9 Apr 2019 14:36:22 +0000 (16:36 +0200)
Add a helper that provides information about whether Trusted Foundations
firmware operations have been registered.

Tested-by: Robert Yang <decatf@gmail.com>
Tested-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
arch/arm/firmware/trusted_foundations.c
arch/arm/include/asm/trusted_foundations.h

index 720904a43c00d93f61e5be340792caa5e3dcaab6..bb2ee73d9e0217b72c82c51191269f692a592592 100644 (file)
@@ -167,3 +167,8 @@ void of_register_trusted_foundations(void)
                panic("Trusted Foundation: missing version-minor property\n");
        register_trusted_foundations(&pdata);
 }
+
+bool trusted_foundations_registered(void)
+{
+       return firmware_ops == &trusted_foundations_ops;
+}
index 201ceb259e71fc9c02b96e23207a019d110bec3d..54513c5338119c81f2f6dcc4d17cf9b381cb0cc4 100644 (file)
@@ -31,6 +31,7 @@
 #include <linux/of.h>
 #include <linux/cpu.h>
 #include <linux/smp.h>
+#include <linux/types.h>
 
 #include <asm/hardware/cache-l2x0.h>
 #include <asm/outercache.h>
@@ -50,6 +51,7 @@ struct trusted_foundations_platform_data {
 
 void register_trusted_foundations(struct trusted_foundations_platform_data *pd);
 void of_register_trusted_foundations(void);
+bool trusted_foundations_registered(void);
 
 #else /* CONFIG_TRUSTED_FOUNDATIONS */
 static inline void tf_dummy_write_sec(unsigned long val, unsigned int reg)
@@ -84,6 +86,11 @@ static inline void of_register_trusted_foundations(void)
        if (of_find_compatible_node(NULL, NULL, "tlm,trusted-foundations"))
                register_trusted_foundations(NULL);
 }
+
+static inline bool trusted_foundations_registered(void)
+{
+       return false;
+}
 #endif /* CONFIG_TRUSTED_FOUNDATIONS */
 
 #endif