ftp://ftp.kernel.org/pub/linux/kernel/v2.6/linux-2.6.6.tar.bz2
[linux-2.6.git] / arch / ppc / platforms / tqm8xx.h
1 /*
2  * TQM8xx(L) board specific definitions
3  *
4  * Copyright (c) 1999-2002 Wolfgang Denk (wd@denx.de)
5  */
6
7 #ifdef __KERNEL__
8 #ifndef __MACH_TQM8xx_H
9 #define __MACH_TQM8xx_H
10
11 #include <linux/config.h>
12
13 #include <asm/ppcboot.h>
14
15 #ifndef __ASSEMBLY__
16 #define TQM_IMMR_BASE   0xFFF00000      /* phys. addr of IMMR */
17 #define TQM_IMAP_SIZE   (64 * 1024)     /* size of mapped area */
18
19 #define IMAP_ADDR       TQM_IMMR_BASE   /* physical base address of IMMR area */
20 #define IMAP_SIZE       TQM_IMAP_SIZE   /* mapped size of IMMR area */
21
22 /*-----------------------------------------------------------------------
23  * PCMCIA stuff
24  *-----------------------------------------------------------------------
25  *
26  */
27 #define PCMCIA_MEM_SIZE         ( 64 << 20 )
28
29 #ifndef CONFIG_KUP4K
30 # define        MAX_HWIFS       1       /* overwrite default in include/asm-ppc/ide.h   */
31
32 #else   /* CONFIG_KUP4K */
33
34 # define        MAX_HWIFS       2       /* overwrite default in include/asm-ppc/ide.h   */
35 # ifndef __ASSEMBLY__
36 # include <asm/8xx_immap.h>
37 static __inline__ void ide_led(int on)
38 {
39         volatile immap_t        *immap = (immap_t *)IMAP_ADDR;
40
41         if (on) {
42                 immap->im_ioport.iop_padat &= ~0x80;
43         } else {
44                 immap->im_ioport.iop_padat |= 0x80;
45         }
46 }
47 # endif /* __ASSEMBLY__ */
48 # define IDE_LED(x) ide_led((x))
49 #endif  /* CONFIG_KUP4K */
50
51 /*
52  * Definitions for IDE0 Interface
53  */
54 #define IDE0_BASE_OFFSET                0
55 #define IDE0_DATA_REG_OFFSET            (PCMCIA_MEM_SIZE + 0x320)
56 #define IDE0_ERROR_REG_OFFSET           (2 * PCMCIA_MEM_SIZE + 0x320 + 1)
57 #define IDE0_NSECTOR_REG_OFFSET         (2 * PCMCIA_MEM_SIZE + 0x320 + 2)
58 #define IDE0_SECTOR_REG_OFFSET          (2 * PCMCIA_MEM_SIZE + 0x320 + 3)
59 #define IDE0_LCYL_REG_OFFSET            (2 * PCMCIA_MEM_SIZE + 0x320 + 4)
60 #define IDE0_HCYL_REG_OFFSET            (2 * PCMCIA_MEM_SIZE + 0x320 + 5)
61 #define IDE0_SELECT_REG_OFFSET          (2 * PCMCIA_MEM_SIZE + 0x320 + 6)
62 #define IDE0_STATUS_REG_OFFSET          (2 * PCMCIA_MEM_SIZE + 0x320 + 7)
63 #define IDE0_CONTROL_REG_OFFSET         0x0106
64 #define IDE0_IRQ_REG_OFFSET             0x000A  /* not used */
65
66 /* define IO_BASE for PCMCIA */
67 #define _IO_BASE 0x80000000
68 #define _IO_BASE_SIZE  (64<<10)
69
70 #define FEC_INTERRUPT            9      /* = SIU_LEVEL4                 */
71 #define PHY_INTERRUPT           12      /* = IRQ6                       */
72 #define IDE0_INTERRUPT          13
73
74 #ifdef CONFIG_IDE
75 #define ide_request_irq(irq,hand,flg,dev,id)    \
76         request_8xxirq((irq),(hand),(flg),(dev),(id))
77 #endif
78
79 /*-----------------------------------------------------------------------
80  * CPM Ethernet through SCCx.
81  *-----------------------------------------------------------------------
82  *
83  */
84
85 /***  TQM823L, TQM850L  ***********************************************/
86
87 #if defined(CONFIG_TQM823L) || defined(CONFIG_TQM850L)
88 /* Bits in parallel I/O port registers that have to be set/cleared
89  * to configure the pins for SCC1 use.
90  */
91 #define PA_ENET_RXD     ((ushort)0x0004)        /* PA 13 */
92 #define PA_ENET_TXD     ((ushort)0x0008)        /* PA 12 */
93 #define PA_ENET_RCLK    ((ushort)0x0100)        /* PA  7 */
94 #define PA_ENET_TCLK    ((ushort)0x0400)        /* PA  5 */
95
96 #define PB_ENET_TENA    ((uint)0x00002000)      /* PB 18 */
97
98 #define PC_ENET_CLSN    ((ushort)0x0040)        /* PC  9 */
99 #define PC_ENET_RENA    ((ushort)0x0080)        /* PC  8 */
100
101 /* Control bits in the SICR to route TCLK (CLK3) and RCLK (CLK1) to
102  * SCC2.  Also, make sure GR2 (bit 16) and SC2 (bit 17) are zero.
103  */
104 #define SICR_ENET_MASK  ((uint)0x0000ff00)
105 #define SICR_ENET_CLKRT ((uint)0x00002600)
106 #endif  /* CONFIG_TQM823L, CONFIG_TQM850L */
107
108 /***  TQM860L  ********************************************************/
109
110 #ifdef CONFIG_TQM860L
111 /* Bits in parallel I/O port registers that have to be set/cleared
112  * to configure the pins for SCC1 use.
113  */
114 #define PA_ENET_RXD     ((ushort)0x0001)        /* PA 15 */
115 #define PA_ENET_TXD     ((ushort)0x0002)        /* PA 14 */
116 #define PA_ENET_RCLK    ((ushort)0x0100)        /* PA  7 */
117 #define PA_ENET_TCLK    ((ushort)0x0400)        /* PA  5 */
118
119 #define PC_ENET_TENA    ((ushort)0x0001)        /* PC 15 */
120 #define PC_ENET_CLSN    ((ushort)0x0010)        /* PC 11 */
121 #define PC_ENET_RENA    ((ushort)0x0020)        /* PC 10 */
122
123 /* Control bits in the SICR to route TCLK (CLK3) and RCLK (CLK1) to
124  * SCC1.  Also, make sure GR1 (bit 24) and SC1 (bit 25) are zero.
125  */
126 #define SICR_ENET_MASK  ((uint)0x000000ff)
127 #define SICR_ENET_CLKRT ((uint)0x00000026)
128 #endif  /* CONFIG_TQM860L */
129
130 /***  FPS850L  *********************************************************/
131
132 #ifdef CONFIG_FPS850L
133 /* Bits in parallel I/O port registers that have to be set/cleared
134  * to configure the pins for SCC1 use.
135  */
136 #define PA_ENET_RXD     ((ushort)0x0004)        /* PA 13 */
137 #define PA_ENET_TXD     ((ushort)0x0008)        /* PA 12 */
138 #define PA_ENET_RCLK    ((ushort)0x0100)        /* PA  7 */
139 #define PA_ENET_TCLK    ((ushort)0x0400)        /* PA  5 */
140
141 #define PC_ENET_TENA    ((ushort)0x0002)        /* PC 14 */
142 #define PC_ENET_CLSN    ((ushort)0x0040)        /* PC  9 */
143 #define PC_ENET_RENA    ((ushort)0x0080)        /* PC  8 */
144
145 /* Control bits in the SICR to route TCLK (CLK2) and RCLK (CLK4) to
146  * SCC2.  Also, make sure GR2 (bit 16) and SC2 (bit 17) are zero.
147  */
148 #define SICR_ENET_MASK  ((uint)0x0000ff00)
149 #define SICR_ENET_CLKRT ((uint)0x00002600)
150 #endif  /* CONFIG_FPS850L */
151
152 /***  SM850  *********************************************************/
153
154 /* The SM850 Service Module uses SCC2 for IrDA and SCC3 for Ethernet */
155
156 #ifdef CONFIG_SM850
157 #define PB_ENET_RXD     ((uint)0x00000004)      /* PB 29 */
158 #define PB_ENET_TXD     ((uint)0x00000002)      /* PB 30 */
159 #define PA_ENET_RCLK    ((ushort)0x0100)        /* PA  7 */
160 #define PA_ENET_TCLK    ((ushort)0x0400)        /* PA  5 */
161
162 #define PC_ENET_LBK     ((ushort)0x0008)        /* PC 12 */
163 #define PC_ENET_TENA    ((ushort)0x0004)        /* PC 13 */
164
165 #define PC_ENET_RENA    ((ushort)0x0800)        /* PC  4 */
166 #define PC_ENET_CLSN    ((ushort)0x0400)        /* PC  5 */
167
168 /* Control bits in the SICR to route TCLK (CLK3) and RCLK (CLK1) to
169  * SCC3.  Also, make sure GR3 (bit 8) and SC3 (bit 9) are zero.
170  */
171 #define SICR_ENET_MASK  ((uint)0x00FF0000)
172 #define SICR_ENET_CLKRT ((uint)0x00260000)
173 #endif  /* CONFIG_SM850 */
174
175 /* We don't use the 8259.
176 */
177 #define NR_8259_INTS    0
178
179 #endif /* !__ASSEMBLY__ */
180 #endif  /* __MACH_TQM8xx_H */
181 #endif /* __KERNEL__ */