blob: 82bc25e1f4107e9fe6811012d2622a8e1a4b2da5 [file] [log] [blame]
wdenk0442ed82002-11-03 10:24:00 +00001/*----------------------------------------------------------------------------+
2|
3| This source code has been made available to you by IBM on an AS-IS
4| basis. Anyone receiving this source is licensed under IBM
5| copyrights to use it in any way he or she deems fit, including
6| copying it, modifying it, compiling it, and redistributing it either
7| with or without modifications. No license under IBM patents or
8| patent applications is to be implied by the copyright license.
9|
10| Any user of this software should understand that IBM cannot provide
11| technical support for this software and will not be responsible for
12| any consequences resulting from the use of this software.
13|
14| Any person who transfers this source code or any derivative work
15| must include the IBM copyright notice, this paragraph, and the
16| preceding two paragraphs in the transferred software.
17|
18| COPYRIGHT I B M CORPORATION 1999
19| LICENSED MATERIAL - PROGRAM PROPERTY OF I B M
20+----------------------------------------------------------------------------*/
21
22#ifndef __PPC405_H__
23#define __PPC405_H__
24
25/*--------------------------------------------------------------------- */
26/* Special Purpose Registers */
27/*--------------------------------------------------------------------- */
wdenk57b2d802003-06-27 21:31:46 +000028 #define srr2 0x3de /* save/restore register 2 */
29 #define srr3 0x3df /* save/restore register 3 */
Grzegorz Bernacki837bc5b2007-06-15 11:19:28 +020030
31 /*
32 * 405 does not really have CSRR0/1 but SRR2/3 are used during critical
33 * exception for the exact same purposes - let's alias them and have a
34 * common handling in crit_return() and CRIT_EXCEPTION
35 */
36 #define csrr0 srr2
37 #define csrr1 srr3
38
wdenk0442ed82002-11-03 10:24:00 +000039 #define dbsr 0x3f0 /* debug status register */
40 #define dbcr0 0x3f2 /* debug control register 0 */
41 #define dbcr1 0x3bd /* debug control register 1 */
42 #define iac1 0x3f4 /* instruction address comparator 1 */
43 #define iac2 0x3f5 /* instruction address comparator 2 */
44 #define iac3 0x3b4 /* instruction address comparator 3 */
45 #define iac4 0x3b5 /* instruction address comparator 4 */
46 #define dac1 0x3f6 /* data address comparator 1 */
47 #define dac2 0x3f7 /* data address comparator 2 */
48 #define dccr 0x3fa /* data cache control register */
49 #define iccr 0x3fb /* instruction cache control register */
50 #define esr 0x3d4 /* execption syndrome register */
51 #define dear 0x3d5 /* data exeption address register */
52 #define evpr 0x3d6 /* exeption vector prefix register */
53 #define tsr 0x3d8 /* timer status register */
54 #define tcr 0x3da /* timer control register */
55 #define pit 0x3db /* programmable interval timer */
wdenk57b2d802003-06-27 21:31:46 +000056 #define sgr 0x3b9 /* storage guarded reg */
57 #define dcwr 0x3ba /* data cache write-thru reg*/
58 #define sler 0x3bb /* storage little-endian reg */
wdenk0442ed82002-11-03 10:24:00 +000059 #define cdbcr 0x3d7 /* cache debug cntrl reg */
60 #define icdbdr 0x3d3 /* instr cache dbug data reg*/
61 #define ccr0 0x3b3 /* core configuration register */
62 #define dvc1 0x3b6 /* data value compare register 1 */
63 #define dvc2 0x3b7 /* data value compare register 2 */
64 #define pid 0x3b1 /* process ID */
65 #define su0r 0x3bc /* storage user-defined register 0 */
66 #define zpr 0x3b0 /* zone protection regsiter */
67
wdenk57b2d802003-06-27 21:31:46 +000068 #define tbl 0x11c /* time base lower - privileged write */
69 #define tbu 0x11d /* time base upper - privileged write */
wdenk0442ed82002-11-03 10:24:00 +000070
71 #define sprg4r 0x104 /* Special purpose general 4 - read only */
72 #define sprg5r 0x105 /* Special purpose general 5 - read only */
73 #define sprg6r 0x106 /* Special purpose general 6 - read only */
74 #define sprg7r 0x107 /* Special purpose general 7 - read only */
75 #define sprg4w 0x114 /* Special purpose general 4 - write only */
76 #define sprg5w 0x115 /* Special purpose general 5 - write only */
77 #define sprg6w 0x116 /* Special purpose general 6 - write only */
78 #define sprg7w 0x117 /* Special purpose general 7 - write only */
79
80/******************************************************************************
81 * Special for PPC405GP
82 ******************************************************************************/
83
84/******************************************************************************
85 * DMA
86 ******************************************************************************/
87#define DMA_DCR_BASE 0x100
88#define dmacr0 (DMA_DCR_BASE+0x00) /* DMA channel control register 0 */
89#define dmact0 (DMA_DCR_BASE+0x01) /* DMA count register 0 */
90#define dmada0 (DMA_DCR_BASE+0x02) /* DMA destination address register 0 */
91#define dmasa0 (DMA_DCR_BASE+0x03) /* DMA source address register 0 */
92#define dmasb0 (DMA_DCR_BASE+0x04) /* DMA scatter/gather descriptor addr 0 */
93#define dmacr1 (DMA_DCR_BASE+0x08) /* DMA channel control register 1 */
94#define dmact1 (DMA_DCR_BASE+0x09) /* DMA count register 1 */
95#define dmada1 (DMA_DCR_BASE+0x0a) /* DMA destination address register 1 */
96#define dmasa1 (DMA_DCR_BASE+0x0b) /* DMA source address register 1 */
97#define dmasb1 (DMA_DCR_BASE+0x0c) /* DMA scatter/gather descriptor addr 1 */
98#define dmacr2 (DMA_DCR_BASE+0x10) /* DMA channel control register 2 */
99#define dmact2 (DMA_DCR_BASE+0x11) /* DMA count register 2 */
100#define dmada2 (DMA_DCR_BASE+0x12) /* DMA destination address register 2 */
101#define dmasa2 (DMA_DCR_BASE+0x13) /* DMA source address register 2 */
102#define dmasb2 (DMA_DCR_BASE+0x14) /* DMA scatter/gather descriptor addr 2 */
103#define dmacr3 (DMA_DCR_BASE+0x18) /* DMA channel control register 3 */
104#define dmact3 (DMA_DCR_BASE+0x19) /* DMA count register 3 */
105#define dmada3 (DMA_DCR_BASE+0x1a) /* DMA destination address register 3 */
106#define dmasa3 (DMA_DCR_BASE+0x1b) /* DMA source address register 3 */
107#define dmasb3 (DMA_DCR_BASE+0x1c) /* DMA scatter/gather descriptor addr 3 */
108#define dmasr (DMA_DCR_BASE+0x20) /* DMA status register */
109#define dmasgc (DMA_DCR_BASE+0x23) /* DMA scatter/gather command register */
110#define dmaadr (DMA_DCR_BASE+0x24) /* DMA address decode register */
111
112/******************************************************************************
113 * Universal interrupt controller
114 ******************************************************************************/
115#define UIC_DCR_BASE 0xc0
116#define uicsr (UIC_DCR_BASE+0x0) /* UIC status */
117#define uicsrs (UIC_DCR_BASE+0x1) /* UIC status set */
118#define uicer (UIC_DCR_BASE+0x2) /* UIC enable */
119#define uiccr (UIC_DCR_BASE+0x3) /* UIC critical */
120#define uicpr (UIC_DCR_BASE+0x4) /* UIC polarity */
121#define uictr (UIC_DCR_BASE+0x5) /* UIC triggering */
122#define uicmsr (UIC_DCR_BASE+0x6) /* UIC masked status */
123#define uicvr (UIC_DCR_BASE+0x7) /* UIC vector */
124#define uicvcr (UIC_DCR_BASE+0x8) /* UIC vector configuration */
125
Stefan Roese153b3e22007-10-05 17:10:59 +0200126#if defined(CONFIG_405EX)
127#define uic0sr uicsr /* UIC status */
128#define uic0srs uicsrs /* UIC status set */
129#define uic0er uicer /* UIC enable */
130#define uic0cr uiccr /* UIC critical */
131#define uic0pr uicpr /* UIC polarity */
132#define uic0tr uictr /* UIC triggering */
133#define uic0msr uicmsr /* UIC masked status */
134#define uic0vr uicvr /* UIC vector */
135#define uic0vcr uicvcr /* UIC vector configuration*/
136
137#define UIC_DCR_BASE1 0xd0
138#define uic1sr (UIC_DCR_BASE1+0x0) /* UIC status */
139#define uic1srs (UIC_DCR_BASE1+0x1) /* UIC status set */
140#define uic1er (UIC_DCR_BASE1+0x2) /* UIC enable */
141#define uic1cr (UIC_DCR_BASE1+0x3) /* UIC critical */
142#define uic1pr (UIC_DCR_BASE1+0x4) /* UIC polarity */
143#define uic1tr (UIC_DCR_BASE1+0x5) /* UIC triggering */
144#define uic1msr (UIC_DCR_BASE1+0x6) /* UIC masked status */
145#define uic1vr (UIC_DCR_BASE1+0x7) /* UIC vector */
146#define uic1vcr (UIC_DCR_BASE1+0x8) /* UIC vector configuration*/
147
148#define UIC_DCR_BASE2 0xe0
149#define uic2sr (UIC_DCR_BASE2+0x0) /* UIC status */
150#define uic2srs (UIC_DCR_BASE2+0x1) /* UIC status set */
151#define uic2er (UIC_DCR_BASE2+0x2) /* UIC enable */
152#define uic2cr (UIC_DCR_BASE2+0x3) /* UIC critical */
153#define uic2pr (UIC_DCR_BASE2+0x4) /* UIC polarity */
154#define uic2tr (UIC_DCR_BASE2+0x5) /* UIC triggering */
155#define uic2msr (UIC_DCR_BASE2+0x6) /* UIC masked status */
156#define uic2vr (UIC_DCR_BASE2+0x7) /* UIC vector */
157#define uic2vcr (UIC_DCR_BASE2+0x8) /* UIC vector configuration*/
158#endif
159
wdenk0442ed82002-11-03 10:24:00 +0000160/*-----------------------------------------------------------------------------+
161| Universal interrupt controller interrupts
162+-----------------------------------------------------------------------------*/
Stefan Roese17ffbc82007-03-21 13:38:59 +0100163#if defined(CONFIG_405EZ)
164#define UIC_DMA0 0x80000000 /* DMA chan. 0 */
165#define UIC_DMA1 0x40000000 /* DMA chan. 1 */
166#define UIC_DMA2 0x20000000 /* DMA chan. 2 */
167#define UIC_DMA3 0x10000000 /* DMA chan. 3 */
168#define UIC_1588 0x08000000 /* IEEE 1588 network synchronization */
169#define UIC_UART0 0x04000000 /* UART 0 */
170#define UIC_UART1 0x02000000 /* UART 1 */
171#define UIC_CAN0 0x01000000 /* CAN 0 */
172#define UIC_CAN1 0x00800000 /* CAN 1 */
173#define UIC_SPI 0x00400000 /* SPI */
174#define UIC_IIC 0x00200000 /* IIC */
175#define UIC_CHT0 0x00100000 /* Chameleon timer high pri interrupt */
176#define UIC_CHT1 0x00080000 /* Chameleon timer high pri interrupt */
177#define UIC_USBH1 0x00040000 /* USB Host 1 */
178#define UIC_USBH2 0x00020000 /* USB Host 2 */
179#define UIC_USBDEV 0x00010000 /* USB Device */
Wolfgang Denk70df7bc2007-06-22 23:59:00 +0200180#define UIC_ENET 0x00008000 /* Ethernet interrupt status */
181#define UIC_ENET1 0x00008000 /* dummy define */
Stefan Roese17ffbc82007-03-21 13:38:59 +0100182#define UIC_EMAC_WAKE 0x00004000 /* EMAC wake up */
183
184#define UIC_MADMAL 0x00002000 /* Logical OR of following MadMAL int */
Wolfgang Denk70df7bc2007-06-22 23:59:00 +0200185#define UIC_MAL_SERR 0x00002000 /* MAL SERR */
Stefan Roese17ffbc82007-03-21 13:38:59 +0100186#define UIC_MAL_TXDE 0x00002000 /* MAL TXDE */
187#define UIC_MAL_RXDE 0x00002000 /* MAL RXDE */
188
189#define UIC_MAL_TXEOB 0x00001000 /* MAL TXEOB */
190#define UIC_MAL_TXEOB1 0x00000800 /* MAL TXEOB1 */
191#define UIC_MAL_RXEOB 0x00000400 /* MAL RXEOB */
192#define UIC_NAND 0x00000200 /* NAND Flash controller */
193#define UIC_ADC 0x00000100 /* ADC */
194#define UIC_DAC 0x00000080 /* DAC */
195#define UIC_OPB2PLB 0x00000040 /* OPB to PLB bridge interrupt */
196#define UIC_RESERVED0 0x00000020 /* Reserved */
197#define UIC_EXT0 0x00000010 /* External interrupt 0 */
198#define UIC_EXT1 0x00000008 /* External interrupt 1 */
199#define UIC_EXT2 0x00000004 /* External interrupt 2 */
200#define UIC_EXT3 0x00000002 /* External interrupt 3 */
201#define UIC_EXT4 0x00000001 /* External interrupt 4 */
202
Stefan Roese153b3e22007-10-05 17:10:59 +0200203#elif defined(CONFIG_405EX)
204
205/* UIC 0 */
206#define UIC_U0 0x80000000 /* */
207#define UIC_U1 0x40000000 /* */
208#define UIC_IIC0 0x20000000 /* */
209#define UIC_PKA 0x10000000 /* */
210#define UIC_TRNG 0x08000000 /* */
211#define UIC_EBM 0x04000000 /* */
212#define UIC_BGI 0x02000000 /* */
213#define UIC_IIC1 0x01000000 /* */
214#define UIC_SPI 0x00800000 /* */
215#define UIC_EIRQ0 0x00400000 /**/
216#define UIC_MTE 0x00200000 /*MAL Tx EOB */
217#define UIC_MRE 0x00100000 /*MAL Rx EOB */
218#define UIC_DMA0 0x00080000 /* */
219#define UIC_DMA1 0x00040000 /* */
220#define UIC_DMA2 0x00020000 /* */
221#define UIC_DMA3 0x00010000 /* */
222#define UIC_PCIE0AL 0x00008000 /* */
223#define UIC_PCIE0VPD 0x00004000 /* */
224#define UIC_RPCIE0HRST 0x00002000 /* */
225#define UIC_FPCIE0HRST 0x00001000 /* */
226#define UIC_PCIE0TCR 0x00000800 /* */
227#define UIC_PCIEMSI0 0x00000400 /* */
228#define UIC_PCIEMSI1 0x00000200 /* */
229#define UIC_SECURITY 0x00000100 /* */
230#define UIC_ENET 0x00000080 /* */
231#define UIC_ENET1 0x00000040 /* */
232#define UIC_PCIEMSI2 0x00000020 /* */
233#define UIC_EIRQ4 0x00000010 /**/
234#define UIC_UIC2NC 0x00000008 /* */
235#define UIC_UIC2C 0x00000004 /* */
236#define UIC_UIC1NC 0x00000002 /* */
237#define UIC_UIC1C 0x00000001 /* */
238
239#define UIC_MAL_TXEOB UIC_MTE/* MAL TXEOB */
240#define UIC_MAL_RXEOB UIC_MRE/* MAL RXEOB */
241/* UIC 1 */
242#define UIC_MS 0x80000000 /* MAL SERR */
243#define UIC_MTDE 0x40000000 /* MAL TXDE */
244#define UIC_MRDE 0x20000000 /* MAL RXDE */
245#define UIC_PCIE0BMVC0 0x10000000 /* */
246#define UIC_PCIE0DCRERR 0x08000000 /* */
247#define UIC_EBC 0x04000000 /* */
248#define UIC_NDFC 0x02000000 /* */
249#define UIC_PCEI1DCRERR 0x01000000 /* */
250#define UIC_GPTCMPT8 0x00800000 /* */
251#define UIC_GPTCMPT9 0x00400000 /* */
252#define UIC_PCIE1AL 0x00200000 /* */
253#define UIC_PCIE1VPD 0x00100000 /* */
254#define UIC_RPCE1HRST 0x00080000 /* */
255#define UIC_FPCE1HRST 0x00040000 /* */
256#define UIC_PCIE1TCR 0x00020000 /* */
257#define UIC_PCIE1VC0 0x00010000 /* */
258#define UIC_GPTCMPT3 0x00008000 /* */
259#define UIC_GPTCMPT4 0x00004000 /* */
260#define UIC_EIRQ7 0x00002000 /* */
261#define UIC_EIRQ8 0x00001000 /* */
262#define UIC_EIRQ9 0x00000800 /* */
263#define UIC_GPTCMP5 0x00000400 /* */
264#define UIC_GPTCMP6 0x00000200 /* */
265#define UIC_GPTCMP7 0x00000100 /* */
266#define UIC_SROM 0x00000080 /* SERIAL ROM*/
267#define UIC_GPTDECPULS 0x00000040 /* GPT Decrement pulse*/
268#define UIC_EIRQ2 0x00000020 /* */
269#define UIC_EIRQ5 0x00000010 /* */
270#define UIC_EIRQ6 0x00000008 /* */
271#define UIC_EMAC0WAKE 0x00000004 /* */
272#define UIC_EIRQ1 0x00000002 /* */
273#define UIC_EMAC1WAKE 0x00000001 /* */
274#define UIC_MAL_SERR UIC_MS /* MAL SERR */
275#define UIC_MAL_TXDE UIC_MTDE /* MAL TXDE */
276#define UIC_MAL_RXDE UIC_MRDE /* MAL RXDE */
277/* UIC 2 */
278#define UIC_PCIE0INTA 0x80000000 /* PCIE0 INTA*/
279#define UIC_PCIE0INTB 0x40000000 /* PCIE0 INTB*/
280#define UIC_PCIE0INTC 0x20000000 /* PCIE0 INTC*/
281#define UIC_PCIE0INTD 0x10000000 /* PCIE0 INTD*/
282#define UIC_EIRQ3 0x08000000 /* External IRQ 3*/
283#define UIC_DDRMCUE 0x04000000 /* */
284#define UIC_DDRMCCE 0x02000000 /* */
285#define UIC_MALINTCOATX0 0x01000000 /* Interrupt coalecence TX0*/
286#define UIC_MALINTCOATX1 0x00800000 /* Interrupt coalecence TX1*/
287#define UIC_MALINTCOARX0 0x00400000 /* Interrupt coalecence RX0*/
288#define UIC_MALINTCOARX1 0x00200000 /* Interrupt coalecence RX1*/
289#define UIC_PCIE1INTA 0x00100000 /* PCIE0 INTA*/
290#define UIC_PCIE1INTB 0x00080000 /* PCIE0 INTB*/
291#define UIC_PCIE1INTC 0x00040000 /* PCIE0 INTC*/
292#define UIC_PCIE1INTD 0x00020000 /* PCIE0 INTD*/
293#define UIC_RPCIEMSI2 0x00010000 /* MSI level 2 Note this looks same as uic0-26*/
294#define UIC_PCIEMSI3 0x00008000 /* MSI level 2*/
295#define UIC_PCIEMSI4 0x00004000 /* MSI level 2*/
296#define UIC_PCIEMSI5 0x00002000 /* MSI level 2*/
297#define UIC_PCIEMSI6 0x00001000 /* MSI level 2*/
298#define UIC_PCIEMSI7 0x00000800 /* MSI level 2*/
299#define UIC_PCIEMSI8 0x00000400 /* MSI level 2*/
300#define UIC_PCIEMSI9 0x00000200 /* MSI level 2*/
301#define UIC_PCIEMSI10 0x00000100 /* MSI level 2*/
302#define UIC_PCIEMSI11 0x00000080 /* MSI level 2*/
303#define UIC_PCIEMSI12 0x00000040 /* MSI level 2*/
304#define UIC_PCIEMSI13 0x00000020 /* MSI level 2*/
305#define UIC_PCIEMSI14 0x00000010 /* MSI level 2*/
306#define UIC_PCIEMSI15 0x00000008 /* MSI level 2*/
307#define UIC_PLB4XAHB 0x00000004 /* PLBxAHB bridge*/
308#define UIC_USBWAKE 0x00000002 /* USB wakup*/
309#define UIC_USBOTG 0x00000001 /* USB OTG*/
310#define UIC_ETH0 UIC_ENET
311#define UIC_ETH1 UIC_ENET1
312
Stefan Roese17ffbc82007-03-21 13:38:59 +0100313#else /* !defined(CONFIG_405EZ) */
314
wdenk0442ed82002-11-03 10:24:00 +0000315#define UIC_UART0 0x80000000 /* UART 0 */
316#define UIC_UART1 0x40000000 /* UART 1 */
317#define UIC_IIC 0x20000000 /* IIC */
318#define UIC_EXT_MAST 0x10000000 /* External Master */
319#define UIC_PCI 0x08000000 /* PCI write to command reg */
320#define UIC_DMA0 0x04000000 /* DMA chan. 0 */
321#define UIC_DMA1 0x02000000 /* DMA chan. 1 */
322#define UIC_DMA2 0x01000000 /* DMA chan. 2 */
323#define UIC_DMA3 0x00800000 /* DMA chan. 3 */
324#define UIC_EMAC_WAKE 0x00400000 /* EMAC wake up */
325#define UIC_MAL_SERR 0x00200000 /* MAL SERR */
326#define UIC_MAL_TXEOB 0x00100000 /* MAL TXEOB */
327#define UIC_MAL_RXEOB 0x00080000 /* MAL RXEOB */
328#define UIC_MAL_TXDE 0x00040000 /* MAL TXDE */
329#define UIC_MAL_RXDE 0x00020000 /* MAL RXDE */
wdenk2a6109c2004-06-06 23:53:59 +0000330#define UIC_ENET 0x00010000 /* Ethernet0 */
331#define UIC_ENET1 0x00004000 /* Ethernet1 on 405EP */
332#define UIC_ECC_CE 0x00004000 /* ECC Correctable Error on 405GP */
wdenk0442ed82002-11-03 10:24:00 +0000333#define UIC_EXT_PCI_SERR 0x00008000 /* External PCI SERR# */
wdenk0442ed82002-11-03 10:24:00 +0000334#define UIC_PCI_PM 0x00002000 /* PCI Power Management */
335#define UIC_EXT0 0x00000040 /* External interrupt 0 */
336#define UIC_EXT1 0x00000020 /* External interrupt 1 */
337#define UIC_EXT2 0x00000010 /* External interrupt 2 */
338#define UIC_EXT3 0x00000008 /* External interrupt 3 */
339#define UIC_EXT4 0x00000004 /* External interrupt 4 */
340#define UIC_EXT5 0x00000002 /* External interrupt 5 */
341#define UIC_EXT6 0x00000001 /* External interrupt 6 */
Stefan Roese17ffbc82007-03-21 13:38:59 +0100342#endif /* defined(CONFIG_405EZ) */
wdenk0442ed82002-11-03 10:24:00 +0000343
344/******************************************************************************
345 * SDRAM Controller
346 ******************************************************************************/
347#define SDRAM_DCR_BASE 0x10
348#define memcfga (SDRAM_DCR_BASE+0x0) /* Memory configuration address reg */
349#define memcfgd (SDRAM_DCR_BASE+0x1) /* Memory configuration data reg */
350 /* values for memcfga register - indirect addressing of these regs */
stroese434979e2003-05-23 11:18:02 +0000351#ifndef CONFIG_405EP
wdenk0442ed82002-11-03 10:24:00 +0000352 #define mem_besra 0x00 /* bus error syndrome reg a */
353 #define mem_besrsa 0x04 /* bus error syndrome reg set a */
354 #define mem_besrb 0x08 /* bus error syndrome reg b */
355 #define mem_besrsb 0x0c /* bus error syndrome reg set b */
356 #define mem_bear 0x10 /* bus error address reg */
stroese434979e2003-05-23 11:18:02 +0000357#endif
wdenk0442ed82002-11-03 10:24:00 +0000358 #define mem_mcopt1 0x20 /* memory controller options 1 */
Heiko Schocher3c58a992007-01-11 15:44:44 +0100359 #define mem_status 0x24 /* memory status */
wdenk0442ed82002-11-03 10:24:00 +0000360 #define mem_rtr 0x30 /* refresh timer reg */
361 #define mem_pmit 0x34 /* power management idle timer */
362 #define mem_mb0cf 0x40 /* memory bank 0 configuration */
363 #define mem_mb1cf 0x44 /* memory bank 1 configuration */
stroeseb0ca12d2003-12-09 14:59:11 +0000364#ifndef CONFIG_405EP
wdenk0442ed82002-11-03 10:24:00 +0000365 #define mem_mb2cf 0x48 /* memory bank 2 configuration */
366 #define mem_mb3cf 0x4c /* memory bank 3 configuration */
stroeseb0ca12d2003-12-09 14:59:11 +0000367#endif
wdenk0442ed82002-11-03 10:24:00 +0000368 #define mem_sdtr1 0x80 /* timing reg 1 */
stroese434979e2003-05-23 11:18:02 +0000369#ifndef CONFIG_405EP
wdenk0442ed82002-11-03 10:24:00 +0000370 #define mem_ecccf 0x94 /* ECC configuration */
371 #define mem_eccerr 0x98 /* ECC error status */
stroese434979e2003-05-23 11:18:02 +0000372#endif
wdenk0442ed82002-11-03 10:24:00 +0000373
stroeseb0ca12d2003-12-09 14:59:11 +0000374#ifndef CONFIG_405EP
wdenk0442ed82002-11-03 10:24:00 +0000375/******************************************************************************
376 * Decompression Controller
377 ******************************************************************************/
378#define DECOMP_DCR_BASE 0x14
379#define kiar (DECOMP_DCR_BASE+0x0) /* Decompression controller addr reg */
380#define kidr (DECOMP_DCR_BASE+0x1) /* Decompression controller data reg */
381 /* values for kiar register - indirect addressing of these regs */
382 #define kitor0 0x00 /* index table origin register 0 */
383 #define kitor1 0x01 /* index table origin register 1 */
384 #define kitor2 0x02 /* index table origin register 2 */
385 #define kitor3 0x03 /* index table origin register 3 */
386 #define kaddr0 0x04 /* address decode definition regsiter 0 */
387 #define kaddr1 0x05 /* address decode definition regsiter 1 */
388 #define kconf 0x40 /* decompression core config register */
389 #define kid 0x41 /* decompression core ID register */
390 #define kver 0x42 /* decompression core version # reg */
391 #define kpear 0x50 /* bus error addr reg (PLB addr) */
392 #define kbear 0x51 /* bus error addr reg (DCP to EBIU addr)*/
393 #define kesr0 0x52 /* bus error status reg 0 (R/clear) */
394 #define kesr0s 0x53 /* bus error status reg 0 (set) */
395 /* There are 0x400 of the following registers, from krom0 to krom3ff*/
396 /* Only the first one is given here. */
397 #define krom0 0x400 /* SRAM/ROM read/write */
stroeseb0ca12d2003-12-09 14:59:11 +0000398#endif
wdenk0442ed82002-11-03 10:24:00 +0000399
400/******************************************************************************
401 * Power Management
402 ******************************************************************************/
Stefan Roese153b3e22007-10-05 17:10:59 +0200403#ifdef CONFIG_405EX
404#define POWERMAN_DCR_BASE 0xb0
405#else
wdenk0442ed82002-11-03 10:24:00 +0000406#define POWERMAN_DCR_BASE 0xb8
Stefan Roese153b3e22007-10-05 17:10:59 +0200407#endif
wdenk0442ed82002-11-03 10:24:00 +0000408#define cpmsr (POWERMAN_DCR_BASE+0x0) /* Power management status */
409#define cpmer (POWERMAN_DCR_BASE+0x1) /* Power management enable */
410#define cpmfr (POWERMAN_DCR_BASE+0x2) /* Power management force */
411
412/******************************************************************************
413 * Extrnal Bus Controller
414 ******************************************************************************/
415#define EBC_DCR_BASE 0x12
416#define ebccfga (EBC_DCR_BASE+0x0) /* External bus controller addr reg */
417#define ebccfgd (EBC_DCR_BASE+0x1) /* External bus controller data reg */
418 /* values for ebccfga register - indirect addressing of these regs */
419 #define pb0cr 0x00 /* periph bank 0 config reg */
420 #define pb1cr 0x01 /* periph bank 1 config reg */
421 #define pb2cr 0x02 /* periph bank 2 config reg */
422 #define pb3cr 0x03 /* periph bank 3 config reg */
423 #define pb4cr 0x04 /* periph bank 4 config reg */
stroeseb0ca12d2003-12-09 14:59:11 +0000424#ifndef CONFIG_405EP
wdenk0442ed82002-11-03 10:24:00 +0000425 #define pb5cr 0x05 /* periph bank 5 config reg */
426 #define pb6cr 0x06 /* periph bank 6 config reg */
427 #define pb7cr 0x07 /* periph bank 7 config reg */
stroeseb0ca12d2003-12-09 14:59:11 +0000428#endif
wdenk0442ed82002-11-03 10:24:00 +0000429 #define pb0ap 0x10 /* periph bank 0 access parameters */
430 #define pb1ap 0x11 /* periph bank 1 access parameters */
431 #define pb2ap 0x12 /* periph bank 2 access parameters */
432 #define pb3ap 0x13 /* periph bank 3 access parameters */
433 #define pb4ap 0x14 /* periph bank 4 access parameters */
stroeseb0ca12d2003-12-09 14:59:11 +0000434#ifndef CONFIG_405EP
wdenk0442ed82002-11-03 10:24:00 +0000435 #define pb5ap 0x15 /* periph bank 5 access parameters */
436 #define pb6ap 0x16 /* periph bank 6 access parameters */
437 #define pb7ap 0x17 /* periph bank 7 access parameters */
stroeseb0ca12d2003-12-09 14:59:11 +0000438#endif
wdenk0442ed82002-11-03 10:24:00 +0000439 #define pbear 0x20 /* periph bus error addr reg */
440 #define pbesr0 0x21 /* periph bus error status reg 0 */
441 #define pbesr1 0x22 /* periph bus error status reg 1 */
442 #define epcr 0x23 /* external periph control reg */
Stefan Roesea8856e32007-02-20 10:57:08 +0100443#define EBC0_CFG 0x23 /* external bus configuration reg */
wdenk0442ed82002-11-03 10:24:00 +0000444
stroese434979e2003-05-23 11:18:02 +0000445#ifdef CONFIG_405EP
wdenk0442ed82002-11-03 10:24:00 +0000446/******************************************************************************
447 * Control
448 ******************************************************************************/
stroese434979e2003-05-23 11:18:02 +0000449#define CNTRL_DCR_BASE 0x0f0
450#define cpc0_pllmr0 (CNTRL_DCR_BASE+0x0) /* PLL mode register 0 */
451#define cpc0_boot (CNTRL_DCR_BASE+0x1) /* Clock status register */
452#define cpc0_epctl (CNTRL_DCR_BASE+0x3) /* EMAC to PHY control register */
453#define cpc0_pllmr1 (CNTRL_DCR_BASE+0x4) /* PLL mode register 1 */
454#define cpc0_ucr (CNTRL_DCR_BASE+0x5) /* UART control register */
455#define cpc0_pci (CNTRL_DCR_BASE+0x9) /* PCI control register */
456
457#define CPC0_PLLMR0 (CNTRL_DCR_BASE+0x0) /* PLL mode 0 register */
458#define CPC0_BOOT (CNTRL_DCR_BASE+0x1) /* Chip Clock Status register */
459#define CPC0_CR1 (CNTRL_DCR_BASE+0x2) /* Chip Control 1 register */
460#define CPC0_EPRCSR (CNTRL_DCR_BASE+0x3) /* EMAC PHY Rcv Clk Src register*/
461#define CPC0_PLLMR1 (CNTRL_DCR_BASE+0x4) /* PLL mode 1 register */
462#define CPC0_UCR (CNTRL_DCR_BASE+0x5) /* UART Control register */
463#define CPC0_SRR (CNTRL_DCR_BASE+0x6) /* Soft Reset register */
464#define CPC0_JTAGID (CNTRL_DCR_BASE+0x7) /* JTAG ID register */
465#define CPC0_SPARE (CNTRL_DCR_BASE+0x8) /* Spare DCR */
466#define CPC0_PCI (CNTRL_DCR_BASE+0x9) /* PCI Control register */
467
468/* Bit definitions */
469#define PLLMR0_CPU_DIV_MASK 0x00300000 /* CPU clock divider */
470#define PLLMR0_CPU_DIV_BYPASS 0x00000000
471#define PLLMR0_CPU_DIV_2 0x00100000
472#define PLLMR0_CPU_DIV_3 0x00200000
473#define PLLMR0_CPU_DIV_4 0x00300000
474
475#define PLLMR0_CPU_TO_PLB_MASK 0x00030000 /* CPU:PLB Frequency Divisor */
476#define PLLMR0_CPU_PLB_DIV_1 0x00000000
477#define PLLMR0_CPU_PLB_DIV_2 0x00010000
478#define PLLMR0_CPU_PLB_DIV_3 0x00020000
479#define PLLMR0_CPU_PLB_DIV_4 0x00030000
480
481#define PLLMR0_OPB_TO_PLB_MASK 0x00003000 /* OPB:PLB Frequency Divisor */
482#define PLLMR0_OPB_PLB_DIV_1 0x00000000
483#define PLLMR0_OPB_PLB_DIV_2 0x00001000
484#define PLLMR0_OPB_PLB_DIV_3 0x00002000
485#define PLLMR0_OPB_PLB_DIV_4 0x00003000
486
487#define PLLMR0_EXB_TO_PLB_MASK 0x00000300 /* External Bus:PLB Divisor */
488#define PLLMR0_EXB_PLB_DIV_2 0x00000000
489#define PLLMR0_EXB_PLB_DIV_3 0x00000100
490#define PLLMR0_EXB_PLB_DIV_4 0x00000200
491#define PLLMR0_EXB_PLB_DIV_5 0x00000300
492
493#define PLLMR0_MAL_TO_PLB_MASK 0x00000030 /* MAL:PLB Divisor */
494#define PLLMR0_MAL_PLB_DIV_1 0x00000000
495#define PLLMR0_MAL_PLB_DIV_2 0x00000010
496#define PLLMR0_MAL_PLB_DIV_3 0x00000020
497#define PLLMR0_MAL_PLB_DIV_4 0x00000030
498
499#define PLLMR0_PCI_TO_PLB_MASK 0x00000003 /* PCI:PLB Frequency Divisor */
500#define PLLMR0_PCI_PLB_DIV_1 0x00000000
501#define PLLMR0_PCI_PLB_DIV_2 0x00000001
502#define PLLMR0_PCI_PLB_DIV_3 0x00000002
503#define PLLMR0_PCI_PLB_DIV_4 0x00000003
504
505#define PLLMR1_SSCS_MASK 0x80000000 /* Select system clock source */
506#define PLLMR1_PLLR_MASK 0x40000000 /* PLL reset */
507#define PLLMR1_FBMUL_MASK 0x00F00000 /* PLL feedback multiplier value */
508#define PLLMR1_FBMUL_DIV_16 0x00000000
509#define PLLMR1_FBMUL_DIV_1 0x00100000
510#define PLLMR1_FBMUL_DIV_2 0x00200000
511#define PLLMR1_FBMUL_DIV_3 0x00300000
512#define PLLMR1_FBMUL_DIV_4 0x00400000
513#define PLLMR1_FBMUL_DIV_5 0x00500000
514#define PLLMR1_FBMUL_DIV_6 0x00600000
515#define PLLMR1_FBMUL_DIV_7 0x00700000
516#define PLLMR1_FBMUL_DIV_8 0x00800000
517#define PLLMR1_FBMUL_DIV_9 0x00900000
518#define PLLMR1_FBMUL_DIV_10 0x00A00000
519#define PLLMR1_FBMUL_DIV_11 0x00B00000
520#define PLLMR1_FBMUL_DIV_12 0x00C00000
521#define PLLMR1_FBMUL_DIV_13 0x00D00000
522#define PLLMR1_FBMUL_DIV_14 0x00E00000
523#define PLLMR1_FBMUL_DIV_15 0x00F00000
524
525#define PLLMR1_FWDVA_MASK 0x00070000 /* PLL forward divider A value */
526#define PLLMR1_FWDVA_DIV_8 0x00000000
527#define PLLMR1_FWDVA_DIV_7 0x00010000
528#define PLLMR1_FWDVA_DIV_6 0x00020000
529#define PLLMR1_FWDVA_DIV_5 0x00030000
530#define PLLMR1_FWDVA_DIV_4 0x00040000
531#define PLLMR1_FWDVA_DIV_3 0x00050000
532#define PLLMR1_FWDVA_DIV_2 0x00060000
533#define PLLMR1_FWDVA_DIV_1 0x00070000
534#define PLLMR1_FWDVB_MASK 0x00007000 /* PLL forward divider B value */
535#define PLLMR1_TUNING_MASK 0x000003FF /* PLL tune bits */
536
537/* Defines for CPC0_EPRCSR register */
538#define CPC0_EPRCSR_E0NFE 0x80000000
539#define CPC0_EPRCSR_E1NFE 0x40000000
540#define CPC0_EPRCSR_E1RPP 0x00000080
541#define CPC0_EPRCSR_E0RPP 0x00000040
542#define CPC0_EPRCSR_E1ERP 0x00000020
543#define CPC0_EPRCSR_E0ERP 0x00000010
544#define CPC0_EPRCSR_E1PCI 0x00000002
545#define CPC0_EPRCSR_E0PCI 0x00000001
546
547/* Defines for CPC0_PCI Register */
548#define CPC0_PCI_SPE 0x00000010 /* PCIINT/WE select */
549#define CPC0_PCI_HOST_CFG_EN 0x00000008 /* PCI host config Enable */
550#define CPC0_PCI_ARBIT_EN 0x00000001 /* PCI Internal Arb Enabled*/
551
552/* Defines for CPC0_BOOR Register */
553#define CPC0_BOOT_SEP 0x00000002 /* serial EEPROM present */
554
555/* Defines for CPC0_PLLMR1 Register fields */
556#define PLL_ACTIVE 0x80000000
557#define CPC0_PLLMR1_SSCS 0x80000000
558#define PLL_RESET 0x40000000
559#define CPC0_PLLMR1_PLLR 0x40000000
560 /* Feedback multiplier */
561#define PLL_FBKDIV 0x00F00000
562#define CPC0_PLLMR1_FBDV 0x00F00000
563#define PLL_FBKDIV_16 0x00000000
564#define PLL_FBKDIV_1 0x00100000
565#define PLL_FBKDIV_2 0x00200000
566#define PLL_FBKDIV_3 0x00300000
567#define PLL_FBKDIV_4 0x00400000
568#define PLL_FBKDIV_5 0x00500000
569#define PLL_FBKDIV_6 0x00600000
570#define PLL_FBKDIV_7 0x00700000
571#define PLL_FBKDIV_8 0x00800000
572#define PLL_FBKDIV_9 0x00900000
573#define PLL_FBKDIV_10 0x00A00000
574#define PLL_FBKDIV_11 0x00B00000
575#define PLL_FBKDIV_12 0x00C00000
576#define PLL_FBKDIV_13 0x00D00000
577#define PLL_FBKDIV_14 0x00E00000
578#define PLL_FBKDIV_15 0x00F00000
579 /* Forward A divisor */
580#define PLL_FWDDIVA 0x00070000
581#define CPC0_PLLMR1_FWDVA 0x00070000
582#define PLL_FWDDIVA_8 0x00000000
583#define PLL_FWDDIVA_7 0x00010000
584#define PLL_FWDDIVA_6 0x00020000
585#define PLL_FWDDIVA_5 0x00030000
586#define PLL_FWDDIVA_4 0x00040000
587#define PLL_FWDDIVA_3 0x00050000
588#define PLL_FWDDIVA_2 0x00060000
589#define PLL_FWDDIVA_1 0x00070000
590 /* Forward B divisor */
591#define PLL_FWDDIVB 0x00007000
592#define CPC0_PLLMR1_FWDVB 0x00007000
593#define PLL_FWDDIVB_8 0x00000000
594#define PLL_FWDDIVB_7 0x00001000
595#define PLL_FWDDIVB_6 0x00002000
596#define PLL_FWDDIVB_5 0x00003000
597#define PLL_FWDDIVB_4 0x00004000
598#define PLL_FWDDIVB_3 0x00005000
599#define PLL_FWDDIVB_2 0x00006000
600#define PLL_FWDDIVB_1 0x00007000
601 /* PLL tune bits */
602#define PLL_TUNE_MASK 0x000003FF
603#define PLL_TUNE_2_M_3 0x00000133 /* 2 <= M <= 3 */
604#define PLL_TUNE_4_M_6 0x00000134 /* 3 < M <= 6 */
605#define PLL_TUNE_7_M_10 0x00000138 /* 6 < M <= 10 */
606#define PLL_TUNE_11_M_14 0x0000013C /* 10 < M <= 14 */
607#define PLL_TUNE_15_M_40 0x0000023E /* 14 < M <= 40 */
608#define PLL_TUNE_VCO_LOW 0x00000000 /* 500MHz <= VCO <= 800MHz */
609#define PLL_TUNE_VCO_HI 0x00000080 /* 800MHz < VCO <= 1000MHz */
610
611/* Defines for CPC0_PLLMR0 Register fields */
612 /* CPU divisor */
613#define PLL_CPUDIV 0x00300000
614#define CPC0_PLLMR0_CCDV 0x00300000
615#define PLL_CPUDIV_1 0x00000000
616#define PLL_CPUDIV_2 0x00100000
617#define PLL_CPUDIV_3 0x00200000
618#define PLL_CPUDIV_4 0x00300000
619 /* PLB divisor */
620#define PLL_PLBDIV 0x00030000
621#define CPC0_PLLMR0_CBDV 0x00030000
622#define PLL_PLBDIV_1 0x00000000
623#define PLL_PLBDIV_2 0x00010000
624#define PLL_PLBDIV_3 0x00020000
625#define PLL_PLBDIV_4 0x00030000
626 /* OPB divisor */
627#define PLL_OPBDIV 0x00003000
628#define CPC0_PLLMR0_OPDV 0x00003000
629#define PLL_OPBDIV_1 0x00000000
630#define PLL_OPBDIV_2 0x00001000
631#define PLL_OPBDIV_3 0x00002000
632#define PLL_OPBDIV_4 0x00003000
633 /* EBC divisor */
634#define PLL_EXTBUSDIV 0x00000300
635#define CPC0_PLLMR0_EPDV 0x00000300
636#define PLL_EXTBUSDIV_2 0x00000000
637#define PLL_EXTBUSDIV_3 0x00000100
638#define PLL_EXTBUSDIV_4 0x00000200
639#define PLL_EXTBUSDIV_5 0x00000300
640 /* MAL divisor */
641#define PLL_MALDIV 0x00000030
642#define CPC0_PLLMR0_MPDV 0x00000030
643#define PLL_MALDIV_1 0x00000000
644#define PLL_MALDIV_2 0x00000010
645#define PLL_MALDIV_3 0x00000020
646#define PLL_MALDIV_4 0x00000030
647 /* PCI divisor */
648#define PLL_PCIDIV 0x00000003
649#define CPC0_PLLMR0_PPFD 0x00000003
650#define PLL_PCIDIV_1 0x00000000
651#define PLL_PCIDIV_2 0x00000001
652#define PLL_PCIDIV_3 0x00000002
653#define PLL_PCIDIV_4 0x00000003
654
655/*
656 *-------------------------------------------------------------------------------
657 * PLL settings for 266MHz CPU, 133MHz PLB/SDRAM, 66MHz EBC, 33MHz PCI,
658 * assuming a 33.3MHz input clock to the 405EP.
659 *-------------------------------------------------------------------------------
660 */
661#define PLLMR0_266_133_66 (PLL_CPUDIV_1 | PLL_PLBDIV_2 | \
wdenk57b2d802003-06-27 21:31:46 +0000662 PLL_OPBDIV_2 | PLL_EXTBUSDIV_2 | \
663 PLL_MALDIV_1 | PLL_PCIDIV_4)
stroese434979e2003-05-23 11:18:02 +0000664#define PLLMR1_266_133_66 (PLL_FBKDIV_8 | \
wdenk57b2d802003-06-27 21:31:46 +0000665 PLL_FWDDIVA_3 | PLL_FWDDIVB_3 | \
666 PLL_TUNE_15_M_40 | PLL_TUNE_VCO_LOW)
stroese434979e2003-05-23 11:18:02 +0000667
668#define PLLMR0_133_66_66_33 (PLL_CPUDIV_1 | PLL_PLBDIV_1 | \
wdenk57b2d802003-06-27 21:31:46 +0000669 PLL_OPBDIV_2 | PLL_EXTBUSDIV_4 | \
670 PLL_MALDIV_1 | PLL_PCIDIV_4)
stroese434979e2003-05-23 11:18:02 +0000671#define PLLMR1_133_66_66_33 (PLL_FBKDIV_4 | \
wdenk57b2d802003-06-27 21:31:46 +0000672 PLL_FWDDIVA_6 | PLL_FWDDIVB_6 | \
673 PLL_TUNE_15_M_40 | PLL_TUNE_VCO_LOW)
stroese434979e2003-05-23 11:18:02 +0000674#define PLLMR0_200_100_50_33 (PLL_CPUDIV_1 | PLL_PLBDIV_2 | \
wdenk57b2d802003-06-27 21:31:46 +0000675 PLL_OPBDIV_2 | PLL_EXTBUSDIV_3 | \
676 PLL_MALDIV_1 | PLL_PCIDIV_4)
stroese434979e2003-05-23 11:18:02 +0000677#define PLLMR1_200_100_50_33 (PLL_FBKDIV_6 | \
wdenk57b2d802003-06-27 21:31:46 +0000678 PLL_FWDDIVA_4 | PLL_FWDDIVB_4 | \
679 PLL_TUNE_15_M_40 | PLL_TUNE_VCO_LOW)
stroese434979e2003-05-23 11:18:02 +0000680#define PLLMR0_266_133_66_33 (PLL_CPUDIV_1 | PLL_PLBDIV_2 | \
wdenk57b2d802003-06-27 21:31:46 +0000681 PLL_OPBDIV_2 | PLL_EXTBUSDIV_4 | \
682 PLL_MALDIV_1 | PLL_PCIDIV_4)
stroese434979e2003-05-23 11:18:02 +0000683#define PLLMR1_266_133_66_33 (PLL_FBKDIV_8 | \
wdenk57b2d802003-06-27 21:31:46 +0000684 PLL_FWDDIVA_3 | PLL_FWDDIVB_3 | \
685 PLL_TUNE_15_M_40 | PLL_TUNE_VCO_LOW)
stroese317a25f2004-12-16 18:03:44 +0000686#define PLLMR0_266_66_33_33 (PLL_CPUDIV_1 | PLL_PLBDIV_4 | \
wdenk07d7e6b2004-12-16 21:44:03 +0000687 PLL_OPBDIV_2 | PLL_EXTBUSDIV_2 | \
688 PLL_MALDIV_1 | PLL_PCIDIV_2)
stroese317a25f2004-12-16 18:03:44 +0000689#define PLLMR1_266_66_33_33 (PLL_FBKDIV_8 | \
wdenk07d7e6b2004-12-16 21:44:03 +0000690 PLL_FWDDIVA_3 | PLL_FWDDIVB_3 | \
691 PLL_TUNE_15_M_40 | PLL_TUNE_VCO_LOW)
Stefan Roesea5d182e2007-08-14 14:44:41 +0200692#define PLLMR0_333_111_55_37 (PLL_CPUDIV_1 | PLL_PLBDIV_3 | \
693 PLL_OPBDIV_2 | PLL_EXTBUSDIV_2 | \
694 PLL_MALDIV_1 | PLL_PCIDIV_3)
695#define PLLMR1_333_111_55_37 (PLL_FBKDIV_10 | \
696 PLL_FWDDIVA_3 | PLL_FWDDIVB_3 | \
697 PLL_TUNE_15_M_40 | PLL_TUNE_VCO_HI)
698#define PLLMR0_333_111_55_111 (PLL_CPUDIV_1 | PLL_PLBDIV_3 | \
699 PLL_OPBDIV_2 | PLL_EXTBUSDIV_2 | \
700 PLL_MALDIV_1 | PLL_PCIDIV_1)
701#define PLLMR1_333_111_55_111 (PLL_FBKDIV_10 | \
702 PLL_FWDDIVA_3 | PLL_FWDDIVB_3 | \
703 PLL_TUNE_15_M_40 | PLL_TUNE_VCO_HI)
stroese434979e2003-05-23 11:18:02 +0000704
705/*
706 * PLL Voltage Controlled Oscillator (VCO) definitions
707 * Maximum and minimum values (in MHz) for correct PLL operation.
708 */
709#define VCO_MIN 500
710#define VCO_MAX 1000
Stefan Roese17ffbc82007-03-21 13:38:59 +0100711#elif defined(CONFIG_405EZ)
Stefan Roese17ffbc82007-03-21 13:38:59 +0100712#define sdrnand0 0x4000
713#define sdrultra0 0x4040
714#define sdrultra1 0x4050
715#define sdricintstat 0x4510
716
717#define SDR_NAND0_NDEN 0x80000000
Stefan Roese23d8d342007-06-06 11:42:13 +0200718#define SDR_NAND0_NDBTEN 0x40000000
719#define SDR_NAND0_NDBADR_MASK 0x30000000
720#define SDR_NAND0_NDBPG_MASK 0x0f000000
721#define SDR_NAND0_NDAREN 0x00800000
722#define SDR_NAND0_NDRBEN 0x00400000
Stefan Roese17ffbc82007-03-21 13:38:59 +0100723
724#define SDR_ULTRA0_NDGPIOBP 0x80000000
725#define SDR_ULTRA0_CSN_MASK 0x78000000
726#define SDR_ULTRA0_CSNSEL0 0x40000000
727#define SDR_ULTRA0_CSNSEL1 0x20000000
728#define SDR_ULTRA0_CSNSEL2 0x10000000
729#define SDR_ULTRA0_CSNSEL3 0x08000000
Stefan Roese23d8d342007-06-06 11:42:13 +0200730#define SDR_ULTRA0_EBCRDYEN 0x04000000
731#define SDR_ULTRA0_SPISSINEN 0x02000000
732#define SDR_ULTRA0_NFSRSTEN 0x01000000
Stefan Roese17ffbc82007-03-21 13:38:59 +0100733
734#define SDR_ULTRA1_LEDNENABLE 0x40000000
735
736#define SDR_ICRX_STAT 0x80000000
737#define SDR_ICTX0_STAT 0x40000000
738#define SDR_ICTX1_STAT 0x20000000
739
Stefan Roese3a75ac12007-04-18 12:05:59 +0200740#define SDR_PINSTP 0x40
741
Stefan Roese17ffbc82007-03-21 13:38:59 +0100742/******************************************************************************
743 * Control
744 ******************************************************************************/
745#define CNTRL_DCR_BASE 0x0C
746#define cprcfga (CNTRL_DCR_BASE+0x0) /* CPR addr reg */
747#define cprcfgd (CNTRL_DCR_BASE+0x1) /* CPR data reg */
748
749/* CPR Registers */
750#define cprclkupd 0x020 /* CPR_CLKUPD */
751#define cprpllc 0x040 /* CPR_PLLC */
752#define cprplld 0x060 /* CPR_PLLD */
753#define cprprimad 0x080 /* CPR_PRIMAD */
754#define cprperd0 0x0e0 /* CPR_PERD0 */
755#define cprperd1 0x0e1 /* CPR_PERD1 */
756#define cprperc0 0x180 /* CPR_PERC0 */
757#define cprmisc0 0x181 /* CPR_MISC0 */
758#define cprmisc1 0x182 /* CPR_MISC1 */
759
760/*
761 * Macro for accessing the indirect CPR register
762 */
Stefan Roese9d6eeef2007-05-22 12:48:09 +0200763#define mtcpr(reg, data) do { mtdcr(cprcfga,reg);mtdcr(cprcfgd,data); } while (0)
764#define mfcpr(reg, data) do { mtdcr(cprcfga,reg);data = mfdcr(cprcfgd); } while (0)
Stefan Roese17ffbc82007-03-21 13:38:59 +0100765
766#define CPR_CLKUPD_ENPLLCH_EN 0x40000000 /* Enable CPR PLL Changes */
767#define CPR_CLKUPD_ENDVCH_EN 0x20000000 /* Enable CPR Sys. Div. Changes */
768#define CPR_PERD0_SPIDV_MASK 0x000F0000 /* SPI Clock Divider */
769
Stefan Roese87476ba2007-08-13 09:05:33 +0200770#define PLLC_SRC_MASK 0x20000000 /* PLL feedback source */
771
Stefan Roese17ffbc82007-03-21 13:38:59 +0100772#define PLLD_FBDV_MASK 0x1F000000 /* PLL feedback divider value */
773#define PLLD_FWDVA_MASK 0x000F0000 /* PLL forward divider A value */
774#define PLLD_FWDVB_MASK 0x00000700 /* PLL forward divider B value */
775
776#define PRIMAD_CPUDV_MASK 0x0F000000 /* CPU Clock Divisor Mask */
777#define PRIMAD_PLBDV_MASK 0x000F0000 /* PLB Clock Divisor Mask */
778#define PRIMAD_OPBDV_MASK 0x00000F00 /* OPB Clock Divisor Mask */
779#define PRIMAD_EBCDV_MASK 0x0000000F /* EBC Clock Divisor Mask */
780
781#define PERD0_PWMDV_MASK 0xFF000000 /* PWM Divider Mask */
782#define PERD0_SPIDV_MASK 0x000F0000 /* SPI Divider Mask */
783#define PERD0_U0DV_MASK 0x0000FF00 /* UART 0 Divider Mask */
784#define PERD0_U1DV_MASK 0x000000FF /* UART 1 Divider Mask */
785
786#if 0 /* Deprecated */
787#define CNTRL_DCR_BASE 0x0f0
788#define cpc0_pllmr0 (CNTRL_DCR_BASE+0x0) /* PLL mode register 0 */
789#define cpc0_boot (CNTRL_DCR_BASE+0x1) /* Clock status register */
790#define cpc0_epctl (CNTRL_DCR_BASE+0x3) /* EMAC to PHY control register */
791#define cpc0_pllmr1 (CNTRL_DCR_BASE+0x4) /* PLL mode register 1 */
792#define cpc0_ucr (CNTRL_DCR_BASE+0x5) /* UART control register */
793#define cpc0_pci (CNTRL_DCR_BASE+0x9) /* PCI control register */
794
795#define CPC0_PLLMR0 (CNTRL_DCR_BASE+0x0) /* PLL mode 0 register */
796#define CPC0_BOOT (CNTRL_DCR_BASE+0x1) /* Chip Clock Status register */
797#define CPC0_CR1 (CNTRL_DCR_BASE+0x2) /* Chip Control 1 register */
798#define CPC0_EPRCSR (CNTRL_DCR_BASE+0x3) /* EMAC PHY Rcv Clk Src register*/
799#define CPC0_PLLMR1 (CNTRL_DCR_BASE+0x4) /* PLL mode 1 register */
800#define CPC0_UCR (CNTRL_DCR_BASE+0x5) /* UART Control register */
801#define CPC0_SRR (CNTRL_DCR_BASE+0x6) /* Soft Reset register */
802#define CPC0_JTAGID (CNTRL_DCR_BASE+0x7) /* JTAG ID register */
803#define CPC0_SPARE (CNTRL_DCR_BASE+0x8) /* Spare DCR */
804#define CPC0_PCI (CNTRL_DCR_BASE+0x9) /* PCI Control register */
805
806/* Bit definitions */
807#define PLLMR0_CPU_DIV_MASK 0x00300000 /* CPU clock divider */
808#define PLLMR0_CPU_DIV_BYPASS 0x00000000
809#define PLLMR0_CPU_DIV_2 0x00100000
810#define PLLMR0_CPU_DIV_3 0x00200000
811#define PLLMR0_CPU_DIV_4 0x00300000
812
813#define PLLMR0_CPU_TO_PLB_MASK 0x00030000 /* CPU:PLB Frequency Divisor */
814#define PLLMR0_CPU_PLB_DIV_1 0x00000000
815#define PLLMR0_CPU_PLB_DIV_2 0x00010000
816#define PLLMR0_CPU_PLB_DIV_3 0x00020000
817#define PLLMR0_CPU_PLB_DIV_4 0x00030000
818
819#define PLLMR0_OPB_TO_PLB_MASK 0x00003000 /* OPB:PLB Frequency Divisor */
820#define PLLMR0_OPB_PLB_DIV_1 0x00000000
821#define PLLMR0_OPB_PLB_DIV_2 0x00001000
822#define PLLMR0_OPB_PLB_DIV_3 0x00002000
823#define PLLMR0_OPB_PLB_DIV_4 0x00003000
824
825#define PLLMR0_EXB_TO_PLB_MASK 0x00000300 /* External Bus:PLB Divisor */
826#define PLLMR0_EXB_PLB_DIV_2 0x00000000
827#define PLLMR0_EXB_PLB_DIV_3 0x00000100
828#define PLLMR0_EXB_PLB_DIV_4 0x00000200
829#define PLLMR0_EXB_PLB_DIV_5 0x00000300
830
831#define PLLMR0_MAL_TO_PLB_MASK 0x00000030 /* MAL:PLB Divisor */
832#define PLLMR0_MAL_PLB_DIV_1 0x00000000
833#define PLLMR0_MAL_PLB_DIV_2 0x00000010
834#define PLLMR0_MAL_PLB_DIV_3 0x00000020
835#define PLLMR0_MAL_PLB_DIV_4 0x00000030
836
837#define PLLMR0_PCI_TO_PLB_MASK 0x00000003 /* PCI:PLB Frequency Divisor */
838#define PLLMR0_PCI_PLB_DIV_1 0x00000000
839#define PLLMR0_PCI_PLB_DIV_2 0x00000001
840#define PLLMR0_PCI_PLB_DIV_3 0x00000002
841#define PLLMR0_PCI_PLB_DIV_4 0x00000003
842
843#define PLLMR1_SSCS_MASK 0x80000000 /* Select system clock source */
844#define PLLMR1_PLLR_MASK 0x40000000 /* PLL reset */
845#define PLLMR1_FBMUL_MASK 0x00F00000 /* PLL feedback multiplier value */
846#define PLLMR1_FBMUL_DIV_16 0x00000000
847#define PLLMR1_FBMUL_DIV_1 0x00100000
848#define PLLMR1_FBMUL_DIV_2 0x00200000
849#define PLLMR1_FBMUL_DIV_3 0x00300000
850#define PLLMR1_FBMUL_DIV_4 0x00400000
851#define PLLMR1_FBMUL_DIV_5 0x00500000
852#define PLLMR1_FBMUL_DIV_6 0x00600000
853#define PLLMR1_FBMUL_DIV_7 0x00700000
854#define PLLMR1_FBMUL_DIV_8 0x00800000
855#define PLLMR1_FBMUL_DIV_9 0x00900000
856#define PLLMR1_FBMUL_DIV_10 0x00A00000
857#define PLLMR1_FBMUL_DIV_11 0x00B00000
858#define PLLMR1_FBMUL_DIV_12 0x00C00000
859#define PLLMR1_FBMUL_DIV_13 0x00D00000
860#define PLLMR1_FBMUL_DIV_14 0x00E00000
861#define PLLMR1_FBMUL_DIV_15 0x00F00000
862
863#define PLLMR1_FWDVA_MASK 0x00070000 /* PLL forward divider A value */
864#define PLLMR1_FWDVA_DIV_8 0x00000000
865#define PLLMR1_FWDVA_DIV_7 0x00010000
866#define PLLMR1_FWDVA_DIV_6 0x00020000
867#define PLLMR1_FWDVA_DIV_5 0x00030000
868#define PLLMR1_FWDVA_DIV_4 0x00040000
869#define PLLMR1_FWDVA_DIV_3 0x00050000
870#define PLLMR1_FWDVA_DIV_2 0x00060000
871#define PLLMR1_FWDVA_DIV_1 0x00070000
872#define PLLMR1_FWDVB_MASK 0x00007000 /* PLL forward divider B value */
873#define PLLMR1_TUNING_MASK 0x000003FF /* PLL tune bits */
874
875/* Defines for CPC0_EPRCSR register */
876#define CPC0_EPRCSR_E0NFE 0x80000000
877#define CPC0_EPRCSR_E1NFE 0x40000000
878#define CPC0_EPRCSR_E1RPP 0x00000080
879#define CPC0_EPRCSR_E0RPP 0x00000040
880#define CPC0_EPRCSR_E1ERP 0x00000020
881#define CPC0_EPRCSR_E0ERP 0x00000010
882#define CPC0_EPRCSR_E1PCI 0x00000002
883#define CPC0_EPRCSR_E0PCI 0x00000001
884
885/* Defines for CPC0_BOOR Register */
886#define CPC0_BOOT_SEP 0x00000002 /* serial EEPROM present */
887
888/* Defines for CPC0_PLLMR1 Register fields */
889#define PLL_ACTIVE 0x80000000
890#define CPC0_PLLMR1_SSCS 0x80000000
891#define PLL_RESET 0x40000000
892#define CPC0_PLLMR1_PLLR 0x40000000
893 /* Feedback multiplier */
894#define PLL_FBKDIV 0x00F00000
895#define CPC0_PLLMR1_FBDV 0x00F00000
896#define PLL_FBKDIV_16 0x00000000
897#define PLL_FBKDIV_1 0x00100000
898#define PLL_FBKDIV_2 0x00200000
899#define PLL_FBKDIV_3 0x00300000
900#define PLL_FBKDIV_4 0x00400000
901#define PLL_FBKDIV_5 0x00500000
902#define PLL_FBKDIV_6 0x00600000
903#define PLL_FBKDIV_7 0x00700000
904#define PLL_FBKDIV_8 0x00800000
905#define PLL_FBKDIV_9 0x00900000
906#define PLL_FBKDIV_10 0x00A00000
907#define PLL_FBKDIV_11 0x00B00000
908#define PLL_FBKDIV_12 0x00C00000
909#define PLL_FBKDIV_13 0x00D00000
910#define PLL_FBKDIV_14 0x00E00000
911#define PLL_FBKDIV_15 0x00F00000
912 /* Forward A divisor */
913#define PLL_FWDDIVA 0x00070000
914#define CPC0_PLLMR1_FWDVA 0x00070000
915#define PLL_FWDDIVA_8 0x00000000
916#define PLL_FWDDIVA_7 0x00010000
917#define PLL_FWDDIVA_6 0x00020000
918#define PLL_FWDDIVA_5 0x00030000
919#define PLL_FWDDIVA_4 0x00040000
920#define PLL_FWDDIVA_3 0x00050000
921#define PLL_FWDDIVA_2 0x00060000
922#define PLL_FWDDIVA_1 0x00070000
923 /* Forward B divisor */
924#define PLL_FWDDIVB 0x00007000
925#define CPC0_PLLMR1_FWDVB 0x00007000
926#define PLL_FWDDIVB_8 0x00000000
927#define PLL_FWDDIVB_7 0x00001000
928#define PLL_FWDDIVB_6 0x00002000
929#define PLL_FWDDIVB_5 0x00003000
930#define PLL_FWDDIVB_4 0x00004000
931#define PLL_FWDDIVB_3 0x00005000
932#define PLL_FWDDIVB_2 0x00006000
933#define PLL_FWDDIVB_1 0x00007000
934 /* PLL tune bits */
935#define PLL_TUNE_MASK 0x000003FF
936#define PLL_TUNE_2_M_3 0x00000133 /* 2 <= M <= 3 */
937#define PLL_TUNE_4_M_6 0x00000134 /* 3 < M <= 6 */
938#define PLL_TUNE_7_M_10 0x00000138 /* 6 < M <= 10 */
939#define PLL_TUNE_11_M_14 0x0000013C /* 10 < M <= 14 */
940#define PLL_TUNE_15_M_40 0x0000023E /* 14 < M <= 40 */
941#define PLL_TUNE_VCO_LOW 0x00000000 /* 500MHz <= VCO <= 800MHz */
942#define PLL_TUNE_VCO_HI 0x00000080 /* 800MHz < VCO <= 1000MHz */
943
944/* Defines for CPC0_PLLMR0 Register fields */
945 /* CPU divisor */
946#define PLL_CPUDIV 0x00300000
947#define CPC0_PLLMR0_CCDV 0x00300000
948#define PLL_CPUDIV_1 0x00000000
949#define PLL_CPUDIV_2 0x00100000
950#define PLL_CPUDIV_3 0x00200000
951#define PLL_CPUDIV_4 0x00300000
952 /* PLB divisor */
953#define PLL_PLBDIV 0x00030000
954#define CPC0_PLLMR0_CBDV 0x00030000
955#define PLL_PLBDIV_1 0x00000000
956#define PLL_PLBDIV_2 0x00010000
957#define PLL_PLBDIV_3 0x00020000
958#define PLL_PLBDIV_4 0x00030000
959 /* OPB divisor */
960#define PLL_OPBDIV 0x00003000
961#define CPC0_PLLMR0_OPDV 0x00003000
962#define PLL_OPBDIV_1 0x00000000
963#define PLL_OPBDIV_2 0x00001000
964#define PLL_OPBDIV_3 0x00002000
965#define PLL_OPBDIV_4 0x00003000
966 /* EBC divisor */
967#define PLL_EXTBUSDIV 0x00000300
968#define CPC0_PLLMR0_EPDV 0x00000300
969#define PLL_EXTBUSDIV_2 0x00000000
970#define PLL_EXTBUSDIV_3 0x00000100
971#define PLL_EXTBUSDIV_4 0x00000200
972#define PLL_EXTBUSDIV_5 0x00000300
973 /* MAL divisor */
974#define PLL_MALDIV 0x00000030
975#define CPC0_PLLMR0_MPDV 0x00000030
976#define PLL_MALDIV_1 0x00000000
977#define PLL_MALDIV_2 0x00000010
978#define PLL_MALDIV_3 0x00000020
979#define PLL_MALDIV_4 0x00000030
980 /* PCI divisor */
981#define PLL_PCIDIV 0x00000003
982#define CPC0_PLLMR0_PPFD 0x00000003
983#define PLL_PCIDIV_1 0x00000000
984#define PLL_PCIDIV_2 0x00000001
985#define PLL_PCIDIV_3 0x00000002
986#define PLL_PCIDIV_4 0x00000003
987
988/*
989 *-------------------------------------------------------------------------------
990 * PLL settings for 266MHz CPU, 133MHz PLB/SDRAM, 66MHz EBC, 33MHz PCI,
991 * assuming a 33.3MHz input clock to the 405EP.
992 *-------------------------------------------------------------------------------
993 */
994#define PLLMR0_266_133_66 (PLL_CPUDIV_1 | PLL_PLBDIV_2 | \
995 PLL_OPBDIV_2 | PLL_EXTBUSDIV_2 | \
996 PLL_MALDIV_1 | PLL_PCIDIV_4)
997#define PLLMR1_266_133_66 (PLL_FBKDIV_8 | \
998 PLL_FWDDIVA_3 | PLL_FWDDIVB_3 | \
999 PLL_TUNE_15_M_40 | PLL_TUNE_VCO_LOW)
1000#define PLLMR0_133_66_66_33 (PLL_CPUDIV_1 | PLL_PLBDIV_1 | \
1001 PLL_OPBDIV_2 | PLL_EXTBUSDIV_4 | \
1002 PLL_MALDIV_1 | PLL_PCIDIV_4)
1003#define PLLMR1_133_66_66_33 (PLL_FBKDIV_4 | \
1004 PLL_FWDDIVA_6 | PLL_FWDDIVB_6 | \
1005 PLL_TUNE_15_M_40 | PLL_TUNE_VCO_LOW)
1006#define PLLMR0_200_100_50_33 (PLL_CPUDIV_1 | PLL_PLBDIV_2 | \
1007 PLL_OPBDIV_2 | PLL_EXTBUSDIV_3 | \
1008 PLL_MALDIV_1 | PLL_PCIDIV_4)
1009#define PLLMR1_200_100_50_33 (PLL_FBKDIV_6 | \
1010 PLL_FWDDIVA_4 | PLL_FWDDIVB_4 | \
1011 PLL_TUNE_15_M_40 | PLL_TUNE_VCO_LOW)
1012#define PLLMR0_266_133_66_33 (PLL_CPUDIV_1 | PLL_PLBDIV_2 | \
1013 PLL_OPBDIV_2 | PLL_EXTBUSDIV_4 | \
1014 PLL_MALDIV_1 | PLL_PCIDIV_4)
1015#define PLLMR1_266_133_66_33 (PLL_FBKDIV_8 | \
1016 PLL_FWDDIVA_3 | PLL_FWDDIVB_3 | \
1017 PLL_TUNE_15_M_40 | PLL_TUNE_VCO_LOW)
1018#define PLLMR0_266_66_33_33 (PLL_CPUDIV_1 | PLL_PLBDIV_4 | \
1019 PLL_OPBDIV_2 | PLL_EXTBUSDIV_2 | \
1020 PLL_MALDIV_1 | PLL_PCIDIV_2)
1021#define PLLMR1_266_66_33_33 (PLL_FBKDIV_8 | \
1022 PLL_FWDDIVA_3 | PLL_FWDDIVB_3 | \
1023 PLL_TUNE_15_M_40 | PLL_TUNE_VCO_LOW)
1024
1025/*
1026 * PLL Voltage Controlled Oscillator (VCO) definitions
1027 * Maximum and minimum values (in MHz) for correct PLL operation.
1028 */
1029#define VCO_MIN 500
1030#define VCO_MAX 1000
1031#endif /* #if 0 */
stroese434979e2003-05-23 11:18:02 +00001032#else /* #ifdef CONFIG_405EP */
1033/******************************************************************************
1034 * Control
1035 ******************************************************************************/
wdenk0442ed82002-11-03 10:24:00 +00001036#define CNTRL_DCR_BASE 0x0b0
1037#define pllmd (CNTRL_DCR_BASE+0x0) /* PLL mode register */
1038#define cntrl0 (CNTRL_DCR_BASE+0x1) /* Control 0 register */
1039#define cntrl1 (CNTRL_DCR_BASE+0x2) /* Control 1 register */
1040#define reset (CNTRL_DCR_BASE+0x3) /* reset register */
Wolfgang Denk70df7bc2007-06-22 23:59:00 +02001041#define strap (CNTRL_DCR_BASE+0x4) /* strap register */
stroese434979e2003-05-23 11:18:02 +00001042
1043#define ecr (0xaa) /* edge conditioner register (405gpr) */
wdenk0442ed82002-11-03 10:24:00 +00001044
1045/* Bit definitions */
1046#define PLLMR_FWD_DIV_MASK 0xE0000000 /* Forward Divisor */
1047#define PLLMR_FWD_DIV_BYPASS 0xE0000000
1048#define PLLMR_FWD_DIV_3 0xA0000000
1049#define PLLMR_FWD_DIV_4 0x80000000
1050#define PLLMR_FWD_DIV_6 0x40000000
1051
1052#define PLLMR_FB_DIV_MASK 0x1E000000 /* Feedback Divisor */
1053#define PLLMR_FB_DIV_1 0x02000000
1054#define PLLMR_FB_DIV_2 0x04000000
1055#define PLLMR_FB_DIV_3 0x06000000
1056#define PLLMR_FB_DIV_4 0x08000000
1057
1058#define PLLMR_TUNING_MASK 0x01F80000
1059
1060#define PLLMR_CPU_TO_PLB_MASK 0x00060000 /* CPU:PLB Frequency Divisor */
1061#define PLLMR_CPU_PLB_DIV_1 0x00000000
1062#define PLLMR_CPU_PLB_DIV_2 0x00020000
1063#define PLLMR_CPU_PLB_DIV_3 0x00040000
1064#define PLLMR_CPU_PLB_DIV_4 0x00060000
1065
1066#define PLLMR_OPB_TO_PLB_MASK 0x00018000 /* OPB:PLB Frequency Divisor */
1067#define PLLMR_OPB_PLB_DIV_1 0x00000000
1068#define PLLMR_OPB_PLB_DIV_2 0x00008000
1069#define PLLMR_OPB_PLB_DIV_3 0x00010000
1070#define PLLMR_OPB_PLB_DIV_4 0x00018000
1071
1072#define PLLMR_PCI_TO_PLB_MASK 0x00006000 /* PCI:PLB Frequency Divisor */
1073#define PLLMR_PCI_PLB_DIV_1 0x00000000
1074#define PLLMR_PCI_PLB_DIV_2 0x00002000
1075#define PLLMR_PCI_PLB_DIV_3 0x00004000
1076#define PLLMR_PCI_PLB_DIV_4 0x00006000
1077
1078#define PLLMR_EXB_TO_PLB_MASK 0x00001800 /* External Bus:PLB Divisor */
1079#define PLLMR_EXB_PLB_DIV_2 0x00000000
1080#define PLLMR_EXB_PLB_DIV_3 0x00000800
1081#define PLLMR_EXB_PLB_DIV_4 0x00001000
1082#define PLLMR_EXB_PLB_DIV_5 0x00001800
1083
1084/* definitions for PPC405GPr (new mode strapping) */
1085#define PLLMR_FWDB_DIV_MASK 0x00000007 /* Forward Divisor B */
1086
1087#define PSR_PLL_FWD_MASK 0xC0000000
1088#define PSR_PLL_FDBACK_MASK 0x30000000
1089#define PSR_PLL_TUNING_MASK 0x0E000000
1090#define PSR_PLB_CPU_MASK 0x01800000
1091#define PSR_OPB_PLB_MASK 0x00600000
1092#define PSR_PCI_PLB_MASK 0x00180000
1093#define PSR_EB_PLB_MASK 0x00060000
1094#define PSR_ROM_WIDTH_MASK 0x00018000
1095#define PSR_ROM_LOC 0x00004000
1096#define PSR_PCI_ASYNC_EN 0x00001000
1097#define PSR_PERCLK_SYNC_MODE_EN 0x00000800 /* PPC405GPr only */
1098#define PSR_PCI_ARBIT_EN 0x00000400
1099#define PSR_NEW_MODE_EN 0x00000020 /* PPC405GPr only */
1100
stroese317a25f2004-12-16 18:03:44 +00001101#ifndef CONFIG_IOP480
wdenk0442ed82002-11-03 10:24:00 +00001102/*
1103 * PLL Voltage Controlled Oscillator (VCO) definitions
1104 * Maximum and minimum values (in MHz) for correct PLL operation.
1105 */
1106#define VCO_MIN 400
1107#define VCO_MAX 800
stroese317a25f2004-12-16 18:03:44 +00001108#endif /* #ifndef CONFIG_IOP480 */
stroese434979e2003-05-23 11:18:02 +00001109#endif /* #ifdef CONFIG_405EP */
wdenk0442ed82002-11-03 10:24:00 +00001110
1111/******************************************************************************
1112 * Memory Access Layer
1113 ******************************************************************************/
Stefan Roese17ffbc82007-03-21 13:38:59 +01001114#if defined(CONFIG_405EZ)
1115#define MAL_DCR_BASE 0x380
1116#define malmcr (MAL_DCR_BASE+0x00) /* MAL Config reg */
1117#define malesr (MAL_DCR_BASE+0x01) /* Err Status reg (Read/Clear)*/
1118#define malier (MAL_DCR_BASE+0x02) /* Interrupt enable reg */
1119#define maldbr (MAL_DCR_BASE+0x03) /* Mal Debug reg (Read only) */
1120#define maltxcasr (MAL_DCR_BASE+0x04) /* TX Channel active reg (set)*/
1121#define maltxcarr (MAL_DCR_BASE+0x05) /* TX Channel active reg (Reset) */
1122#define maltxeobisr (MAL_DCR_BASE+0x06) /* TX End of buffer int status reg */
1123#define maltxdeir (MAL_DCR_BASE+0x07) /* TX Descr. Error Int reg */
1124/* 0x08-0x0F Reserved */
1125#define malrxcasr (MAL_DCR_BASE+0x10) /* RX Channel active reg (set)*/
1126#define malrxcarr (MAL_DCR_BASE+0x11) /* RX Channel active reg (Reset) */
1127#define malrxeobisr (MAL_DCR_BASE+0x12) /* RX End of buffer int status reg */
1128#define malrxdeir (MAL_DCR_BASE+0x13) /* RX Descr. Error Int reg */
1129/* 0x14-0x1F Reserved */
1130#define maltxctp0r (MAL_DCR_BASE+0x20) /* TX 0 Channel table ptr reg */
1131#define maltxctp1r (MAL_DCR_BASE+0x21) /* TX 1 Channel table ptr reg */
1132#define maltxctp2r (MAL_DCR_BASE+0x22) /* TX 2 Channel table ptr reg */
1133#define maltxctp3r (MAL_DCR_BASE+0x23) /* TX 3 Channel table ptr reg */
1134#define maltxctp4r (MAL_DCR_BASE+0x24) /* TX 4 Channel table ptr reg */
1135#define maltxctp5r (MAL_DCR_BASE+0x25) /* TX 5 Channel table ptr reg */
1136#define maltxctp6r (MAL_DCR_BASE+0x26) /* TX 6 Channel table ptr reg */
1137#define maltxctp7r (MAL_DCR_BASE+0x27) /* TX 7 Channel table ptr reg */
1138#define maltxctp8r (MAL_DCR_BASE+0x28) /* TX 8 Channel table ptr reg */
1139#define maltxctp9r (MAL_DCR_BASE+0x29) /* TX 9 Channel table ptr reg */
1140#define maltxctp10r (MAL_DCR_BASE+0x2A) /* TX 10 Channel table ptr reg */
1141#define maltxctp11r (MAL_DCR_BASE+0x2B) /* TX 11 Channel table ptr reg */
1142#define maltxctp12r (MAL_DCR_BASE+0x2C) /* TX 12 Channel table ptr reg */
1143#define maltxctp13r (MAL_DCR_BASE+0x2D) /* TX 13 Channel table ptr reg */
1144#define maltxctp14r (MAL_DCR_BASE+0x2E) /* TX 14 Channel table ptr reg */
1145#define maltxctp15r (MAL_DCR_BASE+0x2F) /* TX 15 Channel table ptr reg */
1146#define maltxctp16r (MAL_DCR_BASE+0x30) /* TX 16 Channel table ptr reg */
1147#define maltxctp17r (MAL_DCR_BASE+0x31) /* TX 17 Channel table ptr reg */
1148#define maltxctp18r (MAL_DCR_BASE+0x32) /* TX 18 Channel table ptr reg */
1149#define maltxctp19r (MAL_DCR_BASE+0x33) /* TX 19 Channel table ptr reg */
1150#define maltxctp20r (MAL_DCR_BASE+0x34) /* TX 20 Channel table ptr reg */
1151#define maltxctp21r (MAL_DCR_BASE+0x35) /* TX 21 Channel table ptr reg */
1152#define maltxctp22r (MAL_DCR_BASE+0x36) /* TX 22 Channel table ptr reg */
1153#define maltxctp23r (MAL_DCR_BASE+0x37) /* TX 23 Channel table ptr reg */
1154#define maltxctp24r (MAL_DCR_BASE+0x38) /* TX 24 Channel table ptr reg */
1155#define maltxctp25r (MAL_DCR_BASE+0x39) /* TX 25 Channel table ptr reg */
1156#define maltxctp26r (MAL_DCR_BASE+0x3A) /* TX 26 Channel table ptr reg */
1157#define maltxctp27r (MAL_DCR_BASE+0x3B) /* TX 27 Channel table ptr reg */
1158#define maltxctp28r (MAL_DCR_BASE+0x3C) /* TX 28 Channel table ptr reg */
1159#define maltxctp29r (MAL_DCR_BASE+0x3D) /* TX 29 Channel table ptr reg */
1160#define maltxctp30r (MAL_DCR_BASE+0x3E) /* TX 30 Channel table ptr reg */
1161#define maltxctp31r (MAL_DCR_BASE+0x3F) /* TX 31 Channel table ptr reg */
1162#define malrxctp0r (MAL_DCR_BASE+0x40) /* RX 0 Channel table ptr reg */
1163#define malrxctp1r (MAL_DCR_BASE+0x41) /* RX 1 Channel table ptr reg */
1164#define malrxctp2r (MAL_DCR_BASE+0x42) /* RX 2 Channel table ptr reg */
1165#define malrxctp3r (MAL_DCR_BASE+0x43) /* RX 3 Channel table ptr reg */
1166#define malrxctp4r (MAL_DCR_BASE+0x44) /* RX 4 Channel table ptr reg */
1167#define malrxctp5r (MAL_DCR_BASE+0x45) /* RX 5 Channel table ptr reg */
1168#define malrxctp6r (MAL_DCR_BASE+0x46) /* RX 6 Channel table ptr reg */
1169#define malrxctp7r (MAL_DCR_BASE+0x47) /* RX 7 Channel table ptr reg */
1170#define malrxctp8r (MAL_DCR_BASE+0x48) /* RX 8 Channel table ptr reg */
1171#define malrxctp9r (MAL_DCR_BASE+0x49) /* RX 9 Channel table ptr reg */
1172#define malrxctp10r (MAL_DCR_BASE+0x4A) /* RX 10 Channel table ptr reg */
1173#define malrxctp11r (MAL_DCR_BASE+0x4B) /* RX 11 Channel table ptr reg */
1174#define malrxctp12r (MAL_DCR_BASE+0x4C) /* RX 12 Channel table ptr reg */
1175#define malrxctp13r (MAL_DCR_BASE+0x4D) /* RX 13 Channel table ptr reg */
1176#define malrxctp14r (MAL_DCR_BASE+0x4E) /* RX 14 Channel table ptr reg */
1177#define malrxctp15r (MAL_DCR_BASE+0x4F) /* RX 15 Channel table ptr reg */
1178#define malrxctp16r (MAL_DCR_BASE+0x50) /* RX 16 Channel table ptr reg */
1179#define malrxctp17r (MAL_DCR_BASE+0x51) /* RX 17 Channel table ptr reg */
1180#define malrxctp18r (MAL_DCR_BASE+0x52) /* RX 18 Channel table ptr reg */
1181#define malrxctp19r (MAL_DCR_BASE+0x53) /* RX 19 Channel table ptr reg */
1182#define malrxctp20r (MAL_DCR_BASE+0x54) /* RX 20 Channel table ptr reg */
1183#define malrxctp21r (MAL_DCR_BASE+0x55) /* RX 21 Channel table ptr reg */
1184#define malrxctp22r (MAL_DCR_BASE+0x56) /* RX 22 Channel table ptr reg */
1185#define malrxctp23r (MAL_DCR_BASE+0x57) /* RX 23 Channel table ptr reg */
1186#define malrxctp24r (MAL_DCR_BASE+0x58) /* RX 24 Channel table ptr reg */
1187#define malrxctp25r (MAL_DCR_BASE+0x59) /* RX 25 Channel table ptr reg */
1188#define malrxctp26r (MAL_DCR_BASE+0x5A) /* RX 26 Channel table ptr reg */
1189#define malrxctp27r (MAL_DCR_BASE+0x5B) /* RX 27 Channel table ptr reg */
1190#define malrxctp28r (MAL_DCR_BASE+0x5C) /* RX 28 Channel table ptr reg */
1191#define malrxctp29r (MAL_DCR_BASE+0x5D) /* RX 29 Channel table ptr reg */
1192#define malrxctp30r (MAL_DCR_BASE+0x5E) /* RX 30 Channel table ptr reg */
1193#define malrxctp31r (MAL_DCR_BASE+0x5F) /* RX 31 Channel table ptr reg */
1194#define malrcbs0 (MAL_DCR_BASE+0x60) /* RX 0 Channel buffer size reg */
1195#define malrcbs1 (MAL_DCR_BASE+0x61) /* RX 1 Channel buffer size reg */
1196#define malrcbs2 (MAL_DCR_BASE+0x62) /* RX 2 Channel buffer size reg */
1197#define malrcbs3 (MAL_DCR_BASE+0x63) /* RX 3 Channel buffer size reg */
1198#define malrcbs4 (MAL_DCR_BASE+0x64) /* RX 4 Channel buffer size reg */
1199#define malrcbs5 (MAL_DCR_BASE+0x65) /* RX 5 Channel buffer size reg */
1200#define malrcbs6 (MAL_DCR_BASE+0x66) /* RX 6 Channel buffer size reg */
1201#define malrcbs7 (MAL_DCR_BASE+0x67) /* RX 7 Channel buffer size reg */
1202#define malrcbs8 (MAL_DCR_BASE+0x68) /* RX 8 Channel buffer size reg */
1203#define malrcbs9 (MAL_DCR_BASE+0x69) /* RX 9 Channel buffer size reg */
1204#define malrcbs10 (MAL_DCR_BASE+0x6A) /* RX 10 Channel buffer size reg */
1205#define malrcbs11 (MAL_DCR_BASE+0x6B) /* RX 11 Channel buffer size reg */
1206#define malrcbs12 (MAL_DCR_BASE+0x6C) /* RX 12 Channel buffer size reg */
1207#define malrcbs13 (MAL_DCR_BASE+0x6D) /* RX 13 Channel buffer size reg */
1208#define malrcbs14 (MAL_DCR_BASE+0x6E) /* RX 14 Channel buffer size reg */
1209#define malrcbs15 (MAL_DCR_BASE+0x6F) /* RX 15 Channel buffer size reg */
1210#define malrcbs16 (MAL_DCR_BASE+0x70) /* RX 16 Channel buffer size reg */
1211#define malrcbs17 (MAL_DCR_BASE+0x71) /* RX 17 Channel buffer size reg */
1212#define malrcbs18 (MAL_DCR_BASE+0x72) /* RX 18 Channel buffer size reg */
1213#define malrcbs19 (MAL_DCR_BASE+0x73) /* RX 19 Channel buffer size reg */
1214#define malrcbs20 (MAL_DCR_BASE+0x74) /* RX 20 Channel buffer size reg */
1215#define malrcbs21 (MAL_DCR_BASE+0x75) /* RX 21 Channel buffer size reg */
1216#define malrcbs22 (MAL_DCR_BASE+0x76) /* RX 22 Channel buffer size reg */
1217#define malrcbs23 (MAL_DCR_BASE+0x77) /* RX 23 Channel buffer size reg */
1218#define malrcbs24 (MAL_DCR_BASE+0x78) /* RX 24 Channel buffer size reg */
1219#define malrcbs25 (MAL_DCR_BASE+0x79) /* RX 25 Channel buffer size reg */
1220#define malrcbs26 (MAL_DCR_BASE+0x7A) /* RX 26 Channel buffer size reg */
1221#define malrcbs27 (MAL_DCR_BASE+0x7B) /* RX 27 Channel buffer size reg */
1222#define malrcbs28 (MAL_DCR_BASE+0x7C) /* RX 28 Channel buffer size reg */
1223#define malrcbs29 (MAL_DCR_BASE+0x7D) /* RX 29 Channel buffer size reg */
1224#define malrcbs30 (MAL_DCR_BASE+0x7E) /* RX 30 Channel buffer size reg */
1225#define malrcbs31 (MAL_DCR_BASE+0x7F) /* RX 31 Channel buffer size reg */
1226
1227#else /* !defined(CONFIG_405EZ) */
1228
wdenk0442ed82002-11-03 10:24:00 +00001229#define MAL_DCR_BASE 0x180
1230#define malmcr (MAL_DCR_BASE+0x00) /* MAL Config reg */
1231#define malesr (MAL_DCR_BASE+0x01) /* Error Status reg (Read/Clear) */
1232#define malier (MAL_DCR_BASE+0x02) /* Interrupt enable reg */
1233#define maldbr (MAL_DCR_BASE+0x03) /* Mal Debug reg (Read only) */
1234#define maltxcasr (MAL_DCR_BASE+0x04) /* TX Channel active reg (set) */
1235#define maltxcarr (MAL_DCR_BASE+0x05) /* TX Channel active reg (Reset) */
1236#define maltxeobisr (MAL_DCR_BASE+0x06) /* TX End of buffer int status reg */
1237#define maltxdeir (MAL_DCR_BASE+0x07) /* TX Descr. Error Int reg */
1238#define malrxcasr (MAL_DCR_BASE+0x10) /* RX Channel active reg (set) */
1239#define malrxcarr (MAL_DCR_BASE+0x11) /* RX Channel active reg (Reset) */
1240#define malrxeobisr (MAL_DCR_BASE+0x12) /* RX End of buffer int status reg */
1241#define malrxdeir (MAL_DCR_BASE+0x13) /* RX Descr. Error Int reg */
1242#define maltxctp0r (MAL_DCR_BASE+0x20) /* TX 0 Channel table pointer reg */
1243#define maltxctp1r (MAL_DCR_BASE+0x21) /* TX 1 Channel table pointer reg */
wdenk2a6109c2004-06-06 23:53:59 +00001244#define maltxctp2r (MAL_DCR_BASE+0x22) /* TX 2 Channel table pointer reg */
wdenk0442ed82002-11-03 10:24:00 +00001245#define malrxctp0r (MAL_DCR_BASE+0x40) /* RX 0 Channel table pointer reg */
wdenk2a6109c2004-06-06 23:53:59 +00001246#define malrxctp1r (MAL_DCR_BASE+0x41) /* RX 1 Channel table pointer reg */
wdenk0442ed82002-11-03 10:24:00 +00001247#define malrcbs0 (MAL_DCR_BASE+0x60) /* RX 0 Channel buffer size reg */
wdenk2a6109c2004-06-06 23:53:59 +00001248#define malrcbs1 (MAL_DCR_BASE+0x61) /* RX 1 Channel buffer size reg */
Stefan Roese17ffbc82007-03-21 13:38:59 +01001249#endif /* defined(CONFIG_405EZ) */
wdenk0442ed82002-11-03 10:24:00 +00001250
1251/*-----------------------------------------------------------------------------
1252| IIC Register Offsets
1253'----------------------------------------------------------------------------*/
1254#define IICMDBUF 0x00
1255#define IICSDBUF 0x02
1256#define IICLMADR 0x04
1257#define IICHMADR 0x05
1258#define IICCNTL 0x06
1259#define IICMDCNTL 0x07
1260#define IICSTS 0x08
1261#define IICEXTSTS 0x09
1262#define IICLSADR 0x0A
1263#define IICHSADR 0x0B
1264#define IICCLKDIV 0x0C
1265#define IICINTRMSK 0x0D
1266#define IICXFRCNT 0x0E
1267#define IICXTCNTLSS 0x0F
1268#define IICDIRECTCNTL 0x10
1269
1270/*-----------------------------------------------------------------------------
1271| UART Register Offsets
1272'----------------------------------------------------------------------------*/
1273#define DATA_REG 0x00
Wolfgang Denk70df7bc2007-06-22 23:59:00 +02001274#define DL_LSB 0x00
1275#define DL_MSB 0x01
wdenk0442ed82002-11-03 10:24:00 +00001276#define INT_ENABLE 0x01
1277#define FIFO_CONTROL 0x02
1278#define LINE_CONTROL 0x03
1279#define MODEM_CONTROL 0x04
Wolfgang Denk70df7bc2007-06-22 23:59:00 +02001280#define LINE_STATUS 0x05
wdenk0442ed82002-11-03 10:24:00 +00001281#define MODEM_STATUS 0x06
1282#define SCRATCH 0x07
1283
1284/******************************************************************************
1285 * On Chip Memory
1286 ******************************************************************************/
Stefan Roese17ffbc82007-03-21 13:38:59 +01001287#if defined(CONFIG_405EZ)
1288#define OCM_DCR_BASE 0x020
1289#define ocmplb3cr1 (OCM_DCR_BASE+0x00) /* OCM PLB3 Bank 1 Config Reg */
1290#define ocmplb3cr2 (OCM_DCR_BASE+0x01) /* OCM PLB3 Bank 2 Config Reg */
1291#define ocmplb3bear (OCM_DCR_BASE+0x02) /* OCM PLB3 Bus Error Add Reg */
1292#define ocmplb3besr0 (OCM_DCR_BASE+0x03) /* OCM PLB3 Bus Error Stat Reg 0 */
1293#define ocmplb3besr1 (OCM_DCR_BASE+0x04) /* OCM PLB3 Bus Error Stat Reg 1 */
1294#define ocmcid (OCM_DCR_BASE+0x05) /* OCM Core ID */
1295#define ocmrevid (OCM_DCR_BASE+0x06) /* OCM Revision ID */
1296#define ocmplb3dpc (OCM_DCR_BASE+0x07) /* OCM PLB3 Data Parity Check */
1297#define ocmdscr1 (OCM_DCR_BASE+0x08) /* OCM D-side Bank 1 Config Reg */
1298#define ocmdscr2 (OCM_DCR_BASE+0x09) /* OCM D-side Bank 2 Config Reg */
1299#define ocmiscr1 (OCM_DCR_BASE+0x0A) /* OCM I-side Bank 1 Config Reg */
1300#define ocmiscr2 (OCM_DCR_BASE+0x0B) /* OCM I-side Bank 2 Config Reg */
1301#define ocmdsisdpc (OCM_DCR_BASE+0x0C) /* OCM D-side/I-side Data Par Chk*/
1302#define ocmdsisbear (OCM_DCR_BASE+0x0D) /* OCM D-side/I-side Bus Err Addr*/
1303#define ocmdsisbesr (OCM_DCR_BASE+0x0E) /* OCM D-side/I-side Bus Err Stat*/
1304#else
wdenk0442ed82002-11-03 10:24:00 +00001305#define OCM_DCR_BASE 0x018
1306#define ocmisarc (OCM_DCR_BASE+0x00) /* OCM I-side address compare reg */
1307#define ocmiscntl (OCM_DCR_BASE+0x01) /* OCM I-side control reg */
1308#define ocmdsarc (OCM_DCR_BASE+0x02) /* OCM D-side address compare reg */
1309#define ocmdscntl (OCM_DCR_BASE+0x03) /* OCM D-side control reg */
Stefan Roese17ffbc82007-03-21 13:38:59 +01001310#endif /* CONFIG_405EZ */
wdenk0442ed82002-11-03 10:24:00 +00001311
stroese434979e2003-05-23 11:18:02 +00001312/******************************************************************************
1313 * GPIO macro register defines
1314 ******************************************************************************/
Stefan Roese17ffbc82007-03-21 13:38:59 +01001315#if defined(CONFIG_405EZ)
1316/* Only the 405EZ has 2 GPIOs */
1317#define GPIO_BASE 0xEF600700
1318#define GPIO0_OR (GPIO_BASE+0x0)
1319#define GPIO0_TCR (GPIO_BASE+0x4)
1320#define GPIO0_OSRL (GPIO_BASE+0x8)
1321#define GPIO0_OSRH (GPIO_BASE+0xC)
1322#define GPIO0_TSRL (GPIO_BASE+0x10)
1323#define GPIO0_TSRH (GPIO_BASE+0x14)
1324#define GPIO0_ODR (GPIO_BASE+0x18)
1325#define GPIO0_IR (GPIO_BASE+0x1C)
1326#define GPIO0_RR1 (GPIO_BASE+0x20)
1327#define GPIO0_RR2 (GPIO_BASE+0x24)
1328#define GPIO0_RR3 (GPIO_BASE+0x28)
1329#define GPIO0_ISR1L (GPIO_BASE+0x30)
1330#define GPIO0_ISR1H (GPIO_BASE+0x34)
1331#define GPIO0_ISR2L (GPIO_BASE+0x38)
1332#define GPIO0_ISR2H (GPIO_BASE+0x3C)
1333#define GPIO0_ISR3L (GPIO_BASE+0x40)
1334#define GPIO0_ISR3H (GPIO_BASE+0x44)
1335
1336#define GPIO1_BASE 0xEF600800
1337#define GPIO1_OR (GPIO1_BASE+0x0)
1338#define GPIO1_TCR (GPIO1_BASE+0x4)
1339#define GPIO1_OSRL (GPIO1_BASE+0x8)
1340#define GPIO1_OSRH (GPIO1_BASE+0xC)
1341#define GPIO1_TSRL (GPIO1_BASE+0x10)
1342#define GPIO1_TSRH (GPIO1_BASE+0x14)
1343#define GPIO1_ODR (GPIO1_BASE+0x18)
1344#define GPIO1_IR (GPIO1_BASE+0x1C)
1345#define GPIO1_RR1 (GPIO1_BASE+0x20)
1346#define GPIO1_RR2 (GPIO1_BASE+0x24)
1347#define GPIO1_RR3 (GPIO1_BASE+0x28)
1348#define GPIO1_ISR1L (GPIO1_BASE+0x30)
1349#define GPIO1_ISR1H (GPIO1_BASE+0x34)
1350#define GPIO1_ISR2L (GPIO1_BASE+0x38)
1351#define GPIO1_ISR2H (GPIO1_BASE+0x3C)
1352#define GPIO1_ISR3L (GPIO1_BASE+0x40)
1353#define GPIO1_ISR3H (GPIO1_BASE+0x44)
1354
Stefan Roese153b3e22007-10-05 17:10:59 +02001355#elif defined(CONFIG_405EX)
1356#define GPIO_BASE 0xEF600800
1357#define GPIO0_OR (GPIO_BASE+0x0)
1358#define GPIO0_TCR (GPIO_BASE+0x4)
1359#define GPIO0_OSRL (GPIO_BASE+0x8)
1360#define GPIO0_OSRH (GPIO_BASE+0xC)
1361#define GPIO0_TSRL (GPIO_BASE+0x10)
1362#define GPIO0_TSRH (GPIO_BASE+0x14)
1363#define GPIO0_ODR (GPIO_BASE+0x18)
1364#define GPIO0_IR (GPIO_BASE+0x1C)
1365#define GPIO0_RR1 (GPIO_BASE+0x20)
1366#define GPIO0_RR2 (GPIO_BASE+0x24)
1367#define GPIO0_ISR1L (GPIO_BASE+0x30)
1368#define GPIO0_ISR1H (GPIO_BASE+0x34)
1369#define GPIO0_ISR2L (GPIO_BASE+0x38)
1370#define GPIO0_ISR2H (GPIO_BASE+0x3C)
1371#define GPIO0_ISR3L (GPIO_BASE+0x40)
1372#define GPIO0_ISR3H (GPIO_BASE+0x44)
1373
Stefan Roese17ffbc82007-03-21 13:38:59 +01001374#else /* !405EZ */
1375
stroese434979e2003-05-23 11:18:02 +00001376#define GPIO_BASE 0xEF600700
1377#define GPIO0_OR (GPIO_BASE+0x0)
1378#define GPIO0_TCR (GPIO_BASE+0x4)
1379#define GPIO0_OSRH (GPIO_BASE+0x8)
1380#define GPIO0_OSRL (GPIO_BASE+0xC)
1381#define GPIO0_TSRH (GPIO_BASE+0x10)
1382#define GPIO0_TSRL (GPIO_BASE+0x14)
1383#define GPIO0_ODR (GPIO_BASE+0x18)
1384#define GPIO0_IR (GPIO_BASE+0x1C)
1385#define GPIO0_RR1 (GPIO_BASE+0x20)
1386#define GPIO0_RR2 (GPIO_BASE+0x24)
1387#define GPIO0_ISR1H (GPIO_BASE+0x30)
1388#define GPIO0_ISR1L (GPIO_BASE+0x34)
1389#define GPIO0_ISR2H (GPIO_BASE+0x38)
1390#define GPIO0_ISR2L (GPIO_BASE+0x3C)
1391
Stefan Roese17ffbc82007-03-21 13:38:59 +01001392#endif /* CONFIG_405EZ */
wdenk0442ed82002-11-03 10:24:00 +00001393
Stefan Roese153b3e22007-10-05 17:10:59 +02001394#if defined(CONFIG_405EX)
1395#define SDR0_SRST 0x0200
1396
1397#define SDRAM_BESR0 0x00
1398#define SDRAM_BEARL 0x02
1399#define SDRAM_BEARU 0x03
1400#define SDRAM_WMIRQ 0x06 /**/
1401#define SDRAM_PLBOPT 0x08 /**/
1402#define SDRAM_PUABA 0x09 /**/
1403#define SDRAM_MCSTAT 0x1F /* memory controller status */
1404#define SDRAM_MCOPT1 0x20 /* memory controller options 1 */
1405#define SDRAM_MCOPT2 0x21 /* memory controller options 2 */
1406#define SDRAM_MODT0 0x22 /* on die termination for bank 0 */
1407#define SDRAM_MODT1 0x23 /* on die termination for bank 1 */
1408#define SDRAM_MODT2 0x24 /* on die termination for bank 2 */
1409#define SDRAM_MODT3 0x25 /* on die termination for bank 3 */
1410#define SDRAM_CODT 0x26 /* on die termination for controller */
1411#define SDRAM_VVPR 0x27 /* variable VRef programmming */
1412#define SDRAM_OPARS 0x28 /* on chip driver control setup */
1413#define SDRAM_OPART 0x29 /* on chip driver control trigger */
1414#define SDRAM_RTR 0x30 /* refresh timer */
1415#define SDRAM_PMIT 0x34 /* power management idle timer */
1416#define SDRAM_MB0CF 0x40 /* memory bank 0 configuration */
1417#define SDRAM_MB1CF 0x44 /* memory bank 1 configuration */
1418#define SDRAM_MB2CF 0x48 /* memory bank 2 configuration */
1419#define SDRAM_MB3CF 0x4C /* memory bank 3 configuration */
1420#define SDRAM_INITPLR0 0x50 /* manual initialization control */
1421#define SDRAM_INITPLR1 0x51 /* manual initialization control */
1422#define SDRAM_INITPLR2 0x52 /* manual initialization control */
1423#define SDRAM_INITPLR3 0x53 /* manual initialization control */
1424#define SDRAM_INITPLR4 0x54 /* manual initialization control */
1425#define SDRAM_INITPLR5 0x55 /* manual initialization control */
1426#define SDRAM_INITPLR6 0x56 /* manual initialization control */
1427#define SDRAM_INITPLR7 0x57 /* manual initialization control */
1428#define SDRAM_INITPLR8 0x58 /* manual initialization control */
1429#define SDRAM_INITPLR9 0x59 /* manual initialization control */
1430#define SDRAM_INITPLR10 0x5a /* manual initialization control */
1431#define SDRAM_INITPLR11 0x5b /* manual initialization control */
1432#define SDRAM_INITPLR12 0x5c /* manual initialization control */
1433#define SDRAM_INITPLR13 0x5d /* manual initialization control */
1434#define SDRAM_INITPLR14 0x5e /* manual initialization control */
1435#define SDRAM_INITPLR15 0x5f /* manual initialization control */
1436#define SDRAM_RQDC 0x70 /* read DQS delay control */
1437#define SDRAM_RFDC 0x74 /* read feedback delay control */
1438#define SDRAM_RDCC 0x78 /* read data capture control */
1439#define SDRAM_DLCR 0x7A /* delay line calibration */
1440#define SDRAM_CLKTR 0x80 /* DDR clock timing */
1441#define SDRAM_WRDTR 0x81 /* write data, DQS, DM clock, timing */
1442#define SDRAM_SDTR1 0x85 /* DDR SDRAM timing 1 */
1443#define SDRAM_SDTR2 0x86 /* DDR SDRAM timing 2 */
1444#define SDRAM_SDTR3 0x87 /* DDR SDRAM timing 3 */
1445#define SDRAM_MMODE 0x88 /* memory mode */
1446#define SDRAM_MEMODE 0x89 /* memory extended mode */
1447#define SDRAM_ECCCR 0x98 /* ECC error status */
1448#define SDRAM_RID 0xF8 /* revision ID */
1449
1450/*-----------------------------------------------------------------------------+
1451| Memory Bank 0-7 configuration
1452+-----------------------------------------------------------------------------*/
1453#define SDRAM_RXBAS_SDSZ_4 0x00000000 /* 4M */
1454#define SDRAM_RXBAS_SDSZ_8 0x00001000 /* 8M */
1455#define SDRAM_RXBAS_SDSZ_16 0x00002000 /* 16M */
1456#define SDRAM_RXBAS_SDSZ_32 0x00003000 /* 32M */
1457#define SDRAM_RXBAS_SDSZ_64 0x00004000 /* 64M */
1458#define SDRAM_RXBAS_SDSZ_128 0x00005000 /* 128M */
1459#define SDRAM_RXBAS_SDSZ_256 0x00006000 /* 256M */
1460#define SDRAM_RXBAS_SDSZ_512 0x00007000 /* 512M */
1461#define SDRAM_RXBAS_SDSZ_1024 0x00008000 /* 1024M */
1462#define SDRAM_RXBAS_SDSZ_2048 0x00009000 /* 2048M */
1463#define SDRAM_RXBAS_SDSZ_4096 0x0000a000 /* 4096M */
1464#define SDRAM_RXBAS_SDSZ_8192 0x0000b000 /* 8192M */
1465
1466/*-----------------------------------------------------------------------------+
1467| Memory Controller Status
1468+-----------------------------------------------------------------------------*/
1469#define SDRAM_MCSTAT_MIC_MASK 0x80000000 /* Memory init status mask */
1470#define SDRAM_MCSTAT_MIC_NOTCOMP 0x00000000 /* Mem init not complete */
1471#define SDRAM_MCSTAT_MIC_COMP 0x80000000 /* Mem init complete */
1472#define SDRAM_MCSTAT_SRMS_MASK 0x80000000 /* Mem self refresh stat mask */
1473#define SDRAM_MCSTAT_SRMS_NOT_SF 0x00000000 /* Mem not in self refresh */
1474#define SDRAM_MCSTAT_SRMS_SF 0x80000000 /* Mem in self refresh */
1475
1476/*-----------------------------------------------------------------------------+
1477| Memory Controller Options 1
1478+-----------------------------------------------------------------------------*/
1479#define SDRAM_MCOPT1_MCHK_MASK 0x30000000 /* Memory data err check mask */
1480#define SDRAM_MCOPT1_MCHK_NON 0x00000000 /* No ECC generation */
1481#define SDRAM_MCOPT1_MCHK_GEN 0x20000000 /* ECC generation */
1482#define SDRAM_MCOPT1_MCHK_CHK 0x10000000 /* ECC generation and check */
1483#define SDRAM_MCOPT1_MCHK_CHK_REP 0x30000000 /* ECC generation, chk, report*/
1484#define SDRAM_MCOPT1_MCHK_CHK_DECODE(n) ((((unsigned long)(n))>>28)&0x3)
1485#define SDRAM_MCOPT1_RDEN_MASK 0x08000000 /* Registered DIMM mask */
1486#define SDRAM_MCOPT1_RDEN 0x08000000 /* Registered DIMM enable */
1487#define SDRAM_MCOPT1_PMU_MASK 0x06000000 /* Page management unit mask */
1488#define SDRAM_MCOPT1_PMU_CLOSE 0x00000000 /* PMU Close */
1489#define SDRAM_MCOPT1_PMU_OPEN 0x04000000 /* PMU Open */
1490#define SDRAM_MCOPT1_PMU_AUTOCLOSE 0x02000000 /* PMU AutoClose */
1491#define SDRAM_MCOPT1_DMWD_MASK 0x01000000 /* DRAM width mask */
1492#define SDRAM_MCOPT1_DMWD_32 0x00000000 /* 32 bits */
1493#define SDRAM_MCOPT1_DMWD_64 0x01000000 /* 64 bits */
1494#define SDRAM_MCOPT1_UIOS_MASK 0x00C00000 /* Unused IO State */
1495#define SDRAM_MCOPT1_BCNT_MASK 0x00200000 /* Bank count */
1496#define SDRAM_MCOPT1_4_BANKS 0x00000000 /* 4 Banks */
1497#define SDRAM_MCOPT1_8_BANKS 0x00200000 /* 8 Banks */
1498#define SDRAM_MCOPT1_DDR_TYPE_MASK 0x00100000 /* DDR Memory Type mask */
1499#define SDRAM_MCOPT1_DDR1_TYPE 0x00000000 /* DDR1 Memory Type */
1500#define SDRAM_MCOPT1_DDR2_TYPE 0x00100000 /* DDR2 Memory Type */
1501#define SDRAM_MCOPT1_QDEP 0x00020000 /* 4 commands deep */
1502#define SDRAM_MCOPT1_RWOO_MASK 0x00008000 /* Out of Order Read mask */
1503#define SDRAM_MCOPT1_RWOO_DISABLED 0x00000000 /* disabled */
1504#define SDRAM_MCOPT1_RWOO_ENABLED 0x00008000 /* enabled */
1505#define SDRAM_MCOPT1_WOOO_MASK 0x00004000 /* Out of Order Write mask */
1506#define SDRAM_MCOPT1_WOOO_DISABLED 0x00000000 /* disabled */
1507#define SDRAM_MCOPT1_WOOO_ENABLED 0x00004000 /* enabled */
1508#define SDRAM_MCOPT1_DCOO_MASK 0x00002000 /* All Out of Order mask */
1509#define SDRAM_MCOPT1_DCOO_DISABLED 0x00002000 /* disabled */
1510#define SDRAM_MCOPT1_DCOO_ENABLED 0x00000000 /* enabled */
1511#define SDRAM_MCOPT1_DREF_MASK 0x00001000 /* Deferred refresh mask */
1512#define SDRAM_MCOPT1_DREF_NORMAL 0x00000000 /* normal refresh */
1513#define SDRAM_MCOPT1_DREF_DEFER_4 0x00001000 /* defer up to 4 refresh cmd */
1514
1515/*-----------------------------------------------------------------------------+
1516| Memory Controller Options 2
1517+-----------------------------------------------------------------------------*/
1518#define SDRAM_MCOPT2_SREN_MASK 0x80000000 /* Self Test mask */
1519#define SDRAM_MCOPT2_SREN_EXIT 0x00000000 /* Self Test exit */
1520#define SDRAM_MCOPT2_SREN_ENTER 0x80000000 /* Self Test enter */
1521#define SDRAM_MCOPT2_PMEN_MASK 0x40000000 /* Power Management mask */
1522#define SDRAM_MCOPT2_PMEN_DISABLE 0x00000000 /* disable */
1523#define SDRAM_MCOPT2_PMEN_ENABLE 0x40000000 /* enable */
1524#define SDRAM_MCOPT2_IPTR_MASK 0x20000000 /* Init Trigger Reg mask */
1525#define SDRAM_MCOPT2_IPTR_IDLE 0x00000000 /* idle */
1526#define SDRAM_MCOPT2_IPTR_EXECUTE 0x20000000 /* execute preloaded init */
1527#define SDRAM_MCOPT2_XSRP_MASK 0x10000000 /* Exit Self Refresh Prevent */
1528#define SDRAM_MCOPT2_XSRP_ALLOW 0x00000000 /* allow self refresh exit */
1529#define SDRAM_MCOPT2_XSRP_PREVENT 0x10000000 /* prevent self refresh exit */
1530#define SDRAM_MCOPT2_DCEN_MASK 0x08000000 /* SDRAM Controller Enable */
1531#define SDRAM_MCOPT2_DCEN_DISABLE 0x00000000 /* SDRAM Controller Enable */
1532#define SDRAM_MCOPT2_DCEN_ENABLE 0x08000000 /* SDRAM Controller Enable */
1533#define SDRAM_MCOPT2_ISIE_MASK 0x04000000 /* Init Seq Interruptable mas*/
1534#define SDRAM_MCOPT2_ISIE_DISABLE 0x00000000 /* disable */
1535#define SDRAM_MCOPT2_ISIE_ENABLE 0x04000000 /* enable */
1536
1537/*-----------------------------------------------------------------------------+
1538| SDRAM Refresh Timer Register
1539+-----------------------------------------------------------------------------*/
1540#define SDRAM_RTR_RINT_MASK 0xFFF80000
1541#define SDRAM_RTR_RINT_ENCODE(n) ((((unsigned long)(n))&0xFFF8)<<16)
1542#define SDRAM_RTR_RINT_DECODE(n) ((((unsigned long)(n))>>16)&0xFFF8)
1543
1544/*-----------------------------------------------------------------------------+
1545| SDRAM Read DQS Delay Control Register
1546+-----------------------------------------------------------------------------*/
1547#define SDRAM_RQDC_RQDE_MASK 0x80000000
1548#define SDRAM_RQDC_RQDE_DISABLE 0x00000000
1549#define SDRAM_RQDC_RQDE_ENABLE 0x80000000
1550#define SDRAM_RQDC_RQFD_MASK 0x000001FF
1551#define SDRAM_RQDC_RQFD_ENCODE(n) ((((unsigned long)(n))&0x1FF)<<0)
1552
1553#define SDRAM_RQDC_RQFD_MAX 0xFF
1554
1555/*-----------------------------------------------------------------------------+
1556| SDRAM Read Data Capture Control Register
1557+-----------------------------------------------------------------------------*/
1558#define SDRAM_RDCC_RDSS_MASK 0xC0000000
1559#define SDRAM_RDCC_RDSS_T1 0x00000000
1560#define SDRAM_RDCC_RDSS_T2 0x40000000
1561#define SDRAM_RDCC_RDSS_T3 0x80000000
1562#define SDRAM_RDCC_RDSS_T4 0xC0000000
1563#define SDRAM_RDCC_RSAE_MASK 0x00000001
1564#define SDRAM_RDCC_RSAE_DISABLE 0x00000001
1565#define SDRAM_RDCC_RSAE_ENABLE 0x00000000
1566
1567/*-----------------------------------------------------------------------------+
1568| SDRAM Read Feedback Delay Control Register
1569+-----------------------------------------------------------------------------*/
1570#define SDRAM_RFDC_ARSE_MASK 0x80000000
1571#define SDRAM_RFDC_ARSE_DISABLE 0x80000000
1572#define SDRAM_RFDC_ARSE_ENABLE 0x00000000
1573#define SDRAM_RFDC_RFOS_MASK 0x007F0000
1574#define SDRAM_RFDC_RFOS_ENCODE(n) ((((unsigned long)(n))&0x7F)<<16)
1575#define SDRAM_RFDC_RFFD_MASK 0x000003FF
1576#define SDRAM_RFDC_RFFD_ENCODE(n) ((((unsigned long)(n))&0x3FF)<<0)
1577
1578#define SDRAM_RFDC_RFFD_MAX 0x4FF
1579
1580/*-----------------------------------------------------------------------------+
1581| SDRAM Delay Line Calibration Register
1582+-----------------------------------------------------------------------------*/
1583#define SDRAM_DLCR_DCLM_MASK 0x80000000
1584#define SDRAM_DLCR_DCLM_MANUEL 0x80000000
1585#define SDRAM_DLCR_DCLM_AUTO 0x00000000
1586#define SDRAM_DLCR_DLCR_MASK 0x08000000
1587#define SDRAM_DLCR_DLCR_CALIBRATE 0x08000000
1588#define SDRAM_DLCR_DLCR_IDLE 0x00000000
1589#define SDRAM_DLCR_DLCS_MASK 0x07000000
1590#define SDRAM_DLCR_DLCS_NOT_RUN 0x00000000
1591#define SDRAM_DLCR_DLCS_IN_PROGRESS 0x01000000
1592#define SDRAM_DLCR_DLCS_COMPLETE 0x02000000
1593#define SDRAM_DLCR_DLCS_CONT_DONE 0x03000000
1594#define SDRAM_DLCR_DLCS_ERROR 0x04000000
1595#define SDRAM_DLCR_DLCV_MASK 0x000001FF
1596#define SDRAM_DLCR_DLCV_ENCODE(n) ((((unsigned long)(n))&0x1FF)<<0)
1597#define SDRAM_DLCR_DLCV_DECODE(n) ((((unsigned long)(n))>>0)&0x1FF)
1598
1599/*-----------------------------------------------------------------------------+
1600| SDRAM Controller On Die Termination Register
1601+-----------------------------------------------------------------------------*/
1602#define SDRAM_CODT_ODT_ON 0x80000000
1603#define SDRAM_CODT_ODT_OFF 0x00000000
1604#define SDRAM_CODT_DQS_VOLTAGE_DDR_MASK 0x00000020
1605#define SDRAM_CODT_DQS_2_5_V_DDR1 0x00000000
1606#define SDRAM_CODT_DQS_1_8_V_DDR2 0x00000020
1607#define SDRAM_CODT_DQS_MASK 0x00000010
1608#define SDRAM_CODT_DQS_DIFFERENTIAL 0x00000000
1609#define SDRAM_CODT_DQS_SINGLE_END 0x00000010
1610#define SDRAM_CODT_CKSE_DIFFERENTIAL 0x00000000
1611#define SDRAM_CODT_CKSE_SINGLE_END 0x00000008
1612#define SDRAM_CODT_FEEBBACK_RCV_SINGLE_END 0x00000004
1613#define SDRAM_CODT_FEEBBACK_DRV_SINGLE_END 0x00000002
1614#define SDRAM_CODT_IO_HIZ 0x00000000
1615#define SDRAM_CODT_IO_NMODE 0x00000001
wdenk0442ed82002-11-03 10:24:00 +00001616
Stefan Roese153b3e22007-10-05 17:10:59 +02001617/*-----------------------------------------------------------------------------+
1618| SDRAM Mode Register
1619+-----------------------------------------------------------------------------*/
1620#define SDRAM_MMODE_WR_MASK 0x00000E00
1621#define SDRAM_MMODE_WR_DDR1 0x00000000
1622#define SDRAM_MMODE_WR_DDR2_3_CYC 0x00000400
1623#define SDRAM_MMODE_WR_DDR2_4_CYC 0x00000600
1624#define SDRAM_MMODE_WR_DDR2_5_CYC 0x00000800
1625#define SDRAM_MMODE_WR_DDR2_6_CYC 0x00000A00
1626#define SDRAM_MMODE_DCL_MASK 0x00000070
1627#define SDRAM_MMODE_DCL_DDR1_2_0_CLK 0x00000020
1628#define SDRAM_MMODE_DCL_DDR1_2_5_CLK 0x00000060
1629#define SDRAM_MMODE_DCL_DDR1_3_0_CLK 0x00000030
1630#define SDRAM_MMODE_DCL_DDR2_2_0_CLK 0x00000020
1631#define SDRAM_MMODE_DCL_DDR2_3_0_CLK 0x00000030
1632#define SDRAM_MMODE_DCL_DDR2_4_0_CLK 0x00000040
1633#define SDRAM_MMODE_DCL_DDR2_5_0_CLK 0x00000050
1634#define SDRAM_MMODE_DCL_DDR2_6_0_CLK 0x00000060
1635#define SDRAM_MMODE_DCL_DDR2_7_0_CLK 0x00000070
1636
1637/*-----------------------------------------------------------------------------+
1638| SDRAM Extended Mode Register
1639+-----------------------------------------------------------------------------*/
1640#define SDRAM_MEMODE_DIC_MASK 0x00000002
1641#define SDRAM_MEMODE_DIC_NORMAL 0x00000000
1642#define SDRAM_MEMODE_DIC_WEAK 0x00000002
1643#define SDRAM_MEMODE_DLL_MASK 0x00000001
1644#define SDRAM_MEMODE_DLL_DISABLE 0x00000001
1645#define SDRAM_MEMODE_DLL_ENABLE 0x00000000
1646#define SDRAM_MEMODE_RTT_MASK 0x00000044
1647#define SDRAM_MEMODE_RTT_DISABLED 0x00000000
1648#define SDRAM_MEMODE_RTT_75OHM 0x00000004
1649#define SDRAM_MEMODE_RTT_150OHM 0x00000040
1650#define SDRAM_MEMODE_DQS_MASK 0x00000400
1651#define SDRAM_MEMODE_DQS_DISABLE 0x00000400
1652#define SDRAM_MEMODE_DQS_ENABLE 0x00000000
1653
1654/*-----------------------------------------------------------------------------+
1655| SDRAM Clock Timing Register
1656+-----------------------------------------------------------------------------*/
1657#define SDRAM_CLKTR_CLKP_MASK 0xC0000000
1658#define SDRAM_CLKTR_CLKP_0_DEG 0x00000000
1659#define SDRAM_CLKTR_CLKP_180_DEG_ADV 0x80000000
1660
1661/*-----------------------------------------------------------------------------+
1662| SDRAM Write Timing Register
1663+-----------------------------------------------------------------------------*/
1664#define SDRAM_WRDTR_WDTP_1_CYC 0x80000000
1665#define SDRAM_WRDTR_LLWP_MASK 0x10000000
1666#define SDRAM_WRDTR_LLWP_DIS 0x10000000
1667#define SDRAM_WRDTR_LLWP_1_CYC 0x00000000
1668#define SDRAM_WRDTR_WTR_MASK 0x0E000000
1669#define SDRAM_WRDTR_WTR_0_DEG 0x06000000
1670#define SDRAM_WRDTR_WTR_180_DEG_ADV 0x02000000
1671#define SDRAM_WRDTR_WTR_270_DEG_ADV 0x00000000
1672
1673/*-----------------------------------------------------------------------------+
1674| SDRAM SDTR1 Options
1675+-----------------------------------------------------------------------------*/
1676#define SDRAM_SDTR1_LDOF_MASK 0x80000000
1677#define SDRAM_SDTR1_LDOF_1_CLK 0x00000000
1678#define SDRAM_SDTR1_LDOF_2_CLK 0x80000000
1679#define SDRAM_SDTR1_RTW_MASK 0x00F00000
1680#define SDRAM_SDTR1_RTW_2_CLK 0x00200000
1681#define SDRAM_SDTR1_RTW_3_CLK 0x00300000
1682#define SDRAM_SDTR1_WTWO_MASK 0x000F0000
1683#define SDRAM_SDTR1_WTWO_0_CLK 0x00000000
1684#define SDRAM_SDTR1_WTWO_1_CLK 0x00010000
1685#define SDRAM_SDTR1_RTRO_MASK 0x0000F000
1686#define SDRAM_SDTR1_RTRO_1_CLK 0x00000000
1687#define SDRAM_SDTR1_RTRO_2_CLK 0x00002000
1688
1689/*-----------------------------------------------------------------------------+
1690| SDRAM SDTR2 Options
1691+-----------------------------------------------------------------------------*/
1692#define SDRAM_SDTR2_RCD_MASK 0xF0000000
1693#define SDRAM_SDTR2_RCD_1_CLK 0x10000000
1694#define SDRAM_SDTR2_RCD_2_CLK 0x20000000
1695#define SDRAM_SDTR2_RCD_3_CLK 0x30000000
1696#define SDRAM_SDTR2_RCD_4_CLK 0x40000000
1697#define SDRAM_SDTR2_RCD_5_CLK 0x50000000
1698#define SDRAM_SDTR2_WTR_MASK 0x0F000000
1699#define SDRAM_SDTR2_WTR_1_CLK 0x01000000
1700#define SDRAM_SDTR2_WTR_2_CLK 0x02000000
1701#define SDRAM_SDTR2_WTR_3_CLK 0x03000000
1702#define SDRAM_SDTR2_WTR_4_CLK 0x04000000
1703#define SDRAM_SDTR3_WTR_ENCODE(n) ((((unsigned long)(n))&0xF)<<24)
1704#define SDRAM_SDTR2_XSNR_MASK 0x00FF0000
1705#define SDRAM_SDTR2_XSNR_8_CLK 0x00080000
1706#define SDRAM_SDTR2_XSNR_16_CLK 0x00100000
1707#define SDRAM_SDTR2_XSNR_32_CLK 0x00200000
1708#define SDRAM_SDTR2_XSNR_64_CLK 0x00400000
1709#define SDRAM_SDTR2_WPC_MASK 0x0000F000
1710#define SDRAM_SDTR2_WPC_2_CLK 0x00002000
1711#define SDRAM_SDTR2_WPC_3_CLK 0x00003000
1712#define SDRAM_SDTR2_WPC_4_CLK 0x00004000
1713#define SDRAM_SDTR2_WPC_5_CLK 0x00005000
1714#define SDRAM_SDTR2_WPC_6_CLK 0x00006000
1715#define SDRAM_SDTR3_WPC_ENCODE(n) ((((unsigned long)(n))&0xF)<<12)
1716#define SDRAM_SDTR2_RPC_MASK 0x00000F00
1717#define SDRAM_SDTR2_RPC_2_CLK 0x00000200
1718#define SDRAM_SDTR2_RPC_3_CLK 0x00000300
1719#define SDRAM_SDTR2_RPC_4_CLK 0x00000400
1720#define SDRAM_SDTR2_RP_MASK 0x000000F0
1721#define SDRAM_SDTR2_RP_3_CLK 0x00000030
1722#define SDRAM_SDTR2_RP_4_CLK 0x00000040
1723#define SDRAM_SDTR2_RP_5_CLK 0x00000050
1724#define SDRAM_SDTR2_RP_6_CLK 0x00000060
1725#define SDRAM_SDTR2_RP_7_CLK 0x00000070
1726#define SDRAM_SDTR2_RRD_MASK 0x0000000F
1727#define SDRAM_SDTR2_RRD_2_CLK 0x00000002
1728#define SDRAM_SDTR2_RRD_3_CLK 0x00000003
1729
1730/*-----------------------------------------------------------------------------+
1731| SDRAM SDTR3 Options
1732+-----------------------------------------------------------------------------*/
1733#define SDRAM_SDTR3_RAS_MASK 0x1F000000
1734#define SDRAM_SDTR3_RAS_ENCODE(n) ((((unsigned long)(n))&0x1F)<<24)
1735#define SDRAM_SDTR3_RC_MASK 0x001F0000
1736#define SDRAM_SDTR3_RC_ENCODE(n) ((((unsigned long)(n))&0x1F)<<16)
1737#define SDRAM_SDTR3_XCS_MASK 0x00001F00
1738#define SDRAM_SDTR3_XCS 0x00000D00
1739#define SDRAM_SDTR3_RFC_MASK 0x0000003F
1740#define SDRAM_SDTR3_RFC_ENCODE(n) ((((unsigned long)(n))&0x3F)<<0)
1741
1742/*-----------------------------------------------------------------------------+
1743| Memory Bank 0-1 configuration
1744+-----------------------------------------------------------------------------*/
1745#define SDRAM_BXCF_M_AM_MASK 0x00000F00 /* Addressing mode */
1746#define SDRAM_BXCF_M_AM_0 0x00000000 /* Mode 0 */
1747#define SDRAM_BXCF_M_AM_1 0x00000100 /* Mode 1 */
1748#define SDRAM_BXCF_M_AM_2 0x00000200 /* Mode 2 */
1749#define SDRAM_BXCF_M_AM_3 0x00000300 /* Mode 3 */
1750#define SDRAM_BXCF_M_AM_4 0x00000400 /* Mode 4 */
1751#define SDRAM_BXCF_M_AM_5 0x00000500 /* Mode 5 */
1752#define SDRAM_BXCF_M_AM_6 0x00000600 /* Mode 6 */
1753#define SDRAM_BXCF_M_AM_7 0x00000700 /* Mode 7 */
1754#define SDRAM_BXCF_M_AM_8 0x00000800 /* Mode 8 */
1755#define SDRAM_BXCF_M_AM_9 0x00000900 /* Mode 9 */
1756#define SDRAM_BXCF_M_BE_MASK 0x00000001 /* Memory Bank Enable */
1757#define SDRAM_BXCF_M_BE_DISABLE 0x00000000 /* Memory Bank Enable */
1758#define SDRAM_BXCF_M_BE_ENABLE 0x00000001 /* Memory Bank Enable */
1759
1760#define sdr_uart0 0x0120 /* UART0 Config */
1761#define sdr_uart1 0x0121 /* UART1 Config */
1762#define sdr_mfr 0x4300 /* SDR0_MFR reg */
1763
1764/* Defines for CPC0_EPRCSR register */
1765#define CPC0_EPRCSR_E0NFE 0x80000000
1766#define CPC0_EPRCSR_E1NFE 0x40000000
1767#define CPC0_EPRCSR_E1RPP 0x00000080
1768#define CPC0_EPRCSR_E0RPP 0x00000040
1769#define CPC0_EPRCSR_E1ERP 0x00000020
1770#define CPC0_EPRCSR_E0ERP 0x00000010
1771#define CPC0_EPRCSR_E1PCI 0x00000002
1772#define CPC0_EPRCSR_E0PCI 0x00000001
1773
1774#define cpr0_clkupd 0x020
1775#define cpr0_pllc 0x040
1776#define cpr0_plld 0x060
1777#define cpr0_cpud 0x080
1778#define cpr0_plbd 0x0a0
1779#define cpr0_opbd 0x0c0
1780#define cpr0_perd 0x0e0
1781#define cpr0_ahbd 0x100
1782#define cpr0_icfg 0x140
1783
1784#define SDR_PINSTP 0x0040
1785#define sdr_sdcs 0x0060
1786
1787#define SDR0_SDCS_SDD (0x80000000 >> 31)
1788
1789/* CUST0 Customer Configuration Register0 */
1790#define SDR0_CUST0 0x4000
1791#define SDR0_CUST0_MUX_E_N_G_MASK 0xC0000000 /* Mux_Emac_NDFC_GPIO */
1792#define SDR0_CUST0_MUX_EMAC_SEL 0x40000000 /* Emac Selection */
1793#define SDR0_CUST0_MUX_NDFC_SEL 0x80000000 /* NDFC Selection */
1794#define SDR0_CUST0_MUX_GPIO_SEL 0xC0000000 /* GPIO Selection */
1795
1796#define SDR0_CUST0_NDFC_EN_MASK 0x20000000 /* NDFC Enable Mask */
1797#define SDR0_CUST0_NDFC_ENABLE 0x20000000 /* NDFC Enable */
1798#define SDR0_CUST0_NDFC_DISABLE 0x00000000 /* NDFC Disable */
1799
1800#define SDR0_CUST0_NDFC_BW_MASK 0x10000000 /* NDFC Boot Width */
1801#define SDR0_CUST0_NDFC_BW_16_BIT 0x10000000 /* NDFC Boot Width = 16 Bit */
1802#define SDR0_CUST0_NDFC_BW_8_BIT 0x00000000 /* NDFC Boot Width = 8 Bit */
1803
1804#define SDR0_CUST0_NDFC_BP_MASK 0x0F000000 /* NDFC Boot Page */
1805#define SDR0_CUST0_NDFC_BP_ENCODE(n) ((((unsigned long)(n))&0xF)<<24)
1806#define SDR0_CUST0_NDFC_BP_DECODE(n) ((((unsigned long)(n))>>24)&0x0F)
1807
1808#define SDR0_CUST0_NDFC_BAC_MASK 0x00C00000 /* NDFC Boot Address Cycle */
1809#define SDR0_CUST0_NDFC_BAC_ENCODE(n) ((((unsigned long)(n))&0x3)<<22)
1810#define SDR0_CUST0_NDFC_BAC_DECODE(n) ((((unsigned long)(n))>>22)&0x03)
1811
1812#define SDR0_CUST0_NDFC_ARE_MASK 0x00200000 /* NDFC Auto Read Enable */
1813#define SDR0_CUST0_NDFC_ARE_ENABLE 0x00200000 /* NDFC Auto Read Enable */
1814#define SDR0_CUST0_NDFC_ARE_DISABLE 0x00000000 /* NDFC Auto Read Disable */
1815
1816#define SDR0_CUST0_NRB_MASK 0x00100000 /* NDFC Ready / Busy */
1817#define SDR0_CUST0_NRB_BUSY 0x00100000 /* Busy */
1818#define SDR0_CUST0_NRB_READY 0x00000000 /* Ready */
1819
1820#define SDR0_CUST0_NDRSC_MASK 0x0000FFF0 /* NDFC Device Reset Count Mask */
1821#define SDR0_CUST0_NDRSC_ENCODE(n) ((((unsigned long)(n))&0xFFF)<<4)
1822#define SDR0_CUST0_NDRSC_DECODE(n) ((((unsigned long)(n))>>4)&0xFFF)
1823
1824#define SDR0_CUST0_CHIPSELGAT_MASK 0x0000000F /* Chip Select Gating Mask */
1825#define SDR0_CUST0_CHIPSELGAT_DIS 0x00000000 /* Chip Select Gating Disable */
1826#define SDR0_CUST0_CHIPSELGAT_ENALL 0x0000000F /* All Chip Select Gating Enable */
1827#define SDR0_CUST0_CHIPSELGAT_EN0 0x00000008 /* Chip Select0 Gating Enable */
1828#define SDR0_CUST0_CHIPSELGAT_EN1 0x00000004 /* Chip Select1 Gating Enable */
1829#define SDR0_CUST0_CHIPSELGAT_EN2 0x00000002 /* Chip Select2 Gating Enable */
1830#define SDR0_CUST0_CHIPSELGAT_EN3 0x00000001 /* Chip Select3 Gating Enable */
1831#endif
1832
1833/******************************************************************************
1834 * SDR Registers
1835 ******************************************************************************/
1836#define SDR_DCR_BASE 0x0E
1837#define sdrcfga (SDR_DCR_BASE+0x0)
1838#define sdrcfgd (SDR_DCR_BASE+0x1)
1839
1840#define CPR0_DCR_BASE 0x0C
1841#define cprcfga (CPR0_DCR_BASE+0x0)
1842#define cprcfgd (CPR0_DCR_BASE+0x1)
1843
1844#define mtcpr(reg, d) do { mtdcr(cprcfga,reg);mtdcr(cprcfgd,d); } while (0)
1845#define mfcpr(reg, d) do { mtdcr(cprcfga,reg);d = mfdcr(cprcfgd); } while (0)
1846
1847#define mtsdr(reg, d) do { mtdcr(sdrcfga,reg);mtdcr(sdrcfgd,d); } while (0)
1848#define mfsdr(reg, d) do { mtdcr(sdrcfga,reg);d = mfdcr(sdrcfgd); } while (0)
1849
1850#define mtebc(reg, d) do { mtdcr(ebccfga,reg);mtdcr(ebccfgd,d); } while (0)
1851#define mfebc(reg, d) do { mtdcr(ebccfga,reg);d = mfdcr(ebccfgd); } while (0)
1852
1853#define mtsdram(reg, d) do { mtdcr(memcfga,reg);mtdcr(memcfgd,d); } while (0)
1854#define mfsdram(reg, d) do { mtdcr(memcfga,reg);d = mfdcr(memcfgd); } while (0)
wdenk0442ed82002-11-03 10:24:00 +00001855
1856#ifndef __ASSEMBLY__
1857
1858typedef struct
1859{
Stefan Roese153b3e22007-10-05 17:10:59 +02001860 unsigned long pllFwdDiv;
1861 unsigned long pllFwdDivB;
1862 unsigned long pllFbkDiv;
1863 unsigned long pllPlbDiv;
1864 unsigned long pllPciDiv;
1865 unsigned long pllExtBusDiv;
1866 unsigned long pllOpbDiv;
1867 unsigned long freqVCOMhz; /* in MHz */
1868 unsigned long freqProcessor;
1869 unsigned long freqPLB;
1870 unsigned long freqPCI;
1871 unsigned long pciIntArbEn; /* Internal PCI arbiter is enabled */
1872 unsigned long pciClkSync; /* PCI clock is synchronous */
1873 unsigned long freqVCOHz;
1874 unsigned long freqOPB;
1875 unsigned long freqEBC;
1876 unsigned long freqDDR;
wdenk0442ed82002-11-03 10:24:00 +00001877} PPC405_SYS_INFO;
1878
1879#endif /* _ASMLANGUAGE */
1880
1881#define RESET_VECTOR 0xfffffffc
1882#define CACHELINE_MASK (CFG_CACHELINE_SIZE - 1) /* Address mask for cache
1883 line aligned data. */
1884
1885#endif /* __PPC405_H__ */