blob: 40624e8291f80d3bc3c99f0f5d2f2112f914e91d [file] [log] [blame]
Eran Libertyf046ccd2005-07-28 10:08:46 -05001/*
Dave Liuf6eda7f2006-10-25 14:41:21 -05002 * (C) Copyright 2004-2006 Freescale Semiconductor, Inc.
Jon Loeligerde1d0a62005-08-01 13:20:47 -05003 *
Dave Liuf6eda7f2006-10-25 14:41:21 -05004 * MPC83xx Internal Memory Map
5 *
6 * History :
7 * 20060601: Daveliu (daveliu@freescale.com)
8 * TanyaJiang (tanya.jiang@freescale.com)
9 * Unified variable names for mpc83xx
10 * 2005 : Mandy Lavi (mandy.lavi@freescale.com)
11 * support for mpc8360e
12 * 2004 : Eran Liberty (liberty@freescale.com)
13 * Initialized for mpc8349
14 * based on:
15 * MPC8260 Internal Memory Map
16 * Copyright (c) 1999 Dan Malek (dmalek@jlc.net)
17 * MPC85xx Internal Memory Map
18 * Copyright(c) 2002,2003 Motorola Inc.
19 * Xianghua Xiao (x.xiao@motorola.com)
20 *
21 * This program is free software; you can redistribute it and/or
22 * modify it under the terms of the GNU General Public License as
23 * published by the Free Software Foundation; either version 2 of
24 * the License, or (at your option) any later version.
25 *
26 * This program is distributed in the hope that it will be useful,
27 * but WITHOUT ANY WARRANTY; without even the implied warranty of
28 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
29 * GNU General Public License for more details.
30 *
31 * You should have received a copy of the GNU General Public License
32 * along with this program; if not, write to the Free Software
33 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
34 * MA 02111-1307 USA
35 *
Eran Libertyf046ccd2005-07-28 10:08:46 -050036 */
Dave Liuf6eda7f2006-10-25 14:41:21 -050037#ifndef __IMMAP_83xx__
38#define __IMMAP_83xx__
Eran Libertyf046ccd2005-07-28 10:08:46 -050039
Dave Liuf6eda7f2006-10-25 14:41:21 -050040#include <config.h>
Eran Libertyf046ccd2005-07-28 10:08:46 -050041#include <asm/types.h>
42#include <asm/i2c.h>
43
Jon Loeligerde1d0a62005-08-01 13:20:47 -050044/*
Eran Libertyf046ccd2005-07-28 10:08:46 -050045 * Local Access Window.
46 */
Dave Liuf6eda7f2006-10-25 14:41:21 -050047typedef struct law83xx {
Eran Libertyf046ccd2005-07-28 10:08:46 -050048 u32 bar; /* LBIU local access window base address register */
Jon Loeligerde1d0a62005-08-01 13:20:47 -050049/* Identifies the 20 most-significant address bits of the base of local
50 * access window n. The specified base address should be aligned to the
51 * window size, as defined by LBLAWARn[SIZE].
52 */
53#define LAWBAR_BAR 0xFFFFF000
Eran Libertyf046ccd2005-07-28 10:08:46 -050054#define LAWBAR_RES ~(LAWBAR_BAR)
55 u32 ar; /* LBIU local access window attribute register */
Dave Liuf6eda7f2006-10-25 14:41:21 -050056} law83xx_t;
Eran Libertyf046ccd2005-07-28 10:08:46 -050057
Jon Loeligerde1d0a62005-08-01 13:20:47 -050058/*
Eran Libertyf046ccd2005-07-28 10:08:46 -050059 * System configuration registers.
60 */
Dave Liuf6eda7f2006-10-25 14:41:21 -050061typedef struct sysconf83xx {
Eran Libertyf046ccd2005-07-28 10:08:46 -050062 u32 immrbar; /* Internal memory map base address register */
63 u8 res0[0x04];
64 u32 altcbar; /* Alternate configuration base address register */
Jon Loeligerde1d0a62005-08-01 13:20:47 -050065/* Identifies the12 most significant address bits of an alternate base
66 * address used for boot sequencer configuration accesses.
67 */
68#define ALTCBAR_BASE_ADDR 0xFFF00000
Eran Libertyf046ccd2005-07-28 10:08:46 -050069#define ALTCBAR_RES ~(ALTCBAR_BASE_ADDR) /* Reserved. Write has no effect, read returns 0. */
70 u8 res1[0x14];
Dave Liuf6eda7f2006-10-25 14:41:21 -050071 law83xx_t lblaw[4]; /* LBIU local access window */
Eran Libertyf046ccd2005-07-28 10:08:46 -050072 u8 res2[0x20];
Dave Liuf6eda7f2006-10-25 14:41:21 -050073 law83xx_t pcilaw[2]; /* PCI local access window */
Eran Libertyf046ccd2005-07-28 10:08:46 -050074 u8 res3[0x30];
Dave Liuf6eda7f2006-10-25 14:41:21 -050075 law83xx_t ddrlaw[2]; /* DDR local access window */
Eran Libertyf046ccd2005-07-28 10:08:46 -050076 u8 res4[0x50];
77 u32 sgprl; /* System General Purpose Register Low */
78 u32 sgprh; /* System General Purpose Register High */
79 u32 spridr; /* System Part and Revision ID Register */
80#define SPRIDR_PARTID 0xFFFF0000 /* Part Identification. */
81#define SPRIDR_REVID 0x0000FFFF /* Revision Identification. */
82 u8 res5[0x04];
Jon Loeligerde1d0a62005-08-01 13:20:47 -050083 u32 spcr; /* System Priority Configuration Register */
Eran Libertyf046ccd2005-07-28 10:08:46 -050084#define SPCR_PCIHPE 0x10000000 /* PCI Highest Priority Enable. */
85#define SPCR_PCIPR 0x03000000 /* PCI bridge system bus request priority. */
86#define SPCR_TBEN 0x00400000 /* E300 PowerPC core time base unit enable. */
87#define SPCR_COREPR 0x00300000 /* E300 PowerPC Core system bus request priority. */
88#define SPCR_TSEC1DP 0x00003000 /* TSEC1 data priority. */
89#define SPCR_TSEC1BDP 0x00000C00 /* TSEC1 buffer descriptor priority. */
90#define SPCR_TSEC1EP 0x00000300 /* TSEC1 emergency priority. */
91#define SPCR_TSEC2DP 0x00000030 /* TSEC2 data priority. */
92#define SPCR_TSEC2BDP 0x0000000C /* TSEC2 buffer descriptor priority. */
93#define SPCR_TSEC2EP 0x00000003 /* TSEC2 emergency priority. */
Jon Loeligerde1d0a62005-08-01 13:20:47 -050094#define SPCR_RES ~(SPCR_PCIHPE | SPCR_PCIPR | SPCR_TBEN | SPCR_COREPR \
95 | SPCR_TSEC1DP | SPCR_TSEC1BDP | SPCR_TSEC1EP \
96 | SPCR_TSEC2DP | SPCR_TSEC2BDP | SPCR_TSEC2EP)
Eran Libertyf046ccd2005-07-28 10:08:46 -050097 u32 sicrl; /* System General Purpose Register Low */
98#define SICRL_LDP_A 0x80000000
Kumar Galab9704802006-01-23 16:22:57 -060099#define SICRL_USB1 0x40000000
100#define SICRL_USB0 0x20000000
Eran Libertyf046ccd2005-07-28 10:08:46 -0500101#define SICRL_UART 0x0C000000
102#define SICRL_GPIO1_A 0x02000000
103#define SICRL_GPIO1_B 0x01000000
104#define SICRL_GPIO1_C 0x00800000
105#define SICRL_GPIO1_D 0x00400000
106#define SICRL_GPIO1_E 0x00200000
107#define SICRL_GPIO1_F 0x00180000
108#define SICRL_GPIO1_G 0x00040000
109#define SICRL_GPIO1_H 0x00020000
110#define SICRL_GPIO1_I 0x00010000
111#define SICRL_GPIO1_J 0x00008000
112#define SICRL_GPIO1_K 0x00004000
113#define SICRL_GPIO1_L 0x00003000
Jon Loeligerde1d0a62005-08-01 13:20:47 -0500114#define SICRL_RES ~(SICRL_LDP_A | SICRL_USB0 | SICRL_USB1 | SICRL_UART \
115 | SICRL_GPIO1_A | SICRL_GPIO1_B | SICRL_GPIO1_C \
116 | SICRL_GPIO1_D | SICRL_GPIO1_E | SICRL_GPIO1_F \
117 | SICRL_GPIO1_G | SICRL_GPIO1_H | SICRL_GPIO1_I \
118 | SICRL_GPIO1_J | SICRL_GPIO1_K | SICRL_GPIO1_L )
Eran Libertyf046ccd2005-07-28 10:08:46 -0500119 u32 sicrh; /* System General Purpose Register High */
120#define SICRH_DDR 0x80000000
121#define SICRH_TSEC1_A 0x10000000
122#define SICRH_TSEC1_B 0x08000000
123#define SICRH_TSEC1_C 0x04000000
124#define SICRH_TSEC1_D 0x02000000
125#define SICRH_TSEC1_E 0x01000000
126#define SICRH_TSEC1_F 0x00800000
127#define SICRH_TSEC2_A 0x00400000
128#define SICRH_TSEC2_B 0x00200000
129#define SICRH_TSEC2_C 0x00100000
130#define SICRH_TSEC2_D 0x00080000
131#define SICRH_TSEC2_E 0x00040000
132#define SICRH_TSEC2_F 0x00020000
133#define SICRH_TSEC2_G 0x00010000
134#define SICRH_TSEC2_H 0x00008000
135#define SICRH_GPIO2_A 0x00004000
136#define SICRH_GPIO2_B 0x00002000
137#define SICRH_GPIO2_C 0x00001000
138#define SICRH_GPIO2_D 0x00000800
139#define SICRH_GPIO2_E 0x00000400
140#define SICRH_GPIO2_F 0x00000200
141#define SICRH_GPIO2_G 0x00000180
142#define SICRH_GPIO2_H 0x00000060
143#define SICRH_TSOBI1 0x00000002
144#define SICRH_TSOBI2 0x00000001
Dave Liuf6eda7f2006-10-25 14:41:21 -0500145#define SICRH_RES ~( SICRH_DDR | SICRH_TSEC1_A | SICRH_TSEC1_B \
Jon Loeligerde1d0a62005-08-01 13:20:47 -0500146 | SICRH_TSEC1_C | SICRH_TSEC1_D | SICRH_TSEC1_E \
147 | SICRH_TSEC1_F | SICRH_TSEC2_A | SICRH_TSEC2_B \
148 | SICRH_TSEC2_C | SICRH_TSEC2_D | SICRH_TSEC2_E \
149 | SICRH_TSEC2_F | SICRH_TSEC2_G | SICRH_TSEC2_H \
150 | SICRH_GPIO2_A | SICRH_GPIO2_B | SICRH_GPIO2_C \
151 | SICRH_GPIO2_D | SICRH_GPIO2_E | SICRH_GPIO2_F \
152 | SICRH_GPIO2_G | SICRH_GPIO2_H | SICRH_TSOBI1 \
153 | SICRH_TSOBI2)
Eran Libertyf046ccd2005-07-28 10:08:46 -0500154 u8 res6[0xE4];
Dave Liuf6eda7f2006-10-25 14:41:21 -0500155} sysconf83xx_t;
Eran Libertyf046ccd2005-07-28 10:08:46 -0500156
Jon Loeligerde1d0a62005-08-01 13:20:47 -0500157/*
Eran Libertyf046ccd2005-07-28 10:08:46 -0500158 * Watch Dog Timer (WDT) Registers
159 */
Dave Liuf6eda7f2006-10-25 14:41:21 -0500160typedef struct wdt83xx {
Jon Loeligerde1d0a62005-08-01 13:20:47 -0500161 u8 res0[4];
Eran Libertyf046ccd2005-07-28 10:08:46 -0500162 u32 swcrr; /* System watchdog control register */
163 u32 swcnr; /* System watchdog count register */
164#define SWCNR_SWCN 0x0000FFFF Software Watchdog Count Field.
165#define SWCNR_RES ~(SWCNR_SWCN)
Jon Loeligerde1d0a62005-08-01 13:20:47 -0500166 u8 res1[2];
Eran Libertyf046ccd2005-07-28 10:08:46 -0500167 u16 swsrr; /* System watchdog service register */
Dave Liuf6eda7f2006-10-25 14:41:21 -0500168#define SWSRR_WS 0x0000FFFF /* Software Watchdog Service Field.*/
Eran Libertyf046ccd2005-07-28 10:08:46 -0500169 u8 res2[0xF0];
Dave Liuf6eda7f2006-10-25 14:41:21 -0500170} wdt83xx_t;
Jon Loeligerde1d0a62005-08-01 13:20:47 -0500171
Eran Libertyf046ccd2005-07-28 10:08:46 -0500172/*
173 * RTC/PIT Module Registers
174 */
Dave Liuf6eda7f2006-10-25 14:41:21 -0500175typedef struct rtclk83xx {
Eran Libertyf046ccd2005-07-28 10:08:46 -0500176 u32 cnr; /* control register */
177#define CNR_CLEN 0x00000080 /* Clock Enable Control Bit */
178#define CNR_CLIN 0x00000040 /* Input Clock Control Bit */
179#define CNR_AIM 0x00000002 /* Alarm Interrupt Mask Bit */
180#define CNR_SIM 0x00000001 /* Second Interrupt Mask Bit */
181#define CNR_RES ~(CNR_CLEN | CNR_CLIN | CNR_AIM | CNR_SIM)
182 u32 ldr; /* load register */
Dave Liuf6eda7f2006-10-25 14:41:21 -0500183#define LDR_CLDV 0xFFFFFFFF /* Contains the 32-bit value to be
184 * loaded in a 32-bit RTC counter.*/
Eran Libertyf046ccd2005-07-28 10:08:46 -0500185 u32 psr; /* prescale register */
Dave Liuf6eda7f2006-10-25 14:41:21 -0500186#define PSR_PRSC 0xFFFFFFFF /* RTC Prescaler bits.*/
187 u32 ctr; /* Counter value field register */
188#define CRT_CNTV 0xFFFFFFFF /* RTC Counter value field.*/
Eran Libertyf046ccd2005-07-28 10:08:46 -0500189 u32 evr; /* event register */
190#define RTEVR_SIF 0x00000001 /* Second Interrupt Flag Bit */
191#define RTEVR_AIF 0x00000002 /* Alarm Interrupt Flag Bit */
Dave Liuf6eda7f2006-10-25 14:41:21 -0500192#define RTEVR_RES ~(RTEVR_SIF | RTEVR_AIF)
193#define PTEVR_PIF 0x00000001 /* Periodic interrupt flag bit.*/
194#define PTEVR_RES ~(PTEVR_PIF)
Eran Libertyf046ccd2005-07-28 10:08:46 -0500195 u32 alr; /* alarm register */
196 u8 res0[0xE8];
Dave Liuf6eda7f2006-10-25 14:41:21 -0500197} rtclk83xx_t;
Eran Libertyf046ccd2005-07-28 10:08:46 -0500198
199/*
200 * Global timper module
201 */
202
Dave Liuf6eda7f2006-10-25 14:41:21 -0500203typedef struct gtm83xx {
Jon Loeligerde1d0a62005-08-01 13:20:47 -0500204 u8 cfr1; /* Timer1/2 Configuration */
Eran Libertyf046ccd2005-07-28 10:08:46 -0500205#define CFR1_PCAS 0x80 /* Pair Cascade mode */
206#define CFR1_BCM 0x40 /* Backward compatible mode */
207#define CFR1_STP2 0x20 /* Stop timer */
208#define CFR1_RST2 0x10 /* Reset timer */
209#define CFR1_GM2 0x08 /* Gate mode for pin 2 */
210#define CFR1_GM1 0x04 /* Gate mode for pin 1 */
211#define CFR1_STP1 0x02 /* Stop timer */
212#define CFR1_RST1 0x01 /* Reset timer */
Dave Liuf6eda7f2006-10-25 14:41:21 -0500213#define CFR1_RES ~(CFR1_PCAS | CFR1_STP2 | CFR1_RST2 | CFR1_GM2 |\
214 CFR1_GM1 | CFR1_STP1 | CFR1_RST1)
Jon Loeligerde1d0a62005-08-01 13:20:47 -0500215 u8 res0[3];
216 u8 cfr2; /* Timer3/4 Configuration */
Eran Libertyf046ccd2005-07-28 10:08:46 -0500217#define CFR2_PCAS 0x80 /* Pair Cascade mode */
218#define CFR2_SCAS 0x40 /* Super Cascade mode */
219#define CFR2_STP4 0x20 /* Stop timer */
220#define CFR2_RST4 0x10 /* Reset timer */
221#define CFR2_GM4 0x08 /* Gate mode for pin 4 */
222#define CFR2_GM3 0x04 /* Gate mode for pin 3 */
223#define CFR2_STP3 0x02 /* Stop timer */
224#define CFR2_RST3 0x01 /* Reset timer */
Jon Loeligerde1d0a62005-08-01 13:20:47 -0500225 u8 res1[10];
226 u16 mdr1; /* Timer1 Mode Register */
Eran Libertyf046ccd2005-07-28 10:08:46 -0500227#define MDR_SPS 0xff00 /* Secondary Prescaler value */
228#define MDR_CE 0x00c0 /* Capture edge and enable interrupt */
229#define MDR_OM 0x0020 /* Output mode */
230#define MDR_ORI 0x0010 /* Output reference interrupt enable */
231#define MDR_FRR 0x0008 /* Free run/restart */
232#define MDR_ICLK 0x0006 /* Input clock source for the timer */
233#define MDR_GE 0x0001 /* Gate enable */
Jon Loeligerde1d0a62005-08-01 13:20:47 -0500234 u16 mdr2; /* Timer2 Mode Register */
Eran Libertyf046ccd2005-07-28 10:08:46 -0500235 u16 rfr1; /* Timer1 Reference Register */
Jon Loeligerde1d0a62005-08-01 13:20:47 -0500236 u16 rfr2; /* Timer2 Reference Register */
237 u16 cpr1; /* Timer1 Capture Register */
238 u16 cpr2; /* Timer2 Capture Register */
239 u16 cnr1; /* Timer1 Counter Register */
240 u16 cnr2; /* Timer2 Counter Register */
241 u16 mdr3; /* Timer3 Mode Register */
242 u16 mdr4; /* Timer4 Mode Register */
243 u16 rfr3; /* Timer3 Reference Register */
244 u16 rfr4; /* Timer4 Reference Register */
245 u16 cpr3; /* Timer3 Capture Register */
246 u16 cpr4; /* Timer4 Capture Register */
247 u16 cnr3; /* Timer3 Counter Register */
248 u16 cnr4; /* Timer4 Counter Register */
249 u16 evr1; /* Timer1 Event Register */
250 u16 evr2; /* Timer2 Event Register */
251 u16 evr3; /* Timer3 Event Register */
252 u16 evr4; /* Timer4 Event Register */
Eran Libertyf046ccd2005-07-28 10:08:46 -0500253#define GTEVR_REF 0x0002 /* Output reference event */
254#define GTEVR_CAP 0x0001 /* Counter Capture event */
255#define GTEVR_RES ~(EVR_CAP|EVR_REF)
Jon Loeligerde1d0a62005-08-01 13:20:47 -0500256 u16 psr1; /* Timer1 Prescaler Register */
257 u16 psr2; /* Timer2 Prescaler Register */
258 u16 psr3; /* Timer3 Prescaler Register */
259 u16 psr4; /* Timer4 Prescaler Register */
Dave Liuf6eda7f2006-10-25 14:41:21 -0500260#define GTPSR_PPS 0x00FF /* Primary Prescaler Bits. */
261#define GTPSR_RES ~(GTPSR_PPS)
Jon Loeligerde1d0a62005-08-01 13:20:47 -0500262 u8 res[0xC0];
Dave Liuf6eda7f2006-10-25 14:41:21 -0500263} gtm83xx_t;
Eran Libertyf046ccd2005-07-28 10:08:46 -0500264
265/*
266 * Integrated Programmable Interrupt Controller
267 */
Dave Liuf6eda7f2006-10-25 14:41:21 -0500268typedef struct ipic83xx {
Jon Loeligerde1d0a62005-08-01 13:20:47 -0500269 u32 sicfr; /* System Global Interrupt Configuration Register (SICFR) */
Eran Libertyf046ccd2005-07-28 10:08:46 -0500270#define SICFR_HPI 0x7f000000 /* Highest Priority Interrupt */
271#define SICFR_MPSB 0x00400000 /* Mixed interrupts Priority Scheme for group B */
272#define SICFR_MPSA 0x00200000 /* Mixed interrupts Priority Scheme for group A */
273#define SICFR_IPSD 0x00080000 /* Internal interrupts Priority Scheme for group D */
274#define SICFR_IPSA 0x00010000 /* Internal interrupts Priority Scheme for group A */
275#define SICFR_HPIT 0x00000300 /* HPI priority position IPIC output interrupt Type */
276#define SICFR_RES ~(SICFR_HPI|SICFR_MPSB|SICFR_MPSA|SICFR_IPSD|SICFR_IPSA|SICFR_HPIT)
Jon Loeligerde1d0a62005-08-01 13:20:47 -0500277 u32 sivcr; /* System Global Interrupt Vector Register (SIVCR) */
Eran Libertyf046ccd2005-07-28 10:08:46 -0500278#define SICVR_IVECX 0xfc000000 /* Interrupt vector (for CE compatibility purpose only not used in 8349 IPIC implementation) */
279#define SICVR_IVEC 0x0000007f /* Interrupt vector */
280#define SICVR_RES ~(SICVR_IVECX|SICVR_IVEC)
Jon Loeligerde1d0a62005-08-01 13:20:47 -0500281 u32 sipnr_h; /* System Internal Interrupt Pending Register - High (SIPNR_H) */
Eran Libertyf046ccd2005-07-28 10:08:46 -0500282#define SIIH_TSEC1TX 0x80000000 /* TSEC1 Tx interrupt */
283#define SIIH_TSEC1RX 0x40000000 /* TSEC1 Rx interrupt */
284#define SIIH_TSEC1ER 0x20000000 /* TSEC1 Eror interrupt */
285#define SIIH_TSEC2TX 0x10000000 /* TSEC2 Tx interrupt */
286#define SIIH_TSEC2RX 0x08000000 /* TSEC2 Rx interrupt */
287#define SIIH_TSEC2ER 0x04000000 /* TSEC2 Eror interrupt */
288#define SIIH_USB2DR 0x02000000 /* USB2 DR interrupt */
289#define SIIH_USB2MPH 0x01000000 /* USB2 MPH interrupt */
290#define SIIH_UART1 0x00000080 /* UART1 interrupt */
291#define SIIH_UART2 0x00000040 /* UART2 interrupt */
292#define SIIH_SEC 0x00000020 /* SEC interrupt */
293#define SIIH_I2C1 0x00000004 /* I2C1 interrupt */
Dave Liuf6eda7f2006-10-25 14:41:21 -0500294#define SIIH_I2C2 0x00000002 /* I2C2 interrupt */
Eran Libertyf046ccd2005-07-28 10:08:46 -0500295#define SIIH_SPI 0x00000001 /* SPI interrupt */
Jon Loeligerde1d0a62005-08-01 13:20:47 -0500296#define SIIH_RES ~(SIIH_TSEC1TX | SIIH_TSEC1RX | SIIH_TSEC1ER \
297 | SIIH_TSEC2TX | SIIH_TSEC2RX | SIIH_TSEC2ER \
298 | SIIH_USB2DR | SIIH_USB2MPH | SIIH_UART1 \
299 | SIIH_UART2 | SIIH_SEC | SIIH_I2C1 \
300 | SIIH_I2C2 | SIIH_SPI)
301 u32 sipnr_l; /* System Internal Interrupt Pending Register - Low (SIPNR_L) */
Eran Libertyf046ccd2005-07-28 10:08:46 -0500302#define SIIL_RTCS 0x80000000 /* RTC SECOND interrupt */
303#define SIIL_PIT 0x40000000 /* PIT interrupt */
304#define SIIL_PCI1 0x20000000 /* PCI1 interrupt */
305#define SIIL_PCI2 0x10000000 /* PCI2 interrupt */
306#define SIIL_RTCA 0x08000000 /* RTC ALARM interrupt */
307#define SIIL_MU 0x04000000 /* Message Unit interrupt */
308#define SIIL_SBA 0x02000000 /* System Bus Arbiter interrupt */
309#define SIIL_DMA 0x01000000 /* DMA interrupt */
310#define SIIL_GTM4 0x00800000 /* GTM4 interrupt */
311#define SIIL_GTM8 0x00400000 /* GTM8 interrupt */
312#define SIIL_GPIO1 0x00200000 /* GPIO1 interrupt */
313#define SIIL_GPIO2 0x00100000 /* GPIO2 interrupt */
314#define SIIL_DDR 0x00080000 /* DDR interrupt */
315#define SIIL_LBC 0x00040000 /* LBC interrupt */
316#define SIIL_GTM2 0x00020000 /* GTM2 interrupt */
317#define SIIL_GTM6 0x00010000 /* GTM6 interrupt */
318#define SIIL_PMC 0x00008000 /* PMC interrupt */
319#define SIIL_GTM3 0x00000800 /* GTM3 interrupt */
320#define SIIL_GTM7 0x00000400 /* GTM7 interrupt */
321#define SIIL_GTM1 0x00000020 /* GTM1 interrupt */
322#define SIIL_GTM5 0x00000010 /* GTM5 interrupt */
323#define SIIL_DPTC 0x00000001 /* DPTC interrupt (!!! Invisible for user !!!) */
Jon Loeligerde1d0a62005-08-01 13:20:47 -0500324#define SIIL_RES ~(SIIL_RTCS | SIIL_PIT | SIIL_PCI1 | SIIL_PCI2 \
325 | SIIL_RTCA | SIIL_MU | SIIL_SBA | SIIL_DMA \
326 | SIIL_GTM4 | SIIL_GTM8 | SIIL_GPIO1 | SIIL_GPIO2 \
327 | SIIL_DDR | SIIL_LBC | SIIL_GTM2 | SIIL_GTM6 \
328 | SIIL_PMC |SIIL_GTM3 | SIIL_GTM7 | SIIL_GTM1 \
329 | SIIL_GTM5 |SIIL_DPTC )
330 u32 siprr_a; /* System Internal Interrupt Group A Priority Register (PRR) */
331 u8 res0[8];
332 u32 siprr_d; /* System Internal Interrupt Group D Priority Register (PRR) */
333 u32 simsr_h; /* System Internal Interrupt Mask Register - High (SIIH) */
334 u32 simsr_l; /* System Internal Interrupt Mask Register - Low (SIIL) */
335 u8 res1[4];
336 u32 sepnr; /* System External Interrupt Pending Register (SEI) */
337 u32 smprr_a; /* System Mixed Interrupt Group A Priority Register (PRR) */
338 u32 smprr_b; /* System Mixed Interrupt Group B Priority Register (PRR) */
Eran Libertyf046ccd2005-07-28 10:08:46 -0500339#define PRR_0 0xe0000000 /* Priority Register, Position 0 programming */
340#define PRR_1 0x1c000000 /* Priority Register, Position 1 programming */
341#define PRR_2 0x03800000 /* Priority Register, Position 2 programming */
342#define PRR_3 0x00700000 /* Priority Register, Position 3 programming */
343#define PRR_4 0x0000e000 /* Priority Register, Position 4 programming */
344#define PRR_5 0x00001c00 /* Priority Register, Position 5 programming */
345#define PRR_6 0x00000380 /* Priority Register, Position 6 programming */
346#define PRR_7 0x00000070 /* Priority Register, Position 7 programming */
347#define PRR_RES ~(PRR_0|PRR_1|PRR_2|PRR_3|PRR_4|PRR_5|PRR_6|PRR_7)
Jon Loeligerde1d0a62005-08-01 13:20:47 -0500348 u32 semsr; /* System External Interrupt Mask Register (SEI) */
Eran Libertyf046ccd2005-07-28 10:08:46 -0500349#define SEI_IRQ0 0x80000000 /* IRQ0 external interrupt */
350#define SEI_IRQ1 0x40000000 /* IRQ1 external interrupt */
351#define SEI_IRQ2 0x20000000 /* IRQ2 external interrupt */
352#define SEI_IRQ3 0x10000000 /* IRQ3 external interrupt */
353#define SEI_IRQ4 0x08000000 /* IRQ4 external interrupt */
354#define SEI_IRQ5 0x04000000 /* IRQ5 external interrupt */
355#define SEI_IRQ6 0x02000000 /* IRQ6 external interrupt */
356#define SEI_IRQ7 0x01000000 /* IRQ7 external interrupt */
357#define SEI_SIRQ0 0x00008000 /* SIRQ0 external interrupt */
Jon Loeligerde1d0a62005-08-01 13:20:47 -0500358#define SEI_RES ~( SEI_IRQ0 | SEI_IRQ1 | SEI_IRQ2 | SEI_IRQ3 \
359 | SEI_IRQ4 | SEI_IRQ5 | SEI_IRQ6 | SEI_IRQ7 \
360 | SEI_SIRQ0)
361 u32 secnr; /* System External Interrupt Control Register (SECNR) */
Eran Libertyf046ccd2005-07-28 10:08:46 -0500362#define SECNR_MIXB0T 0xc0000000 /* MIXB0 priority position IPIC output interrupt type */
363#define SECNR_MIXB1T 0x30000000 /* MIXB1 priority position IPIC output interrupt type */
364#define SECNR_MIXA0T 0x00c00000 /* MIXA0 priority position IPIC output interrupt type */
365#define SECNR_SYSA1T 0x00300000 /* MIXA1 priority position IPIC output interrupt type */
366#define SECNR_EDI0 0x00008000 /* IRQ0 external interrupt edge/level detect */
367#define SECNR_EDI1 0x00004000 /* IRQ1 external interrupt edge/level detect */
368#define SECNR_EDI2 0x00002000 /* IRQ2 external interrupt edge/level detect */
369#define SECNR_EDI3 0x00001000 /* IRQ3 external interrupt edge/level detect */
370#define SECNR_EDI4 0x00000800 /* IRQ4 external interrupt edge/level detect */
371#define SECNR_EDI5 0x00000400 /* IRQ5 external interrupt edge/level detect */
372#define SECNR_EDI6 0x00000200 /* IRQ6 external interrupt edge/level detect */
373#define SECNR_EDI7 0x00000100 /* IRQ7 external interrupt edge/level detect */
Jon Loeligerde1d0a62005-08-01 13:20:47 -0500374#define SECNR_RES ~( SECNR_MIXB0T | SECNR_MIXB1T | SECNR_MIXA0T \
375 | SECNR_SYSA1T | SECNR_EDI0 | SECNR_EDI1 \
376 | SECNR_EDI2 | SECNR_EDI3 | SECNR_EDI4 \
377 | SECNR_EDI5 | SECNR_EDI6 | SECNR_EDI7)
378 u32 sersr; /* System Error Status Register (SERR) */
379 u32 sermr; /* System Error Mask Register (SERR) */
Eran Libertyf046ccd2005-07-28 10:08:46 -0500380#define SERR_IRQ0 0x80000000 /* IRQ0 MCP request */
381#define SERR_WDT 0x40000000 /* WDT MCP request */
382#define SERR_SBA 0x20000000 /* SBA MCP request */
383#define SERR_DDR 0x10000000 /* DDR MCP request */
384#define SERR_LBC 0x08000000 /* LBC MCP request */
385#define SERR_PCI1 0x04000000 /* PCI1 MCP request */
386#define SERR_PCI2 0x02000000 /* PCI2 MCP request */
387#define SERR_MU 0x01000000 /* MU MCP request */
388#define SERR_RNC 0x00010000 /* MU MCP request (!!! Non-visible for users !!!) */
Jon Loeligerde1d0a62005-08-01 13:20:47 -0500389#define SERR_RES ~( SERR_IRQ0 | SERR_WDT | SERR_SBA | SERR_DDR \
390 |SERR_LBC | SERR_PCI1 | SERR_PCI2 | SERR_MU \
391 |SERR_RNC )
392 u32 sercr; /* System Error Control Register (SERCR) */
Eran Libertyf046ccd2005-07-28 10:08:46 -0500393#define SERCR_MCPR 0x00000001 /* MCP Route */
394#define SERCR_RES ~(SERCR_MCPR)
Jon Loeligerde1d0a62005-08-01 13:20:47 -0500395 u8 res2[4];
396 u32 sifcr_h; /* System Internal Interrupt Force Register - High (SIIH) */
397 u32 sifcr_l; /* System Internal Interrupt Force Register - Low (SIIL) */
398 u32 sefcr; /* System External Interrupt Force Register (SEI) */
399 u32 serfr; /* System Error Force Register (SERR) */
Dave Liuf6eda7f2006-10-25 14:41:21 -0500400 u32 scvcr; /* System Critical Interrupt Vector Register */
401#define SCVCR_CVECX 0xFC000000 /* Backward (MPC8260) compatible
402 critical interrupt vector. */
403#define SCVCR_CVEC 0x0000007F /* Critical interrupt vector */
404#define SCVCR_RES ~(SCVCR_CVECX|SCVCR_CVEC)
405 u32 smvcr; /* System Management Interrupt Vector Register */
406#define SMVCR_CVECX 0xFC000000 /* Backward (MPC8260) compatible
407 critical interrupt vector. */
408#define SMVCR_CVEC 0x0000007F /* Critical interrupt vector */
409#define SMVCR_RES ~(SMVCR_CVECX|SMVCR_CVEC)
410 u8 res3[0x98];
411} ipic83xx_t;
Eran Libertyf046ccd2005-07-28 10:08:46 -0500412
413/*
414 * System Arbiter Registers
415 */
Dave Liuf6eda7f2006-10-25 14:41:21 -0500416typedef struct arbiter83xx {
Eran Libertyf046ccd2005-07-28 10:08:46 -0500417 u32 acr; /* Arbiter Configuration Register */
Jon Loeligerde1d0a62005-08-01 13:20:47 -0500418#define ACR_COREDIS 0x10000000 /* Core disable. */
Eran Libertyf046ccd2005-07-28 10:08:46 -0500419#define ACR_PIPE_DEP 0x00070000 /* Pipeline depth (number of outstanding transactions). */
420#define ACR_PCI_RPTCNT 0x00007000 /* PCI repeat count. */
Jon Loeligerde1d0a62005-08-01 13:20:47 -0500421#define ACR_RPTCNT 0x00000700 /* Repeat count. */
Eran Libertyf046ccd2005-07-28 10:08:46 -0500422#define ACR_APARK 0x00000030 /* Address parking. */
423#define ACR_PARKM 0x0000000F /* Parking master. */
424#define ACR_RES ~(ACR_COREDIS|ACR_PIPE_DEP|ACR_PCI_RPTCNT|ACR_RPTCNT|ACR_APARK|ACR_PARKM)
425 u32 atr; /* Arbiter Timers Register */
426#define ATR_DTO 0x00FF0000 /* Data time out. */
427#define ATR_ATO 0x000000FF /* Address time out. */
428#define ATR_RES ~(ATR_DTO|ATR_ATO)
429 u8 res[4];
430 u32 aer; /* Arbiter Event Register (AE)*/
431 u32 aidr; /* Arbiter Interrupt Definition Register (AE) */
432 u32 amr; /* Arbiter Mask Register (AE) */
433 u32 aeatr; /* Arbiter Event Attributes Register */
434#define AEATR_EVENT 0x07000000 /* Event type. */
435#define AEATR_MSTR_ID 0x001F0000 /* Master Id. */
436#define AEATR_TBST 0x00000800 /* Transfer burst. */
437#define AEATR_TSIZE 0x00000700 /* Transfer Size. */
438#define AEATR_TTYPE 0x0000001F /* Transfer Type. */
439#define AEATR_RES ~(AEATR_EVENT|AEATR_MSTR_ID|AEATR_TBST|AEATR_TSIZE|AEATR_TTYPE)
440 u32 aeadr; /* Arbiter Event Address Register */
441 u32 aerr; /* Arbiter Event Response Register (AE)*/
442#define AE_ETEA 0x00000020 /* Transfer error. */
443#define AE_RES_ 0x00000010 /* Reserved transfer type. */
444#define AE_ECW 0x00000008 /* External control word transfer type. */
445#define AE_AO 0x00000004 /* Address Only transfer type. */
446#define AE_DTO 0x00000002 /* Data time out. */
447#define AE_ATO 0x00000001 /* Address time out. */
448#define AE_RSRV ~(AE_ETEA|AE_RES_|AE_ECW|AE_AO|AE_DTO|AE_ATO)
449 u8 res1[0xDC];
Dave Liuf6eda7f2006-10-25 14:41:21 -0500450} arbiter83xx_t;
Eran Libertyf046ccd2005-07-28 10:08:46 -0500451
452/*
453 * Reset Module
454 */
Dave Liuf6eda7f2006-10-25 14:41:21 -0500455typedef struct reset83xx {
Jon Loeligerde1d0a62005-08-01 13:20:47 -0500456 u32 rcwl; /* RCWL Register */
Eran Libertyf046ccd2005-07-28 10:08:46 -0500457#define RCWL_LBIUCM 0x80000000 /* LBIUCM */
458#define RCWL_LBIUCM_SHIFT 31
459#define RCWL_DDRCM 0x40000000 /* DDRCM */
460#define RCWL_DDRCM_SHIFT 30
461#define RCWL_SVCOD 0x30000000 /* SVCOD */
462#define RCWL_SPMF 0x0f000000 /* SPMF */
463#define RCWL_SPMF_SHIFT 24
464#define RCWL_COREPLL 0x007F0000 /* COREPLL */
465#define RCWL_COREPLL_SHIFT 16
466#define RCWL_CEVCOD 0x000000C0 /* CEVCOD */
467#define RCWL_CEPDF 0x00000020 /* CEPDF */
468#define RCWL_CEPMF 0x0000001F /* CEPMF */
Dave Liuf6eda7f2006-10-25 14:41:21 -0500469#define RCWL_RES ~(RCWL_LBIUCM|RCWL_DDRCM|RCWL_SVCOD|RCWL_SPMF|RCWL_COREPLL|RCWL_CEVCOD|RCWL_CEPDF|RCWL_CEPMF)
Jon Loeligerde1d0a62005-08-01 13:20:47 -0500470 u32 rcwh; /* RCHL Register */
Eran Libertyf046ccd2005-07-28 10:08:46 -0500471#define RCWH_PCIHOST 0x80000000 /* PCIHOST */
472#define RCWH_PCIHOST_SHIFT 31
473#define RCWH_PCI64 0x40000000 /* PCI64 */
474#define RCWH_PCI1ARB 0x20000000 /* PCI1ARB */
475#define RCWH_PCI2ARB 0x10000000 /* PCI2ARB */
476#define RCWH_COREDIS 0x08000000 /* COREDIS */
477#define RCWH_BMS 0x04000000 /* BMS */
478#define RCWH_BOOTSEQ 0x03000000 /* BOOTSEQ */
479#define RCWH_SWEN 0x00800000 /* SWEN */
480#define RCWH_ROMLOC 0x00700000 /* ROMLOC */
481#define RCWH_TSEC1M 0x0000c000 /* TSEC1M */
482#define RCWH_TSEC2M 0x00003000 /* TSEC2M */
483#define RCWH_TPR 0x00000100 /* TPR */
484#define RCWH_TLE 0x00000008 /* TLE */
485#define RCWH_LALE 0x00000004 /* LALE */
Jon Loeligerde1d0a62005-08-01 13:20:47 -0500486#define RCWH_RES ~(RCWH_PCIHOST | RCWH_PCI64 | RCWH_PCI1ARB \
487 | RCWH_PCI2ARB | RCWH_COREDIS | RCWH_BMS \
488 | RCWH_BOOTSEQ | RCWH_SWEN | RCWH_ROMLOC \
489 | RCWH_TSEC1M | RCWH_TSEC2M | RCWH_TPR \
490 | RCWH_TLE | RCWH_LALE)
491 u8 res0[8];
492 u32 rsr; /* Reset status Register */
Eran Libertyf046ccd2005-07-28 10:08:46 -0500493#define RSR_RSTSRC 0xE0000000 /* Reset source */
494#define RSR_RSTSRC_SHIFT 29
495#define RSR_BSF 0x00010000 /* Boot seq. fail */
496#define RSR_BSF_SHIFT 16
497#define RSR_SWSR 0x00002000 /* software soft reset */
498#define RSR_SWSR_SHIFT 13
499#define RSR_SWHR 0x00001000 /* software hard reset */
500#define RSR_SWHR_SHIFT 12
501#define RSR_JHRS 0x00000200 /* jtag hreset */
502#define RSR_JHRS_SHIFT 9
503#define RSR_JSRS 0x00000100 /* jtag sreset status */
504#define RSR_JSRS_SHIFT 8
505#define RSR_CSHR 0x00000010 /* checkstop reset status */
506#define RSR_CSHR_SHIFT 4
507#define RSR_SWRS 0x00000008 /* software watchdog reset status */
508#define RSR_SWRS_SHIFT 3
509#define RSR_BMRS 0x00000004 /* bus monitop reset status */
510#define RSR_BMRS_SHIFT 2
511#define RSR_SRS 0x00000002 /* soft reset status */
512#define RSR_SRS_SHIFT 1
513#define RSR_HRS 0x00000001 /* hard reset status */
514#define RSR_HRS_SHIFT 0
Jon Loeligerde1d0a62005-08-01 13:20:47 -0500515#define RSR_RES ~(RSR_RSTSRC | RSR_BSF | RSR_SWSR | RSR_SWHR | RSR_JHRS | RSR_JSRS | RSR_CSHR | RSR_SWRS | RSR_BMRS | RSR_SRS | RSR_HRS)
516 u32 rmr; /* Reset mode Register */
Eran Libertyf046ccd2005-07-28 10:08:46 -0500517#define RMR_CSRE 0x00000001 /* checkstop reset enable */
518#define RMR_CSRE_SHIFT 0
519#define RMR_RES ~(RMR_CSRE)
Jon Loeligerde1d0a62005-08-01 13:20:47 -0500520 u32 rpr; /* Reset protection Register */
521 u32 rcr; /* Reset Control Register */
Eran Libertyf046ccd2005-07-28 10:08:46 -0500522#define RCR_SWHR 0x00000002 /* software hard reset */
523#define RCR_SWSR 0x00000001 /* software soft reset */
Jon Loeligerde1d0a62005-08-01 13:20:47 -0500524#define RCR_RES ~(RCR_SWHR | RCR_SWSR)
525 u32 rcer; /* Reset Control Enable Register */
Eran Libertyf046ccd2005-07-28 10:08:46 -0500526#define RCER_CRE 0x00000001 /* software hard reset */
527#define RCER_RES ~(RCER_CRE)
528 u8 res1[0xDC];
Dave Liuf6eda7f2006-10-25 14:41:21 -0500529} reset83xx_t;
Jon Loeligerde1d0a62005-08-01 13:20:47 -0500530
Dave Liuf6eda7f2006-10-25 14:41:21 -0500531typedef struct clk83xx {
Jon Loeligerde1d0a62005-08-01 13:20:47 -0500532 u32 spmr; /* system PLL mode Register */
Eran Libertyf046ccd2005-07-28 10:08:46 -0500533#define SPMR_LBIUCM 0x80000000 /* LBIUCM */
534#define SPMR_DDRCM 0x40000000 /* DDRCM */
535#define SPMR_SVCOD 0x30000000 /* SVCOD */
536#define SPMR_SPMF 0x0F000000 /* SPMF */
537#define SPMR_CKID 0x00800000 /* CKID */
Jon Loeligerde1d0a62005-08-01 13:20:47 -0500538#define SPMR_CKID_SHIFT 23
Eran Libertyf046ccd2005-07-28 10:08:46 -0500539#define SPMR_COREPLL 0x007F0000 /* COREPLL */
540#define SPMR_CEVCOD 0x000000C0 /* CEVCOD */
541#define SPMR_CEPDF 0x00000020 /* CEPDF */
542#define SPMR_CEPMF 0x0000001F /* CEPMF */
Jon Loeligerde1d0a62005-08-01 13:20:47 -0500543#define SPMR_RES ~(SPMR_LBIUCM | SPMR_DDRCM | SPMR_SVCOD \
544 | SPMR_SPMF | SPMR_CKID | SPMR_COREPLL \
545 | SPMR_CEVCOD | SPMR_CEPDF | SPMR_CEPMF)
546 u32 occr; /* output clock control Register */
Eran Libertyf046ccd2005-07-28 10:08:46 -0500547#define OCCR_PCICOE0 0x80000000 /* PCICOE0 */
548#define OCCR_PCICOE1 0x40000000 /* PCICOE1 */
549#define OCCR_PCICOE2 0x20000000 /* PCICOE2 */
550#define OCCR_PCICOE3 0x10000000 /* PCICOE3 */
551#define OCCR_PCICOE4 0x08000000 /* PCICOE4 */
552#define OCCR_PCICOE5 0x04000000 /* PCICOE5 */
553#define OCCR_PCICOE6 0x02000000 /* PCICOE6 */
554#define OCCR_PCICOE7 0x01000000 /* PCICOE7 */
555#define OCCR_PCICD0 0x00800000 /* PCICD0 */
556#define OCCR_PCICD1 0x00400000 /* PCICD1 */
557#define OCCR_PCICD2 0x00200000 /* PCICD2 */
558#define OCCR_PCICD3 0x00100000 /* PCICD3 */
559#define OCCR_PCICD4 0x00080000 /* PCICD4 */
560#define OCCR_PCICD5 0x00040000 /* PCICD5 */
561#define OCCR_PCICD6 0x00020000 /* PCICD6 */
562#define OCCR_PCICD7 0x00010000 /* PCICD7 */
563#define OCCR_PCI1CR 0x00000002 /* PCI1CR */
564#define OCCR_PCI2CR 0x00000001 /* PCI2CR */
Jon Loeligerde1d0a62005-08-01 13:20:47 -0500565#define OCCR_RES ~(OCCR_PCICOE0 | OCCR_PCICOE1 | OCCR_PCICOE2 \
566 | OCCR_PCICOE3 | OCCR_PCICOE4 | OCCR_PCICOE5 \
567 | OCCR_PCICOE6 | OCCR_PCICOE7 | OCCR_PCICD0 \
568 | OCCR_PCICD1 | OCCR_PCICD2 | OCCR_PCICD3 \
569 | OCCR_PCICD4 | OCCR_PCICD5 | OCCR_PCICD6 \
570 | OCCR_PCICD7 | OCCR_PCI1CR | OCCR_PCI2CR )
571 u32 sccr; /* system clock control Register */
Eran Libertyf046ccd2005-07-28 10:08:46 -0500572#define SCCR_TSEC1CM 0xc0000000 /* TSEC1CM */
573#define SCCR_TSEC1CM_SHIFT 30
574#define SCCR_TSEC2CM 0x30000000 /* TSEC2CM */
575#define SCCR_TSEC2CM_SHIFT 28
576#define SCCR_ENCCM 0x03000000 /* ENCCM */
577#define SCCR_ENCCM_SHIFT 24
578#define SCCR_USBMPHCM 0x00c00000 /* USBMPHCM */
579#define SCCR_USBMPHCM_SHIFT 22
580#define SCCR_USBDRCM 0x00300000 /* USBDRCM */
581#define SCCR_USBDRCM_SHIFT 20
582#define SCCR_PCICM 0x00010000 /* PCICM */
Jon Loeligerde1d0a62005-08-01 13:20:47 -0500583#define SCCR_RES ~( SCCR_TSEC1CM | SCCR_TSEC2CM | SCCR_ENCCM \
584 | SCCR_USBMPHCM | SCCR_USBDRCM | SCCR_PCICM)
Eran Libertyf046ccd2005-07-28 10:08:46 -0500585 u8 res0[0xF4];
Dave Liuf6eda7f2006-10-25 14:41:21 -0500586} clk83xx_t;
Eran Libertyf046ccd2005-07-28 10:08:46 -0500587
588/*
589 * Power Management Control Module
590 */
Dave Liuf6eda7f2006-10-25 14:41:21 -0500591typedef struct pmc83xx {
Jon Loeligerde1d0a62005-08-01 13:20:47 -0500592 u32 pmccr; /* PMC Configuration Register */
Eran Libertyf046ccd2005-07-28 10:08:46 -0500593#define PMCCR_SLPEN 0x00000001 /* System Low Power Enable */
594#define PMCCR_DLPEN 0x00000002 /* DDR SDRAM Low Power Enable */
Dave Liuf6eda7f2006-10-25 14:41:21 -0500595#define PMCCR_RES ~(PMCCR_SLPEN | PMCCR_DLPEN)
Jon Loeligerde1d0a62005-08-01 13:20:47 -0500596 u32 pmcer; /* PMC Event Register */
Eran Libertyf046ccd2005-07-28 10:08:46 -0500597#define PMCER_PMCI 0x00000001 /* PMC Interrupt */
598#define PMCER_RES ~(PMCER_PMCI)
Jon Loeligerde1d0a62005-08-01 13:20:47 -0500599 u32 pmcmr; /* PMC Mask Register */
Eran Libertyf046ccd2005-07-28 10:08:46 -0500600#define PMCMR_PMCIE 0x0001 /* PMC Interrupt Enable */
601#define PMCMR_RES ~(PMCMR_PMCIE)
602 u8 res0[0xF4];
Dave Liuf6eda7f2006-10-25 14:41:21 -0500603} pmc83xx_t;
Eran Libertyf046ccd2005-07-28 10:08:46 -0500604
605/*
606 * general purpose I/O module
607 */
Dave Liuf6eda7f2006-10-25 14:41:21 -0500608typedef struct gpio83xx {
Eran Libertyf046ccd2005-07-28 10:08:46 -0500609 u32 dir; /* direction register */
Jon Loeligerde1d0a62005-08-01 13:20:47 -0500610 u32 odr; /* open drain register */
Eran Libertyf046ccd2005-07-28 10:08:46 -0500611 u32 dat; /* data register */
612 u32 ier; /* interrupt event register */
613 u32 imr; /* interrupt mask register */
614 u32 icr; /* external interrupt control register */
615 u8 res0[0xE8];
Dave Liuf6eda7f2006-10-25 14:41:21 -0500616} gpio83xx_t;
Eran Libertyf046ccd2005-07-28 10:08:46 -0500617
Jon Loeligerde1d0a62005-08-01 13:20:47 -0500618/*
Eran Libertyf046ccd2005-07-28 10:08:46 -0500619 * DDR Memory Controller Memory Map
620 */
621typedef struct ddr_cs_bnds{
Jon Loeligerde1d0a62005-08-01 13:20:47 -0500622 u32 csbnds;
Eran Libertyf046ccd2005-07-28 10:08:46 -0500623#define CSBNDS_SA 0x00FF0000
Marian Balakowicze6f2e902005-10-11 19:09:42 +0200624#define CSBNDS_SA_SHIFT 8
Eran Libertyf046ccd2005-07-28 10:08:46 -0500625#define CSBNDS_EA 0x000000FF
Marian Balakowicze6f2e902005-10-11 19:09:42 +0200626#define CSBNDS_EA_SHIFT 24
Jon Loeligerde1d0a62005-08-01 13:20:47 -0500627 u8 res0[4];
Eran Libertyf046ccd2005-07-28 10:08:46 -0500628} ddr_cs_bnds_t;
629
Dave Liuf6eda7f2006-10-25 14:41:21 -0500630typedef struct ddr83xx {
Jon Loeligerde1d0a62005-08-01 13:20:47 -0500631 ddr_cs_bnds_t csbnds[4]; /**< Chip Select x Memory Bounds */
632 u8 res0[0x60];
633 u32 cs_config[4]; /**< Chip Select x Configuration */
Eran Libertyf046ccd2005-07-28 10:08:46 -0500634#define CSCONFIG_EN 0x80000000
635#define CSCONFIG_AP 0x00800000
636#define CSCONFIG_ROW_BIT 0x00000700
637#define CSCONFIG_ROW_BIT_12 0x00000000
638#define CSCONFIG_ROW_BIT_13 0x00000100
639#define CSCONFIG_ROW_BIT_14 0x00000200
640#define CSCONFIG_COL_BIT 0x00000007
641#define CSCONFIG_COL_BIT_8 0x00000000
642#define CSCONFIG_COL_BIT_9 0x00000001
643#define CSCONFIG_COL_BIT_10 0x00000002
644#define CSCONFIG_COL_BIT_11 0x00000003
Jon Loeligerde1d0a62005-08-01 13:20:47 -0500645 u8 res1[0x78];
646 u32 timing_cfg_1; /**< SDRAM Timing Configuration 1 */
Eran Libertyf046ccd2005-07-28 10:08:46 -0500647#define TIMING_CFG1_PRETOACT 0x70000000
648#define TIMING_CFG1_PRETOACT_SHIFT 28
649#define TIMING_CFG1_ACTTOPRE 0x0F000000
650#define TIMING_CFG1_ACTTOPRE_SHIFT 24
651#define TIMING_CFG1_ACTTORW 0x00700000
652#define TIMING_CFG1_ACTTORW_SHIFT 20
653#define TIMING_CFG1_CASLAT 0x00070000
654#define TIMING_CFG1_CASLAT_SHIFT 16
655#define TIMING_CFG1_REFREC 0x0000F000
656#define TIMING_CFG1_REFREC_SHIFT 12
657#define TIMING_CFG1_WRREC 0x00000700
658#define TIMING_CFG1_WRREC_SHIFT 8
659#define TIMING_CFG1_ACTTOACT 0x00000070
Jon Loeligerde1d0a62005-08-01 13:20:47 -0500660#define TIMING_CFG1_ACTTOACT_SHIFT 4
Eran Libertyf046ccd2005-07-28 10:08:46 -0500661#define TIMING_CFG1_WRTORD 0x00000007
662#define TIMING_CFG1_WRTORD_SHIFT 0
Marian Balakowicze6f2e902005-10-11 19:09:42 +0200663#define TIMING_CFG1_CASLAT_20 0x00030000 /* CAS latency = 2.0 */
664#define TIMING_CFG1_CASLAT_25 0x00040000 /* CAS latency = 2.5 */
Eran Libertyf046ccd2005-07-28 10:08:46 -0500665
Jon Loeligerde1d0a62005-08-01 13:20:47 -0500666 u32 timing_cfg_2; /**< SDRAM Timing Configuration 2 */
Eran Libertyf046ccd2005-07-28 10:08:46 -0500667#define TIMING_CFG2_CPO 0x0F000000
668#define TIMING_CFG2_CPO_SHIFT 24
669#define TIMING_CFG2_ACSM 0x00080000
Jon Loeligerde1d0a62005-08-01 13:20:47 -0500670#define TIMING_CFG2_WR_DATA_DELAY 0x00001C00
Eran Libertyf046ccd2005-07-28 10:08:46 -0500671#define TIMING_CFG2_WR_DATA_DELAY_SHIFT 10
Marian Balakowicze6f2e902005-10-11 19:09:42 +0200672#define TIMING_CFG2_CPO_DEF 0x00000000 /* default (= CASLAT + 1) */
Eran Libertyf046ccd2005-07-28 10:08:46 -0500673
Jon Loeligerde1d0a62005-08-01 13:20:47 -0500674 u32 sdram_cfg; /**< SDRAM Control Configuration */
Eran Libertyf046ccd2005-07-28 10:08:46 -0500675#define SDRAM_CFG_MEM_EN 0x80000000
676#define SDRAM_CFG_SREN 0x40000000
677#define SDRAM_CFG_ECC_EN 0x20000000
678#define SDRAM_CFG_RD_EN 0x10000000
679#define SDRAM_CFG_SDRAM_TYPE 0x03000000
680#define SDRAM_CFG_SDRAM_TYPE_SHIFT 24
681#define SDRAM_CFG_DYN_PWR 0x00200000
682#define SDRAM_CFG_32_BE 0x00080000
683#define SDRAM_CFG_8_BE 0x00040000
684#define SDRAM_CFG_NCAP 0x00020000
685#define SDRAM_CFG_2T_EN 0x00008000
Marian Balakowicze6f2e902005-10-11 19:09:42 +0200686#define SDRAM_CFG_SDRAM_TYPE_DDR 0x02000000
Eran Libertyf046ccd2005-07-28 10:08:46 -0500687
Jon Loeligerde1d0a62005-08-01 13:20:47 -0500688 u8 res2[4];
689 u32 sdram_mode; /**< SDRAM Mode Configuration */
690#define SDRAM_MODE_ESD 0xFFFF0000
691#define SDRAM_MODE_ESD_SHIFT 16
Eran Libertyf046ccd2005-07-28 10:08:46 -0500692#define SDRAM_MODE_SD 0x0000FFFF
693#define SDRAM_MODE_SD_SHIFT 0
Marian Balakowicze6f2e902005-10-11 19:09:42 +0200694#define DDR_MODE_EXT_MODEREG 0x4000 /* select extended mode reg */
695#define DDR_MODE_EXT_OPMODE 0x3FF8 /* operating mode, mask */
696#define DDR_MODE_EXT_OP_NORMAL 0x0000 /* normal operation */
697#define DDR_MODE_QFC 0x0004 /* QFC / compatibility, mask */
698#define DDR_MODE_QFC_COMP 0x0000 /* compatible to older SDRAMs */
699#define DDR_MODE_WEAK 0x0002 /* weak drivers */
700#define DDR_MODE_DLL_DIS 0x0001 /* disable DLL */
701#define DDR_MODE_CASLAT 0x0070 /* CAS latency, mask */
702#define DDR_MODE_CASLAT_15 0x0010 /* CAS latency 1.5 */
703#define DDR_MODE_CASLAT_20 0x0020 /* CAS latency 2 */
704#define DDR_MODE_CASLAT_25 0x0060 /* CAS latency 2.5 */
705#define DDR_MODE_CASLAT_30 0x0030 /* CAS latency 3 */
706#define DDR_MODE_BTYPE_SEQ 0x0000 /* sequential burst */
707#define DDR_MODE_BTYPE_ILVD 0x0008 /* interleaved burst */
708#define DDR_MODE_BLEN_2 0x0001 /* burst length 2 */
709#define DDR_MODE_BLEN_4 0x0002 /* burst length 4 */
710#define DDR_REFINT_166MHZ_7US 1302 /* exact value for 7.8125 µs */
711#define DDR_BSTOPRE 256 /* use 256 cycles as a starting point */
712#define DDR_MODE_MODEREG 0x0000 /* select mode register */
Eran Libertyf046ccd2005-07-28 10:08:46 -0500713
Jon Loeligerde1d0a62005-08-01 13:20:47 -0500714 u8 res3[8];
715 u32 sdram_interval; /**< SDRAM Interval Configuration */
Eran Libertyf046ccd2005-07-28 10:08:46 -0500716#define SDRAM_INTERVAL_REFINT 0x3FFF0000
717#define SDRAM_INTERVAL_REFINT_SHIFT 16
718#define SDRAM_INTERVAL_BSTOPRE 0x00003FFF
719#define SDRAM_INTERVAL_BSTOPRE_SHIFT 0
Jon Loeligerde1d0a62005-08-01 13:20:47 -0500720 u8 res9[8];
721 u32 sdram_clk_cntl;
Marian Balakowicze6f2e902005-10-11 19:09:42 +0200722#define DDR_SDRAM_CLK_CNTL_SS_EN 0x80000000
Marian Balakowicze24e0f02006-03-14 16:03:46 +0100723#define DDR_SDRAM_CLK_CNTL_CLK_ADJUST_025 0x01000000
Marian Balakowicze6f2e902005-10-11 19:09:42 +0200724#define DDR_SDRAM_CLK_CNTL_CLK_ADJUST_05 0x02000000
Marian Balakowicze24e0f02006-03-14 16:03:46 +0100725#define DDR_SDRAM_CLK_CNTL_CLK_ADJUST_075 0x03000000
726#define DDR_SDRAM_CLK_CNTL_CLK_ADJUST_1 0x04000000
Marian Balakowicze6f2e902005-10-11 19:09:42 +0200727
Jon Loeligerde1d0a62005-08-01 13:20:47 -0500728 u8 res4[0xCCC];
729 u32 data_err_inject_hi; /**< Memory Data Path Error Injection Mask High */
730 u32 data_err_inject_lo; /**< Memory Data Path Error Injection Mask Low */
731 u32 ecc_err_inject; /**< Memory Data Path Error Injection Mask ECC */
Marian Balakowicze24e0f02006-03-14 16:03:46 +0100732#define ECC_ERR_INJECT_EMB (0x80000000>>22) /* ECC Mirror Byte */
733#define ECC_ERR_INJECT_EIEN (0x80000000>>23) /* Error Injection Enable */
Marian Balakowicz97f98002006-03-16 14:35:32 +0100734#define ECC_ERR_INJECT_EEIM (0xff000000>>24) /* ECC Erroe Injection Enable */
Marian Balakowicze24e0f02006-03-14 16:03:46 +0100735#define ECC_ERR_INJECT_EEIM_SHIFT 0
Jon Loeligerde1d0a62005-08-01 13:20:47 -0500736 u8 res5[0x14];
737 u32 capture_data_hi; /**< Memory Data Path Read Capture High */
738 u32 capture_data_lo; /**< Memory Data Path Read Capture Low */
739 u32 capture_ecc; /**< Memory Data Path Read Capture ECC */
Marian Balakowicz97f98002006-03-16 14:35:32 +0100740#define CAPTURE_ECC_ECE (0xff000000>>24)
Marian Balakowicze24e0f02006-03-14 16:03:46 +0100741#define CAPTURE_ECC_ECE_SHIFT 0
Jon Loeligerde1d0a62005-08-01 13:20:47 -0500742 u8 res6[0x14];
743 u32 err_detect; /**< Memory Error Detect */
Marian Balakowicze24e0f02006-03-14 16:03:46 +0100744#define ECC_ERROR_DETECT_MME (0x80000000>>0) /* Multiple Memory Errors */
745#define ECC_ERROR_DETECT_MBE (0x80000000>>28) /* Multiple-Bit Error */
746#define ECC_ERROR_DETECT_SBE (0x80000000>>29) /* Single-Bit ECC Error Pickup */
747#define ECC_ERROR_DETECT_MSE (0x80000000>>31) /* Memory Select Error */
Jon Loeligerde1d0a62005-08-01 13:20:47 -0500748 u32 err_disable; /**< Memory Error Disable */
Marian Balakowicze24e0f02006-03-14 16:03:46 +0100749#define ECC_ERROR_DISABLE_MBED (0x80000000>>28) /* Multiple-Bit ECC Error Disable */
750#define ECC_ERROR_DISABLE_SBED (0x80000000>>29) /* Sinle-Bit ECC Error disable */
751#define ECC_ERROR_DISABLE_MSED (0x80000000>>31) /* Memory Select Error Disable */
752#define ECC_ERROR_ENABLE ~(ECC_ERROR_DISABLE_MSED|ECC_ERROR_DISABLE_SBED|ECC_ERROR_DISABLE_MBED)
Jon Loeligerde1d0a62005-08-01 13:20:47 -0500753 u32 err_int_en; /**< Memory Error Interrupt Enable */
Marian Balakowicze24e0f02006-03-14 16:03:46 +0100754#define ECC_ERR_INT_EN_MBEE (0x80000000>>28) /* Multiple-Bit ECC Error Interrupt Enable */
755#define ECC_ERR_INT_EN_SBEE (0x80000000>>29) /* Single-Bit ECC Error Interrupt Enable */
756#define ECC_ERR_INT_EN_MSEE (0x80000000>>31) /* Memory Select Error Interrupt Enable */
757#define ECC_ERR_INT_DISABLE ~(ECC_ERR_INT_EN_MBEE|ECC_ERR_INT_EN_SBEE|ECC_ERR_INT_EN_MSEE)
Jon Loeligerde1d0a62005-08-01 13:20:47 -0500758 u32 capture_attributes; /**< Memory Error Attributes Capture */
Marian Balakowicze24e0f02006-03-14 16:03:46 +0100759#define ECC_CAPT_ATTR_BNUM (0xe0000000>>1) /* Data Beat Num */
760#define ECC_CAPT_ATTR_BNUM_SHIFT 28
761#define ECC_CAPT_ATTR_TSIZ (0xc0000000>>6) /* Transaction Size */
762#define ECC_CAPT_ATTR_TSIZ_FOUR_DW 0
763#define ECC_CAPT_ATTR_TSIZ_ONE_DW 1
764#define ECC_CAPT_ATTR_TSIZ_TWO_DW 2
765#define ECC_CAPT_ATTR_TSIZ_THREE_DW 3
766#define ECC_CAPT_ATTR_TSIZ_SHIFT 24
767#define ECC_CAPT_ATTR_TSRC (0xf8000000>>11) /* Transaction Source */
768#define ECC_CAPT_ATTR_TSRC_E300_CORE_DT 0x0
769#define ECC_CAPT_ATTR_TSRC_E300_CORE_IF 0x2
770#define ECC_CAPT_ATTR_TSRC_TSEC1 0x4
771#define ECC_CAPT_ATTR_TSRC_TSEC2 0x5
772#define ECC_CAPT_ATTR_TSRC_USB (0x06|0x07)
773#define ECC_CAPT_ATTR_TSRC_ENCRYPT 0x8
774#define ECC_CAPT_ATTR_TSRC_I2C 0x9
775#define ECC_CAPT_ATTR_TSRC_JTAG 0xA
776#define ECC_CAPT_ATTR_TSRC_PCI1 0xD
777#define ECC_CAPT_ATTR_TSRC_PCI2 0xE
778#define ECC_CAPT_ATTR_TSRC_DMA 0xF
779#define ECC_CAPT_ATTR_TSRC_SHIFT 16
780#define ECC_CAPT_ATTR_TTYP (0xe0000000>>18) /* Transaction Type */
781#define ECC_CAPT_ATTR_TTYP_WRITE 0x1
782#define ECC_CAPT_ATTR_TTYP_READ 0x2
783#define ECC_CAPT_ATTR_TTYP_R_M_W 0x3
784#define ECC_CAPT_ATTR_TTYP_SHIFT 12
785#define ECC_CAPT_ATTR_VLD (0x80000000>>31) /* Valid */
Jon Loeligerde1d0a62005-08-01 13:20:47 -0500786 u32 capture_address; /**< Memory Error Address Capture */
787 u32 capture_ext_address;/**< Memory Error Extended Address Capture */
788 u32 err_sbe; /**< Memory Single-Bit ECC Error Management */
Marian Balakowicze24e0f02006-03-14 16:03:46 +0100789#define ECC_ERROR_MAN_SBET (0xff000000>>8) /* Single-Bit Error Threshold 0..255*/
790#define ECC_ERROR_MAN_SBET_SHIFT 16
791#define ECC_ERROR_MAN_SBEC (0xff000000>>24) /* Single Bit Error Counter 0..255*/
792#define ECC_ERROR_MAN_SBEC_SHIFT 0
Jon Loeligerde1d0a62005-08-01 13:20:47 -0500793 u8 res7[0xA4];
Eran Libertyf046ccd2005-07-28 10:08:46 -0500794 u32 debug_reg;
Jon Loeligerde1d0a62005-08-01 13:20:47 -0500795 u8 res8[0xFC];
Dave Liuf6eda7f2006-10-25 14:41:21 -0500796} ddr83xx_t;
Eran Libertyf046ccd2005-07-28 10:08:46 -0500797
798/*
799 * I2C1 Controller
Jon Loeligerde1d0a62005-08-01 13:20:47 -0500800 */
Eran Libertyf046ccd2005-07-28 10:08:46 -0500801
802
803/*
804 * DUART
805 */
Dave Liuf6eda7f2006-10-25 14:41:21 -0500806typedef struct duart83xx{
Jon Loeligerde1d0a62005-08-01 13:20:47 -0500807 u8 urbr_ulcr_udlb; /**< combined register for URBR, UTHR and UDLB */
808 u8 uier_udmb; /**< combined register for UIER and UDMB */
809 u8 uiir_ufcr_uafr; /**< combined register for UIIR, UFCR and UAFR */
810 u8 ulcr; /**< line control register */
811 u8 umcr; /**< MODEM control register */
812 u8 ulsr; /**< line status register */
813 u8 umsr; /**< MODEM status register */
814 u8 uscr; /**< scratch register */
815 u8 res0[8];
816 u8 udsr; /**< DMA status register */
817 u8 res1[3];
818 u8 res2[0xEC];
Dave Liuf6eda7f2006-10-25 14:41:21 -0500819} duart83xx_t;
Eran Libertyf046ccd2005-07-28 10:08:46 -0500820
821/*
822 * Local Bus Controller Registers
823 */
824typedef struct lbus_bank{
Jon Loeligerde1d0a62005-08-01 13:20:47 -0500825 u32 br; /**< Base Register */
826 u32 or; /**< Base Register */
Eran Libertyf046ccd2005-07-28 10:08:46 -0500827} lbus_bank_t;
828
Dave Liuf6eda7f2006-10-25 14:41:21 -0500829typedef struct lbus83xx {
Jon Loeligerde1d0a62005-08-01 13:20:47 -0500830 lbus_bank_t bank[8];
831 u8 res0[0x28];
832 u32 mar; /**< UPM Address Register */
833 u8 res1[0x4];
834 u32 mamr; /**< UPMA Mode Register */
835 u32 mbmr; /**< UPMB Mode Register */
836 u32 mcmr; /**< UPMC Mode Register */
837 u8 res2[0x8];
838 u32 mrtpr; /**< Memory Refresh Timer Prescaler Register */
839 u32 mdr; /**< UPM Data Register */
840 u8 res3[0x8];
841 u32 lsdmr; /**< SDRAM Mode Register */
842 u8 res4[0x8];
843 u32 lurt; /**< UPM Refresh Timer */
844 u32 lsrt; /**< SDRAM Refresh Timer */
845 u8 res5[0x8];
846 u32 ltesr; /**< Transfer Error Status Register */
847 u32 ltedr; /**< Transfer Error Disable Register */
848 u32 lteir; /**< Transfer Error Interrupt Register */
849 u32 lteatr; /**< Transfer Error Attributes Register */
850 u32 ltear; /**< Transfer Error Address Register */
851 u8 res6[0xC];
852 u32 lbcr; /**< Configuration Register */
Eran Libertyf046ccd2005-07-28 10:08:46 -0500853#define LBCR_LDIS 0x80000000
854#define LBCR_LDIS_SHIFT 31
855#define LBCR_BCTLC 0x00C00000
856#define LBCR_BCTLC_SHIFT 22
857#define LBCR_LPBSE 0x00020000
Jon Loeligerde1d0a62005-08-01 13:20:47 -0500858#define LBCR_LPBSE_SHIFT 17
Eran Libertyf046ccd2005-07-28 10:08:46 -0500859#define LBCR_EPAR 0x00010000
860#define LBCR_EPAR_SHIFT 16
861#define LBCR_BMT 0x0000FF00
862#define LBCR_BMT_SHIFT 8
Jon Loeligerde1d0a62005-08-01 13:20:47 -0500863 u32 lcrr; /**< Clock Ratio Register */
Eran Libertyf046ccd2005-07-28 10:08:46 -0500864#define LCRR_DBYP 0x80000000
865#define LCRR_DBYP_SHIFT 31
866#define LCRR_BUFCMDC 0x30000000
867#define LCRR_BUFCMDC_SHIFT 28
868#define LCRR_ECL 0x03000000
869#define LCRR_ECL_SHIFT 24
870#define LCRR_EADC 0x00030000
871#define LCRR_EADC_SHIFT 16
872#define LCRR_CLKDIV 0x0000000F
873#define LCRR_CLKDIV_SHIFT 0
874
875
Jon Loeligerde1d0a62005-08-01 13:20:47 -0500876 u8 res7[0x28];
877 u8 res8[0xF00];
Dave Liuf6eda7f2006-10-25 14:41:21 -0500878} lbus83xx_t;
Eran Libertyf046ccd2005-07-28 10:08:46 -0500879
880/*
881 * Serial Peripheral Interface
882 */
Dave Liuf6eda7f2006-10-25 14:41:21 -0500883typedef struct spi83xx
Eran Libertyf046ccd2005-07-28 10:08:46 -0500884{
Jon Loeligerde1d0a62005-08-01 13:20:47 -0500885 u32 mode; /**< mode register */
886 u32 event; /**< event register */
887 u32 mask; /**< mask register */
888 u32 com; /**< command register */
889 u8 res0[0x10];
890 u32 tx; /**< transmit register */
891 u32 rx; /**< receive register */
892 u8 res1[0xD8];
Dave Liuf6eda7f2006-10-25 14:41:21 -0500893} spi83xx_t;
Jon Loeligerde1d0a62005-08-01 13:20:47 -0500894
Marian Balakowicz61f25152006-03-14 16:14:48 +0100895
896/*
897 * DMA/Messaging Unit
898 */
Dave Liuf6eda7f2006-10-25 14:41:21 -0500899typedef struct dma83xx {
Marian Balakowicz61f25152006-03-14 16:14:48 +0100900 u32 res0[0xC]; /* 0x0-0x29 reseverd */
901 u32 omisr; /* 0x30 Outbound message interrupt status register */
902 u32 omimr; /* 0x34 Outbound message interrupt mask register */
903 u32 res1[0x6]; /* 0x38-0x49 reserved */
904
905 u32 imr0; /* 0x50 Inbound message register 0 */
906 u32 imr1; /* 0x54 Inbound message register 1 */
907 u32 omr0; /* 0x58 Outbound message register 0 */
908 u32 omr1; /* 0x5C Outbound message register 1 */
909
910 u32 odr; /* 0x60 Outbound doorbell register */
911 u32 res2; /* 0x64-0x67 reserved */
912 u32 idr; /* 0x68 Inbound doorbell register */
913 u32 res3[0x5]; /* 0x6C-0x79 reserved */
914
915 u32 imisr; /* 0x80 Inbound message interrupt status register */
916 u32 imimr; /* 0x84 Inbound message interrupt mask register */
917 u32 res4[0x1E]; /* 0x88-0x99 reserved */
918
919 u32 dmamr0; /* 0x100 DMA 0 mode register */
920 u32 dmasr0; /* 0x104 DMA 0 status register */
921 u32 dmacdar0; /* 0x108 DMA 0 current descriptor address register */
922 u32 res5; /* 0x10C reserved */
923 u32 dmasar0; /* 0x110 DMA 0 source address register */
924 u32 res6; /* 0x114 reserved */
925 u32 dmadar0; /* 0x118 DMA 0 destination address register */
926 u32 res7; /* 0x11C reserved */
927 u32 dmabcr0; /* 0x120 DMA 0 byte count register */
928 u32 dmandar0; /* 0x124 DMA 0 next descriptor address register */
929 u32 res8[0x16]; /* 0x128-0x179 reserved */
930
931 u32 dmamr1; /* 0x180 DMA 1 mode register */
932 u32 dmasr1; /* 0x184 DMA 1 status register */
933 u32 dmacdar1; /* 0x188 DMA 1 current descriptor address register */
934 u32 res9; /* 0x18C reserved */
935 u32 dmasar1; /* 0x190 DMA 1 source address register */
936 u32 res10; /* 0x194 reserved */
937 u32 dmadar1; /* 0x198 DMA 1 destination address register */
938 u32 res11; /* 0x19C reserved */
939 u32 dmabcr1; /* 0x1A0 DMA 1 byte count register */
940 u32 dmandar1; /* 0x1A4 DMA 1 next descriptor address register */
941 u32 res12[0x16];/* 0x1A8-0x199 reserved */
942
943 u32 dmamr2; /* 0x200 DMA 2 mode register */
944 u32 dmasr2; /* 0x204 DMA 2 status register */
945 u32 dmacdar2; /* 0x208 DMA 2 current descriptor address register */
946 u32 res13; /* 0x20C reserved */
947 u32 dmasar2; /* 0x210 DMA 2 source address register */
948 u32 res14; /* 0x214 reserved */
949 u32 dmadar2; /* 0x218 DMA 2 destination address register */
950 u32 res15; /* 0x21C reserved */
951 u32 dmabcr2; /* 0x220 DMA 2 byte count register */
952 u32 dmandar2; /* 0x224 DMA 2 next descriptor address register */
953 u32 res16[0x16];/* 0x228-0x279 reserved */
954
955 u32 dmamr3; /* 0x280 DMA 3 mode register */
956 u32 dmasr3; /* 0x284 DMA 3 status register */
957 u32 dmacdar3; /* 0x288 DMA 3 current descriptor address register */
958 u32 res17; /* 0x28C reserved */
959 u32 dmasar3; /* 0x290 DMA 3 source address register */
960 u32 res18; /* 0x294 reserved */
961 u32 dmadar3; /* 0x298 DMA 3 destination address register */
962 u32 res19; /* 0x29C reserved */
963 u32 dmabcr3; /* 0x2A0 DMA 3 byte count register */
964 u32 dmandar3; /* 0x2A4 DMA 3 next descriptor address register */
965
966 u32 dmagsr; /* 0x2A8 DMA general status register */
967 u32 res20[0x15];/* 0x2AC-0x2FF reserved */
Dave Liuf6eda7f2006-10-25 14:41:21 -0500968} dma83xx_t;
Eran Libertyf046ccd2005-07-28 10:08:46 -0500969
Marian Balakowicz61f25152006-03-14 16:14:48 +0100970/* DMAMRn bits */
971#define DMA_CHANNEL_START (0x00000001) /* Bit - DMAMRn CS */
972#define DMA_CHANNEL_TRANSFER_MODE_DIRECT (0x00000004) /* Bit - DMAMRn CTM */
973#define DMA_CHANNEL_SOURCE_ADRESSS_HOLD_EN (0x00001000) /* Bit - DMAMRn SAHE */
974#define DMA_CHANNEL_SOURCE_ADDRESS_HOLD_1B (0x00000000) /* 2Bit- DMAMRn SAHTS 1byte */
975#define DMA_CHANNEL_SOURCE_ADDRESS_HOLD_2B (0x00004000) /* 2Bit- DMAMRn SAHTS 2bytes */
976#define DMA_CHANNEL_SOURCE_ADDRESS_HOLD_4B (0x00008000) /* 2Bit- DMAMRn SAHTS 4bytes */
977#define DMA_CHANNEL_SOURCE_ADDRESS_HOLD_8B (0x0000c000) /* 2Bit- DMAMRn SAHTS 8bytes */
978#define DMA_CHANNEL_SNOOP (0x00010000) /* Bit - DMAMRn DMSEN */
979
980/* DMASRn bits */
981#define DMA_CHANNEL_BUSY (0x00000004) /* Bit - DMASRn CB */
982#define DMA_CHANNEL_TRANSFER_ERROR (0x00000080) /* Bit - DMASRn TE */
983
Eran Libertyf046ccd2005-07-28 10:08:46 -0500984/*
985 * PCI Software Configuration Registers
986 */
Dave Liuf6eda7f2006-10-25 14:41:21 -0500987typedef struct pciconf83xx {
Eran Libertyf046ccd2005-07-28 10:08:46 -0500988 u32 config_address;
989#define PCI_CONFIG_ADDRESS_EN 0x80000000
990#define PCI_CONFIG_ADDRESS_BN_SHIFT 16
991#define PCI_CONFIG_ADDRESS_BN_MASK 0x00ff0000
992#define PCI_CONFIG_ADDRESS_DN_SHIFT 11
993#define PCI_CONFIG_ADDRESS_DN_MASK 0x0000f800
994#define PCI_CONFIG_ADDRESS_FN_SHIFT 8
995#define PCI_CONFIG_ADDRESS_FN_MASK 0x00000700
996#define PCI_CONFIG_ADDRESS_RN_SHIFT 0
997#define PCI_CONFIG_ADDRESS_RN_MASK 0x000000fc
998 u32 config_data;
999 u32 int_ack;
1000 u8 res[116];
Dave Liuf6eda7f2006-10-25 14:41:21 -05001001} pciconf83xx_t;
Eran Libertyf046ccd2005-07-28 10:08:46 -05001002
1003/*
1004 * PCI Outbound Translation Register
1005 */
1006typedef struct pci_outbound_window {
1007 u32 potar;
1008 u8 res0[4];
1009 u32 pobar;
1010 u8 res1[4];
1011 u32 pocmr;
1012 u8 res2[4];
Dave Liuf6eda7f2006-10-25 14:41:21 -05001013} pot83xx_t;
Eran Libertyf046ccd2005-07-28 10:08:46 -05001014/*
1015 * Sequencer
Jon Loeligerde1d0a62005-08-01 13:20:47 -05001016 */
Dave Liuf6eda7f2006-10-25 14:41:21 -05001017typedef struct ios83xx {
1018 pot83xx_t pot[6];
Eran Libertyf046ccd2005-07-28 10:08:46 -05001019#define POTAR_TA_MASK 0x000fffff
1020#define POBAR_BA_MASK 0x000fffff
1021#define POCMR_EN 0x80000000
1022#define POCMR_IO 0x40000000 /* 0--memory space 1--I/O space */
1023#define POCMR_SE 0x20000000 /* streaming enable */
1024#define POCMR_DST 0x10000000 /* 0--PCI1 1--PCI2*/
1025#define POCMR_CM_MASK 0x000fffff
1026#define POCMR_CM_4G 0x00000000
1027#define POCMR_CM_2G 0x00080000
1028#define POCMR_CM_1G 0x000C0000
1029#define POCMR_CM_512M 0x000E0000
1030#define POCMR_CM_256M 0x000F0000
1031#define POCMR_CM_128M 0x000F8000
1032#define POCMR_CM_64M 0x000FC000
1033#define POCMR_CM_32M 0x000FE000
1034#define POCMR_CM_16M 0x000FF000
1035#define POCMR_CM_8M 0x000FF800
1036#define POCMR_CM_4M 0x000FFC00
1037#define POCMR_CM_2M 0x000FFE00
1038#define POCMR_CM_1M 0x000FFF00
1039#define POCMR_CM_512K 0x000FFF80
1040#define POCMR_CM_256K 0x000FFFC0
1041#define POCMR_CM_128K 0x000FFFE0
1042#define POCMR_CM_64K 0x000FFFF0
1043#define POCMR_CM_32K 0x000FFFF8
1044#define POCMR_CM_16K 0x000FFFFC
1045#define POCMR_CM_8K 0x000FFFFE
1046#define POCMR_CM_4K 0x000FFFFF
1047 u8 res0[0x60];
1048 u32 pmcr;
1049 u8 res1[4];
1050 u32 dtcr;
1051 u8 res2[4];
Dave Liuf6eda7f2006-10-25 14:41:21 -05001052} ios83xx_t;
Eran Libertyf046ccd2005-07-28 10:08:46 -05001053
1054/*
1055 * PCI Controller Control and Status Registers
1056 */
Dave Liuf6eda7f2006-10-25 14:41:21 -05001057typedef struct pcictrl83xx {
Eran Libertyf046ccd2005-07-28 10:08:46 -05001058 u32 esr;
1059#define ESR_MERR 0x80000000
1060#define ESR_APAR 0x00000400
1061#define ESR_PCISERR 0x00000200
1062#define ESR_MPERR 0x00000100
1063#define ESR_TPERR 0x00000080
1064#define ESR_NORSP 0x00000040
1065#define ESR_TABT 0x00000020
1066 u32 ecdr;
1067#define ECDR_APAR 0x00000400
1068#define ECDR_PCISERR 0x00000200
1069#define ECDR_MPERR 0x00000100
1070#define ECDR_TPERR 0x00000080
1071#define ECDR_NORSP 0x00000040
1072#define ECDR_TABT 0x00000020
1073 u32 eer;
1074#define EER_APAR 0x00000400
1075#define EER_PCISERR 0x00000200
1076#define EER_MPERR 0x00000100
1077#define EER_TPERR 0x00000080
1078#define EER_NORSP 0x00000040
1079#define EER_TABT 0x00000020
1080 u32 eatcr;
1081#define EATCR_ERRTYPR_MASK 0x70000000
1082#define EATCR_ERRTYPR_APR 0x00000000 /* address parity error */
1083#define EATCR_ERRTYPR_WDPR 0x10000000 /* write data parity error */
1084#define EATCR_ERRTYPR_RDPR 0x20000000 /* read data parity error */
1085#define EATCR_ERRTYPR_MA 0x30000000 /* master abort */
1086#define EATCR_ERRTYPR_TA 0x40000000 /* target abort */
1087#define EATCR_ERRTYPR_SE 0x50000000 /* system error indication received */
1088#define EATCR_ERRTYPR_PEA 0x60000000 /* parity error indication received on a read */
1089#define EATCR_ERRTYPR_PEW 0x70000000 /* parity error indication received on a write */
1090#define EATCR_BN_MASK 0x0f000000 /* beat number */
1091#define EATCR_BN_1st 0x00000000
1092#define EATCR_BN_2ed 0x01000000
1093#define EATCR_BN_3rd 0x02000000
1094#define EATCR_BN_4th 0x03000000
1095#define EATCR_BN_5th 0x0400000
1096#define EATCR_BN_6th 0x05000000
1097#define EATCR_BN_7th 0x06000000
1098#define EATCR_BN_8th 0x07000000
1099#define EATCR_BN_9th 0x08000000
1100#define EATCR_TS_MASK 0x00300000 /* transaction size */
1101#define EATCR_TS_4 0x00000000
1102#define EATCR_TS_1 0x00100000
1103#define EATCR_TS_2 0x00200000
1104#define EATCR_TS_3 0x00300000
1105#define EATCR_ES_MASK 0x000f0000 /* error source */
1106#define EATCR_ES_EM 0x00000000 /* external master */
Jon Loeligerde1d0a62005-08-01 13:20:47 -05001107#define EATCR_ES_DMA 0x00050000
Eran Libertyf046ccd2005-07-28 10:08:46 -05001108#define EATCR_CMD_MASK 0x0000f000
1109#define EATCR_HBE_MASK 0x00000f00 /* PCI high byte enable*/
1110#define EATCR_BE_MASK 0x000000f0 /* PCI byte enable */
1111#define EATCR_HPB 0x00000004 /* high parity bit */
1112#define EATCR_PB 0x00000002 /* parity bit*/
1113#define EATCR_VI 0x00000001 /* error information valid */
1114 u32 eacr;
1115 u32 eeacr;
1116 u32 edlcr;
1117 u32 edhcr;
1118 u32 gcr;
1119 u32 ecr;
1120 u32 gsr;
1121 u8 res0[12];
1122 u32 pitar2;
1123 u8 res1[4];
1124 u32 pibar2;
1125 u32 piebar2;
1126 u32 piwar2;
1127 u8 res2[4];
1128 u32 pitar1;
1129 u8 res3[4];
1130 u32 pibar1;
1131 u32 piebar1;
1132 u32 piwar1;
1133 u8 res4[4];
1134 u32 pitar0;
1135 u8 res5[4];
1136 u32 pibar0;
1137 u8 res6[4];
1138 u32 piwar0;
1139 u8 res7[132];
1140#define PITAR_TA_MASK 0x000fffff
1141#define PIBAR_MASK 0xffffffff
1142#define PIEBAR_EBA_MASK 0x000fffff
1143#define PIWAR_EN 0x80000000
1144#define PIWAR_PF 0x20000000
1145#define PIWAR_RTT_MASK 0x000f0000
1146#define PIWAR_RTT_NO_SNOOP 0x00040000
1147#define PIWAR_RTT_SNOOP 0x00050000
1148#define PIWAR_WTT_MASK 0x0000f000
1149#define PIWAR_WTT_NO_SNOOP 0x00004000
Jon Loeligerde1d0a62005-08-01 13:20:47 -05001150#define PIWAR_WTT_SNOOP 0x00005000
Eran Libertyf046ccd2005-07-28 10:08:46 -05001151#define PIWAR_IWS_MASK 0x0000003F
1152#define PIWAR_IWS_4K 0x0000000B
1153#define PIWAR_IWS_8K 0x0000000C
1154#define PIWAR_IWS_16K 0x0000000D
1155#define PIWAR_IWS_32K 0x0000000E
1156#define PIWAR_IWS_64K 0x0000000F
1157#define PIWAR_IWS_128K 0x00000010
1158#define PIWAR_IWS_256K 0x00000011
1159#define PIWAR_IWS_512K 0x00000012
1160#define PIWAR_IWS_1M 0x00000013
1161#define PIWAR_IWS_2M 0x00000014
1162#define PIWAR_IWS_4M 0x00000015
1163#define PIWAR_IWS_8M 0x00000016
1164#define PIWAR_IWS_16M 0x00000017
1165#define PIWAR_IWS_32M 0x00000018
1166#define PIWAR_IWS_64M 0x00000019
1167#define PIWAR_IWS_128M 0x0000001A
1168#define PIWAR_IWS_256M 0x0000001B
1169#define PIWAR_IWS_512M 0x0000001C
1170#define PIWAR_IWS_1G 0x0000001D
1171#define PIWAR_IWS_2G 0x0000001E
Dave Liuf6eda7f2006-10-25 14:41:21 -05001172} pcictrl83xx_t;
Eran Libertyf046ccd2005-07-28 10:08:46 -05001173
1174/*
Jon Loeligerde1d0a62005-08-01 13:20:47 -05001175 * USB
Eran Libertyf046ccd2005-07-28 10:08:46 -05001176 */
Dave Liuf6eda7f2006-10-25 14:41:21 -05001177typedef struct usb83xx {
Eran Libertyf046ccd2005-07-28 10:08:46 -05001178 u8 fixme[0x2000];
Dave Liuf6eda7f2006-10-25 14:41:21 -05001179} usb83xx_t;
Eran Libertyf046ccd2005-07-28 10:08:46 -05001180
1181/*
1182 * TSEC
1183 */
Dave Liuf6eda7f2006-10-25 14:41:21 -05001184typedef struct tsec83xx {
Eran Libertyf046ccd2005-07-28 10:08:46 -05001185 u8 fixme[0x1000];
Dave Liuf6eda7f2006-10-25 14:41:21 -05001186} tsec83xx_t;
Eran Libertyf046ccd2005-07-28 10:08:46 -05001187
1188/*
1189 * Security
1190 */
Dave Liuf6eda7f2006-10-25 14:41:21 -05001191typedef struct security83xx {
Eran Libertyf046ccd2005-07-28 10:08:46 -05001192 u8 fixme[0x10000];
Dave Liuf6eda7f2006-10-25 14:41:21 -05001193} security83xx_t;
Eran Libertyf046ccd2005-07-28 10:08:46 -05001194
1195typedef struct immap {
Dave Liuf6eda7f2006-10-25 14:41:21 -05001196 sysconf83xx_t sysconf; /* System configuration */
1197 wdt83xx_t wdt; /* Watch Dog Timer (WDT) Registers */
1198 rtclk83xx_t rtc; /* Real Time Clock Module Registers */
1199 rtclk83xx_t pit; /* Periodic Interval Timer */
1200 gtm83xx_t gtm[2]; /* Global Timers Module */
1201 ipic83xx_t ipic; /* Integrated Programmable Interrupt Controller */
1202 arbiter83xx_t arbiter; /* System Arbiter Registers */
1203 reset83xx_t reset; /* Reset Module */
1204 clk83xx_t clk; /* System Clock Module */
1205 pmc83xx_t pmc; /* Power Management Control Module */
1206 gpio83xx_t pgio[2]; /* general purpose I/O module */
Eran Libertyf046ccd2005-07-28 10:08:46 -05001207 u8 res0[0x200];
1208 u8 DDL_DDR[0x100];
1209 u8 DDL_LBIU[0x100];
1210 u8 res1[0xE00];
Dave Liuf6eda7f2006-10-25 14:41:21 -05001211 ddr83xx_t ddr; /* DDR Memory Controller Memory */
Eran Libertyf046ccd2005-07-28 10:08:46 -05001212 i2c_t i2c[2]; /* I2C1 Controller */
1213 u8 res2[0x1300];
Dave Liuf6eda7f2006-10-25 14:41:21 -05001214 duart83xx_t duart[2];/* DUART */
Eran Libertyf046ccd2005-07-28 10:08:46 -05001215 u8 res3[0x900];
Dave Liuf6eda7f2006-10-25 14:41:21 -05001216 lbus83xx_t lbus; /* Local Bus Controller Registers */
Eran Libertyf046ccd2005-07-28 10:08:46 -05001217 u8 res4[0x1000];
Dave Liuf6eda7f2006-10-25 14:41:21 -05001218 spi83xx_t spi; /* Serial Peripheral Interface */
Eran Libertyf046ccd2005-07-28 10:08:46 -05001219 u8 res5[0xF00];
Dave Liuf6eda7f2006-10-25 14:41:21 -05001220 dma83xx_t dma; /* DMA */
1221 pciconf83xx_t pci_conf[2]; /* PCI Software Configuration Registers */
1222 ios83xx_t ios; /* Sequencer */
1223 pcictrl83xx_t pci_ctrl[2]; /* PCI Controller Control and Status Registers */
Eran Libertyf046ccd2005-07-28 10:08:46 -05001224 u8 res6[0x19900];
Dave Liuf6eda7f2006-10-25 14:41:21 -05001225 usb83xx_t usb;
1226 tsec83xx_t tsec[2];
Eran Libertyf046ccd2005-07-28 10:08:46 -05001227 u8 res7[0xA000];
Dave Liuf6eda7f2006-10-25 14:41:21 -05001228 security83xx_t security;
Eran Libertyf046ccd2005-07-28 10:08:46 -05001229} immap_t;
1230
Dave Liuf6eda7f2006-10-25 14:41:21 -05001231#endif /* __IMMAP_83xx__ */