ftp://ftp.kernel.org/pub/linux/kernel/v2.6/linux-2.6.6.tar.bz2
[linux-2.6.git] / include / asm-mips / vr41xx / vrc4173.h
1 /*
2  * FILE NAME
3  *      include/asm-mips/vr41xx/vrc4173.h
4  *
5  * BRIEF MODULE DESCRIPTION
6  *      Include file for NEC VRC4173.
7  *
8  * This file is subject to the terms and conditions of the GNU General Public
9  * License.  See the file "COPYING" in the main directory of this archive
10  * for more details.
11  *
12  * Copyright (C) 2000 by Michael R. McDonald
13  *
14  * Copyright 2001-2003 Montavista Software Inc.
15  * Author: Yoichi Yuasa
16  *         yyuasa@mvista.com or source@mvista.com
17  */
18 #ifndef __NEC_VRC4173_H 
19 #define __NEC_VRC4173_H 
20
21 #include <asm/io.h>
22
23 /*
24  * Interrupt Number
25  */
26 #define VRC4173_IRQ_BASE        72
27 #define VRC4173_IRQ(x)          (VRC4173_IRQ_BASE + (x))
28 #define VRC4173_USB_IRQ         VRC4173_IRQ(0)
29 #define VRC4173_PCMCIA2_IRQ     VRC4173_IRQ(1)
30 #define VRC4173_PCMCIA1_IRQ     VRC4173_IRQ(2)
31 #define VRC4173_PS2CH2_IRQ      VRC4173_IRQ(3)
32 #define VRC4173_PS2CH1_IRQ      VRC4173_IRQ(4)
33 #define VRC4173_PIU_IRQ         VRC4173_IRQ(5)
34 #define VRC4173_AIU_IRQ         VRC4173_IRQ(6)
35 #define VRC4173_KIU_IRQ         VRC4173_IRQ(7)
36 #define VRC4173_GIU_IRQ         VRC4173_IRQ(8)
37 #define VRC4173_AC97_IRQ        VRC4173_IRQ(9)
38 #define VRC4173_AC97INT1_IRQ    VRC4173_IRQ(10)
39 /* RFU */
40 #define VRC4173_DOZEPIU_IRQ     VRC4173_IRQ(13)
41 #define VRC4173_IRQ_LAST        VRC4173_DOZEPIU_IRQ
42
43 /*
44  * PCI I/O accesses
45  */
46 extern unsigned long vrc4173_io_offset;
47
48 #define set_vrc4173_io_offset(offset)   do { vrc4173_io_offset = (offset); } while (0)
49
50 #define vrc4173_outb(val,port)          outb((val), vrc4173_io_offset+(port))
51 #define vrc4173_outw(val,port)          outw((val), vrc4173_io_offset+(port))
52 #define vrc4173_outl(val,port)          outl((val), vrc4173_io_offset+(port))
53 #define vrc4173_outb_p(val,port)        outb_p((val), vrc4173_io_offset+(port))
54 #define vrc4173_outw_p(val,port)        outw_p((val), vrc4173_io_offset+(port))
55 #define vrc4173_outl_p(val,port)        outl_p((val), vrc4173_io_offset+(port))
56
57 #define vrc4173_inb(port)               inb(vrc4173_io_offset+(port))
58 #define vrc4173_inw(port)               inw(vrc4173_io_offset+(port))
59 #define vrc4173_inl(port)               inl(vrc4173_io_offset+(port))
60 #define vrc4173_inb_p(port)             inb_p(vrc4173_io_offset+(port))
61 #define vrc4173_inw_p(port)             inw_p(vrc4173_io_offset+(port))
62 #define vrc4173_inl_p(port)             inl_p(vrc4173_io_offset+(port))
63
64 #define vrc4173_outsb(port,addr,count)  outsb(vrc4173_io_offset+(port),(addr),(count))
65 #define vrc4173_outsw(port,addr,count)  outsw(vrc4173_io_offset+(port),(addr),(count))
66 #define vrc4173_outsl(port,addr,count)  outsl(vrc4173_io_offset+(port),(addr),(count))
67
68 #define vrc4173_insb(port,addr,count)   insb(vrc4173_io_offset+(port),(addr),(count))
69 #define vrc4173_insw(port,addr,count)   insw(vrc4173_io_offset+(port),(addr),(count))
70 #define vrc4173_insl(port,addr,count)   insl(vrc4173_io_offset+(port),(addr),(count))
71
72 /*
73  * Clock Mask Unit
74  */
75 #define VRC4173_PIU_CLOCK               0x0001
76 #define VRC4173_KIU_CLOCK               0x0002
77 #define VRC4173_AIU_CLOCK               0x0004
78 #define VRC4173_PS2CH1_CLOCK            0x0008
79 #define VRC4173_PS2CH2_CLOCK            0x0010
80 #define VRC4173_USBU_PCI_CLOCK          0x0020
81 #define VRC4173_CARDU1_PCI_CLOCK        0x0040
82 #define VRC4173_CARDU2_PCI_CLOCK        0x0080
83 #define VRC4173_AC97U_PCI_CLOCK         0x0100
84 #define VRC4173_USBU_48MHz_CLOCK        0x0400
85 #define VRC4173_EXT_48MHz_CLOCK         0x0800
86 #define VRC4173_48MHz_CLOCK             0x1000
87
88 extern void vrc4173_clock_supply(u16 mask);
89 extern void vrc4173_clock_mask(u16 mask);
90
91 /*
92  * General-Purpose I/O Unit
93  */
94 enum {
95         PS2CH1_SELECT,
96         PS2CH2_SELECT,
97         TOUCHPANEL_SELECT,
98         KIU8_SELECT,
99         KIU10_SELECT,
100         KIU12_SELECT,
101         GPIO_SELECT
102 };
103
104 extern void vrc4173_select_function(int func);
105
106 #endif /* __NEC_VRC4173_H */