blob: d345c85bdf96ccebba5862501f03f02a522b8416 [file] [log] [blame]
Eran Liberty9095d4a2005-07-28 10:08:46 -05001/*
Ilya Yanoka3e5fd52010-06-28 16:44:33 +04002 * Copyright (C) 2004-2007, 2010 Freescale Semiconductor, Inc.
Eran Liberty9095d4a2005-07-28 10:08:46 -05003 *
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.
Eran Liberty9095d4a2005-07-28 10:08:46 -050011 */
12
Eran Liberty9095d4a2005-07-28 10:08:46 -050013#ifndef __MPC83XX_H__
14#define __MPC83XX_H__
15
Dave Liuf5035922006-10-25 14:41:21 -050016#include <config.h>
Anton Vorontsov056b2c92008-05-28 18:20:15 +040017#include <asm/fsl_lbc.h>
Eran Liberty9095d4a2005-07-28 10:08:46 -050018#if defined(CONFIG_E300)
19#include <asm/e300.h>
20#endif
21
Heiko Schocher788fa962011-09-26 13:36:53 +020022/*
23 * MPC83xx cpu provide RCR register to do reset thing specially
Eran Liberty9095d4a2005-07-28 10:08:46 -050024 */
Eran Liberty9095d4a2005-07-28 10:08:46 -050025#define MPC83xx_RESET
26
Heiko Schocher788fa962011-09-26 13:36:53 +020027/*
28 * System reset offset (PowerPC standard)
Dave Liu0b6bc772006-12-07 21:11:58 +080029 */
30#define EXC_OFF_SYS_RESET 0x0100
Rafal Jaworowski06244e42007-06-22 14:58:04 +020031#define _START_OFFSET EXC_OFF_SYS_RESET
Dave Liu0b6bc772006-12-07 21:11:58 +080032
Heiko Schocher788fa962011-09-26 13:36:53 +020033/*
34 * IMMRBAR - Internal Memory Register Base Address
Dave Liu0b6bc772006-12-07 21:11:58 +080035 */
Scott Woodb71689b2008-06-30 14:13:28 -050036#ifndef CONFIG_DEFAULT_IMMR
Heiko Schocher788fa962011-09-26 13:36:53 +020037/* Default IMMR base address */
38#define CONFIG_DEFAULT_IMMR 0xFF400000
Scott Woodb71689b2008-06-30 14:13:28 -050039#endif
Heiko Schocher788fa962011-09-26 13:36:53 +020040/* Register offset to immr */
41#define IMMRBAR 0x0000
42#define IMMRBAR_BASE_ADDR 0xFFF00000 /* Base addr. mask */
Dave Liu0b6bc772006-12-07 21:11:58 +080043#define IMMRBAR_RES ~(IMMRBAR_BASE_ADDR)
44
Heiko Schocher788fa962011-09-26 13:36:53 +020045/*
46 * LAWBAR - Local Access Window Base Address Register
Eran Liberty9095d4a2005-07-28 10:08:46 -050047 */
Heiko Schocher788fa962011-09-26 13:36:53 +020048/* Register offset to immr */
49#define LBLAWBAR0 0x0020
Dave Liu0b6bc772006-12-07 21:11:58 +080050#define LBLAWAR0 0x0024
51#define LBLAWBAR1 0x0028
52#define LBLAWAR1 0x002C
53#define LBLAWBAR2 0x0030
54#define LBLAWAR2 0x0034
55#define LBLAWBAR3 0x0038
56#define LBLAWAR3 0x003C
Heiko Schocher788fa962011-09-26 13:36:53 +020057#define LAWBAR_BAR 0xFFFFF000 /* Base addr. mask */
Eran Liberty9095d4a2005-07-28 10:08:46 -050058
Heiko Schocher788fa962011-09-26 13:36:53 +020059/*
60 * SPRIDR - System Part and Revision ID Register
Eran Liberty9095d4a2005-07-28 10:08:46 -050061 */
Kim Phillipsecb2d6f2008-03-28 10:19:07 -050062#define SPRIDR_PARTID 0xFFFF0000 /* Part Id */
63#define SPRIDR_REVID 0x0000FFFF /* Revision Id */
Dave Liu0b6bc772006-12-07 21:11:58 +080064
Peter Tyser72f2d392009-05-22 17:23:25 -050065#if defined(CONFIG_MPC834x)
Kim Phillipsecb2d6f2008-03-28 10:19:07 -050066#define REVID_MAJOR(spridr) ((spridr & 0x0000FF00) >> 8)
67#define REVID_MINOR(spridr) (spridr & 0x000000FF)
68#else
69#define REVID_MAJOR(spridr) ((spridr & 0x000000F0) >> 4)
70#define REVID_MINOR(spridr) (spridr & 0x0000000F)
71#endif
Dave Liu0b6bc772006-12-07 21:11:58 +080072
Kim Phillipsecb2d6f2008-03-28 10:19:07 -050073#define PARTID_NO_E(spridr) ((spridr & 0xFFFE0000) >> 16)
Kim Phillips868e3462008-06-16 15:55:53 -050074#define SPR_FAMILY(spridr) ((spridr & 0xFFF00000) >> 20)
Dave Liu5245ff52007-09-18 12:36:11 +080075
Ilya Yanoka3e5fd52010-06-28 16:44:33 +040076#define SPR_8308 0x8100
Kim Phillips868e3462008-06-16 15:55:53 -050077#define SPR_831X_FAMILY 0x80B
Kim Phillipsecb2d6f2008-03-28 10:19:07 -050078#define SPR_8311 0x80B2
79#define SPR_8313 0x80B0
80#define SPR_8314 0x80B6
81#define SPR_8315 0x80B4
Kim Phillips868e3462008-06-16 15:55:53 -050082#define SPR_832X_FAMILY 0x806
Kim Phillipsecb2d6f2008-03-28 10:19:07 -050083#define SPR_8321 0x8066
84#define SPR_8323 0x8062
Kim Phillips868e3462008-06-16 15:55:53 -050085#define SPR_834X_FAMILY 0x803
Kim Phillipsecb2d6f2008-03-28 10:19:07 -050086#define SPR_8343 0x8036
87#define SPR_8347_TBGA_ 0x8032
88#define SPR_8347_PBGA_ 0x8034
89#define SPR_8349 0x8030
Kim Phillips868e3462008-06-16 15:55:53 -050090#define SPR_836X_FAMILY 0x804
Kim Phillipsecb2d6f2008-03-28 10:19:07 -050091#define SPR_8358_TBGA_ 0x804A
92#define SPR_8358_PBGA_ 0x804E
93#define SPR_8360 0x8048
Kim Phillips868e3462008-06-16 15:55:53 -050094#define SPR_837X_FAMILY 0x80C
Kim Phillipsecb2d6f2008-03-28 10:19:07 -050095#define SPR_8377 0x80C6
96#define SPR_8378 0x80C4
97#define SPR_8379 0x80C2
Scott Wood9f15d502007-04-16 14:31:55 -050098
Heiko Schocher788fa962011-09-26 13:36:53 +020099/*
100 * SPCR - System Priority Configuration Register
Dave Liu0b6bc772006-12-07 21:11:58 +0800101 */
Heiko Schocher788fa962011-09-26 13:36:53 +0200102/* PCI Highest Priority Enable */
103#define SPCR_PCIHPE 0x10000000
Dave Liu0b6bc772006-12-07 21:11:58 +0800104#define SPCR_PCIHPE_SHIFT (31-3)
Heiko Schocher788fa962011-09-26 13:36:53 +0200105/* PCI bridge system bus request priority */
106#define SPCR_PCIPR 0x03000000
Dave Liu0b6bc772006-12-07 21:11:58 +0800107#define SPCR_PCIPR_SHIFT (31-7)
108#define SPCR_OPT 0x00800000 /* Optimize */
Michael Barkowski06e2e192008-03-20 13:15:34 -0400109#define SPCR_OPT_SHIFT (31-8)
Heiko Schocher788fa962011-09-26 13:36:53 +0200110/* E300 PowerPC core time base unit enable */
111#define SPCR_TBEN 0x00400000
Dave Liu0b6bc772006-12-07 21:11:58 +0800112#define SPCR_TBEN_SHIFT (31-9)
Heiko Schocher788fa962011-09-26 13:36:53 +0200113/* E300 PowerPC Core system bus request priority */
114#define SPCR_COREPR 0x00300000
Dave Liu0b6bc772006-12-07 21:11:58 +0800115#define SPCR_COREPR_SHIFT (31-11)
116
Peter Tyser72f2d392009-05-22 17:23:25 -0500117#if defined(CONFIG_MPC834x)
Dave Liu0b6bc772006-12-07 21:11:58 +0800118/* SPCR bits - MPC8349 specific */
Heiko Schocher788fa962011-09-26 13:36:53 +0200119/* TSEC1 data priority */
120#define SPCR_TSEC1DP 0x00003000
Dave Liu0b6bc772006-12-07 21:11:58 +0800121#define SPCR_TSEC1DP_SHIFT (31-19)
Heiko Schocher788fa962011-09-26 13:36:53 +0200122/* TSEC1 buffer descriptor priority */
123#define SPCR_TSEC1BDP 0x00000C00
Dave Liu0b6bc772006-12-07 21:11:58 +0800124#define SPCR_TSEC1BDP_SHIFT (31-21)
Heiko Schocher788fa962011-09-26 13:36:53 +0200125/* TSEC1 emergency priority */
126#define SPCR_TSEC1EP 0x00000300
Dave Liu0b6bc772006-12-07 21:11:58 +0800127#define SPCR_TSEC1EP_SHIFT (31-23)
Heiko Schocher788fa962011-09-26 13:36:53 +0200128/* TSEC2 data priority */
129#define SPCR_TSEC2DP 0x00000030
Dave Liu0b6bc772006-12-07 21:11:58 +0800130#define SPCR_TSEC2DP_SHIFT (31-27)
Heiko Schocher788fa962011-09-26 13:36:53 +0200131/* TSEC2 buffer descriptor priority */
132#define SPCR_TSEC2BDP 0x0000000C
Dave Liu0b6bc772006-12-07 21:11:58 +0800133#define SPCR_TSEC2BDP_SHIFT (31-29)
Heiko Schocher788fa962011-09-26 13:36:53 +0200134/* TSEC2 emergency priority */
135#define SPCR_TSEC2EP 0x00000003
Dave Liu0b6bc772006-12-07 21:11:58 +0800136#define SPCR_TSEC2EP_SHIFT (31-31)
Scott Wood9f15d502007-04-16 14:31:55 -0500137
Ilya Yanoka3e5fd52010-06-28 16:44:33 +0400138#elif defined(CONFIG_MPC8308) || defined(CONFIG_MPC831x) || \
139 defined(CONFIG_MPC837x)
140/* SPCR bits - MPC8308, MPC831x and MPC837x specific */
Heiko Schocher788fa962011-09-26 13:36:53 +0200141/* TSEC data priority */
142#define SPCR_TSECDP 0x00003000
Scott Wood9f15d502007-04-16 14:31:55 -0500143#define SPCR_TSECDP_SHIFT (31-19)
Heiko Schocher788fa962011-09-26 13:36:53 +0200144/* TSEC buffer descriptor priority */
145#define SPCR_TSECBDP 0x00000C00
Dave Liu70de8dc2008-01-10 23:05:00 +0800146#define SPCR_TSECBDP_SHIFT (31-21)
Heiko Schocher788fa962011-09-26 13:36:53 +0200147/* TSEC emergency priority */
148#define SPCR_TSECEP 0x00000300
Dave Liu70de8dc2008-01-10 23:05:00 +0800149#define SPCR_TSECEP_SHIFT (31-23)
Dave Liu0b6bc772006-12-07 21:11:58 +0800150#endif
Eran Liberty9095d4a2005-07-28 10:08:46 -0500151
Dave Liu0b6bc772006-12-07 21:11:58 +0800152/* SICRL/H - System I/O Configuration Register Low/High
Eran Liberty9095d4a2005-07-28 10:08:46 -0500153 */
Peter Tyser72f2d392009-05-22 17:23:25 -0500154#if defined(CONFIG_MPC834x)
Dave Liu0b6bc772006-12-07 21:11:58 +0800155/* SICRL bits - MPC8349 specific */
156#define SICRL_LDP_A 0x80000000
157#define SICRL_USB1 0x40000000
158#define SICRL_USB0 0x20000000
159#define SICRL_UART 0x0C000000
160#define SICRL_GPIO1_A 0x02000000
161#define SICRL_GPIO1_B 0x01000000
162#define SICRL_GPIO1_C 0x00800000
163#define SICRL_GPIO1_D 0x00400000
164#define SICRL_GPIO1_E 0x00200000
165#define SICRL_GPIO1_F 0x00180000
166#define SICRL_GPIO1_G 0x00040000
167#define SICRL_GPIO1_H 0x00020000
168#define SICRL_GPIO1_I 0x00010000
169#define SICRL_GPIO1_J 0x00008000
170#define SICRL_GPIO1_K 0x00004000
171#define SICRL_GPIO1_L 0x00003000
172
173/* SICRH bits - MPC8349 specific */
174#define SICRH_DDR 0x80000000
175#define SICRH_TSEC1_A 0x10000000
176#define SICRH_TSEC1_B 0x08000000
177#define SICRH_TSEC1_C 0x04000000
178#define SICRH_TSEC1_D 0x02000000
179#define SICRH_TSEC1_E 0x01000000
180#define SICRH_TSEC1_F 0x00800000
181#define SICRH_TSEC2_A 0x00400000
182#define SICRH_TSEC2_B 0x00200000
183#define SICRH_TSEC2_C 0x00100000
184#define SICRH_TSEC2_D 0x00080000
185#define SICRH_TSEC2_E 0x00040000
186#define SICRH_TSEC2_F 0x00020000
187#define SICRH_TSEC2_G 0x00010000
188#define SICRH_TSEC2_H 0x00008000
189#define SICRH_GPIO2_A 0x00004000
190#define SICRH_GPIO2_B 0x00002000
191#define SICRH_GPIO2_C 0x00001000
192#define SICRH_GPIO2_D 0x00000800
193#define SICRH_GPIO2_E 0x00000400
194#define SICRH_GPIO2_F 0x00000200
195#define SICRH_GPIO2_G 0x00000180
196#define SICRH_GPIO2_H 0x00000060
197#define SICRH_TSOBI1 0x00000002
198#define SICRH_TSOBI2 0x00000001
Eran Liberty9095d4a2005-07-28 10:08:46 -0500199
Dave Liu0b6bc772006-12-07 21:11:58 +0800200#elif defined(CONFIG_MPC8360)
201/* SICRL bits - MPC8360 specific */
202#define SICRL_LDP_A 0xC0000000
203#define SICRL_LCLK_1 0x10000000
204#define SICRL_LCLK_2 0x08000000
205#define SICRL_SRCID_A 0x03000000
206#define SICRL_IRQ_CKSTP_A 0x00C00000
Eran Liberty9095d4a2005-07-28 10:08:46 -0500207
Dave Liu0b6bc772006-12-07 21:11:58 +0800208/* SICRH bits - MPC8360 specific */
209#define SICRH_DDR 0x80000000
210#define SICRH_SECONDARY_DDR 0x40000000
211#define SICRH_SDDROE 0x20000000
212#define SICRH_IRQ3 0x10000000
213#define SICRH_UC1EOBI 0x00000004
214#define SICRH_UC2E1OBI 0x00000002
215#define SICRH_UC2E2OBI 0x00000001
Dave Liue740c462006-12-07 21:13:15 +0800216
Peter Tyser72f2d392009-05-22 17:23:25 -0500217#elif defined(CONFIG_MPC832x)
218/* SICRL bits - MPC832x specific */
Dave Liue740c462006-12-07 21:13:15 +0800219#define SICRL_LDP_LCS_A 0x80000000
220#define SICRL_IRQ_CKS 0x20000000
221#define SICRL_PCI_MSRC 0x10000000
222#define SICRL_URT_CTPR 0x06000000
223#define SICRL_IRQ_CTPR 0x00C00000
Scott Wood9f15d502007-04-16 14:31:55 -0500224
Dave Liue0cfec82007-09-18 12:36:58 +0800225#elif defined(CONFIG_MPC8313)
226/* SICRL bits - MPC8313 specific */
Scott Wood9f15d502007-04-16 14:31:55 -0500227#define SICRL_LBC 0x30000000
228#define SICRL_UART 0x0C000000
229#define SICRL_SPI_A 0x03000000
230#define SICRL_SPI_B 0x00C00000
231#define SICRL_SPI_C 0x00300000
232#define SICRL_SPI_D 0x000C0000
Ron Madridbd258af2010-06-01 17:00:49 -0700233#define SICRL_USBDR_11 0x00000C00
234#define SICRL_USBDR_10 0x00000800
235#define SICRL_USBDR_01 0x00000400
236#define SICRL_USBDR_00 0x00000000
Scott Wood9f15d502007-04-16 14:31:55 -0500237#define SICRL_ETSEC1_A 0x0000000C
238#define SICRL_ETSEC2_A 0x00000003
239
Dave Liue0cfec82007-09-18 12:36:58 +0800240/* SICRH bits - MPC8313 specific */
Scott Wood9f15d502007-04-16 14:31:55 -0500241#define SICRH_INTR_A 0x02000000
242#define SICRH_INTR_B 0x00C00000
243#define SICRH_IIC 0x00300000
244#define SICRH_ETSEC2_B 0x000C0000
245#define SICRH_ETSEC2_C 0x00030000
246#define SICRH_ETSEC2_D 0x0000C000
247#define SICRH_ETSEC2_E 0x00003000
248#define SICRH_ETSEC2_F 0x00000C00
249#define SICRH_ETSEC2_G 0x00000300
250#define SICRH_ETSEC1_B 0x00000080
251#define SICRH_ETSEC1_C 0x00000060
252#define SICRH_GTX1_DLY 0x00000008
253#define SICRH_GTX2_DLY 0x00000004
254#define SICRH_TSOBI1 0x00000002
255#define SICRH_TSOBI2 0x00000001
256
Dave Liue0cfec82007-09-18 12:36:58 +0800257#elif defined(CONFIG_MPC8315)
258/* SICRL bits - MPC8315 specific */
259#define SICRL_DMA_CH0 0xc0000000
260#define SICRL_DMA_SPI 0x30000000
261#define SICRL_UART 0x0c000000
262#define SICRL_IRQ4 0x02000000
263#define SICRL_IRQ5 0x01800000
264#define SICRL_IRQ6_7 0x00400000
265#define SICRL_IIC1 0x00300000
266#define SICRL_TDM 0x000c0000
267#define SICRL_TDM_SHARED 0x00030000
268#define SICRL_PCI_A 0x0000c000
269#define SICRL_ELBC_A 0x00003000
270#define SICRL_ETSEC1_A 0x000000c0
271#define SICRL_ETSEC1_B 0x00000030
272#define SICRL_ETSEC1_C 0x0000000c
273#define SICRL_TSEXPOBI 0x00000001
274
275/* SICRH bits - MPC8315 specific */
276#define SICRH_GPIO_0 0xc0000000
277#define SICRH_GPIO_1 0x30000000
278#define SICRH_GPIO_2 0x0c000000
279#define SICRH_GPIO_3 0x03000000
280#define SICRH_GPIO_4 0x00c00000
281#define SICRH_GPIO_5 0x00300000
282#define SICRH_GPIO_6 0x000c0000
283#define SICRH_GPIO_7 0x00030000
284#define SICRH_GPIO_8 0x0000c000
285#define SICRH_GPIO_9 0x00003000
286#define SICRH_GPIO_10 0x00000c00
287#define SICRH_GPIO_11 0x00000300
288#define SICRH_ETSEC2_A 0x000000c0
289#define SICRH_TSOBI1 0x00000002
290#define SICRH_TSOBI2 0x00000001
291
Peter Tyser72f2d392009-05-22 17:23:25 -0500292#elif defined(CONFIG_MPC837x)
Dave Liu5245ff52007-09-18 12:36:11 +0800293/* SICRL bits - MPC837x specific */
294#define SICRL_USB_A 0xC0000000
295#define SICRL_USB_B 0x30000000
Andy Fleming1463b4b2008-10-30 16:50:14 -0500296#define SICRL_USB_B_SD 0x20000000
Dave Liu5245ff52007-09-18 12:36:11 +0800297#define SICRL_UART 0x0C000000
298#define SICRL_GPIO_A 0x02000000
299#define SICRL_GPIO_B 0x01000000
300#define SICRL_GPIO_C 0x00800000
301#define SICRL_GPIO_D 0x00400000
302#define SICRL_GPIO_E 0x00200000
303#define SICRL_GPIO_F 0x00180000
304#define SICRL_GPIO_G 0x00040000
305#define SICRL_GPIO_H 0x00020000
306#define SICRL_GPIO_I 0x00010000
307#define SICRL_GPIO_J 0x00008000
308#define SICRL_GPIO_K 0x00004000
309#define SICRL_GPIO_L 0x00003000
310#define SICRL_DMA_A 0x00000800
311#define SICRL_DMA_B 0x00000400
312#define SICRL_DMA_C 0x00000200
313#define SICRL_DMA_D 0x00000100
314#define SICRL_DMA_E 0x00000080
315#define SICRL_DMA_F 0x00000040
316#define SICRL_DMA_G 0x00000020
317#define SICRL_DMA_H 0x00000010
318#define SICRL_DMA_I 0x00000008
319#define SICRL_DMA_J 0x00000004
320#define SICRL_LDP_A 0x00000002
321#define SICRL_LDP_B 0x00000001
322
323/* SICRH bits - MPC837x specific */
324#define SICRH_DDR 0x80000000
325#define SICRH_TSEC1_A 0x10000000
326#define SICRH_TSEC1_B 0x08000000
327#define SICRH_TSEC2_A 0x00400000
328#define SICRH_TSEC2_B 0x00200000
329#define SICRH_TSEC2_C 0x00100000
330#define SICRH_TSEC2_D 0x00080000
331#define SICRH_TSEC2_E 0x00040000
332#define SICRH_TMR 0x00010000
333#define SICRH_GPIO2_A 0x00008000
334#define SICRH_GPIO2_B 0x00004000
335#define SICRH_GPIO2_C 0x00002000
336#define SICRH_GPIO2_D 0x00001000
337#define SICRH_GPIO2_E 0x00000C00
Andy Fleming1463b4b2008-10-30 16:50:14 -0500338#define SICRH_GPIO2_E_SD 0x00000800
Dave Liu5245ff52007-09-18 12:36:11 +0800339#define SICRH_GPIO2_F 0x00000300
340#define SICRH_GPIO2_G 0x000000C0
341#define SICRH_GPIO2_H 0x00000030
342#define SICRH_SPI 0x00000003
Andy Fleming1463b4b2008-10-30 16:50:14 -0500343#define SICRH_SPI_SD 0x00000001
Ilya Yanok1a2afd32010-09-17 23:41:48 +0200344
345#elif defined(CONFIG_MPC8308)
346/* SICRL bits - MPC8308 specific */
347#define SICRL_SPI_PF0 (0 << 28)
348#define SICRL_SPI_PF1 (1 << 28)
349#define SICRL_SPI_PF3 (3 << 28)
350#define SICRL_UART_PF0 (0 << 26)
351#define SICRL_UART_PF1 (1 << 26)
352#define SICRL_UART_PF3 (3 << 26)
353#define SICRL_IRQ_PF0 (0 << 24)
354#define SICRL_IRQ_PF1 (1 << 24)
355#define SICRL_I2C2_PF0 (0 << 20)
356#define SICRL_I2C2_PF1 (1 << 20)
357#define SICRL_ETSEC1_TX_CLK (0 << 6)
358#define SICRL_ETSEC1_GTX_CLK125 (1 << 6)
359
360/* SICRH bits - MPC8308 specific */
361#define SICRH_ESDHC_A_SD (0 << 30)
362#define SICRH_ESDHC_A_GTM (1 << 30)
363#define SICRH_ESDHC_A_GPIO (3 << 30)
364#define SICRH_ESDHC_B_SD (0 << 28)
365#define SICRH_ESDHC_B_GTM (1 << 28)
366#define SICRH_ESDHC_B_GPIO (3 << 28)
367#define SICRH_ESDHC_C_SD (0 << 26)
368#define SICRH_ESDHC_C_GTM (1 << 26)
369#define SICRH_ESDHC_C_GPIO (3 << 26)
370#define SICRH_GPIO_A_GPIO (0 << 24)
371#define SICRH_GPIO_A_TSEC2 (1 << 24)
372#define SICRH_GPIO_B_GPIO (0 << 22)
373#define SICRH_GPIO_B_TSEC2_TX_CLK (1 << 22)
374#define SICRH_GPIO_B_TSEC2_GTX_CLK125 (2 << 22)
375#define SICRH_IEEE1588_A_TMR (1 << 20)
376#define SICRH_IEEE1588_A_GPIO (3 << 20)
377#define SICRH_USB (1 << 18)
378#define SICRH_GTM_GTM (1 << 16)
379#define SICRH_GTM_GPIO (3 << 16)
380#define SICRH_IEEE1588_B_TMR (1 << 14)
381#define SICRH_IEEE1588_B_GPIO (3 << 14)
382#define SICRH_ETSEC2_CRS (1 << 12)
383#define SICRH_ETSEC2_GPIO (3 << 12)
384#define SICRH_GPIOSEL_0 (0 << 8)
385#define SICRH_GPIOSEL_1 (1 << 8)
386#define SICRH_TMROBI_V3P3 (0 << 4)
387#define SICRH_TMROBI_V2P5 (1 << 4)
388#define SICRH_TSOBI1_V3P3 (0 << 1)
389#define SICRH_TSOBI1_V2P5 (1 << 1)
390#define SICRH_TSOBI2_V3P3 (0 << 0)
391#define SICRH_TSOBI2_V2P5 (1 << 0)
Dave Liu0b6bc772006-12-07 21:11:58 +0800392#endif
Eran Liberty9095d4a2005-07-28 10:08:46 -0500393
Heiko Schocher788fa962011-09-26 13:36:53 +0200394/*
395 * SWCRR - System Watchdog Control Register
Eran Liberty9095d4a2005-07-28 10:08:46 -0500396 */
Heiko Schocher788fa962011-09-26 13:36:53 +0200397/* Register offset to immr */
398#define SWCRR 0x0204
399/* Software Watchdog Time Count */
400#define SWCRR_SWTC 0xFFFF0000
401/* Watchdog Enable bit */
402#define SWCRR_SWEN 0x00000004
403/* Software Watchdog Reset/Interrupt Select bit */
404#define SWCRR_SWRI 0x00000002
405/* Software Watchdog Counter Prescale bit */
406#define SWCRR_SWPR 0x00000001
407#define SWCRR_RES (~(SWCRR_SWTC | SWCRR_SWEN | \
408 SWCRR_SWRI | SWCRR_SWPR))
Eran Liberty9095d4a2005-07-28 10:08:46 -0500409
Heiko Schocher788fa962011-09-26 13:36:53 +0200410/*
411 * SWCNR - System Watchdog Counter Register
Eran Liberty9095d4a2005-07-28 10:08:46 -0500412 */
Heiko Schocher788fa962011-09-26 13:36:53 +0200413/* Register offset to immr */
414#define SWCNR 0x0208
415/* Software Watchdog Count mask */
416#define SWCNR_SWCN 0x0000FFFF
Dave Liu0b6bc772006-12-07 21:11:58 +0800417#define SWCNR_RES ~(SWCNR_SWCN)
Eran Liberty9095d4a2005-07-28 10:08:46 -0500418
Heiko Schocher788fa962011-09-26 13:36:53 +0200419/*
420 * SWSRR - System Watchdog Service Register
Dave Liuf5035922006-10-25 14:41:21 -0500421 */
Heiko Schocher788fa962011-09-26 13:36:53 +0200422/* Register offset to immr */
423#define SWSRR 0x020E
Dave Liua46daea2006-11-03 19:33:44 -0600424
Heiko Schocher788fa962011-09-26 13:36:53 +0200425/*
426 * ACR - Arbiter Configuration Register
Dave Liu0b6bc772006-12-07 21:11:58 +0800427 */
428#define ACR_COREDIS 0x10000000 /* Core disable */
429#define ACR_COREDIS_SHIFT (31-7)
430#define ACR_PIPE_DEP 0x00070000 /* Pipeline depth */
431#define ACR_PIPE_DEP_SHIFT (31-15)
432#define ACR_PCI_RPTCNT 0x00007000 /* PCI repeat count */
433#define ACR_PCI_RPTCNT_SHIFT (31-19)
434#define ACR_RPTCNT 0x00000700 /* Repeat count */
435#define ACR_RPTCNT_SHIFT (31-23)
436#define ACR_APARK 0x00000030 /* Address parking */
437#define ACR_APARK_SHIFT (31-27)
438#define ACR_PARKM 0x0000000F /* Parking master */
439#define ACR_PARKM_SHIFT (31-31)
Dave Liua46daea2006-11-03 19:33:44 -0600440
Heiko Schocher788fa962011-09-26 13:36:53 +0200441/*
442 * ATR - Arbiter Timers Register
Dave Liu0b6bc772006-12-07 21:11:58 +0800443 */
444#define ATR_DTO 0x00FF0000 /* Data time out */
Nick Spence67c2e5c2008-08-22 23:52:40 -0700445#define ATR_DTO_SHIFT 16
Dave Liu0b6bc772006-12-07 21:11:58 +0800446#define ATR_ATO 0x000000FF /* Address time out */
Nick Spence67c2e5c2008-08-22 23:52:40 -0700447#define ATR_ATO_SHIFT 0
Eran Liberty9095d4a2005-07-28 10:08:46 -0500448
Heiko Schocher788fa962011-09-26 13:36:53 +0200449/*
450 * AER - Arbiter Event Register
Eran Liberty9095d4a2005-07-28 10:08:46 -0500451 */
Dave Liu0b6bc772006-12-07 21:11:58 +0800452#define AER_ETEA 0x00000020 /* Transfer error */
Heiko Schocher788fa962011-09-26 13:36:53 +0200453/* Reserved transfer type */
454#define AER_RES 0x00000010
455/* External control word transfer type */
456#define AER_ECW 0x00000008
457/* Address Only transfer type */
458#define AER_AO 0x00000004
Dave Liu0b6bc772006-12-07 21:11:58 +0800459#define AER_DTO 0x00000002 /* Data time out */
460#define AER_ATO 0x00000001 /* Address time out */
Eran Liberty9095d4a2005-07-28 10:08:46 -0500461
Heiko Schocher788fa962011-09-26 13:36:53 +0200462/*
463 * AEATR - Arbiter Event Address Register
Dave Liu0b6bc772006-12-07 21:11:58 +0800464 */
465#define AEATR_EVENT 0x07000000 /* Event type */
Nick Spence67c2e5c2008-08-22 23:52:40 -0700466#define AEATR_EVENT_SHIFT 24
Dave Liu0b6bc772006-12-07 21:11:58 +0800467#define AEATR_MSTR_ID 0x001F0000 /* Master Id */
Nick Spence67c2e5c2008-08-22 23:52:40 -0700468#define AEATR_MSTR_ID_SHIFT 16
Dave Liu0b6bc772006-12-07 21:11:58 +0800469#define AEATR_TBST 0x00000800 /* Transfer burst */
Nick Spence67c2e5c2008-08-22 23:52:40 -0700470#define AEATR_TBST_SHIFT 11
Dave Liu0b6bc772006-12-07 21:11:58 +0800471#define AEATR_TSIZE 0x00000700 /* Transfer Size */
Nick Spence67c2e5c2008-08-22 23:52:40 -0700472#define AEATR_TSIZE_SHIFT 8
Dave Liu0b6bc772006-12-07 21:11:58 +0800473#define AEATR_TTYPE 0x0000001F /* Transfer Type */
Nick Spence67c2e5c2008-08-22 23:52:40 -0700474#define AEATR_TTYPE_SHIFT 0
Eran Liberty9095d4a2005-07-28 10:08:46 -0500475
Heiko Schocher788fa962011-09-26 13:36:53 +0200476/*
477 * HRCWL - Hard Reset Configuration Word Low
Dave Liu0b6bc772006-12-07 21:11:58 +0800478 */
479#define HRCWL_LBIUCM 0x80000000
480#define HRCWL_LBIUCM_SHIFT 31
481#define HRCWL_LCL_BUS_TO_SCB_CLK_1X1 0x00000000
482#define HRCWL_LCL_BUS_TO_SCB_CLK_2X1 0x80000000
Eran Liberty9095d4a2005-07-28 10:08:46 -0500483
Dave Liu0b6bc772006-12-07 21:11:58 +0800484#define HRCWL_DDRCM 0x40000000
485#define HRCWL_DDRCM_SHIFT 30
486#define HRCWL_DDR_TO_SCB_CLK_1X1 0x00000000
487#define HRCWL_DDR_TO_SCB_CLK_2X1 0x40000000
Eran Liberty9095d4a2005-07-28 10:08:46 -0500488
Dave Liu0b6bc772006-12-07 21:11:58 +0800489#define HRCWL_SPMF 0x0f000000
490#define HRCWL_SPMF_SHIFT 24
491#define HRCWL_CSB_TO_CLKIN_16X1 0x00000000
492#define HRCWL_CSB_TO_CLKIN_1X1 0x01000000
493#define HRCWL_CSB_TO_CLKIN_2X1 0x02000000
494#define HRCWL_CSB_TO_CLKIN_3X1 0x03000000
495#define HRCWL_CSB_TO_CLKIN_4X1 0x04000000
496#define HRCWL_CSB_TO_CLKIN_5X1 0x05000000
497#define HRCWL_CSB_TO_CLKIN_6X1 0x06000000
498#define HRCWL_CSB_TO_CLKIN_7X1 0x07000000
499#define HRCWL_CSB_TO_CLKIN_8X1 0x08000000
500#define HRCWL_CSB_TO_CLKIN_9X1 0x09000000
501#define HRCWL_CSB_TO_CLKIN_10X1 0x0A000000
502#define HRCWL_CSB_TO_CLKIN_11X1 0x0B000000
503#define HRCWL_CSB_TO_CLKIN_12X1 0x0C000000
504#define HRCWL_CSB_TO_CLKIN_13X1 0x0D000000
505#define HRCWL_CSB_TO_CLKIN_14X1 0x0E000000
506#define HRCWL_CSB_TO_CLKIN_15X1 0x0F000000
Eran Liberty9095d4a2005-07-28 10:08:46 -0500507
Dave Liu0b6bc772006-12-07 21:11:58 +0800508#define HRCWL_VCO_BYPASS 0x00000000
509#define HRCWL_VCO_1X2 0x00000000
510#define HRCWL_VCO_1X4 0x00200000
511#define HRCWL_VCO_1X8 0x00400000
Eran Liberty9095d4a2005-07-28 10:08:46 -0500512
Dave Liu0b6bc772006-12-07 21:11:58 +0800513#define HRCWL_COREPLL 0x007F0000
514#define HRCWL_COREPLL_SHIFT 16
515#define HRCWL_CORE_TO_CSB_BYPASS 0x00000000
516#define HRCWL_CORE_TO_CSB_1X1 0x00020000
517#define HRCWL_CORE_TO_CSB_1_5X1 0x00030000
518#define HRCWL_CORE_TO_CSB_2X1 0x00040000
519#define HRCWL_CORE_TO_CSB_2_5X1 0x00050000
520#define HRCWL_CORE_TO_CSB_3X1 0x00060000
521
Peter Tyser72f2d392009-05-22 17:23:25 -0500522#if defined(CONFIG_MPC8360) || defined(CONFIG_MPC832x)
Dave Liu0b6bc772006-12-07 21:11:58 +0800523#define HRCWL_CEVCOD 0x000000C0
524#define HRCWL_CEVCOD_SHIFT 6
525#define HRCWL_CE_PLL_VCO_DIV_4 0x00000000
526#define HRCWL_CE_PLL_VCO_DIV_8 0x00000040
527#define HRCWL_CE_PLL_VCO_DIV_2 0x00000080
528
529#define HRCWL_CEPDF 0x00000020
530#define HRCWL_CEPDF_SHIFT 5
531#define HRCWL_CE_PLL_DIV_1X1 0x00000000
532#define HRCWL_CE_PLL_DIV_2X1 0x00000020
533
534#define HRCWL_CEPMF 0x0000001F
535#define HRCWL_CEPMF_SHIFT 0
536#define HRCWL_CE_TO_PLL_1X16_ 0x00000000
537#define HRCWL_CE_TO_PLL_1X2 0x00000002
538#define HRCWL_CE_TO_PLL_1X3 0x00000003
539#define HRCWL_CE_TO_PLL_1X4 0x00000004
540#define HRCWL_CE_TO_PLL_1X5 0x00000005
541#define HRCWL_CE_TO_PLL_1X6 0x00000006
542#define HRCWL_CE_TO_PLL_1X7 0x00000007
543#define HRCWL_CE_TO_PLL_1X8 0x00000008
544#define HRCWL_CE_TO_PLL_1X9 0x00000009
545#define HRCWL_CE_TO_PLL_1X10 0x0000000A
546#define HRCWL_CE_TO_PLL_1X11 0x0000000B
547#define HRCWL_CE_TO_PLL_1X12 0x0000000C
548#define HRCWL_CE_TO_PLL_1X13 0x0000000D
549#define HRCWL_CE_TO_PLL_1X14 0x0000000E
550#define HRCWL_CE_TO_PLL_1X15 0x0000000F
551#define HRCWL_CE_TO_PLL_1X16 0x00000010
552#define HRCWL_CE_TO_PLL_1X17 0x00000011
553#define HRCWL_CE_TO_PLL_1X18 0x00000012
554#define HRCWL_CE_TO_PLL_1X19 0x00000013
555#define HRCWL_CE_TO_PLL_1X20 0x00000014
556#define HRCWL_CE_TO_PLL_1X21 0x00000015
557#define HRCWL_CE_TO_PLL_1X22 0x00000016
558#define HRCWL_CE_TO_PLL_1X23 0x00000017
559#define HRCWL_CE_TO_PLL_1X24 0x00000018
560#define HRCWL_CE_TO_PLL_1X25 0x00000019
561#define HRCWL_CE_TO_PLL_1X26 0x0000001A
562#define HRCWL_CE_TO_PLL_1X27 0x0000001B
563#define HRCWL_CE_TO_PLL_1X28 0x0000001C
564#define HRCWL_CE_TO_PLL_1X29 0x0000001D
565#define HRCWL_CE_TO_PLL_1X30 0x0000001E
566#define HRCWL_CE_TO_PLL_1X31 0x0000001F
Dave Liu5245ff52007-09-18 12:36:11 +0800567
Ilya Yanoka3e5fd52010-06-28 16:44:33 +0400568#elif defined(CONFIG_MPC8308) || defined(CONFIG_MPC8315)
Dave Liu045338e2008-01-10 23:06:05 +0800569#define HRCWL_SVCOD 0x30000000
570#define HRCWL_SVCOD_SHIFT 28
571#define HRCWL_SVCOD_DIV_2 0x00000000
572#define HRCWL_SVCOD_DIV_4 0x10000000
573#define HRCWL_SVCOD_DIV_8 0x20000000
574#define HRCWL_SVCOD_DIV_1 0x30000000
575
Peter Tyser72f2d392009-05-22 17:23:25 -0500576#elif defined(CONFIG_MPC837x)
Dave Liu5245ff52007-09-18 12:36:11 +0800577#define HRCWL_SVCOD 0x30000000
578#define HRCWL_SVCOD_SHIFT 28
579#define HRCWL_SVCOD_DIV_4 0x00000000
580#define HRCWL_SVCOD_DIV_8 0x10000000
581#define HRCWL_SVCOD_DIV_2 0x20000000
582#define HRCWL_SVCOD_DIV_1 0x30000000
Dave Liu0b6bc772006-12-07 21:11:58 +0800583#endif
584
Heiko Schocher788fa962011-09-26 13:36:53 +0200585/*
586 * HRCWH - Hardware Reset Configuration Word High
Jon Loeligerebc72242005-08-01 13:20:47 -0500587 */
Dave Liu0b6bc772006-12-07 21:11:58 +0800588#define HRCWH_PCI_HOST 0x80000000
589#define HRCWH_PCI_HOST_SHIFT 31
590#define HRCWH_PCI_AGENT 0x00000000
Eran Liberty9095d4a2005-07-28 10:08:46 -0500591
Peter Tyser72f2d392009-05-22 17:23:25 -0500592#if defined(CONFIG_MPC834x)
Dave Liu0b6bc772006-12-07 21:11:58 +0800593#define HRCWH_32_BIT_PCI 0x00000000
594#define HRCWH_64_BIT_PCI 0x40000000
Dave Liua46daea2006-11-03 19:33:44 -0600595#endif
Eran Liberty9095d4a2005-07-28 10:08:46 -0500596
Dave Liu0b6bc772006-12-07 21:11:58 +0800597#define HRCWH_PCI1_ARBITER_DISABLE 0x00000000
598#define HRCWH_PCI1_ARBITER_ENABLE 0x20000000
Eran Liberty9095d4a2005-07-28 10:08:46 -0500599
Dave Liu0b6bc772006-12-07 21:11:58 +0800600#define HRCWH_PCI_ARBITER_DISABLE 0x00000000
601#define HRCWH_PCI_ARBITER_ENABLE 0x20000000
602
Peter Tyser72f2d392009-05-22 17:23:25 -0500603#if defined(CONFIG_MPC834x)
Dave Liu0b6bc772006-12-07 21:11:58 +0800604#define HRCWH_PCI2_ARBITER_DISABLE 0x00000000
605#define HRCWH_PCI2_ARBITER_ENABLE 0x10000000
606
607#elif defined(CONFIG_MPC8360)
608#define HRCWH_PCICKDRV_DISABLE 0x00000000
609#define HRCWH_PCICKDRV_ENABLE 0x10000000
Dave Liua46daea2006-11-03 19:33:44 -0600610#endif
Eran Liberty9095d4a2005-07-28 10:08:46 -0500611
Dave Liu0b6bc772006-12-07 21:11:58 +0800612#define HRCWH_CORE_DISABLE 0x08000000
613#define HRCWH_CORE_ENABLE 0x00000000
Eran Liberty9095d4a2005-07-28 10:08:46 -0500614
Dave Liu0b6bc772006-12-07 21:11:58 +0800615#define HRCWH_FROM_0X00000100 0x00000000
616#define HRCWH_FROM_0XFFF00100 0x04000000
Eran Liberty9095d4a2005-07-28 10:08:46 -0500617
Dave Liu0b6bc772006-12-07 21:11:58 +0800618#define HRCWH_BOOTSEQ_DISABLE 0x00000000
619#define HRCWH_BOOTSEQ_NORMAL 0x01000000
620#define HRCWH_BOOTSEQ_EXTENDED 0x02000000
Eran Liberty9095d4a2005-07-28 10:08:46 -0500621
Dave Liu0b6bc772006-12-07 21:11:58 +0800622#define HRCWH_SW_WATCHDOG_DISABLE 0x00000000
623#define HRCWH_SW_WATCHDOG_ENABLE 0x00800000
Eran Liberty9095d4a2005-07-28 10:08:46 -0500624
Dave Liu0b6bc772006-12-07 21:11:58 +0800625#define HRCWH_ROM_LOC_DDR_SDRAM 0x00000000
626#define HRCWH_ROM_LOC_PCI1 0x00100000
Peter Tyser72f2d392009-05-22 17:23:25 -0500627#if defined(CONFIG_MPC834x)
Dave Liu0b6bc772006-12-07 21:11:58 +0800628#define HRCWH_ROM_LOC_PCI2 0x00200000
Dave Liua46daea2006-11-03 19:33:44 -0600629#endif
Peter Tyser72f2d392009-05-22 17:23:25 -0500630#if defined(CONFIG_MPC837x)
Dave Liu5245ff52007-09-18 12:36:11 +0800631#define HRCWH_ROM_LOC_ON_CHIP_ROM 0x00300000
632#endif
Dave Liu0b6bc772006-12-07 21:11:58 +0800633#define HRCWH_ROM_LOC_LOCAL_8BIT 0x00500000
634#define HRCWH_ROM_LOC_LOCAL_16BIT 0x00600000
635#define HRCWH_ROM_LOC_LOCAL_32BIT 0x00700000
Eran Liberty9095d4a2005-07-28 10:08:46 -0500636
Ilya Yanoka3e5fd52010-06-28 16:44:33 +0400637#if defined(CONFIG_MPC8308) || defined(CONFIG_MPC831x) || \
638 defined(CONFIG_MPC837x)
Wolfgang Denk70df7bc2007-06-22 23:59:00 +0200639#define HRCWH_ROM_LOC_NAND_SP_8BIT 0x00100000
Scott Wood9f15d502007-04-16 14:31:55 -0500640#define HRCWH_ROM_LOC_NAND_SP_16BIT 0x00200000
Wolfgang Denk70df7bc2007-06-22 23:59:00 +0200641#define HRCWH_ROM_LOC_NAND_LP_8BIT 0x00500000
Scott Wood9f15d502007-04-16 14:31:55 -0500642#define HRCWH_ROM_LOC_NAND_LP_16BIT 0x00600000
643
644#define HRCWH_RL_EXT_LEGACY 0x00000000
645#define HRCWH_RL_EXT_NAND 0x00040000
646
Anton Vorontsov688bb382008-10-02 18:31:59 +0400647#define HRCWH_TSEC1M_MASK 0x0000E000
Scott Wood9f15d502007-04-16 14:31:55 -0500648#define HRCWH_TSEC1M_IN_MII 0x00000000
649#define HRCWH_TSEC1M_IN_RMII 0x00002000
650#define HRCWH_TSEC1M_IN_RGMII 0x00006000
651#define HRCWH_TSEC1M_IN_RTBI 0x0000A000
652#define HRCWH_TSEC1M_IN_SGMII 0x0000C000
653
Anton Vorontsov688bb382008-10-02 18:31:59 +0400654#define HRCWH_TSEC2M_MASK 0x00001C00
Scott Wood9f15d502007-04-16 14:31:55 -0500655#define HRCWH_TSEC2M_IN_MII 0x00000000
656#define HRCWH_TSEC2M_IN_RMII 0x00000400
657#define HRCWH_TSEC2M_IN_RGMII 0x00000C00
658#define HRCWH_TSEC2M_IN_RTBI 0x00001400
659#define HRCWH_TSEC2M_IN_SGMII 0x00001800
660#endif
661
Peter Tyser72f2d392009-05-22 17:23:25 -0500662#if defined(CONFIG_MPC834x)
Dave Liu0b6bc772006-12-07 21:11:58 +0800663#define HRCWH_TSEC1M_IN_RGMII 0x00000000
664#define HRCWH_TSEC1M_IN_RTBI 0x00004000
665#define HRCWH_TSEC1M_IN_GMII 0x00008000
666#define HRCWH_TSEC1M_IN_TBI 0x0000C000
667#define HRCWH_TSEC2M_IN_RGMII 0x00000000
668#define HRCWH_TSEC2M_IN_RTBI 0x00001000
669#define HRCWH_TSEC2M_IN_GMII 0x00002000
670#define HRCWH_TSEC2M_IN_TBI 0x00003000
Dave Liua46daea2006-11-03 19:33:44 -0600671#endif
672
Dave Liu0b6bc772006-12-07 21:11:58 +0800673#if defined(CONFIG_MPC8360)
674#define HRCWH_SECONDARY_DDR_DISABLE 0x00000000
675#define HRCWH_SECONDARY_DDR_ENABLE 0x00000010
Dave Liua46daea2006-11-03 19:33:44 -0600676#endif
Eran Liberty9095d4a2005-07-28 10:08:46 -0500677
Dave Liu0b6bc772006-12-07 21:11:58 +0800678#define HRCWH_BIG_ENDIAN 0x00000000
679#define HRCWH_LITTLE_ENDIAN 0x00000008
Eran Liberty9095d4a2005-07-28 10:08:46 -0500680
Dave Liu0b6bc772006-12-07 21:11:58 +0800681#define HRCWH_LALE_NORMAL 0x00000000
682#define HRCWH_LALE_EARLY 0x00000004
Dave Liuf5035922006-10-25 14:41:21 -0500683
Dave Liu0b6bc772006-12-07 21:11:58 +0800684#define HRCWH_LDP_SET 0x00000000
685#define HRCWH_LDP_CLEAR 0x00000002
Dave Liuf5035922006-10-25 14:41:21 -0500686
Heiko Schocher788fa962011-09-26 13:36:53 +0200687/*
688 * RSR - Reset Status Register
Eran Liberty9095d4a2005-07-28 10:08:46 -0500689 */
Ilya Yanoka3e5fd52010-06-28 16:44:33 +0400690#if defined(CONFIG_MPC8308) || defined(CONFIG_MPC831x) || \
691 defined(CONFIG_MPC837x)
Dave Liu5245ff52007-09-18 12:36:11 +0800692#define RSR_RSTSRC 0xF0000000 /* Reset source */
693#define RSR_RSTSRC_SHIFT 28
694#else
Dave Liu0b6bc772006-12-07 21:11:58 +0800695#define RSR_RSTSRC 0xE0000000 /* Reset source */
696#define RSR_RSTSRC_SHIFT 29
Dave Liu5245ff52007-09-18 12:36:11 +0800697#endif
Dave Liu0b6bc772006-12-07 21:11:58 +0800698#define RSR_BSF 0x00010000 /* Boot seq. fail */
699#define RSR_BSF_SHIFT 16
Heiko Schocher788fa962011-09-26 13:36:53 +0200700/* software soft reset */
701#define RSR_SWSR 0x00002000
Dave Liu0b6bc772006-12-07 21:11:58 +0800702#define RSR_SWSR_SHIFT 13
Heiko Schocher788fa962011-09-26 13:36:53 +0200703/* software hard reset */
704#define RSR_SWHR 0x00001000
Dave Liu0b6bc772006-12-07 21:11:58 +0800705#define RSR_SWHR_SHIFT 12
706#define RSR_JHRS 0x00000200 /* jtag hreset */
707#define RSR_JHRS_SHIFT 9
Heiko Schocher788fa962011-09-26 13:36:53 +0200708/* jtag sreset status */
709#define RSR_JSRS 0x00000100
Dave Liu0b6bc772006-12-07 21:11:58 +0800710#define RSR_JSRS_SHIFT 8
Heiko Schocher788fa962011-09-26 13:36:53 +0200711/* checkstop reset status */
712#define RSR_CSHR 0x00000010
Dave Liu0b6bc772006-12-07 21:11:58 +0800713#define RSR_CSHR_SHIFT 4
Heiko Schocher788fa962011-09-26 13:36:53 +0200714/* software watchdog reset status */
715#define RSR_SWRS 0x00000008
Dave Liu0b6bc772006-12-07 21:11:58 +0800716#define RSR_SWRS_SHIFT 3
Heiko Schocher788fa962011-09-26 13:36:53 +0200717/* bus monitop reset status */
718#define RSR_BMRS 0x00000004
Dave Liu0b6bc772006-12-07 21:11:58 +0800719#define RSR_BMRS_SHIFT 2
720#define RSR_SRS 0x00000002 /* soft reset status */
721#define RSR_SRS_SHIFT 1
722#define RSR_HRS 0x00000001 /* hard reset status */
723#define RSR_HRS_SHIFT 0
Heiko Schocher788fa962011-09-26 13:36:53 +0200724#define RSR_RES (~(RSR_RSTSRC | RSR_BSF | RSR_SWSR | \
725 RSR_SWHR | RSR_JHRS | \
726 RSR_JSRS | RSR_CSHR | \
727 RSR_SWRS | RSR_BMRS | \
728 RSR_SRS | RSR_HRS))
729/*
730 * RMR - Reset Mode Register
Dave Liu0b6bc772006-12-07 21:11:58 +0800731 */
Heiko Schocher788fa962011-09-26 13:36:53 +0200732/* checkstop reset enable */
733#define RMR_CSRE 0x00000001
Dave Liu0b6bc772006-12-07 21:11:58 +0800734#define RMR_CSRE_SHIFT 0
735#define RMR_RES ~(RMR_CSRE)
Eran Liberty9095d4a2005-07-28 10:08:46 -0500736
Heiko Schocher788fa962011-09-26 13:36:53 +0200737/*
738 * RCR - Reset Control Register
Dave Liu0b6bc772006-12-07 21:11:58 +0800739 */
Heiko Schocher788fa962011-09-26 13:36:53 +0200740/* software hard reset */
741#define RCR_SWHR 0x00000002
742/* software soft reset */
743#define RCR_SWSR 0x00000001
Dave Liu0b6bc772006-12-07 21:11:58 +0800744#define RCR_RES ~(RCR_SWHR | RCR_SWSR)
Eran Liberty9095d4a2005-07-28 10:08:46 -0500745
Heiko Schocher788fa962011-09-26 13:36:53 +0200746/*
747 * RCER - Reset Control Enable Register
Dave Liu0b6bc772006-12-07 21:11:58 +0800748 */
Heiko Schocher788fa962011-09-26 13:36:53 +0200749/* software hard reset */
750#define RCER_CRE 0x00000001
Dave Liu0b6bc772006-12-07 21:11:58 +0800751#define RCER_RES ~(RCER_CRE)
Eran Liberty9095d4a2005-07-28 10:08:46 -0500752
Heiko Schocher788fa962011-09-26 13:36:53 +0200753/*
754 * SPMR - System PLL Mode Register
Dave Liu0b6bc772006-12-07 21:11:58 +0800755 */
756#define SPMR_LBIUCM 0x80000000
Joakim Tjernlundf2af1bb2011-01-27 16:30:54 +0100757#define SPMR_LBIUCM_SHIFT 31
Dave Liu0b6bc772006-12-07 21:11:58 +0800758#define SPMR_DDRCM 0x40000000
Joakim Tjernlundf2af1bb2011-01-27 16:30:54 +0100759#define SPMR_DDRCM_SHIFT 30
Dave Liu0b6bc772006-12-07 21:11:58 +0800760#define SPMR_SPMF 0x0F000000
Joakim Tjernlundf2af1bb2011-01-27 16:30:54 +0100761#define SPMR_SPMF_SHIFT 24
Dave Liu0b6bc772006-12-07 21:11:58 +0800762#define SPMR_CKID 0x00800000
763#define SPMR_CKID_SHIFT 23
764#define SPMR_COREPLL 0x007F0000
Joakim Tjernlundf2af1bb2011-01-27 16:30:54 +0100765#define SPMR_COREPLL_SHIFT 16
Dave Liu0b6bc772006-12-07 21:11:58 +0800766#define SPMR_CEVCOD 0x000000C0
Joakim Tjernlundf2af1bb2011-01-27 16:30:54 +0100767#define SPMR_CEVCOD_SHIFT 6
Dave Liu0b6bc772006-12-07 21:11:58 +0800768#define SPMR_CEPDF 0x00000020
Joakim Tjernlundf2af1bb2011-01-27 16:30:54 +0100769#define SPMR_CEPDF_SHIFT 5
Dave Liu0b6bc772006-12-07 21:11:58 +0800770#define SPMR_CEPMF 0x0000001F
Joakim Tjernlundf2af1bb2011-01-27 16:30:54 +0100771#define SPMR_CEPMF_SHIFT 0
Eran Liberty9095d4a2005-07-28 10:08:46 -0500772
Heiko Schocher788fa962011-09-26 13:36:53 +0200773/*
774 * OCCR - Output Clock Control Register
Dave Liu0b6bc772006-12-07 21:11:58 +0800775 */
776#define OCCR_PCICOE0 0x80000000
777#define OCCR_PCICOE1 0x40000000
778#define OCCR_PCICOE2 0x20000000
779#define OCCR_PCICOE3 0x10000000
780#define OCCR_PCICOE4 0x08000000
781#define OCCR_PCICOE5 0x04000000
782#define OCCR_PCICOE6 0x02000000
783#define OCCR_PCICOE7 0x01000000
784#define OCCR_PCICD0 0x00800000
785#define OCCR_PCICD1 0x00400000
786#define OCCR_PCICD2 0x00200000
787#define OCCR_PCICD3 0x00100000
788#define OCCR_PCICD4 0x00080000
789#define OCCR_PCICD5 0x00040000
790#define OCCR_PCICD6 0x00020000
791#define OCCR_PCICD7 0x00010000
792#define OCCR_PCI1CR 0x00000002
793#define OCCR_PCI2CR 0x00000001
794#define OCCR_PCICR OCCR_PCI1CR
Eran Liberty9095d4a2005-07-28 10:08:46 -0500795
Heiko Schocher788fa962011-09-26 13:36:53 +0200796/*
797 * SCCR - System Clock Control Register
Dave Liu0b6bc772006-12-07 21:11:58 +0800798 */
799#define SCCR_ENCCM 0x03000000
800#define SCCR_ENCCM_SHIFT 24
801#define SCCR_ENCCM_0 0x00000000
802#define SCCR_ENCCM_1 0x01000000
803#define SCCR_ENCCM_2 0x02000000
804#define SCCR_ENCCM_3 0x03000000
Dave Liua46daea2006-11-03 19:33:44 -0600805
Dave Liu0b6bc772006-12-07 21:11:58 +0800806#define SCCR_PCICM 0x00010000
807#define SCCR_PCICM_SHIFT 16
Dave Liua46daea2006-11-03 19:33:44 -0600808
Peter Tyser72f2d392009-05-22 17:23:25 -0500809#if defined(CONFIG_MPC834x)
Dave Liu5245ff52007-09-18 12:36:11 +0800810/* SCCR bits - MPC834x specific */
Dave Liu0b6bc772006-12-07 21:11:58 +0800811#define SCCR_TSEC1CM 0xc0000000
812#define SCCR_TSEC1CM_SHIFT 30
813#define SCCR_TSEC1CM_0 0x00000000
814#define SCCR_TSEC1CM_1 0x40000000
815#define SCCR_TSEC1CM_2 0x80000000
816#define SCCR_TSEC1CM_3 0xC0000000
817
818#define SCCR_TSEC2CM 0x30000000
819#define SCCR_TSEC2CM_SHIFT 28
820#define SCCR_TSEC2CM_0 0x00000000
821#define SCCR_TSEC2CM_1 0x10000000
822#define SCCR_TSEC2CM_2 0x20000000
823#define SCCR_TSEC2CM_3 0x30000000
Scott Wood9f15d502007-04-16 14:31:55 -0500824
Dave Liu5245ff52007-09-18 12:36:11 +0800825/* The MPH must have the same clock ratio as DR, unless its clock disabled */
826#define SCCR_USBMPHCM 0x00c00000
827#define SCCR_USBMPHCM_SHIFT 22
828#define SCCR_USBDRCM 0x00300000
829#define SCCR_USBDRCM_SHIFT 20
830#define SCCR_USBCM 0x00f00000
831#define SCCR_USBCM_SHIFT 20
832#define SCCR_USBCM_0 0x00000000
833#define SCCR_USBCM_1 0x00500000
834#define SCCR_USBCM_2 0x00A00000
835#define SCCR_USBCM_3 0x00F00000
836
Dave Liue0cfec82007-09-18 12:36:58 +0800837#elif defined(CONFIG_MPC8313)
Dave Liub7896ad2008-01-17 18:23:19 +0800838/* TSEC1 bits are for TSEC2 as well */
Scott Wood9f15d502007-04-16 14:31:55 -0500839#define SCCR_TSEC1CM 0xc0000000
840#define SCCR_TSEC1CM_SHIFT 30
Kim Phillips19a91de2008-01-16 12:06:16 -0600841#define SCCR_TSEC1CM_0 0x00000000
Scott Wood9f15d502007-04-16 14:31:55 -0500842#define SCCR_TSEC1CM_1 0x40000000
843#define SCCR_TSEC1CM_2 0x80000000
844#define SCCR_TSEC1CM_3 0xC0000000
845
846#define SCCR_TSEC1ON 0x20000000
Timur Tabi0b2deff2007-07-03 13:04:34 -0500847#define SCCR_TSEC1ON_SHIFT 29
Scott Wood9f15d502007-04-16 14:31:55 -0500848#define SCCR_TSEC2ON 0x10000000
Timur Tabi0b2deff2007-07-03 13:04:34 -0500849#define SCCR_TSEC2ON_SHIFT 28
Scott Wood9f15d502007-04-16 14:31:55 -0500850
Dave Liu0b6bc772006-12-07 21:11:58 +0800851#define SCCR_USBDRCM 0x00300000
852#define SCCR_USBDRCM_SHIFT 20
Dave Liu5245ff52007-09-18 12:36:11 +0800853#define SCCR_USBDRCM_0 0x00000000
854#define SCCR_USBDRCM_1 0x00100000
855#define SCCR_USBDRCM_2 0x00200000
856#define SCCR_USBDRCM_3 0x00300000
Dave Liu0b6bc772006-12-07 21:11:58 +0800857
Ilya Yanoka3e5fd52010-06-28 16:44:33 +0400858#elif defined(CONFIG_MPC8308) || defined(CONFIG_MPC8315)
859/* SCCR bits - MPC8315/MPC8308 specific */
Dave Liue0cfec82007-09-18 12:36:58 +0800860#define SCCR_TSEC1CM 0xc0000000
861#define SCCR_TSEC1CM_SHIFT 30
862#define SCCR_TSEC1CM_0 0x00000000
863#define SCCR_TSEC1CM_1 0x40000000
864#define SCCR_TSEC1CM_2 0x80000000
865#define SCCR_TSEC1CM_3 0xC0000000
866
867#define SCCR_TSEC2CM 0x30000000
868#define SCCR_TSEC2CM_SHIFT 28
869#define SCCR_TSEC2CM_0 0x00000000
870#define SCCR_TSEC2CM_1 0x10000000
871#define SCCR_TSEC2CM_2 0x20000000
872#define SCCR_TSEC2CM_3 0x30000000
873
Ilya Yanoka3e5fd52010-06-28 16:44:33 +0400874#define SCCR_SDHCCM 0x0c000000
875#define SCCR_SDHCCM_SHIFT 26
876#define SCCR_SDHCCM_0 0x00000000
877#define SCCR_SDHCCM_1 0x04000000
878#define SCCR_SDHCCM_2 0x08000000
879#define SCCR_SDHCCM_3 0x0c000000
880
Dave Liu045338e2008-01-10 23:06:05 +0800881#define SCCR_USBDRCM 0x00c00000
882#define SCCR_USBDRCM_SHIFT 22
Dave Liue0cfec82007-09-18 12:36:58 +0800883#define SCCR_USBDRCM_0 0x00000000
Dave Liu045338e2008-01-10 23:06:05 +0800884#define SCCR_USBDRCM_1 0x00400000
885#define SCCR_USBDRCM_2 0x00800000
886#define SCCR_USBDRCM_3 0x00c00000
Dave Liue0cfec82007-09-18 12:36:58 +0800887
Dave Liu045338e2008-01-10 23:06:05 +0800888#define SCCR_SATA1CM 0x00003000
889#define SCCR_SATA1CM_SHIFT 12
890#define SCCR_SATACM 0x00003c00
891#define SCCR_SATACM_SHIFT 10
Dave Liue0cfec82007-09-18 12:36:58 +0800892#define SCCR_SATACM_0 0x00000000
Dave Liu045338e2008-01-10 23:06:05 +0800893#define SCCR_SATACM_1 0x00001400
894#define SCCR_SATACM_2 0x00002800
895#define SCCR_SATACM_3 0x00003c00
Dave Liue0cfec82007-09-18 12:36:58 +0800896
Dave Liu045338e2008-01-10 23:06:05 +0800897#define SCCR_TDMCM 0x00000030
898#define SCCR_TDMCM_SHIFT 4
Dave Liue0cfec82007-09-18 12:36:58 +0800899#define SCCR_TDMCM_0 0x00000000
Dave Liu045338e2008-01-10 23:06:05 +0800900#define SCCR_TDMCM_1 0x00000010
901#define SCCR_TDMCM_2 0x00000020
902#define SCCR_TDMCM_3 0x00000030
Dave Liue0cfec82007-09-18 12:36:58 +0800903
Peter Tyser72f2d392009-05-22 17:23:25 -0500904#elif defined(CONFIG_MPC837x)
Dave Liu5245ff52007-09-18 12:36:11 +0800905/* SCCR bits - MPC837x specific */
906#define SCCR_TSEC1CM 0xc0000000
907#define SCCR_TSEC1CM_SHIFT 30
908#define SCCR_TSEC1CM_0 0x00000000
909#define SCCR_TSEC1CM_1 0x40000000
910#define SCCR_TSEC1CM_2 0x80000000
911#define SCCR_TSEC1CM_3 0xC0000000
912
913#define SCCR_TSEC2CM 0x30000000
914#define SCCR_TSEC2CM_SHIFT 28
915#define SCCR_TSEC2CM_0 0x00000000
916#define SCCR_TSEC2CM_1 0x10000000
917#define SCCR_TSEC2CM_2 0x20000000
918#define SCCR_TSEC2CM_3 0x30000000
919
920#define SCCR_SDHCCM 0x0c000000
921#define SCCR_SDHCCM_SHIFT 26
922#define SCCR_SDHCCM_0 0x00000000
923#define SCCR_SDHCCM_1 0x04000000
924#define SCCR_SDHCCM_2 0x08000000
925#define SCCR_SDHCCM_3 0x0c000000
926
927#define SCCR_USBDRCM 0x00c00000
928#define SCCR_USBDRCM_SHIFT 22
929#define SCCR_USBDRCM_0 0x00000000
930#define SCCR_USBDRCM_1 0x00400000
931#define SCCR_USBDRCM_2 0x00800000
932#define SCCR_USBDRCM_3 0x00c00000
933
Anton Vorontsov1a8206c2009-01-08 04:26:12 +0300934/* All of the four SATA controllers must have the same clock ratio */
935#define SCCR_SATA1CM 0x000000c0
936#define SCCR_SATA1CM_SHIFT 6
937#define SCCR_SATACM 0x000000ff
938#define SCCR_SATACM_SHIFT 0
939#define SCCR_SATACM_0 0x00000000
940#define SCCR_SATACM_1 0x00000055
941#define SCCR_SATACM_2 0x000000aa
942#define SCCR_SATACM_3 0x000000ff
943#endif
944
Dave Liu5245ff52007-09-18 12:36:11 +0800945#define SCCR_PCIEXP1CM 0x00300000
946#define SCCR_PCIEXP1CM_SHIFT 20
947#define SCCR_PCIEXP1CM_0 0x00000000
948#define SCCR_PCIEXP1CM_1 0x00100000
949#define SCCR_PCIEXP1CM_2 0x00200000
950#define SCCR_PCIEXP1CM_3 0x00300000
951
952#define SCCR_PCIEXP2CM 0x000c0000
953#define SCCR_PCIEXP2CM_SHIFT 18
954#define SCCR_PCIEXP2CM_0 0x00000000
955#define SCCR_PCIEXP2CM_1 0x00040000
956#define SCCR_PCIEXP2CM_2 0x00080000
957#define SCCR_PCIEXP2CM_3 0x000c0000
958
Heiko Schocher788fa962011-09-26 13:36:53 +0200959/*
960 * CSn_BDNS - Chip Select memory Bounds Register
Dave Liu0b6bc772006-12-07 21:11:58 +0800961 */
962#define CSBNDS_SA 0x00FF0000
963#define CSBNDS_SA_SHIFT 8
964#define CSBNDS_EA 0x000000FF
965#define CSBNDS_EA_SHIFT 24
966
Heiko Schocher788fa962011-09-26 13:36:53 +0200967/*
968 * CSn_CONFIG - Chip Select Configuration Register
Dave Liu0b6bc772006-12-07 21:11:58 +0800969 */
970#define CSCONFIG_EN 0x80000000
971#define CSCONFIG_AP 0x00800000
Kim Phillips19a91de2008-01-16 12:06:16 -0600972#define CSCONFIG_ODT_WR_ACS 0x00010000
Heiko Schocherbdccb9e2009-08-21 16:30:30 -0500973#if defined(CONFIG_MPC832x)
974#define CSCONFIG_ODT_WR_CFG 0x00040000
975#endif
Tor Krill92ddea12008-06-02 15:09:30 +0200976#define CSCONFIG_BANK_BIT_3 0x00004000
Dave Liu0b6bc772006-12-07 21:11:58 +0800977#define CSCONFIG_ROW_BIT 0x00000700
978#define CSCONFIG_ROW_BIT_12 0x00000000
979#define CSCONFIG_ROW_BIT_13 0x00000100
980#define CSCONFIG_ROW_BIT_14 0x00000200
981#define CSCONFIG_COL_BIT 0x00000007
982#define CSCONFIG_COL_BIT_8 0x00000000
983#define CSCONFIG_COL_BIT_9 0x00000001
984#define CSCONFIG_COL_BIT_10 0x00000002
985#define CSCONFIG_COL_BIT_11 0x00000003
986
Heiko Schocher788fa962011-09-26 13:36:53 +0200987/*
988 * TIMING_CFG_0 - DDR SDRAM Timing Configuration 0
Scott Wood9f15d502007-04-16 14:31:55 -0500989 */
990#define TIMING_CFG0_RWT 0xC0000000
991#define TIMING_CFG0_RWT_SHIFT 30
992#define TIMING_CFG0_WRT 0x30000000
993#define TIMING_CFG0_WRT_SHIFT 28
994#define TIMING_CFG0_RRT 0x0C000000
995#define TIMING_CFG0_RRT_SHIFT 26
996#define TIMING_CFG0_WWT 0x03000000
997#define TIMING_CFG0_WWT_SHIFT 24
998#define TIMING_CFG0_ACT_PD_EXIT 0x00700000
999#define TIMING_CFG0_ACT_PD_EXIT_SHIFT 20
1000#define TIMING_CFG0_PRE_PD_EXIT 0x00070000
1001#define TIMING_CFG0_PRE_PD_EXIT_SHIFT 16
1002#define TIMING_CFG0_ODT_PD_EXIT 0x00000F00
1003#define TIMING_CFG0_ODT_PD_EXIT_SHIFT 8
Anton Vorontsovaadf39e2008-03-24 20:46:57 +03001004#define TIMING_CFG0_MRS_CYC 0x0000000F
Scott Wood9f15d502007-04-16 14:31:55 -05001005#define TIMING_CFG0_MRS_CYC_SHIFT 0
1006
Heiko Schocher788fa962011-09-26 13:36:53 +02001007/*
1008 * TIMING_CFG_1 - DDR SDRAM Timing Configuration 1
Dave Liu0b6bc772006-12-07 21:11:58 +08001009 */
1010#define TIMING_CFG1_PRETOACT 0x70000000
1011#define TIMING_CFG1_PRETOACT_SHIFT 28
1012#define TIMING_CFG1_ACTTOPRE 0x0F000000
1013#define TIMING_CFG1_ACTTOPRE_SHIFT 24
1014#define TIMING_CFG1_ACTTORW 0x00700000
1015#define TIMING_CFG1_ACTTORW_SHIFT 20
1016#define TIMING_CFG1_CASLAT 0x00070000
1017#define TIMING_CFG1_CASLAT_SHIFT 16
1018#define TIMING_CFG1_REFREC 0x0000F000
1019#define TIMING_CFG1_REFREC_SHIFT 12
1020#define TIMING_CFG1_WRREC 0x00000700
1021#define TIMING_CFG1_WRREC_SHIFT 8
1022#define TIMING_CFG1_ACTTOACT 0x00000070
1023#define TIMING_CFG1_ACTTOACT_SHIFT 4
1024#define TIMING_CFG1_WRTORD 0x00000007
1025#define TIMING_CFG1_WRTORD_SHIFT 0
1026#define TIMING_CFG1_CASLAT_20 0x00030000 /* CAS latency = 2.0 */
1027#define TIMING_CFG1_CASLAT_25 0x00040000 /* CAS latency = 2.5 */
Heiko Schocher521aed12008-11-19 10:10:30 +01001028#define TIMING_CFG1_CASLAT_30 0x00050000 /* CAS latency = 3.0 */
1029#define TIMING_CFG1_CASLAT_35 0x00060000 /* CAS latency = 3.5 */
1030#define TIMING_CFG1_CASLAT_40 0x00070000 /* CAS latency = 4.0 */
Heiko Schocher6a8a4492009-02-11 19:26:15 +01001031#define TIMING_CFG1_CASLAT_45 0x00080000 /* CAS latency = 4.5 */
1032#define TIMING_CFG1_CASLAT_50 0x00090000 /* CAS latency = 5.0 */
Dave Liu0b6bc772006-12-07 21:11:58 +08001033
Heiko Schocher788fa962011-09-26 13:36:53 +02001034/*
1035 * TIMING_CFG_2 - DDR SDRAM Timing Configuration 2
Dave Liu0b6bc772006-12-07 21:11:58 +08001036 */
Xie Xiaobo800b7532007-02-14 18:26:44 +08001037#define TIMING_CFG2_CPO 0x0F800000
1038#define TIMING_CFG2_CPO_SHIFT 23
Dave Liu0b6bc772006-12-07 21:11:58 +08001039#define TIMING_CFG2_ACSM 0x00080000
1040#define TIMING_CFG2_WR_DATA_DELAY 0x00001C00
1041#define TIMING_CFG2_WR_DATA_DELAY_SHIFT 10
Heiko Schocher788fa962011-09-26 13:36:53 +02001042/* default (= CASLAT + 1) */
1043#define TIMING_CFG2_CPO_DEF 0x00000000
Dave Liu0b6bc772006-12-07 21:11:58 +08001044
Scott Wood9f15d502007-04-16 14:31:55 -05001045#define TIMING_CFG2_ADD_LAT 0x70000000
1046#define TIMING_CFG2_ADD_LAT_SHIFT 28
1047#define TIMING_CFG2_WR_LAT_DELAY 0x00380000
1048#define TIMING_CFG2_WR_LAT_DELAY_SHIFT 19
1049#define TIMING_CFG2_RD_TO_PRE 0x0000E000
1050#define TIMING_CFG2_RD_TO_PRE_SHIFT 13
1051#define TIMING_CFG2_CKE_PLS 0x000001C0
1052#define TIMING_CFG2_CKE_PLS_SHIFT 6
1053#define TIMING_CFG2_FOUR_ACT 0x0000003F
1054#define TIMING_CFG2_FOUR_ACT_SHIFT 0
1055
Heiko Schocher788fa962011-09-26 13:36:53 +02001056/*
1057 * DDR_SDRAM_CFG - DDR SDRAM Control Configuration
Dave Liu0b6bc772006-12-07 21:11:58 +08001058 */
1059#define SDRAM_CFG_MEM_EN 0x80000000
1060#define SDRAM_CFG_SREN 0x40000000
1061#define SDRAM_CFG_ECC_EN 0x20000000
1062#define SDRAM_CFG_RD_EN 0x10000000
Kim Phillips3b9c20f2007-08-16 22:52:48 -05001063#define SDRAM_CFG_SDRAM_TYPE_DDR1 0x02000000
1064#define SDRAM_CFG_SDRAM_TYPE_DDR2 0x03000000
1065#define SDRAM_CFG_SDRAM_TYPE_MASK 0x07000000
Dave Liu0b6bc772006-12-07 21:11:58 +08001066#define SDRAM_CFG_SDRAM_TYPE_SHIFT 24
1067#define SDRAM_CFG_DYN_PWR 0x00200000
1068#define SDRAM_CFG_32_BE 0x00080000
1069#define SDRAM_CFG_8_BE 0x00040000
1070#define SDRAM_CFG_NCAP 0x00020000
1071#define SDRAM_CFG_2T_EN 0x00008000
Andre Schwarz0b816ea2011-04-14 14:53:37 +02001072#define SDRAM_CFG_HSE 0x00000008
Scott Wood9f15d502007-04-16 14:31:55 -05001073#define SDRAM_CFG_BI 0x00000001
Dave Liu0b6bc772006-12-07 21:11:58 +08001074
Heiko Schocher788fa962011-09-26 13:36:53 +02001075/*
1076 * DDR_SDRAM_MODE - DDR SDRAM Mode Register
Dave Liu0b6bc772006-12-07 21:11:58 +08001077 */
1078#define SDRAM_MODE_ESD 0xFFFF0000
1079#define SDRAM_MODE_ESD_SHIFT 16
1080#define SDRAM_MODE_SD 0x0000FFFF
1081#define SDRAM_MODE_SD_SHIFT 0
Heiko Schocher788fa962011-09-26 13:36:53 +02001082/* select extended mode reg */
1083#define DDR_MODE_EXT_MODEREG 0x4000
1084/* operating mode, mask */
1085#define DDR_MODE_EXT_OPMODE 0x3FF8
Dave Liu0b6bc772006-12-07 21:11:58 +08001086#define DDR_MODE_EXT_OP_NORMAL 0x0000 /* normal operation */
Heiko Schocher788fa962011-09-26 13:36:53 +02001087/* QFC / compatibility, mask */
1088#define DDR_MODE_QFC 0x0004
1089/* compatible to older SDRAMs */
1090#define DDR_MODE_QFC_COMP 0x0000
1091/* weak drivers */
1092#define DDR_MODE_WEAK 0x0002
1093/* disable DLL */
1094#define DDR_MODE_DLL_DIS 0x0001
1095/* CAS latency, mask */
1096#define DDR_MODE_CASLAT 0x0070
Dave Liu0b6bc772006-12-07 21:11:58 +08001097#define DDR_MODE_CASLAT_15 0x0010 /* CAS latency 1.5 */
1098#define DDR_MODE_CASLAT_20 0x0020 /* CAS latency 2 */
1099#define DDR_MODE_CASLAT_25 0x0060 /* CAS latency 2.5 */
1100#define DDR_MODE_CASLAT_30 0x0030 /* CAS latency 3 */
Heiko Schocher788fa962011-09-26 13:36:53 +02001101/* sequential burst */
1102#define DDR_MODE_BTYPE_SEQ 0x0000
1103/* interleaved burst */
1104#define DDR_MODE_BTYPE_ILVD 0x0008
Dave Liu0b6bc772006-12-07 21:11:58 +08001105#define DDR_MODE_BLEN_2 0x0001 /* burst length 2 */
1106#define DDR_MODE_BLEN_4 0x0002 /* burst length 4 */
Heiko Schocher788fa962011-09-26 13:36:53 +02001107/* exact value for 7.8125us */
1108#define DDR_REFINT_166MHZ_7US 1302
1109/* use 256 cycles as a starting point */
1110#define DDR_BSTOPRE 256
1111/* select mode register */
1112#define DDR_MODE_MODEREG 0x0000
Dave Liu0b6bc772006-12-07 21:11:58 +08001113
Heiko Schocher788fa962011-09-26 13:36:53 +02001114/*
1115 * DDR_SDRAM_INTERVAL - DDR SDRAM Interval Register
Dave Liu0b6bc772006-12-07 21:11:58 +08001116 */
1117#define SDRAM_INTERVAL_REFINT 0x3FFF0000
1118#define SDRAM_INTERVAL_REFINT_SHIFT 16
1119#define SDRAM_INTERVAL_BSTOPRE 0x00003FFF
1120#define SDRAM_INTERVAL_BSTOPRE_SHIFT 0
1121
Heiko Schocher788fa962011-09-26 13:36:53 +02001122/*
1123 * DDR_SDRAM_CLK_CNTL - DDR SDRAM Clock Control Register
Dave Liu0b6bc772006-12-07 21:11:58 +08001124 */
1125#define DDR_SDRAM_CLK_CNTL_SS_EN 0x80000000
1126#define DDR_SDRAM_CLK_CNTL_CLK_ADJUST_025 0x01000000
1127#define DDR_SDRAM_CLK_CNTL_CLK_ADJUST_05 0x02000000
1128#define DDR_SDRAM_CLK_CNTL_CLK_ADJUST_075 0x03000000
1129#define DDR_SDRAM_CLK_CNTL_CLK_ADJUST_1 0x04000000
1130
Heiko Schocher788fa962011-09-26 13:36:53 +02001131/*
1132 * ECC_ERR_INJECT - Memory data path error injection mask ECC
Dave Liu0b6bc772006-12-07 21:11:58 +08001133 */
Heiko Schocher788fa962011-09-26 13:36:53 +02001134/* ECC Mirror Byte */
1135#define ECC_ERR_INJECT_EMB (0x80000000 >> 22)
1136/* Error Injection Enable */
1137#define ECC_ERR_INJECT_EIEN (0x80000000 >> 23)
1138/* ECC Erroe Injection Enable */
1139#define ECC_ERR_INJECT_EEIM (0xff000000 >> 24)
Dave Liu0b6bc772006-12-07 21:11:58 +08001140#define ECC_ERR_INJECT_EEIM_SHIFT 0
1141
Heiko Schocher788fa962011-09-26 13:36:53 +02001142/*
1143 * CAPTURE_ECC - Memory data path read capture ECC
Dave Liu0b6bc772006-12-07 21:11:58 +08001144 */
Heiko Schocher788fa962011-09-26 13:36:53 +02001145#define CAPTURE_ECC_ECE (0xff000000 >> 24)
Dave Liu0b6bc772006-12-07 21:11:58 +08001146#define CAPTURE_ECC_ECE_SHIFT 0
1147
Heiko Schocher788fa962011-09-26 13:36:53 +02001148/*
1149 * ERR_DETECT - Memory error detect
Dave Liu0b6bc772006-12-07 21:11:58 +08001150 */
Heiko Schocher788fa962011-09-26 13:36:53 +02001151/* Multiple Memory Errors */
1152#define ECC_ERROR_DETECT_MME (0x80000000 >> 0)
1153/* Multiple-Bit Error */
1154#define ECC_ERROR_DETECT_MBE (0x80000000 >> 28)
1155/* Single-Bit ECC Error Pickup */
1156#define ECC_ERROR_DETECT_SBE (0x80000000 >> 29)
1157/* Memory Select Error */
1158#define ECC_ERROR_DETECT_MSE (0x80000000 >> 31)
Dave Liu0b6bc772006-12-07 21:11:58 +08001159
Heiko Schocher788fa962011-09-26 13:36:53 +02001160/*
1161 * ERR_DISABLE - Memory error disable
Dave Liu0b6bc772006-12-07 21:11:58 +08001162 */
Heiko Schocher788fa962011-09-26 13:36:53 +02001163/* Multiple-Bit ECC Error Disable */
1164#define ECC_ERROR_DISABLE_MBED (0x80000000 >> 28)
1165/* Sinle-Bit ECC Error disable */
1166#define ECC_ERROR_DISABLE_SBED (0x80000000 >> 29)
1167/* Memory Select Error Disable */
1168#define ECC_ERROR_DISABLE_MSED (0x80000000 >> 31)
1169#define ECC_ERROR_ENABLE (~(ECC_ERROR_DISABLE_MSED | \
1170 ECC_ERROR_DISABLE_SBED | \
1171 ECC_ERROR_DISABLE_MBED))
1172
1173/*
1174 * ERR_INT_EN - Memory error interrupt enable
Dave Liu0b6bc772006-12-07 21:11:58 +08001175 */
Heiko Schocher788fa962011-09-26 13:36:53 +02001176/* Multiple-Bit ECC Error Interrupt Enable */
1177#define ECC_ERR_INT_EN_MBEE (0x80000000 >> 28)
1178/* Single-Bit ECC Error Interrupt Enable */
1179#define ECC_ERR_INT_EN_SBEE (0x80000000 >> 29)
1180/* Memory Select Error Interrupt Enable */
1181#define ECC_ERR_INT_EN_MSEE (0x80000000 >> 31)
1182#define ECC_ERR_INT_DISABLE (~(ECC_ERR_INT_EN_MBEE | \
1183 ECC_ERR_INT_EN_SBEE | \
1184 ECC_ERR_INT_EN_MSEE))
1185
1186/*
1187 * CAPTURE_ATTRIBUTES - Memory error attributes capture
Dave Liu0b6bc772006-12-07 21:11:58 +08001188 */
Heiko Schocher788fa962011-09-26 13:36:53 +02001189/* Data Beat Num */
1190#define ECC_CAPT_ATTR_BNUM (0xe0000000 >> 1)
Dave Liu0b6bc772006-12-07 21:11:58 +08001191#define ECC_CAPT_ATTR_BNUM_SHIFT 28
Heiko Schocher788fa962011-09-26 13:36:53 +02001192/* Transaction Size */
1193#define ECC_CAPT_ATTR_TSIZ (0xc0000000 >> 6)
Dave Liu0b6bc772006-12-07 21:11:58 +08001194#define ECC_CAPT_ATTR_TSIZ_FOUR_DW 0
1195#define ECC_CAPT_ATTR_TSIZ_ONE_DW 1
1196#define ECC_CAPT_ATTR_TSIZ_TWO_DW 2
1197#define ECC_CAPT_ATTR_TSIZ_THREE_DW 3
1198#define ECC_CAPT_ATTR_TSIZ_SHIFT 24
Heiko Schocher788fa962011-09-26 13:36:53 +02001199/* Transaction Source */
1200#define ECC_CAPT_ATTR_TSRC (0xf8000000 >> 11)
Dave Liu0b6bc772006-12-07 21:11:58 +08001201#define ECC_CAPT_ATTR_TSRC_E300_CORE_DT 0x0
1202#define ECC_CAPT_ATTR_TSRC_E300_CORE_IF 0x2
1203#define ECC_CAPT_ATTR_TSRC_TSEC1 0x4
1204#define ECC_CAPT_ATTR_TSRC_TSEC2 0x5
1205#define ECC_CAPT_ATTR_TSRC_USB (0x06|0x07)
1206#define ECC_CAPT_ATTR_TSRC_ENCRYPT 0x8
1207#define ECC_CAPT_ATTR_TSRC_I2C 0x9
1208#define ECC_CAPT_ATTR_TSRC_JTAG 0xA
1209#define ECC_CAPT_ATTR_TSRC_PCI1 0xD
1210#define ECC_CAPT_ATTR_TSRC_PCI2 0xE
1211#define ECC_CAPT_ATTR_TSRC_DMA 0xF
1212#define ECC_CAPT_ATTR_TSRC_SHIFT 16
Heiko Schocher788fa962011-09-26 13:36:53 +02001213/* Transaction Type */
1214#define ECC_CAPT_ATTR_TTYP (0xe0000000 >> 18)
Dave Liu0b6bc772006-12-07 21:11:58 +08001215#define ECC_CAPT_ATTR_TTYP_WRITE 0x1
1216#define ECC_CAPT_ATTR_TTYP_READ 0x2
1217#define ECC_CAPT_ATTR_TTYP_R_M_W 0x3
1218#define ECC_CAPT_ATTR_TTYP_SHIFT 12
Heiko Schocher788fa962011-09-26 13:36:53 +02001219#define ECC_CAPT_ATTR_VLD (0x80000000 >> 31) /* Valid */
Dave Liu0b6bc772006-12-07 21:11:58 +08001220
Heiko Schocher788fa962011-09-26 13:36:53 +02001221/*
1222 * ERR_SBE - Single bit ECC memory error management
Dave Liu0b6bc772006-12-07 21:11:58 +08001223 */
Heiko Schocher788fa962011-09-26 13:36:53 +02001224/* Single-Bit Error Threshold 0..255 */
1225#define ECC_ERROR_MAN_SBET (0xff000000 >> 8)
Dave Liu0b6bc772006-12-07 21:11:58 +08001226#define ECC_ERROR_MAN_SBET_SHIFT 16
Heiko Schocher788fa962011-09-26 13:36:53 +02001227/* Single Bit Error Counter 0..255 */
1228#define ECC_ERROR_MAN_SBEC (0xff000000 >> 24)
Dave Liu0b6bc772006-12-07 21:11:58 +08001229#define ECC_ERROR_MAN_SBEC_SHIFT 0
1230
Heiko Schocher788fa962011-09-26 13:36:53 +02001231/*
1232 * CONFIG_ADDRESS - PCI Config Address Register
Dave Liu0b6bc772006-12-07 21:11:58 +08001233 */
1234#define PCI_CONFIG_ADDRESS_EN 0x80000000
1235#define PCI_CONFIG_ADDRESS_BN_SHIFT 16
1236#define PCI_CONFIG_ADDRESS_BN_MASK 0x00ff0000
1237#define PCI_CONFIG_ADDRESS_DN_SHIFT 11
1238#define PCI_CONFIG_ADDRESS_DN_MASK 0x0000f800
1239#define PCI_CONFIG_ADDRESS_FN_SHIFT 8
1240#define PCI_CONFIG_ADDRESS_FN_MASK 0x00000700
1241#define PCI_CONFIG_ADDRESS_RN_SHIFT 0
1242#define PCI_CONFIG_ADDRESS_RN_MASK 0x000000fc
1243
Heiko Schocher788fa962011-09-26 13:36:53 +02001244/*
1245 * POTAR - PCI Outbound Translation Address Register
Dave Liu0b6bc772006-12-07 21:11:58 +08001246 */
1247#define POTAR_TA_MASK 0x000fffff
1248
Heiko Schocher788fa962011-09-26 13:36:53 +02001249/*
1250 * POBAR - PCI Outbound Base Address Register
Dave Liu0b6bc772006-12-07 21:11:58 +08001251 */
1252#define POBAR_BA_MASK 0x000fffff
1253
Heiko Schocher788fa962011-09-26 13:36:53 +02001254/*
1255 * POCMR - PCI Outbound Comparision Mask Register
Dave Liu0b6bc772006-12-07 21:11:58 +08001256 */
1257#define POCMR_EN 0x80000000
Heiko Schocher788fa962011-09-26 13:36:53 +02001258/* 0-memory space 1-I/O space */
1259#define POCMR_IO 0x40000000
Dave Liu0b6bc772006-12-07 21:11:58 +08001260#define POCMR_SE 0x20000000 /* streaming enable */
1261#define POCMR_DST 0x10000000 /* 0-PCI1 1-PCI2 */
1262#define POCMR_CM_MASK 0x000fffff
1263#define POCMR_CM_4G 0x00000000
1264#define POCMR_CM_2G 0x00080000
1265#define POCMR_CM_1G 0x000C0000
1266#define POCMR_CM_512M 0x000E0000
1267#define POCMR_CM_256M 0x000F0000
1268#define POCMR_CM_128M 0x000F8000
1269#define POCMR_CM_64M 0x000FC000
1270#define POCMR_CM_32M 0x000FE000
1271#define POCMR_CM_16M 0x000FF000
1272#define POCMR_CM_8M 0x000FF800
1273#define POCMR_CM_4M 0x000FFC00
1274#define POCMR_CM_2M 0x000FFE00
1275#define POCMR_CM_1M 0x000FFF00
1276#define POCMR_CM_512K 0x000FFF80
1277#define POCMR_CM_256K 0x000FFFC0
1278#define POCMR_CM_128K 0x000FFFE0
1279#define POCMR_CM_64K 0x000FFFF0
1280#define POCMR_CM_32K 0x000FFFF8
1281#define POCMR_CM_16K 0x000FFFFC
1282#define POCMR_CM_8K 0x000FFFFE
1283#define POCMR_CM_4K 0x000FFFFF
1284
Heiko Schocher788fa962011-09-26 13:36:53 +02001285/*
1286 * PITAR - PCI Inbound Translation Address Register
Dave Liu0b6bc772006-12-07 21:11:58 +08001287 */
1288#define PITAR_TA_MASK 0x000fffff
1289
Heiko Schocher788fa962011-09-26 13:36:53 +02001290/*
1291 * PIBAR - PCI Inbound Base/Extended Address Register
Dave Liu0b6bc772006-12-07 21:11:58 +08001292 */
1293#define PIBAR_MASK 0xffffffff
1294#define PIEBAR_EBA_MASK 0x000fffff
1295
Heiko Schocher788fa962011-09-26 13:36:53 +02001296/*
1297 * PIWAR - PCI Inbound Windows Attributes Register
Dave Liu0b6bc772006-12-07 21:11:58 +08001298 */
1299#define PIWAR_EN 0x80000000
1300#define PIWAR_PF 0x20000000
1301#define PIWAR_RTT_MASK 0x000f0000
1302#define PIWAR_RTT_NO_SNOOP 0x00040000
1303#define PIWAR_RTT_SNOOP 0x00050000
1304#define PIWAR_WTT_MASK 0x0000f000
1305#define PIWAR_WTT_NO_SNOOP 0x00004000
1306#define PIWAR_WTT_SNOOP 0x00005000
1307#define PIWAR_IWS_MASK 0x0000003F
1308#define PIWAR_IWS_4K 0x0000000B
1309#define PIWAR_IWS_8K 0x0000000C
1310#define PIWAR_IWS_16K 0x0000000D
1311#define PIWAR_IWS_32K 0x0000000E
1312#define PIWAR_IWS_64K 0x0000000F
1313#define PIWAR_IWS_128K 0x00000010
1314#define PIWAR_IWS_256K 0x00000011
1315#define PIWAR_IWS_512K 0x00000012
1316#define PIWAR_IWS_1M 0x00000013
1317#define PIWAR_IWS_2M 0x00000014
1318#define PIWAR_IWS_4M 0x00000015
1319#define PIWAR_IWS_8M 0x00000016
1320#define PIWAR_IWS_16M 0x00000017
1321#define PIWAR_IWS_32M 0x00000018
1322#define PIWAR_IWS_64M 0x00000019
1323#define PIWAR_IWS_128M 0x0000001A
1324#define PIWAR_IWS_256M 0x0000001B
1325#define PIWAR_IWS_512M 0x0000001C
1326#define PIWAR_IWS_1G 0x0000001D
1327#define PIWAR_IWS_2G 0x0000001E
Dave Liuf5035922006-10-25 14:41:21 -05001328
Heiko Schocher788fa962011-09-26 13:36:53 +02001329/*
1330 * PMCCR1 - PCI Configuration Register 1
Scott Wood9f15d502007-04-16 14:31:55 -05001331 */
1332#define PMCCR1_POWER_OFF 0x00000020
1333
Heiko Schocher788fa962011-09-26 13:36:53 +02001334/*
1335 * DDRCDR - DDR Control Driver Register
Scott Wood9f15d502007-04-16 14:31:55 -05001336 */
Kim Phillips19a91de2008-01-16 12:06:16 -06001337#define DDRCDR_DHC_EN 0x80000000
Scott Wood9f15d502007-04-16 14:31:55 -05001338#define DDRCDR_EN 0x40000000
1339#define DDRCDR_PZ 0x3C000000
1340#define DDRCDR_PZ_MAXZ 0x00000000
1341#define DDRCDR_PZ_HIZ 0x20000000
1342#define DDRCDR_PZ_NOMZ 0x30000000
1343#define DDRCDR_PZ_LOZ 0x38000000
1344#define DDRCDR_PZ_MINZ 0x3C000000
1345#define DDRCDR_NZ 0x3C000000
1346#define DDRCDR_NZ_MAXZ 0x00000000
1347#define DDRCDR_NZ_HIZ 0x02000000
1348#define DDRCDR_NZ_NOMZ 0x03000000
1349#define DDRCDR_NZ_LOZ 0x03800000
1350#define DDRCDR_NZ_MINZ 0x03C00000
1351#define DDRCDR_ODT 0x00080000
1352#define DDRCDR_DDR_CFG 0x00040000
1353#define DDRCDR_M_ODR 0x00000002
1354#define DDRCDR_Q_DRN 0x00000001
1355
Heiko Schocher788fa962011-09-26 13:36:53 +02001356/*
1357 * PCIE Bridge Register
1358 */
Anton Vorontsov1a8206c2009-01-08 04:26:12 +03001359#define PEX_CSB_CTRL_OBPIOE 0x00000001
1360#define PEX_CSB_CTRL_IBPIOE 0x00000002
1361#define PEX_CSB_CTRL_WDMAE 0x00000004
1362#define PEX_CSB_CTRL_RDMAE 0x00000008
1363
1364#define PEX_CSB_OBCTRL_PIOE 0x00000001
1365#define PEX_CSB_OBCTRL_MEMWE 0x00000002
1366#define PEX_CSB_OBCTRL_IOWE 0x00000004
1367#define PEX_CSB_OBCTRL_CFGWE 0x00000008
1368
1369#define PEX_CSB_IBCTRL_PIOE 0x00000001
1370
1371#define PEX_OWAR_EN 0x00000001
1372#define PEX_OWAR_TYPE_CFG 0x00000000
1373#define PEX_OWAR_TYPE_IO 0x00000002
1374#define PEX_OWAR_TYPE_MEM 0x00000004
1375#define PEX_OWAR_RLXO 0x00000008
1376#define PEX_OWAR_NANP 0x00000010
1377#define PEX_OWAR_SIZE 0xFFFFF000
1378
1379#define PEX_IWAR_EN 0x00000001
1380#define PEX_IWAR_TYPE_INT 0x00000000
1381#define PEX_IWAR_TYPE_PF 0x00000004
1382#define PEX_IWAR_TYPE_NO_PF 0x00000006
1383#define PEX_IWAR_NSOV 0x00000008
1384#define PEX_IWAR_NSNP 0x00000010
1385#define PEX_IWAR_SIZE 0xFFFFF000
1386#define PEX_IWAR_SIZE_1M 0x000FF000
1387#define PEX_IWAR_SIZE_2M 0x001FF000
1388#define PEX_IWAR_SIZE_4M 0x003FF000
1389#define PEX_IWAR_SIZE_8M 0x007FF000
1390#define PEX_IWAR_SIZE_16M 0x00FFF000
1391#define PEX_IWAR_SIZE_32M 0x01FFF000
1392#define PEX_IWAR_SIZE_64M 0x03FFF000
1393#define PEX_IWAR_SIZE_128M 0x07FFF000
1394#define PEX_IWAR_SIZE_256M 0x0FFFF000
1395
1396#define PEX_GCLK_RATIO 0x440
1397
Scott Wood2fa13912007-04-16 14:34:21 -05001398#ifndef __ASSEMBLY__
1399struct pci_region;
Peter Tysere2283322010-09-14 19:13:50 -05001400void mpc83xx_pci_init(int num_buses, struct pci_region **reg);
Ira Snydere2e29ec2009-01-12 13:32:26 -08001401void mpc83xx_pcislave_unlock(int bus);
Peter Tysere2283322010-09-14 19:13:50 -05001402void mpc83xx_pcie_init(int num_buses, struct pci_region **reg);
Scott Wood2fa13912007-04-16 14:34:21 -05001403#endif
1404
Eran Liberty9095d4a2005-07-28 10:08:46 -05001405#endif /* __MPC83XX_H__ */