Release 4.14 arch/powerpc/platforms/pasemi/idle.c
/*
* Copyright (C) 2006-2007 PA Semi, Inc
*
* Maintained by: Olof Johansson <olof@lixom.net>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
#undef DEBUG
#include <linux/kernel.h>
#include <linux/string.h>
#include <linux/irq.h>
#include <asm/machdep.h>
#include <asm/reg.h>
#include <asm/smp.h>
#include "pasemi.h"
struct sleep_mode {
char *name;
void (*entry)(void);
};
static struct sleep_mode modes[] = {
{ .name = "spin", .entry = &idle_spin },
{ .name = "doze", .entry = &idle_doze },
};
static int current_mode = 0;
static int pasemi_system_reset_exception(struct pt_regs *regs)
{
/* If we were woken up from power savings, we need to return
* to the calling function, since nip is not saved across
* all modes.
*/
if (regs->msr & SRR1_WAKEMASK)
regs->nip = regs->link;
switch (regs->msr & SRR1_WAKEMASK) {
case SRR1_WAKEDEC:
set_dec(1);
case SRR1_WAKEEE:
/*
* Handle these when interrupts get re-enabled and we take
* them as regular exceptions. We are in an NMI context
* and can't handle these here.
*/
break;
default:
/* do system reset */
return 0;
}
/* Set higher astate since we come out of power savings at 0 */
restore_astate(hard_smp_processor_id());
/* everything handled */
regs->msr |= MSR_RI;
return 1;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Olof Johansson | 68 | 93.15% | 2 | 66.67% |
Nicholas Piggin | 5 | 6.85% | 1 | 33.33% |
Total | 73 | 100.00% | 3 | 100.00% |
static int __init pasemi_idle_init(void)
{
#ifndef CONFIG_PPC_PASEMI_CPUFREQ
printk(KERN_WARNING "No cpufreq driver, powersavings modes disabled\n");
current_mode = 0;
#endif
ppc_md.system_reset_exception = pasemi_system_reset_exception;
ppc_md.power_save = modes[current_mode].entry;
printk(KERN_INFO "Using PA6T idle loop (%s)\n", modes[current_mode].name);
return 0;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Olof Johansson | 57 | 100.00% | 3 | 100.00% |
Total | 57 | 100.00% | 3 | 100.00% |
machine_late_initcall(pasemi, pasemi_idle_init);
static int __init idle_param(char *p)
{
int i;
for (i = 0; i < ARRAY_SIZE(modes); i++) {
if (!strcmp(modes[i].name, p)) {
current_mode = i;
break;
}
}
return 0;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Olof Johansson | 56 | 98.25% | 1 | 50.00% |
Stoyan Gaydarov | 1 | 1.75% | 1 | 50.00% |
Total | 57 | 100.00% | 2 | 100.00% |
early_param("idle", idle_param);
Overall Contributors
Person | Tokens | Prop | Commits | CommitProp |
Olof Johansson | 269 | 94.72% | 3 | 37.50% |
Stephen Rothwell | 6 | 2.11% | 2 | 25.00% |
Nicholas Piggin | 5 | 1.76% | 1 | 12.50% |
Grant C. Likely | 3 | 1.06% | 1 | 12.50% |
Stoyan Gaydarov | 1 | 0.35% | 1 | 12.50% |
Total | 284 | 100.00% | 8 | 100.00% |
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.