This source file includes following definitions.
- tf_dummy_write_sec
- register_trusted_foundations
- of_register_trusted_foundations
- trusted_foundations_registered
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 #ifndef __FIRMWARE_TRUSTED_FOUNDATIONS_H
18 #define __FIRMWARE_TRUSTED_FOUNDATIONS_H
19
20 #include <linux/printk.h>
21 #include <linux/bug.h>
22 #include <linux/of.h>
23 #include <linux/cpu.h>
24 #include <linux/smp.h>
25 #include <linux/types.h>
26
27 #include <asm/hardware/cache-l2x0.h>
28 #include <asm/outercache.h>
29
30 #define TF_PM_MODE_LP0 0
31 #define TF_PM_MODE_LP1 1
32 #define TF_PM_MODE_LP1_NO_MC_CLK 2
33 #define TF_PM_MODE_LP2 3
34 #define TF_PM_MODE_LP2_NOFLUSH_L2 4
35
36 struct trusted_foundations_platform_data {
37 unsigned int version_major;
38 unsigned int version_minor;
39 };
40
41 #if IS_ENABLED(CONFIG_TRUSTED_FOUNDATIONS)
42
43 void register_trusted_foundations(struct trusted_foundations_platform_data *pd);
44 void of_register_trusted_foundations(void);
45 bool trusted_foundations_registered(void);
46
47 #else
48 static inline void tf_dummy_write_sec(unsigned long val, unsigned int reg)
49 {
50 }
51
52 static inline void register_trusted_foundations(
53 struct trusted_foundations_platform_data *pd)
54 {
55
56
57
58
59 pr_err("No support for Trusted Foundations, continuing in degraded mode.\n");
60 pr_err("Secondary processors as well as CPU PM will be disabled.\n");
61 #if IS_ENABLED(CONFIG_CACHE_L2X0)
62 pr_err("L2X0 cache will be kept disabled.\n");
63 outer_cache.write_sec = tf_dummy_write_sec;
64 #endif
65 #if IS_ENABLED(CONFIG_SMP)
66 setup_max_cpus = 0;
67 #endif
68 cpu_idle_poll_ctrl(true);
69 }
70
71 static inline void of_register_trusted_foundations(void)
72 {
73
74
75
76
77 if (of_find_compatible_node(NULL, NULL, "tlm,trusted-foundations"))
78 register_trusted_foundations(NULL);
79 }
80
81 static inline bool trusted_foundations_registered(void)
82 {
83 return false;
84 }
85 #endif
86
87 #endif