RTEMS  5.1
lpc-emc.h
Go to the documentation of this file.
1 
9 /*
10  * Copyright (c) 2010-2011 embedded brains GmbH. All rights reserved.
11  *
12  * embedded brains GmbH
13  * Obere Lagerstr. 30
14  * 82178 Puchheim
15  * Germany
16  * <rtems@embedded-brains.de>
17  *
18  * The license and distribution terms for this file may be
19  * found in the file LICENSE in this distribution or at
20  * http://www.rtems.org/license/LICENSE.
21  */
22 
23 #ifndef LIBBSP_ARM_SHARED_LPC_EMC_H
24 #define LIBBSP_ARM_SHARED_LPC_EMC_H
25 
26 #include <bsp/utility.h>
27 
28 #ifdef __cplusplus
29 extern "C" {
30 #endif /* __cplusplus */
31 
49 #define EMC_CTRL_E BSP_BIT32(0)
50 #define EMC_CTRL_M BSP_BIT32(0)
51 #define EMC_CTRL_L BSP_BIT32(2)
52 
61 #define EMC_DYN_CTRL_CE BSP_BIT32(0)
62 #define EMC_DYN_CTRL_CS BSP_BIT32(1)
63 #define EMC_DYN_CTRL_SR BSP_BIT32(2)
64 #define EMC_DYN_CTRL_SRMCC BSP_BIT32(3)
65 #define EMC_DYN_CTRL_IMCC BSP_BIT32(4)
66 #define EMC_DYN_CTRL_MCC BSP_BIT32(5)
67 #define EMC_DYN_CTRL_I_MASK BSP_MSK32(7, 8)
68 #define EMC_DYN_CTRL_I_NORMAL BSP_FLD32(0x0, 7, 8)
69 #define EMC_DYN_CTRL_I_MODE BSP_FLD32(0x1, 7, 8)
70 #define EMC_DYN_CTRL_I_PALL BSP_FLD32(0x2, 7, 8)
71 #define EMC_DYN_CTRL_I_NOP BSP_FLD32(0x3, 7, 8)
72 #define EMC_DYN_CTRL_DP BSP_BIT32(13)
73 
82 #define EMC_DYN_READ_CONFIG_SDR_STRAT(val) BSP_FLD32(val, 0, 1)
83 #define EMC_DYN_READ_CONFIG_SDR_POL_POS BSP_BIT32(4)
84 #define EMC_DYN_READ_CONFIG_DDR_STRAT(val) BSP_FLD32(val, 8, 9)
85 #define EMC_DYN_READ_CONFIG_DDR_POL_POS BSP_BIT32(12)
86 
95 #define EMC_DYN_CFG_MD_LPC24XX(val) BSP_FLD32(val, 3, 4)
96 #define EMC_DYN_CFG_MD_LPC32XX(val) BSP_FLD32(val, 0, 2)
97 #define EMC_DYN_CFG_AM(val) BSP_FLD32(val, 7, 14)
98 #define EMC_DYN_CFG_B BSP_BIT32(19)
99 #define EMC_DYN_CFG_P BSP_BIT32(20)
100 
109 #define EMC_DYN_RASCAS_RAS(val) BSP_FLD32(val, 0, 3)
110 #define EMC_DYN_RASCAS_CAS(val, half) BSP_FLD32(((val) << 1) | (half), 7, 10)
111 
114 #define EMC_DYN_CHIP_COUNT 4
115 
116 #define EMC_STATIC_CHIP_COUNT 4
117 
118 typedef struct {
119  uint32_t config;
120  uint32_t rascas;
121  uint32_t reserved_0 [6];
123 
124 typedef struct {
125  uint32_t config;
126  uint32_t waitwen;
127  uint32_t waitoen;
128  uint32_t waitrd;
129  uint32_t waitpage;
130  uint32_t waitwr;
131  uint32_t waitturn;
132  uint32_t reserved_0 [1];
134 
135 typedef struct {
136  uint32_t control;
137  uint32_t status;
138  uint32_t config;
139  uint32_t reserved_0 [5];
140  uint32_t dynamiccontrol;
141  uint32_t dynamicrefresh;
142  uint32_t dynamicreadconfig;
143  uint32_t reserved_1;
144  uint32_t dynamictrp;
145  uint32_t dynamictras;
146  uint32_t dynamictsrex;
147  uint32_t dynamictapr;
148  uint32_t dynamictdal;
149  uint32_t dynamictwr;
150  uint32_t dynamictrc;
151  uint32_t dynamictrfc;
152  uint32_t dynamictxsr;
153  uint32_t dynamictrrd;
154  uint32_t dynamictmrd;
155  uint32_t dynamictcdlr;
156  uint32_t reserved_3 [8];
157  uint32_t staticextendedwait;
158  uint32_t reserved_4 [31];
159  lpc_emc_dynamic dynamic [EMC_DYN_CHIP_COUNT];
160  uint32_t reserved_5 [32];
161  lpc_emc_static emcstatic [EMC_STATIC_CHIP_COUNT];
162 } lpc_emc;
163 
166 #ifdef __cplusplus
167 }
168 #endif /* __cplusplus */
169 
170 #endif /* LIBBSP_ARM_SHARED_LPC_EMC_H */
Definition: deflate.c:115
Definition: lpc-emc.h:124
Utility macros.
Definition: lpc-emc.h:118
Definition: intercom.c:74
Definition: lpc-emc.h:135