File: system.h

package info (click to toggle)
linux-kernel-headers 2.6.18-7
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 38,648 kB
  • ctags: 300,882
  • sloc: ansic: 461,192; asm: 1,555; cpp: 340; makefile: 312; sh: 110
file content (49 lines) | stat: -rw-r--r-- 1,324 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
/*
 * linux/include/asm-arm/arch-ixp2000/system.h
 *
 * Copyright (C) 2002 Intel Corp.
 * Copyricht (C) 2003-2005 MontaVista Software, Inc.
 *
 * 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.
 */

#include <asm/hardware.h>
#include <asm/mach-types.h>

static inline void arch_idle(void)
{
	cpu_do_idle();
}

static inline void arch_reset(char mode)
{
	local_irq_disable();

	/*
	 * Reset flash banking register so that we are pointing at
	 * RedBoot bank.
	 */
	if (machine_is_ixdp2401()) {
		ixp2000_reg_write(IXDP2X01_CPLD_FLASH_REG,
					((0 >> IXDP2X01_FLASH_WINDOW_BITS)
						| IXDP2X01_CPLD_FLASH_INTERN));
		ixp2000_reg_wrb(IXDP2X01_CPLD_RESET_REG, 0xffffffff);
	}

	/*
	 * On IXDP2801 we need to write this magic sequence to the CPLD
	 * to cause a complete reset of the CPU and all external devices
	 * and move the flash bank register back to 0.
	 */
	if (machine_is_ixdp2801() || machine_is_ixdp28x5()) {
		unsigned long reset_reg = *IXDP2X01_CPLD_RESET_REG;

		reset_reg = 0x55AA0000 | (reset_reg & 0x0000FFFF);
		ixp2000_reg_write(IXDP2X01_CPLD_RESET_REG, reset_reg);
		ixp2000_reg_wrb(IXDP2X01_CPLD_RESET_REG, 0x80000000);
	}

	ixp2000_reg_wrb(IXP2000_RESET0, RSTALL);
}