2 * Copyright 2003 PMC-Sierra
3 * Author: Manish Lachwani (lachwani@pmc-sierra.com)
5 * Board specific definititions for the PMC-Sierra Yosemite
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the
9 * Free Software Foundation; either version 2 of the License, or (at your
10 * option) any later version.
13 #ifndef __TITAN_DEP_H__
14 #define __TITAN_DEP_H__
16 #include <asm/addrspace.h> /* for KSEG1ADDR() */
17 #include <asm/byteorder.h> /* for cpu_to_le32() */
20 #define TITAN_PCI_BASE 0xbb000000
22 #define TITAN_WRITE(ofs, data) \
23 *(volatile u32 *)(TITAN_PCI_BASE+(ofs)) = cpu_to_le32(data)
24 #define TITAN_READ(ofs, data) \
25 *(data) = le32_to_cpu(*(volatile u32 *)(TITAN_PCI_BASE+(ofs)))
26 #define TITAN_READ_DATA(ofs) \
27 le32_to_cpu(*(volatile u32 *)(TITAN_PCI_BASE+(ofs)))
29 #define TITAN_WRITE_16(ofs, data) \
30 *(volatile u16 *)(TITAN_PCI_BASE+(ofs)) = cpu_to_le16(data)
31 #define TITAN_READ_16(ofs, data) \
32 *(data) = le16_to_cpu(*(volatile u16 *)(TITAN_PCI_BASE+(ofs)))
34 #define TITAN_WRITE_8(ofs, data) \
35 *(volatile u8 *)(TITAN_PCI_BASE+(ofs)) = data
36 #define TITAN_READ_8(ofs, data) \
37 *(data) = *(volatile u8 *)(TITAN_PCI_BASE+(ofs))
40 * PCI specific defines
42 #define TITAN_PCI_0_CONFIG_ADDRESS 0x780
43 #define TITAN_PCI_0_CONFIG_DATA 0x784
48 #define RM9000x2_HTLINK_REG 0xbb000644
49 #define RM9000x2_BASE_ADDR 0xbb000000
51 #define OCD_BASE 0xfb000000UL
52 #define OCD_SIZE 0x3000UL
54 extern unsigned long ocd_base
;
59 #define RM9000x2_OCD_LKB5 0x0128 /* Ethernet */
60 #define RM9000x2_OCD_LKM5 0x012c
62 #define RM9000x2_OCD_LKB7 0x0138 /* HT Region 0 */
63 #define RM9000x2_OCD_LKM7 0x013c
64 #define RM9000x2_OCD_LKB8 0x0140 /* HT Region 1 */
65 #define RM9000x2_OCD_LKM8 0x0144
67 #define RM9000x2_OCD_LKB9 0x0148 /* Local Bus */
68 #define RM9000x2_OCD_LKM9 0x014c
69 #define RM9000x2_OCD_LKB10 0x0150
70 #define RM9000x2_OCD_LKM10 0x0154
71 #define RM9000x2_OCD_LKB11 0x0158
72 #define RM9000x2_OCD_LKM11 0x015c
73 #define RM9000x2_OCD_LKB12 0x0160
74 #define RM9000x2_OCD_LKM12 0x0164
76 #define RM9000x2_OCD_LKB13 0x0168 /* Scratch RAM */
77 #define RM9000x2_OCD_LKM13 0x016c
79 #define RM9000x2_OCD_LPD0 0x0200 /* Local Bus */
80 #define RM9000x2_OCD_LPD1 0x0210
81 #define RM9000x2_OCD_LPD2 0x0220
82 #define RM9000x2_OCD_LPD3 0x0230
84 #define RM9000x2_OCD_HTDVID 0x0600 /* HT Device Header */
85 #define RM9000x2_OCD_HTSC 0x0604
86 #define RM9000x2_OCD_HTCCR 0x0608
87 #define RM9000x2_OCD_HTBHL 0x060c
88 #define RM9000x2_OCD_HTBAR0 0x0610
89 #define RM9000x2_OCD_HTBAR1 0x0614
90 #define RM9000x2_OCD_HTBAR2 0x0618
91 #define RM9000x2_OCD_HTBAR3 0x061c
92 #define RM9000x2_OCD_HTBAR4 0x0620
93 #define RM9000x2_OCD_HTBAR5 0x0624
94 #define RM9000x2_OCD_HTCBCPT 0x0628
95 #define RM9000x2_OCD_HTSDVID 0x062c
96 #define RM9000x2_OCD_HTXRA 0x0630
97 #define RM9000x2_OCD_HTCAP1 0x0634
98 #define RM9000x2_OCD_HTIL 0x063c
100 #define RM9000x2_OCD_HTLCC 0x0640 /* HT Capability Block */
101 #define RM9000x2_OCD_HTLINK 0x0644
102 #define RM9000x2_OCD_HTFQREV 0x0648
104 #define RM9000x2_OCD_HTERCTL 0x0668 /* HT Controller */
105 #define RM9000x2_OCD_HTRXDB 0x066c
106 #define RM9000x2_OCD_HTIMPED 0x0670
107 #define RM9000x2_OCD_HTSWIMP 0x0674
108 #define RM9000x2_OCD_HTCAL 0x0678
110 #define RM9000x2_OCD_HTBAA30 0x0680
111 #define RM9000x2_OCD_HTBAA54 0x0684
112 #define RM9000x2_OCD_HTMASK0 0x0688
113 #define RM9000x2_OCD_HTMASK1 0x068c
114 #define RM9000x2_OCD_HTMASK2 0x0690
115 #define RM9000x2_OCD_HTMASK3 0x0694
116 #define RM9000x2_OCD_HTMASK4 0x0698
117 #define RM9000x2_OCD_HTMASK5 0x069c
119 #define RM9000x2_OCD_HTIFCTL 0x06a0
120 #define RM9000x2_OCD_HTPLL 0x06a4
122 #define RM9000x2_OCD_HTSRI 0x06b0
123 #define RM9000x2_OCD_HTRXNUM 0x06b4
124 #define RM9000x2_OCD_HTTXNUM 0x06b8
126 #define RM9000x2_OCD_HTTXCNT 0x06c8
128 #define RM9000x2_OCD_HTERROR 0x06d8
129 #define RM9000x2_OCD_HTRCRCE 0x06dc
130 #define RM9000x2_OCD_HTEOI 0x06e0
132 #define RM9000x2_OCD_CRCR 0x06f0
134 #define RM9000x2_OCD_HTCFGA 0x06f8
135 #define RM9000x2_OCD_HTCFGD 0x06fc
137 #define RM9000x2_OCD_INTMSG 0x0a00
139 #define RM9000x2_OCD_INTPIN0 0x0a40
140 #define RM9000x2_OCD_INTPIN1 0x0a44
141 #define RM9000x2_OCD_INTPIN2 0x0a48
142 #define RM9000x2_OCD_INTPIN3 0x0a4c
143 #define RM9000x2_OCD_INTPIN4 0x0a50
144 #define RM9000x2_OCD_INTPIN5 0x0a54
145 #define RM9000x2_OCD_INTPIN6 0x0a58
146 #define RM9000x2_OCD_INTPIN7 0x0a5c
147 #define RM9000x2_OCD_SEM 0x0a60
148 #define RM9000x2_OCD_SEMSET 0x0a64
149 #define RM9000x2_OCD_SEMCLR 0x0a68
151 #define RM9000x2_OCD_TKT 0x0a70
152 #define RM9000x2_OCD_TKTINC 0x0a74
154 #define RM9000x2_OCD_NMICONFIG 0x0ac0 /* Interrupts */
155 #define RM9000x2_OCD_INTP0PRI 0x1a80
156 #define RM9000x2_OCD_INTP1PRI 0x1a80
157 #define RM9000x2_OCD_INTP0STATUS0 0x1b00
158 #define RM9000x2_OCD_INTP0MASK0 0x1b04
159 #define RM9000x2_OCD_INTP0SET0 0x1b08
160 #define RM9000x2_OCD_INTP0CLEAR0 0x1b0c
161 #define RM9000x2_OCD_INTP0STATUS1 0x1b10
162 #define RM9000x2_OCD_INTP0MASK1 0x1b14
163 #define RM9000x2_OCD_INTP0SET1 0x1b18
164 #define RM9000x2_OCD_INTP0CLEAR1 0x1b1c
165 #define RM9000x2_OCD_INTP0STATUS2 0x1b20
166 #define RM9000x2_OCD_INTP0MASK2 0x1b24
167 #define RM9000x2_OCD_INTP0SET2 0x1b28
168 #define RM9000x2_OCD_INTP0CLEAR2 0x1b2c
169 #define RM9000x2_OCD_INTP0STATUS3 0x1b30
170 #define RM9000x2_OCD_INTP0MASK3 0x1b34
171 #define RM9000x2_OCD_INTP0SET3 0x1b38
172 #define RM9000x2_OCD_INTP0CLEAR3 0x1b3c
173 #define RM9000x2_OCD_INTP0STATUS4 0x1b40
174 #define RM9000x2_OCD_INTP0MASK4 0x1b44
175 #define RM9000x2_OCD_INTP0SET4 0x1b48
176 #define RM9000x2_OCD_INTP0CLEAR4 0x1b4c
177 #define RM9000x2_OCD_INTP0STATUS5 0x1b50
178 #define RM9000x2_OCD_INTP0MASK5 0x1b54
179 #define RM9000x2_OCD_INTP0SET5 0x1b58
180 #define RM9000x2_OCD_INTP0CLEAR5 0x1b5c
181 #define RM9000x2_OCD_INTP0STATUS6 0x1b60
182 #define RM9000x2_OCD_INTP0MASK6 0x1b64
183 #define RM9000x2_OCD_INTP0SET6 0x1b68
184 #define RM9000x2_OCD_INTP0CLEAR6 0x1b6c
185 #define RM9000x2_OCD_INTP0STATUS7 0x1b70
186 #define RM9000x2_OCD_INTP0MASK7 0x1b74
187 #define RM9000x2_OCD_INTP0SET7 0x1b78
188 #define RM9000x2_OCD_INTP0CLEAR7 0x1b7c
189 #define RM9000x2_OCD_INTP1STATUS0 0x2b00
190 #define RM9000x2_OCD_INTP1MASK0 0x2b04
191 #define RM9000x2_OCD_INTP1SET0 0x2b08
192 #define RM9000x2_OCD_INTP1CLEAR0 0x2b0c
193 #define RM9000x2_OCD_INTP1STATUS1 0x2b10
194 #define RM9000x2_OCD_INTP1MASK1 0x2b14
195 #define RM9000x2_OCD_INTP1SET1 0x2b18
196 #define RM9000x2_OCD_INTP1CLEAR1 0x2b1c
197 #define RM9000x2_OCD_INTP1STATUS2 0x2b20
198 #define RM9000x2_OCD_INTP1MASK2 0x2b24
199 #define RM9000x2_OCD_INTP1SET2 0x2b28
200 #define RM9000x2_OCD_INTP1CLEAR2 0x2b2c
201 #define RM9000x2_OCD_INTP1STATUS3 0x2b30
202 #define RM9000x2_OCD_INTP1MASK3 0x2b34
203 #define RM9000x2_OCD_INTP1SET3 0x2b38
204 #define RM9000x2_OCD_INTP1CLEAR3 0x2b3c
205 #define RM9000x2_OCD_INTP1STATUS4 0x2b40
206 #define RM9000x2_OCD_INTP1MASK4 0x2b44
207 #define RM9000x2_OCD_INTP1SET4 0x2b48
208 #define RM9000x2_OCD_INTP1CLEAR4 0x2b4c
209 #define RM9000x2_OCD_INTP1STATUS5 0x2b50
210 #define RM9000x2_OCD_INTP1MASK5 0x2b54
211 #define RM9000x2_OCD_INTP1SET5 0x2b58
212 #define RM9000x2_OCD_INTP1CLEAR5 0x2b5c
213 #define RM9000x2_OCD_INTP1STATUS6 0x2b60
214 #define RM9000x2_OCD_INTP1MASK6 0x2b64
215 #define RM9000x2_OCD_INTP1SET6 0x2b68
216 #define RM9000x2_OCD_INTP1CLEAR6 0x2b6c
217 #define RM9000x2_OCD_INTP1STATUS7 0x2b70
218 #define RM9000x2_OCD_INTP1MASK7 0x2b74
219 #define RM9000x2_OCD_INTP1SET7 0x2b78
220 #define RM9000x2_OCD_INTP1CLEAR7 0x2b7c
222 #define OCD_READ(reg) (*(volatile unsigned int *)(ocd_base + (reg)))
223 #define OCD_WRITE(reg, val) \
224 do { *(volatile unsigned int *)(ocd_base + (reg)) = (val); } while (0)
227 * Hypertransport specific macros
229 #define RM9K_WRITE(ofs, data) *(volatile u_int32_t *)(RM9000x2_BASE_ADDR+ofs) = data
230 #define RM9K_WRITE_8(ofs, data) *(volatile u8 *)(RM9000x2_BASE_ADDR+ofs) = data
231 #define RM9K_WRITE_16(ofs, data) *(volatile u16 *)(RM9000x2_BASE_ADDR+ofs) = data
233 #define RM9K_READ(ofs, val) *(val) = *(volatile u_int32_t *)(RM9000x2_BASE_ADDR+ofs)
234 #define RM9K_READ_8(ofs, val) *(val) = *(volatile u8 *)(RM9000x2_BASE_ADDR+ofs)
235 #define RM9K_READ_16(ofs, val) *(val) = *(volatile u16 *)(RM9000x2_BASE_ADDR+ofs)