VServer 1.9.2 (patch-2.6.8.1-vs1.9.2.diff)
[linux-2.6.git] / include / asm-mips / vr41xx / vrc4173.h
1 /*
2  *  vrc4173.h, Include file for NEC VRC4173.
3  *
4  *  Copyright (C) 2000  Michael R. McDonald
5  *  Copyright (C) 2001-2003 Montavista Software Inc.
6  *    Author: Yoichi Yuasa <yyuasa@mvista.com, or source@mvista.com>
7  *  Copyright (C) 2004  Yoichi Yuasa <yuasa@hh.iij4u.or.jp>
8  *
9  *  This program is free software; you can redistribute it and/or modify
10  *  it under the terms of the GNU General Public License as published by
11  *  the Free Software Foundation; either version 2 of the License, or
12  *  (at your option) any later version.
13  *
14  *  This program is distributed in the hope that it will be useful,
15  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
16  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17  *  GNU General Public License for more details.
18  *
19  *  You should have received a copy of the GNU General Public License
20  *  along with this program; if not, write to the Free Software
21  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
22  */
23 #ifndef __NEC_VRC4173_H 
24 #define __NEC_VRC4173_H 
25
26 #include <asm/io.h>
27
28 /*
29  * Interrupt Number
30  */
31 #define VRC4173_IRQ_BASE        72
32 #define VRC4173_IRQ(x)          (VRC4173_IRQ_BASE + (x))
33 #define VRC4173_USB_IRQ         VRC4173_IRQ(0)
34 #define VRC4173_PCMCIA2_IRQ     VRC4173_IRQ(1)
35 #define VRC4173_PCMCIA1_IRQ     VRC4173_IRQ(2)
36 #define VRC4173_PS2CH2_IRQ      VRC4173_IRQ(3)
37 #define VRC4173_PS2CH1_IRQ      VRC4173_IRQ(4)
38 #define VRC4173_PIU_IRQ         VRC4173_IRQ(5)
39 #define VRC4173_AIU_IRQ         VRC4173_IRQ(6)
40 #define VRC4173_KIU_IRQ         VRC4173_IRQ(7)
41 #define VRC4173_GIU_IRQ         VRC4173_IRQ(8)
42 #define VRC4173_AC97_IRQ        VRC4173_IRQ(9)
43 #define VRC4173_AC97INT1_IRQ    VRC4173_IRQ(10)
44 /* RFU */
45 #define VRC4173_DOZEPIU_IRQ     VRC4173_IRQ(13)
46 #define VRC4173_IRQ_LAST        VRC4173_DOZEPIU_IRQ
47
48 /*
49  * PCI I/O accesses
50  */
51 extern unsigned long vrc4173_io_offset;
52
53 #define set_vrc4173_io_offset(offset)   do { vrc4173_io_offset = (offset); } while (0)
54
55 #define vrc4173_outb(val,port)          outb((val), vrc4173_io_offset+(port))
56 #define vrc4173_outw(val,port)          outw((val), vrc4173_io_offset+(port))
57 #define vrc4173_outl(val,port)          outl((val), vrc4173_io_offset+(port))
58 #define vrc4173_outb_p(val,port)        outb_p((val), vrc4173_io_offset+(port))
59 #define vrc4173_outw_p(val,port)        outw_p((val), vrc4173_io_offset+(port))
60 #define vrc4173_outl_p(val,port)        outl_p((val), vrc4173_io_offset+(port))
61
62 #define vrc4173_inb(port)               inb(vrc4173_io_offset+(port))
63 #define vrc4173_inw(port)               inw(vrc4173_io_offset+(port))
64 #define vrc4173_inl(port)               inl(vrc4173_io_offset+(port))
65 #define vrc4173_inb_p(port)             inb_p(vrc4173_io_offset+(port))
66 #define vrc4173_inw_p(port)             inw_p(vrc4173_io_offset+(port))
67 #define vrc4173_inl_p(port)             inl_p(vrc4173_io_offset+(port))
68
69 #define vrc4173_outsb(port,addr,count)  outsb(vrc4173_io_offset+(port),(addr),(count))
70 #define vrc4173_outsw(port,addr,count)  outsw(vrc4173_io_offset+(port),(addr),(count))
71 #define vrc4173_outsl(port,addr,count)  outsl(vrc4173_io_offset+(port),(addr),(count))
72
73 #define vrc4173_insb(port,addr,count)   insb(vrc4173_io_offset+(port),(addr),(count))
74 #define vrc4173_insw(port,addr,count)   insw(vrc4173_io_offset+(port),(addr),(count))
75 #define vrc4173_insl(port,addr,count)   insl(vrc4173_io_offset+(port),(addr),(count))
76
77 /*
78  * Clock Mask Unit
79  */
80 typedef enum vrc4173_clock {
81         VRC4173_PIU_CLOCK,
82         VRC4173_KIU_CLOCK,
83         VRC4173_AIU_CLOCK,
84         VRC4173_PS2_CH1_CLOCK,
85         VRC4173_PS2_CH2_CLOCK,
86         VRC4173_USBU_PCI_CLOCK,
87         VRC4173_CARDU1_PCI_CLOCK,
88         VRC4173_CARDU2_PCI_CLOCK,
89         VRC4173_AC97U_PCI_CLOCK,
90         VRC4173_USBU_48MHz_CLOCK,
91         VRC4173_EXT_48MHz_CLOCK,
92         VRC4173_48MHz_CLOCK,
93 } vrc4173_clock_t;
94
95 extern void vrc4173_supply_clock(vrc4173_clock_t clock);
96 extern void vrc4173_mask_clock(vrc4173_clock_t clock);
97
98 /*
99  * General-Purpose I/O Unit
100  */
101 typedef enum vrc4173_function {
102         PS2_CHANNEL1,
103         PS2_CHANNEL2,
104         TOUCHPANEL,
105         KEYBOARD_8SCANLINES,
106         KEYBOARD_10SCANLINES,
107         KEYBOARD_12SCANLINES,
108         GPIO_0_15PINS,
109         GPIO_16_20PINS,
110 } vrc4173_function_t;
111
112 extern void vrc4173_select_function(vrc4173_function_t function);
113
114 #endif /* __NEC_VRC4173_H */