This commit was manufactured by cvs2svn to create branch 'vserver'.
[linux-2.6.git] / arch / arm / mach-iop3xx / common.c
1 /*
2  * arch/arm/mach-iop3xx/common.c
3  *
4  * Common routines shared across all IOP3xx implementations
5  *
6  * Author: Deepak Saxena <dsaxena@mvista.com>
7  *
8  * Copyright 2003 (c) MontaVista, Software, Inc.
9  *
10  * This file is licensed under  the terms of the GNU General Public
11  * License version 2. This program is licensed "as is" without any
12  * warranty of any kind, whether express or implied.
13  */
14
15 #include <linux/config.h>
16 #include <linux/delay.h>
17 #include <asm/hardware.h>
18
19 /*
20  * Shared variables
21  */
22 unsigned long iop3xx_pcibios_min_io = 0;
23 unsigned long iop3xx_pcibios_min_mem = 0;
24
25 #ifdef CONFIG_ARCH_EP80219
26 #include <linux/kernel.h>
27 /*
28  * Default power-off for EP80219
29  */
30 #include <asm/mach-types.h>
31 #include <asm/hardware.h>
32
33 static inline void ep80219_send_to_pic(__u8 c) {
34 }
35
36 void ep80219_power_off(void)
37 {
38         /*
39      * This function will send a SHUTDOWN_COMPLETE message to the PIC controller
40      * over I2C.  We are not using the i2c subsystem since we are going to power
41      * off and it may be removed
42      */
43
44         /* Send the Address byte w/ the start condition */
45         *IOP321_IDBR1 = 0x60;
46         *IOP321_ICR1 = 0xE9;
47     mdelay(1);
48
49         /* Send the START_MSG byte w/ no start or stop condition */
50         *IOP321_IDBR1 = 0x0F;
51         *IOP321_ICR1 = 0xE8;
52     mdelay(1);
53
54         /* Send the SHUTDOWN_COMPLETE Message ID byte w/ no start or stop condition */
55         *IOP321_IDBR1 = 0x03;
56         *IOP321_ICR1 = 0xE8;
57     mdelay(1);
58
59         /* Send an ignored byte w/ stop condition */
60         *IOP321_IDBR1 = 0x00;
61         *IOP321_ICR1 = 0xEA;
62
63         while (1) ;
64 }
65
66 #include <linux/init.h>
67 #include <linux/pm.h>
68
69 static int __init ep80219_init(void)
70 {
71         pm_power_off = ep80219_power_off;
72         return 0;
73 }
74 arch_initcall(ep80219_init);
75 #endif