RTEMS 7.0-rc1
Loading...
Searching...
No Matches
at91rm9200_mem.h
Go to the documentation of this file.
1/* SPDX-License-Identifier: BSD-2-Clause */
2
11/*
12 * Copyright (C) 2002 Cogent Computer Systems
13 * Written by Mike Kelly <mike@cogcomp.com>
14 *
15 * Redistribution and use in source and binary forms, with or without
16 * modification, are permitted provided that the following conditions
17 * are met:
18 * 1. Redistributions of source code must retain the above copyright
19 * notice, this list of conditions and the following disclaimer.
20 * 2. Redistributions in binary form must reproduce the above copyright
21 * notice, this list of conditions and the following disclaimer in the
22 * documentation and/or other materials provided with the distribution.
23 *
24 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
25 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
26 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
27 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
28 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
29 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
30 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
31 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
32 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
33 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
34 * POSSIBILITY OF SUCH DAMAGE.
35 */
36
37#ifndef AT91RM9200_MEM_H
38#define AT91RM9200_MEM_H
39
40/**********************************************************************
41 * External Bus Interface Unit
42 **********************************************************************/
43#define EBI_CSA 0x00 /* Chip Select Assignment Register */
44#define EBI_CFGR 0x04 /* Configuration Register */
45
46/* Bit Defines */
47/* EBI_CSA - Chip Select Assignment Register */
48#define EBI_CSA_CS4_CF BIT4 /* 1 = CS4-6 are assigned to Compact Flash, 0 = Chip Selects */
49#define EBI_CSA_CS3_SMM BIT3 /* 1 = CS3 is assigned to SmartMedia, 0 = Chip Select */
50#define EBI_CSA_CS1_SDRAM BIT1 /* 1 = CS1 is assigned to SDRAM, 0 = Chip Select */
51#define EBI_CSA_CS0_BF BIT0 /* 1 = CS0 is assigned to Burst Flash, 0 = Chip Select */
52
53/* EBI_CFGR - Configuration Register */
54#define EBI_CFGR_DBPU BIT0 /* 1 = Disable D0-15 pullups */
55
56/***************************************************************************
57 * Static Memory Interface Unit
58 ***************************************************************************/
59#define SMC_CSR0 0x00 /* Chip Select Register 0 */
60#define SMC_CSR1 0x04 /* Chip Select Register 1 */
61#define SMC_CSR2 0x08 /* Chip Select Register 2 */
62#define SMC_CSR3 0x0C /* Chip Select Register 3 */
63#define SMC_CSR4 0x10 /* Chip Select Register 4 */
64#define SMC_CSR5 0x14 /* Chip Select Register 5 */
65#define SMC_CSR6 0x18 /* Chip Select Register 6 */
66#define SMC_CSR7 0x1C /* Chip Select Register 7 */
67
68/* Bit Defines */
69/* SMC_CSR0 -7 - Chip Selects 0 - 7 Register */
70#define SMC_CSR_RWHOLD(_x_) ((_x_ & 0x3) << 28) /* Hold CS after R/W strobes */
71#define SMC_CSR_RWSETUP(_x_) ((_x_ & 0x3) << 24) /* Setup CS before R/W strobes */
72#define SMC_CSR_ACSS_0 (0 << 16) /* Setup/Hold Address 0 clocks before/after CS */
73#define SMC_CSR_ACSS_1 (1 << 16) /* Setup/Hold Address 1 clock before/after CS */
74#define SMC_CSR_ACSS_2 (2 << 16) /* Setup/Hold Address 2 clocks before/after CS */
75#define SMC_CSR_ACSS_3 (3 << 16) /* Setup/Hold Address 3 clocks before/after CS */
76#define SMC_CSR_DRP_NORMAL 0 /* 0 = normal read protocol */
77#define SMC_CSR_DRP_EARLY BIT15 /* 1 = early read protocol */
78#define SMC_CSR_DBW_16 (1 << 13) /* CS DataBus Width = 16-Bits */
79#define SMC_CSR_DBW_8 (2 << 13) /* CS DataBus Width = 8 Bits */
80#define SMC_CSR_BAT_16_1 0 /* Single 16-Bit device (when DBW is 16) */
81#define SMC_CSR_BAT_16_2 BIT12 /* Dual 8-Bit devices (when DBW is 16) */
82#define SMC_CSR_TDF(_x_) ((_x_ & 0xf) << 8) /* Intercycle Data Float Time */
83#define SMC_CSR_WSEN BIT7 /* 1 = wait states are enabled */
84#define SMC_CSR_NWS(_x_) ((_x_ & 0x7f) << 0) /* Wait States + 1 */
85
86/* ***************************************************************************** */
87/* SDRAM Memory Interface Unit */
88/* ***************************************************************************** */
89#define SDRC_MR 0x00 /* Mode Register */
90#define SDRC_TR 0x04 /* Refresh Timer Register */
91#define SDRC_CR 0x08 /* Configuration Register */
92#define SDRC_SRR 0x0C /* Self Refresh Register */
93#define SDRC_LPR 0x10 /* Low Power Register */
94#define SDRC_IER 0x14 /* Interrupt Enable Register */
95#define SDRC_IDR 0x18 /* Interrupt Disable Register */
96#define SDRC_IMR 0x1C /* Interrupt Mask Register */
97#define SDRC_ISR 0x20 /* Interrupt Status Register */
98
99/* Bit Defines */
100/* SDRC_MR - Mode Register */
101#define SDRC_MR_DBW_16 BIT4 /* 1 = SDRAM is 16-bits wide, 0 = 32-bits */
102#define SDRC_MR_NORM (0 << 0) /* Normal Mode - All accesses to SDRAM are decoded normally */
103#define SDRC_MR_NOP (1 << 0) /* NOP Command is sent to SDRAM */
104#define SDRC_MR_PRE (2 << 0) /* Precharge All Command is sent to SDRAM */
105#define SDRC_MR_MRS (3 << 0) /* Mode Register Set Command is sent to SDRAM */
106#define SDRC_MR_REF (4 << 0) /* Refresh Command is sent to SDRAM */
107
108/* SDRC_TR - Refresh Timer Register */
109#define SDRC_TR_COUNT(_x_) ((_x_ & 0xfff) << 0)
110
111/* SDRC_CR - Configuration Register */
112#define SDRC_CR_TXSR(_x_) ((_x_ & 0xf) << 27) /* CKE to ACT Time */
113#define SDRC_CR_TRAS(_x_) ((_x_ & 0xf) << 23) /* ACT to PRE Time */
114#define SDRC_CR_TRCD(_x_) ((_x_ & 0xf) << 19) /* RAS to CAS Time */
115#define SDRC_CR_TRP(_x_) ((_x_ & 0xf) << 15) /* PRE to ACT Time */
116#define SDRC_CR_TRC(_x_) ((_x_ & 0xf) << 11) /* REF to ACT Time */
117#define SDRC_CR_TWR(_x_) ((_x_ & 0xf) << 7) /* Write Recovery Time */
118#define SDRC_CR_CAS_2 (2 << 5) /* Cas Delay = 2, this is the only supported value */
119#define SDRC_CR_NB_2 0 /* 2 Banks per device */
120#define SDRC_CR_NB_4 BIT4 /* 4 Banks per device */
121#define SDRC_CR_NR_11 (0 << 2) /* Number of rows = 11 */
122#define SDRC_CR_NR_12 (1 << 2) /* Number of rows = 12 */
123#define SDRC_CR_NR_13 (2 << 2) /* Number of rows = 13 */
124#define SDRC_CR_NC_8 (0 << 0) /* Number of columns = 8 */
125#define SDRC_CR_NC_9 (1 << 0) /* Number of columns = 9 */
126#define SDRC_CR_NC_10 (2 << 0) /* Number of columns = 10 */
127#define SDRC_CR_NC_11 (3 << 0) /* Number of columns = 11 */
128
129/* SDRC_SRR - Self Refresh Register */
130#define SDRC_SRR_SRCB BIT0 /* 1 = Enter Self Refresh */
131
132/* SDRC_LPR - Low Power Register */
133#define SDRC_LPR_LPCB BIT0 /* 1 = De-assert CKE between accesses */
134
135/* SDRC_IER - Interrupt Enable Register */
136/* SDRC_IDR - Interrupt Disable Register */
137/* SDRC_ISR - Interrupt Mask Register */
138/* SDRC_IMR - Interrupt Mask Register */
139#define SDRC_INT_RES BIT0 /* Refresh Error Status */
140
141#endif