fix to allow usb modules to compile
[linux-2.4.21-pre4.git] / arch / ppc / platforms / cpc700.h
1 /*
2  * include/asm-ppc/cpc700.h
3  * 
4  * Header file for IBM CPC700 Host Bridge, et. al.
5  *
6  * Author: Mark A. Greer
7  *         mgreer@mvista.com
8  *
9  * Copyright 2000-2002 MontaVista Software Inc.
10  *
11  * This program is free software; you can redistribute  it and/or modify it
12  * under  the terms of  the GNU General Public License as published by the
13  * Free Software Foundation;  either version 2 of the  License, or (at your
14  * option) any later version.
15  *
16  * THIS  SOFTWARE  IS PROVIDED   ``AS  IS'' AND   ANY  EXPRESS OR   IMPLIED
17  * WARRANTIES,   INCLUDING, BUT NOT  LIMITED  TO, THE IMPLIED WARRANTIES OF
18  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN
19  * NO  EVENT  SHALL   THE AUTHOR  BE    LIABLE FOR ANY   DIRECT,  INDIRECT,
20  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
21  * NOT LIMITED   TO, PROCUREMENT OF  SUBSTITUTE GOODS  OR SERVICES; LOSS OF
22  * USE, DATA,  OR PROFITS; OR  BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
23  * ANY THEORY OF LIABILITY, WHETHER IN  CONTRACT, STRICT LIABILITY, OR TORT
24  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
25  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26  *
27  * You should have received a copy of the  GNU General Public License along
28  * with this program; if not, write  to the Free Software Foundation, Inc.,
29  * 675 Mass Ave, Cambridge, MA 02139, USA.
30  */
31
32 /*
33  * This file contains the defines and macros for the IBM CPC700 host bridge,
34  * memory controller, PIC, UARTs, IIC, and Timers.
35  */
36
37 #ifndef _ASMPPC_CPC700_H
38 #define _ASMPPC_CPC700_H
39
40 #include <linux/stddef.h>
41 #include <linux/types.h>
42 #include <linux/init.h>
43
44 #define CPC700_OUT_32(a,d)  (*(u_int *)a = d)
45 #define CPC700_IN_32(a)     (*(u_int *)a)
46
47 /*
48  * PCI Section
49  */
50 #define CPC700_PCI_CONFIG_ADDR          0xfec00000
51 #define CPC700_PCI_CONFIG_DATA          0xfec00004
52
53 #define CPC700_PMM0_LOCAL               0xff400000
54 #define CPC700_PMM0_MASK_ATTR           0xff400004
55 #define CPC700_PMM0_PCI_LOW             0xff400008
56 #define CPC700_PMM0_PCI_HIGH            0xff40000c
57 #define CPC700_PMM1_LOCAL               0xff400010
58 #define CPC700_PMM1_MASK_ATTR           0xff400014
59 #define CPC700_PMM1_PCI_LOW             0xff400018
60 #define CPC700_PMM1_PCI_HIGH            0xff40001c
61 #define CPC700_PMM2_LOCAL               0xff400020
62 #define CPC700_PMM2_MASK_ATTR           0xff400024
63 #define CPC700_PMM2_PCI_LOW             0xff400028
64 #define CPC700_PMM2_PCI_HIGH            0xff40002c
65 #define CPC700_PTM1_MEMSIZE             0xff400030
66 #define CPC700_PTM1_LOCAL               0xff400034
67 #define CPC700_PTM2_MEMSIZE             0xff400038
68 #define CPC700_PTM2_LOCAL               0xff40003c
69
70 /*
71  * PIC Section
72  *
73  * IBM calls the CPC700's programmable interrupt controller the Universal
74  * Interrupt Controller or UIC.
75  */
76
77 /*
78  * UIC Register Addresses.
79  */
80 #define CPC700_UIC_UICSR                0xff500880      /* Status Reg (Rd/Clr)*/
81 #define CPC700_UIC_UICSRS               0xff500884      /* Status Reg (Set) */
82 #define CPC700_UIC_UICER                0xff500888      /* Enable Reg */
83 #define CPC700_UIC_UICCR                0xff50088c      /* Critical Reg */
84 #define CPC700_UIC_UICPR                0xff500890      /* Polarity Reg */
85 #define CPC700_UIC_UICTR                0xff500894      /* Trigger Reg */
86 #define CPC700_UIC_UICMSR               0xff500898      /* Masked Status Reg */
87 #define CPC700_UIC_UICVR                0xff50089c      /* Vector Reg */
88 #define CPC700_UIC_UICVCR               0xff5008a0      /* Vector Config Reg */
89
90 #define CPC700_UIC_UICER_ENABLE         0x00000001      /* Enable an IRQ */
91
92 #define CPC700_UIC_UICVCR_31_HI         0x00000000      /* IRQ 31 hi priority */
93 #define CPC700_UIC_UICVCR_0_HI          0x00000001      /* IRQ 0 hi priority */
94 #define CPC700_UIC_UICVCR_BASE_MASK     0xfffffffc
95 #define CPC700_UIC_UICVCR_ORDER_MASK    0x00000001
96
97 /* Specify value of a bit for an IRQ. */
98 #define CPC700_UIC_IRQ_BIT(i)           ((0x00000001) << (31 - (i)))
99
100 /*
101  * UIC Exports...
102  */
103 extern struct hw_interrupt_type cpc700_pic;
104 extern unsigned int cpc700_irq_assigns[32][2];
105  
106 extern void __init cpc700_init_IRQ(void);
107 extern int cpc700_get_irq(struct pt_regs *);
108
109 #endif  /* _ASMPPC_CPC700_H */