]> git.kernelconcepts.de Git - karo-tx-uboot.git/blob - include/mpc83xx.h
Merge with /home/tur/nand/u-boot
[karo-tx-uboot.git] / include / mpc83xx.h
1 /*
2  * Copyright 2004 Freescale Semiconductor, Inc.
3  *
4  * See file CREDITS for list of people who contributed to this
5  * project.
6  *
7  * This program is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License as
9  * published by the Free Software Foundation; either version 2 of
10  * the License, or (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, write to the Free Software
19  * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
20  * MA 02111-1307 USA
21  */
22
23 /*
24  * mpc83xx.h
25  *
26  * MPC83xx specific definitions
27  */
28
29 #ifndef __MPC83XX_H__
30 #define __MPC83XX_H__
31
32 #if defined(CONFIG_E300)
33 #include <asm/e300.h>
34 #endif
35
36 /*
37  * MPC83xx cpu provide RCR register to do reset thing specially. easier
38  * to implement
39  */
40
41 #define MPC83xx_RESET
42
43 /*
44  * System reset offset (PowerPC standard)
45  */
46 #define EXC_OFF_SYS_RESET       0x0100
47
48 /*
49  * Default Internal Memory Register Space (Freescale recomandation)
50  */
51 #define CONFIG_DEFAULT_IMMR 0xFF400000
52
53 /*
54  * Watchdog
55  */
56 #define SWCRR      0x0204
57 #define SWCRR_SWTC 0xFFFF0000 /* Software Watchdog Time Count. */
58 #define SWCRR_SWEN 0x00000004 /* Watchdog Enable bit. */
59 #define SWCRR_SWRI 0x00000002 /* Software Watchdog Reset/Interrupt Select bit. */
60 #define SWCRR_SWPR 0x00000001 /* Software Watchdog Counter Prescale bit. */
61 #define SWCRR_RES  ~(SWCRR_SWTC | SWCRR_SWEN | SWCRR_SWRI | SWCRR_SWPR)
62
63 #define SWCNR      0x0208
64 #define SWCNR_SWCN 0x0000FFFF Software Watchdog Count Field.
65 #define SWCNR_RES  ~(SWCNR_SWCN)
66
67 #define SWSRR      0x020E
68
69 /*
70  * Default Internal Memory Register Space (Freescale recomandation)
71  */
72 #define IMMRBAR 0x0000
73 #define IMMRBAR_BASE_ADDR     0xFFF00000 /* Identifies the 12 most-significant address bits of the base of the 1 MByte internal memory window. */
74 #define IMMRBAR_RES           ~(IMMRBAR_BASE_ADDR)
75
76 /*
77  * Default Internal Memory Register Space (Freescale recomandation)
78  */
79 #define LBLAWBAR0 0x0020
80 #define LBLAWAR0  0x0024
81 #define LBLAWBAR1 0x0028
82 #define LBLAWAR1  0x002C
83 #define LBLAWBAR2 0x0030
84 #define LBLAWAR2  0x0034
85 #define LBLAWBAR3 0x0038
86 #define LBLAWAR3  0x003C
87
88
89 /*
90  * Base Registers & Option Registers
91  */
92 #define BR0 0x5000
93 #define BR1 0x5008
94 #define BR2 0x5010
95 #define BR3 0x5018
96 #define BR4 0x5020
97 #define BR5 0x5028
98 #define BR6 0x5030
99 #define BR7 0x5038
100
101 #define BR_BA           0xFFFF8000
102 #define BR_BA_SHIFT             15
103 #define BR_PS           0x00001800
104 #define BR_PS_SHIFT             11
105 #define BR_PS_8         0x00000800  /* Port Size 8 bit */
106 #define BR_PS_16        0x00001000  /* Port Size 16 bit */
107 #define BR_PS_32        0x00001800  /* Port Size 32 bit */
108 #define BR_DECC         0x00000600
109 #define BR_DECC_SHIFT            9
110 #define BR_WP           0x00000100
111 #define BR_WP_SHIFT              8
112 #define BR_MSEL         0x000000E0
113 #define BR_MSEL_SHIFT            5
114 #define BR_MS_GPCM      0x00000000  /* GPCM */
115 #define BR_MS_SDRAM     0x00000060  /* SDRAM */
116 #define BR_MS_UPMA      0x00000080  /* UPMA */
117 #define BR_MS_UPMB      0x000000A0  /* UPMB */
118 #define BR_MS_UPMC      0x000000C0  /* UPMC */
119 #define BR_V            0x00000001
120 #define BR_V_SHIFT               0
121 #define BR_RES          ~(BR_BA|BR_PS|BR_DECC|BR_WP|BR_MSEL|BR_V)
122
123 #define OR0 0x5004
124 #define OR1 0x500C
125 #define OR2 0x5014
126 #define OR3 0x501C
127 #define OR4 0x5024
128 #define OR5 0x502C
129 #define OR6 0x5034
130 #define OR7 0x503C
131
132 #define OR_GPCM_AM              0xFFFF8000
133 #define OR_GPCM_AM_SHIFT                15
134 #define OR_GPCM_BCTLD           0x00001000
135 #define OR_GPCM_BCTLD_SHIFT             12
136 #define OR_GPCM_CSNT            0x00000800
137 #define OR_GPCM_CSNT_SHIFT              11
138 #define OR_GPCM_ACS             0x00000600
139 #define OR_GPCM_ACS_SHIFT                9
140 #define OR_GPCM_ACS_0b10        0x00000400
141 #define OR_GPCM_ACS_0b11        0x00000600
142 #define OR_GPCM_XACS            0x00000100
143 #define OR_GPCM_XACS_SHIFT               8
144 #define OR_GPCM_SCY             0x000000F0
145 #define OR_GPCM_SCY_SHIFT                4
146 #define OR_GPCM_SCY_1           0x00000010
147 #define OR_GPCM_SCY_2           0x00000020
148 #define OR_GPCM_SCY_3           0x00000030
149 #define OR_GPCM_SCY_4           0x00000040
150 #define OR_GPCM_SCY_5           0x00000050
151 #define OR_GPCM_SCY_6           0x00000060
152 #define OR_GPCM_SCY_7           0x00000070
153 #define OR_GPCM_SCY_8           0x00000080
154 #define OR_GPCM_SCY_9           0x00000090
155 #define OR_GPCM_SCY_10          0x000000a0
156 #define OR_GPCM_SCY_11          0x000000b0
157 #define OR_GPCM_SCY_12          0x000000c0
158 #define OR_GPCM_SCY_13          0x000000d0
159 #define OR_GPCM_SCY_14          0x000000e0
160 #define OR_GPCM_SCY_15          0x000000f0
161 #define OR_GPCM_SETA            0x00000008
162 #define OR_GPCM_SETA_SHIFT               3
163 #define OR_GPCM_TRLX            0x00000004
164 #define OR_GPCM_TRLX_SHIFT               2
165 #define OR_GPCM_EHTR            0x00000002
166 #define OR_GPCM_EHTR_SHIFT               1
167 #define OR_GPCM_EAD             0x00000001
168 #define OR_GPCM_EAD_SHIFT                0
169
170 #define OR_UPM_AM    0xFFFF8000
171 #define OR_UPM_AM_SHIFT      15
172 #define OR_UPM_XAM   0x00006000
173 #define OR_UPM_XAM_SHIFT     13
174 #define OR_UPM_BCTLD 0x00001000
175 #define OR_UPM_BCTLD_SHIFT   12
176 #define OR_UPM_BI    0x00000100
177 #define OR_UPM_BI_SHIFT       8
178 #define OR_UPM_TRLX  0x00000004
179 #define OR_UPM_TRLX_SHIFT     2
180 #define OR_UPM_EHTR  0x00000002
181 #define OR_UPM_EHTR_SHIFT     1
182 #define OR_UPM_EAD   0x00000001
183 #define OR_UPM_EAD_SHIFT      0
184
185 #define OR_SDRAM_AM    0xFFFF8000
186 #define OR_SDRAM_AM_SHIFT      15
187 #define OR_SDRAM_XAM   0x00006000
188 #define OR_SDRAM_XAM_SHIFT     13
189 #define OR_SDRAM_COLS  0x00001C00
190 #define OR_SDRAM_COLS_SHIFT    10
191 #define OR_SDRAM_ROWS  0x000001C0
192 #define OR_SDRAM_ROWS_SHIFT     6
193 #define OR_SDRAM_PMSEL 0x00000020
194 #define OR_SDRAM_PMSEL_SHIFT    5
195 #define OR_SDRAM_EAD   0x00000001
196 #define OR_SDRAM_EAD_SHIFT      0
197
198 /*
199  * Hard Reset Configration Word - High
200  */
201 #define HRCWH_PCI_AGENT              0x00000000
202 #define HRCWH_PCI_HOST               0x80000000
203
204 #define HRCWH_32_BIT_PCI             0x00000000
205 #define HRCWH_64_BIT_PCI             0x40000000
206
207 #define HRCWH_PCI1_ARBITER_DISABLE   0x00000000
208 #define HRCWH_PCI1_ARBITER_ENABLE    0x20000000
209
210 #define HRCWH_PCI2_ARBITER_DISABLE   0x00000000
211 #define HRCWH_PCI2_ARBITER_ENABLE    0x10000000
212
213 #define HRCWH_CORE_DISABLE           0x08000000
214 #define HRCWH_CORE_ENABLE            0x00000000
215
216 #define HRCWH_FROM_0X00000100        0x00000000
217 #define HRCWH_FROM_0XFFF00100        0x04000000
218
219 #define HRCWH_BOOTSEQ_DISABLE        0x00000000
220 #define HRCWH_BOOTSEQ_NORMAL         0x01000000
221 #define HRCWH_BOOTSEQ_EXTENDED       0x02000000
222
223 #define HRCWH_SW_WATCHDOG_DISABLE    0x00000000
224 #define HRCWH_SW_WATCHDOG_ENABLE     0x00800000
225
226 #define HRCWH_ROM_LOC_DDR_SDRAM      0x00000000
227 #define HRCWH_ROM_LOC_PCI1           0x00100000
228 #define HRCWH_ROM_LOC_PCI2           0x00200000
229 #define HRCWH_ROM_LOC_LOCAL_8BIT     0x00500000
230 #define HRCWH_ROM_LOC_LOCAL_16BIT    0x00600000
231 #define HRCWH_ROM_LOC_LOCAL_32BIT    0x00700000
232
233 #define HRCWH_TSEC1M_IN_RGMII        0x00000000
234 #define HRCWH_TSEC1M_IN_RTBI         0x00004000
235 #define HRCWH_TSEC1M_IN_GMII         0x00008000
236 #define HRCWH_TSEC1M_IN_TBI          0x0000C000
237
238 #define HRCWH_TSEC2M_IN_RGMII        0x00000000
239 #define HRCWH_TSEC2M_IN_RTBI         0x00001000
240 #define HRCWH_TSEC2M_IN_GMII         0x00002000
241 #define HRCWH_TSEC2M_IN_TBI          0x00003000
242
243 #define HRCWH_BIG_ENDIAN             0x00000000
244 #define HRCWH_LITTLE_ENDIAN          0x00000008
245
246 /*
247  * Hard Reset Configration Word - Low
248  */
249 #define HRCWL_LCL_BUS_TO_SCB_CLK_1X1 0x00000000
250 #define HRCWL_LCL_BUS_TO_SCB_CLK_2X1 0x80000000
251
252 #define HRCWL_DDR_TO_SCB_CLK_1X1     0x00000000
253 #define HRCWL_DDR_TO_SCB_CLK_2X1     0x40000000
254
255 #define HRCWL_CSB_TO_CLKIN_16X1      0x00000000
256 #define HRCWL_CSB_TO_CLKIN_1X1       0x01000000
257 #define HRCWL_CSB_TO_CLKIN_2X1       0x02000000
258 #define HRCWL_CSB_TO_CLKIN_3X1       0x03000000
259 #define HRCWL_CSB_TO_CLKIN_4X1       0x04000000
260 #define HRCWL_CSB_TO_CLKIN_5X1       0x05000000
261 #define HRCWL_CSB_TO_CLKIN_6X1       0x06000000
262 #define HRCWL_CSB_TO_CLKIN_7X1       0x07000000
263 #define HRCWL_CSB_TO_CLKIN_8X1       0x08000000
264 #define HRCWL_CSB_TO_CLKIN_9X1       0x09000000
265 #define HRCWL_CSB_TO_CLKIN_10X1      0x0A000000
266 #define HRCWL_CSB_TO_CLKIN_11X1      0x0B000000
267 #define HRCWL_CSB_TO_CLKIN_12X1      0x0C000000
268 #define HRCWL_CSB_TO_CLKIN_13X1      0x0D000000
269 #define HRCWL_CSB_TO_CLKIN_14X1      0x0E000000
270 #define HRCWL_CSB_TO_CLKIN_15X1      0x0F000000
271
272 #define HRCWL_VCO_BYPASS             0x00000000
273 #define HRCWL_VCO_1X2                0x00000000
274 #define HRCWL_VCO_1X4                0x00200000
275 #define HRCWL_VCO_1X8                0x00400000
276
277 #define HRCWL_CORE_TO_CSB_BYPASS     0x00000000
278 #define HRCWL_CORE_TO_CSB_1X1        0x00020000
279 #define HRCWL_CORE_TO_CSB_1_5X1      0x00030000
280 #define HRCWL_CORE_TO_CSB_2X1        0x00040000
281 #define HRCWL_CORE_TO_CSB_2_5X1      0x00050000
282 #define HRCWL_CORE_TO_CSB_3X1        0x00060000
283
284 /*
285  * LCRR - Clock Ratio Register (10.3.1.16)
286  */
287 #define LCRR_DBYP      0x80000000
288 #define LCRR_DBYP_SHIFT        31
289 #define LCRR_BUFCMDC   0x30000000
290 #define LCRR_BUFCMDC_1 0x10000000
291 #define LCRR_BUFCMDC_2 0x20000000
292 #define LCRR_BUFCMDC_3 0x30000000
293 #define LCRR_BUFCMDC_4 0x00000000
294 #define LCRR_BUFCMDC_SHIFT     28
295 #define LCRR_ECL       0x03000000
296 #define LCRR_ECL_4     0x00000000
297 #define LCRR_ECL_5     0x01000000
298 #define LCRR_ECL_6     0x02000000
299 #define LCRR_ECL_7     0x03000000
300 #define LCRR_ECL_SHIFT         24
301 #define LCRR_EADC      0x00030000
302 #define LCRR_EADC_1    0x00010000
303 #define LCRR_EADC_2    0x00020000
304 #define LCRR_EADC_3    0x00030000
305 #define LCRR_EADC_4    0x00000000
306 #define LCRR_EADC_SHIFT        16
307 #define LCRR_CLKDIV    0x0000000F
308 #define LCRR_CLKDIV_2  0x00000002
309 #define LCRR_CLKDIV_4  0x00000004
310 #define LCRR_CLKDIV_8  0x00000008
311 #define LCRR_CLKDIV_SHIFT       0
312
313 #endif  /* __MPC83XX_H__ */