1/*
2 *  linux/include/asm-arm/arch-rpc/system.h
3 *
4 *  Copyright (C) 1996-1999 Russell King.
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10#include <asm/arch/hardware.h>
11#include <asm/hardware/iomd.h>
12#include <asm/io.h>
13
14static void arch_idle(void)
15{
16	unsigned long start_idle;
17
18	start_idle = jiffies;
19
20	do {
21		if (current->need_resched || hlt_counter)
22			goto slow_out;
23		cpu_do_idle(IDLE_WAIT_FAST);
24	} while (time_before(jiffies, start_idle + HZ/50));
25
26	cpu_do_idle(IDLE_CLOCK_SLOW);
27
28	while (!current->need_resched && !hlt_counter) {
29		cpu_do_idle(IDLE_WAIT_SLOW);
30	}
31
32	cpu_do_idle(IDLE_CLOCK_FAST);
33slow_out:
34}
35
36static inline void arch_reset(char mode)
37{
38	iomd_writeb(0, IOMD_ROMCR0);
39
40	/*
41	 * Jump into the ROM
42	 */
43	cpu_reset(0);
44}
45