diff options
author | Abhimanyu Kapur <abhimany@codeaurora.org> | 2014-01-23 12:24:33 -0800 |
---|---|---|
committer | Georgi Djakov <georgi.djakov@linaro.org> | 2015-02-19 10:50:52 +0200 |
commit | f53335807992313adb5101253d8b70e0a1c4905e (patch) | |
tree | ecaa95977e329f337efdc2915bfa9956d36a419c /arch/arm64/kernel/cpu_ops.c | |
parent | ed85cb134fc4ec19cae4aac93134a20edd7c097b (diff) |
arm64: introduce CPU_OF_TABLES for cpu ops selection
Add support to arm64 to provide a dt-based method to
allow soc-vendors to supply cpu_ops. Also move psci and
smp_spin_table ops to use CPU_OF_TABLES.
Change-Id: I4fd5b330fa3a7436fb88fff385deeb80a90548d6
Signed-off-by: Abhimanyu Kapur <abhimany@codeaurora.org>
Signed-off-by: Georgi Djakov <georgi.djakov@linaro.org>
Diffstat (limited to 'arch/arm64/kernel/cpu_ops.c')
-rw-r--r-- | arch/arm64/kernel/cpu_ops.c | 27 |
1 files changed, 9 insertions, 18 deletions
diff --git a/arch/arm64/kernel/cpu_ops.c b/arch/arm64/kernel/cpu_ops.c index cce952440c6..ad33f980249 100644 --- a/arch/arm64/kernel/cpu_ops.c +++ b/arch/arm64/kernel/cpu_ops.c @@ -22,29 +22,20 @@ #include <linux/of.h> #include <linux/string.h> -extern const struct cpu_operations smp_spin_table_ops; -extern const struct cpu_operations cpu_psci_ops; - const struct cpu_operations *cpu_ops[NR_CPUS]; -static const struct cpu_operations *supported_cpu_ops[] __initconst = { -#ifdef CONFIG_SMP - &smp_spin_table_ops, -#endif - &cpu_psci_ops, - NULL, -}; +extern struct cpu_operations __cpu_method_of_table[]; +static const struct cpu_operations *__cpu_method_of_table_sentinel + __used __section(__cpu_method_of_table_end); -static const struct cpu_operations * __init cpu_get_ops(const char *name) +const struct cpu_operations * __init cpu_get_ops(const char *name) { - const struct cpu_operations **ops = supported_cpu_ops; - - while (*ops) { - if (!strcmp(name, (*ops)->name)) - return *ops; + const struct cpu_operations **start = (void *)__cpu_method_of_table; - ops++; - } + for (; *start; start++) { + if (!strcmp((*start)->name, name)) + return *start; + }; return NULL; } |