This source file includes following definitions.
- mips_machine_is_compatible
1
2
3
4
5
6
7 #ifndef __MIPS_ASM_MACHINE_H__
8 #define __MIPS_ASM_MACHINE_H__
9
10 #include <linux/libfdt.h>
11 #include <linux/of.h>
12
13 struct mips_machine {
14 const struct of_device_id *matches;
15 const void *fdt;
16 bool (*detect)(void);
17 const void *(*fixup_fdt)(const void *fdt, const void *match_data);
18 unsigned int (*measure_hpt_freq)(void);
19 };
20
21 extern long __mips_machines_start;
22 extern long __mips_machines_end;
23
24 #define MIPS_MACHINE(name) \
25 static const struct mips_machine __mips_mach_##name \
26 __used __section(.mips.machines.init)
27
28 #define for_each_mips_machine(mach) \
29 for ((mach) = (struct mips_machine *)&__mips_machines_start; \
30 (mach) < (struct mips_machine *)&__mips_machines_end; \
31 (mach)++)
32
33
34
35
36
37
38
39
40
41
42
43 static inline const struct of_device_id *
44 mips_machine_is_compatible(const struct mips_machine *mach, const void *fdt)
45 {
46 const struct of_device_id *match;
47
48 if (!mach->matches)
49 return NULL;
50
51 for (match = mach->matches; match->compatible[0]; match++) {
52 if (fdt_node_check_compatible(fdt, 0, match->compatible) == 0)
53 return match;
54 }
55
56 return NULL;
57 }
58
59
60
61
62
63
64
65
66
67
68 struct mips_fdt_fixup {
69 int (*apply)(void *fdt);
70 const char *description;
71 };
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86 extern int __init apply_mips_fdt_fixups(void *fdt_out, size_t fdt_out_size,
87 const void *fdt_in,
88 const struct mips_fdt_fixup *fixups);
89
90 #endif