xref: /openbmc/u-boot/include/mpc83xx.h (revision 8e6f1a8e)
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_DECC 0x00000600
106 #define BR_DECC_SHIFT    9
107 #define BR_WP   0x00000100
108 #define BR_WP_SHIFT      8
109 #define BR_MSEL 0x000000E0
110 #define BR_MSEL_SHIFT    5
111 #define BR_V    0x00000001
112 #define BR_V_SHIFT       0
113 #define BR_RES  ~(BR_BA|BR_PS|BR_DECC|BR_WP|BR_MSEL|BR_V)
114 
115 #define OR0 0x5004
116 #define OR1 0x500C
117 #define OR2 0x5014
118 #define OR3 0x501C
119 #define OR4 0x5024
120 #define OR5 0x502C
121 #define OR6 0x5034
122 #define OR7 0x503C
123 
124 #define OR_GPCM_AM    0xFFFF8000
125 #define OR_GPCM_AM_SHIFT      15
126 #define OR_GPCM_BCTLD 0x00001000
127 #define OR_GPCM_BCTLD_SHIFT   12
128 #define OR_GPCM_CSNT  0x00000800
129 #define OR_GPCM_CSNT_SHIFT    11
130 #define OR_GPCM_ACS   0x00000600
131 #define OR_GPCM_ACS_SHIFT      9
132 #define OR_GPCM_XACS  0x00000100
133 #define OR_GPCM_XACS_SHIFT     8
134 #define OR_GPCM_SCY   0x000000F0
135 #define OR_GPCM_SCY_SHIFT      4
136 #define OR_GPCM_SETA  0x00000008
137 #define OR_GPCM_SETA_SHIFT     3
138 #define OR_GPCM_TRLX  0x00000004
139 #define OR_GPCM_TRLX_SHIFT     2
140 #define OR_GPCM_EHTR  0x00000002
141 #define OR_GPCM_EHTR_SHIFT     1
142 #define OR_GPCM_EAD   0x00000001
143 #define OR_GPCM_EAD_SHIFT      0
144 
145 #define OR_UPM_AM    0xFFFF8000
146 #define OR_UPM_AM_SHIFT      15
147 #define OR_UPM_XAM   0x00006000
148 #define OR_UPM_XAM_SHIFT     13
149 #define OR_UPM_BCTLD 0x00001000
150 #define OR_UPM_BCTLD_SHIFT   12
151 #define OR_UPM_BI    0x00000100
152 #define OR_UPM_BI_SHIFT       8
153 #define OR_UPM_TRLX  0x00000004
154 #define OR_UPM_TRLX_SHIFT     2
155 #define OR_UPM_EHTR  0x00000002
156 #define OR_UPM_EHTR_SHIFT     1
157 #define OR_UPM_EAD   0x00000001
158 #define OR_UPM_EAD_SHIFT      0
159 
160 #define OR_SDRAM_AM    0xFFFF8000
161 #define OR_SDRAM_AM_SHIFT      15
162 #define OR_SDRAM_XAM   0x00006000
163 #define OR_SDRAM_XAM_SHIFT     13
164 #define OR_SDRAM_COLS  0x00001C00
165 #define OR_SDRAM_COLS_SHIFT    10
166 #define OR_SDRAM_ROWS  0x000001C0
167 #define OR_SDRAM_ROWS_SHIFT     6
168 #define OR_SDRAM_PMSEL 0x00000020
169 #define OR_SDRAM_PMSEL_SHIFT    5
170 #define OR_SDRAM_EAD   0x00000001
171 #define OR_SDRAM_EAD_SHIFT      0
172 
173 /*
174  * Hard Reset Configration Word - High
175  */
176 #define HRCWH_PCI_AGENT              0x00000000
177 #define HRCWH_PCI_HOST               0x80000000
178 
179 #define HRCWH_32_BIT_PCI             0x00000000
180 #define HRCWH_64_BIT_PCI             0x40000000
181 
182 #define HRCWH_PCI1_ARBITER_DISABLE   0x00000000
183 #define HRCWH_PCI1_ARBITER_ENABLE    0x20000000
184 
185 #define HRCWH_PCI2_ARBITER_DISABLE   0x00000000
186 #define HRCWH_PCI2_ARBITER_ENABLE    0x10000000
187 
188 #define HRCWH_CORE_DISABLE           0x08000000
189 #define HRCWH_CORE_ENABLE            0x00000000
190 
191 #define HRCWH_FROM_0X00000100        0x00000000
192 #define HRCWH_FROM_0XFFF00100        0x04000000
193 
194 #define HRCWH_BOOTSEQ_DISABLE        0x00000000
195 #define HRCWH_BOOTSEQ_NORMAL         0x01000000
196 #define HRCWH_BOOTSEQ_EXTENDED       0x02000000
197 
198 #define HRCWH_SW_WATCHDOG_DISABLE    0x00000000
199 #define HRCWH_SW_WATCHDOG_ENABLE     0x00800000
200 
201 #define HRCWH_ROM_LOC_DDR_SDRAM      0x00000000
202 #define HRCWH_ROM_LOC_PCI1           0x00100000
203 #define HRCWH_ROM_LOC_PCI2           0x00200000
204 #define HRCWH_ROM_LOC_LOCAL_8BIT     0x00500000
205 #define HRCWH_ROM_LOC_LOCAL_16BIT    0x00600000
206 #define HRCWH_ROM_LOC_LOCAL_32BIT    0x00700000
207 
208 #define HRCWH_TSEC1M_IN_RGMII        0x00000000
209 #define HRCWH_TSEC1M_IN_RTBI         0x00004000
210 #define HRCWH_TSEC1M_IN_GMII         0x00008000
211 #define HRCWH_TSEC1M_IN_TBI          0x0000C000
212 
213 #define HRCWH_TSEC2M_IN_RGMII        0x00000000
214 #define HRCWH_TSEC2M_IN_RTBI         0x00001000
215 #define HRCWH_TSEC2M_IN_GMII         0x00002000
216 #define HRCWH_TSEC2M_IN_TBI          0x00003000
217 
218 #define HRCWH_BIG_ENDIAN             0x00000000
219 #define HRCWH_LITTLE_ENDIAN          0x00000008
220 
221 /*
222  * Hard Reset Configration Word - Low
223  */
224 #define HRCWL_LCL_BUS_TO_SCB_CLK_1X1 0x00000000
225 #define HRCWL_LCL_BUS_TO_SCB_CLK_2X1 0x80000000
226 
227 #define HRCWL_DDR_TO_SCB_CLK_1X1     0x00000000
228 #define HRCWL_DDR_TO_SCB_CLK_2X1     0x40000000
229 
230 #define HRCWL_CSB_TO_CLKIN_16X1      0x00000000
231 #define HRCWL_CSB_TO_CLKIN_1X1       0x01000000
232 #define HRCWL_CSB_TO_CLKIN_2X1       0x02000000
233 #define HRCWL_CSB_TO_CLKIN_3X1       0x03000000
234 #define HRCWL_CSB_TO_CLKIN_4X1       0x04000000
235 #define HRCWL_CSB_TO_CLKIN_5X1       0x05000000
236 #define HRCWL_CSB_TO_CLKIN_6X1       0x06000000
237 #define HRCWL_CSB_TO_CLKIN_7X1       0x07000000
238 #define HRCWL_CSB_TO_CLKIN_8X1       0x08000000
239 #define HRCWL_CSB_TO_CLKIN_9X1       0x09000000
240 #define HRCWL_CSB_TO_CLKIN_10X1      0x0A000000
241 #define HRCWL_CSB_TO_CLKIN_11X1      0x0B000000
242 #define HRCWL_CSB_TO_CLKIN_12X1      0x0C000000
243 #define HRCWL_CSB_TO_CLKIN_13X1      0x0D000000
244 #define HRCWL_CSB_TO_CLKIN_14X1      0x0E000000
245 #define HRCWL_CSB_TO_CLKIN_15X1      0x0F000000
246 
247 #define HRCWL_VCO_BYPASS             0x00000000
248 #define HRCWL_VCO_1X2                0x00000000
249 #define HRCWL_VCO_1X4                0x00200000
250 #define HRCWL_VCO_1X8                0x00400000
251 
252 #define HRCWL_CORE_TO_CSB_BYPASS     0x00000000
253 #define HRCWL_CORE_TO_CSB_1X1        0x00020000
254 #define HRCWL_CORE_TO_CSB_1_5X1      0x00030000
255 #define HRCWL_CORE_TO_CSB_2X1        0x00040000
256 #define HRCWL_CORE_TO_CSB_2_5X1      0x00050000
257 #define HRCWL_CORE_TO_CSB_3X1        0x00060000
258 
259 /*
260  * LCRR - Clock Ratio Register (10.3.1.16)
261  */
262 #define LCRR_DBYP      0x80000000
263 #define LCRR_DBYP_SHIFT        31
264 #define LCRR_BUFCMDC   0x30000000
265 #define LCRR_BUFCMDC_1 0x10000000
266 #define LCRR_BUFCMDC_2 0x20000000
267 #define LCRR_BUFCMDC_3 0x30000000
268 #define LCRR_BUFCMDC_4 0x00000000
269 #define LCRR_BUFCMDC_SHIFT     28
270 #define LCRR_ECL       0x03000000
271 #define LCRR_ECL_4     0x00000000
272 #define LCRR_ECL_5     0x01000000
273 #define LCRR_ECL_6     0x02000000
274 #define LCRR_ECL_7     0x03000000
275 #define LCRR_ECL_SHIFT         24
276 #define LCRR_EADC      0x00030000
277 #define LCRR_EADC_1    0x00010000
278 #define LCRR_EADC_2    0x00020000
279 #define LCRR_EADC_3    0x00030000
280 #define LCRR_EADC_4    0x00000000
281 #define LCRR_EADC_SHIFT        16
282 #define LCRR_CLKDIV    0x0000000F
283 #define LCRR_CLKDIV_2  0x00000002
284 #define LCRR_CLKDIV_4  0x00000004
285 #define LCRR_CLKDIV_8  0x00000008
286 #define LCRR_CLKDIV_SHIFT       0
287 
288 #endif	/* __MPC83XX_H__ */
289