This source file includes following definitions.
- disable_sfi
- sfi_init
- sfi_init_late
- sfi_table_parse
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59 #ifndef _LINUX_SFI_H
60 #define _LINUX_SFI_H
61
62 #include <linux/init.h>
63 #include <linux/types.h>
64
65
66 #define SFI_SIG_SYST "SYST"
67 #define SFI_SIG_FREQ "FREQ"
68 #define SFI_SIG_IDLE "IDLE"
69 #define SFI_SIG_CPUS "CPUS"
70 #define SFI_SIG_MTMR "MTMR"
71 #define SFI_SIG_MRTC "MRTC"
72 #define SFI_SIG_MMAP "MMAP"
73 #define SFI_SIG_APIC "APIC"
74 #define SFI_SIG_XSDT "XSDT"
75 #define SFI_SIG_WAKE "WAKE"
76 #define SFI_SIG_DEVS "DEVS"
77 #define SFI_SIG_GPIO "GPIO"
78
79 #define SFI_SIGNATURE_SIZE 4
80 #define SFI_OEM_ID_SIZE 6
81 #define SFI_OEM_TABLE_ID_SIZE 8
82
83 #define SFI_NAME_LEN 16
84
85 #define SFI_SYST_SEARCH_BEGIN 0x000E0000
86 #define SFI_SYST_SEARCH_END 0x000FFFFF
87
88 #define SFI_GET_NUM_ENTRIES(ptable, entry_type) \
89 ((ptable->header.len - sizeof(struct sfi_table_header)) / \
90 (sizeof(entry_type)))
91
92
93
94
95 struct sfi_table_header {
96 char sig[SFI_SIGNATURE_SIZE];
97 u32 len;
98 u8 rev;
99 u8 csum;
100 char oem_id[SFI_OEM_ID_SIZE];
101 char oem_table_id[SFI_OEM_TABLE_ID_SIZE];
102 } __packed;
103
104 struct sfi_table_simple {
105 struct sfi_table_header header;
106 u64 pentry[1];
107 } __packed;
108
109
110 struct sfi_mem_entry {
111 u32 type;
112 u64 phys_start;
113 u64 virt_start;
114 u64 pages;
115 u64 attrib;
116 } __packed;
117
118 struct sfi_cpu_table_entry {
119 u32 apic_id;
120 } __packed;
121
122 struct sfi_cstate_table_entry {
123 u32 hint;
124 u32 latency;
125 } __packed;
126
127 struct sfi_apic_table_entry {
128 u64 phys_addr;
129 } __packed;
130
131 struct sfi_freq_table_entry {
132 u32 freq_mhz;
133 u32 latency;
134 u32 ctrl_val;
135 } __packed;
136
137 struct sfi_wake_table_entry {
138 u64 phys_addr;
139 } __packed;
140
141 struct sfi_timer_table_entry {
142 u64 phys_addr;
143 u32 freq_hz;
144 u32 irq;
145 } __packed;
146
147 struct sfi_rtc_table_entry {
148 u64 phys_addr;
149 u32 irq;
150 } __packed;
151
152 struct sfi_device_table_entry {
153 u8 type;
154 #define SFI_DEV_TYPE_SPI 0
155 #define SFI_DEV_TYPE_I2C 1
156 #define SFI_DEV_TYPE_UART 2
157 #define SFI_DEV_TYPE_HSI 3
158 #define SFI_DEV_TYPE_IPC 4
159 #define SFI_DEV_TYPE_SD 5
160
161 u8 host_num;
162 u16 addr;
163 u8 irq;
164 u32 max_freq;
165 char name[SFI_NAME_LEN];
166 } __packed;
167
168 struct sfi_gpio_table_entry {
169 char controller_name[SFI_NAME_LEN];
170 u16 pin_no;
171 char pin_name[SFI_NAME_LEN];
172 } __packed;
173
174 typedef int (*sfi_table_handler) (struct sfi_table_header *table);
175
176 #ifdef CONFIG_SFI
177 extern void __init sfi_init(void);
178 extern int __init sfi_platform_init(void);
179 extern void __init sfi_init_late(void);
180 extern int sfi_table_parse(char *signature, char *oem_id, char *oem_table_id,
181 sfi_table_handler handler);
182
183 extern int sfi_disabled;
184 static inline void disable_sfi(void)
185 {
186 sfi_disabled = 1;
187 }
188
189 #else
190
191 static inline void sfi_init(void)
192 {
193 }
194
195 static inline void sfi_init_late(void)
196 {
197 }
198
199 #define sfi_disabled 0
200
201 static inline int sfi_table_parse(char *signature, char *oem_id,
202 char *oem_table_id,
203 sfi_table_handler handler)
204 {
205 return -1;
206 }
207
208 #endif
209
210 #endif