psci.c (00ef54bb97389bfe8894272f48496f4191aae946) | psci.c (cd1aebf5277a3a154a9e4c0ea4b3acabb62e5cab) |
---|---|
1/* 2 * This program is free software; you can redistribute it and/or modify 3 * it under the terms of the GNU General Public License version 2 as 4 * published by the Free Software Foundation. 5 * 6 * This program is distributed in the hope that it will be useful, 7 * but WITHOUT ANY WARRANTY; without even the implied warranty of 8 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --- 6 unchanged lines hidden (view full) --- 15 16#define pr_fmt(fmt) "psci: " fmt 17 18#include <linux/init.h> 19#include <linux/of.h> 20#include <linux/smp.h> 21 22#include <asm/compiler.h> | 1/* 2 * This program is free software; you can redistribute it and/or modify 3 * it under the terms of the GNU General Public License version 2 as 4 * published by the Free Software Foundation. 5 * 6 * This program is distributed in the hope that it will be useful, 7 * but WITHOUT ANY WARRANTY; without even the implied warranty of 8 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --- 6 unchanged lines hidden (view full) --- 15 16#define pr_fmt(fmt) "psci: " fmt 17 18#include <linux/init.h> 19#include <linux/of.h> 20#include <linux/smp.h> 21 22#include <asm/compiler.h> |
23#include <asm/cpu_ops.h> |
|
23#include <asm/errno.h> 24#include <asm/psci.h> 25#include <asm/smp_plat.h> 26 27#define PSCI_POWER_STATE_TYPE_STANDBY 0 28#define PSCI_POWER_STATE_TYPE_POWER_DOWN 1 29 30struct psci_power_state { --- 195 unchanged lines hidden (view full) --- 226 227out_put_node: 228 of_node_put(np); 229 return err; 230} 231 232#ifdef CONFIG_SMP 233 | 24#include <asm/errno.h> 25#include <asm/psci.h> 26#include <asm/smp_plat.h> 27 28#define PSCI_POWER_STATE_TYPE_STANDBY 0 29#define PSCI_POWER_STATE_TYPE_POWER_DOWN 1 30 31struct psci_power_state { --- 195 unchanged lines hidden (view full) --- 227 228out_put_node: 229 of_node_put(np); 230 return err; 231} 232 233#ifdef CONFIG_SMP 234 |
234static int __init smp_psci_init_cpu(struct device_node *dn, int cpu) | 235static int __init cpu_psci_cpu_init(struct device_node *dn, unsigned int cpu) |
235{ 236 return 0; 237} 238 | 236{ 237 return 0; 238} 239 |
239static int __init smp_psci_prepare_cpu(int cpu) | 240static int __init cpu_psci_cpu_prepare(unsigned int cpu) |
240{ 241 int err; 242 243 if (!psci_ops.cpu_on) { 244 pr_err("no cpu_on method, not booting CPU%d\n", cpu); 245 return -ENODEV; 246 } 247 248 err = psci_ops.cpu_on(cpu_logical_map(cpu), __pa(secondary_holding_pen)); 249 if (err) { 250 pr_err("failed to boot CPU%d (%d)\n", cpu, err); 251 return err; 252 } 253 254 return 0; 255} 256 | 241{ 242 int err; 243 244 if (!psci_ops.cpu_on) { 245 pr_err("no cpu_on method, not booting CPU%d\n", cpu); 246 return -ENODEV; 247 } 248 249 err = psci_ops.cpu_on(cpu_logical_map(cpu), __pa(secondary_holding_pen)); 250 if (err) { 251 pr_err("failed to boot CPU%d (%d)\n", cpu, err); 252 return err; 253 } 254 255 return 0; 256} 257 |
257const struct smp_enable_ops smp_psci_ops __initconst = { | 258const struct cpu_operations cpu_psci_ops = { |
258 .name = "psci", | 259 .name = "psci", |
259 .init_cpu = smp_psci_init_cpu, 260 .prepare_cpu = smp_psci_prepare_cpu, | 260 .cpu_init = cpu_psci_cpu_init, 261 .cpu_prepare = cpu_psci_cpu_prepare, |
261}; 262 263#endif | 262}; 263 264#endif |