RTEMS 6.1-rc6
Loading...
Searching...
No Matches
lpc-emc.h
Go to the documentation of this file.
1/* SPDX-License-Identifier: BSD-2-Clause */
2
11/*
12 * Copyright (C) 2010, 2011 embedded brains GmbH & Co. KG
13 *
14 * Redistribution and use in source and binary forms, with or without
15 * modification, are permitted provided that the following conditions
16 * are met:
17 * 1. Redistributions of source code must retain the above copyright
18 * notice, this list of conditions and the following disclaimer.
19 * 2. Redistributions in binary form must reproduce the above copyright
20 * notice, this list of conditions and the following disclaimer in the
21 * documentation and/or other materials provided with the distribution.
22 *
23 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
24 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
25 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
26 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
27 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
28 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
29 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
30 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
31 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
32 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
33 * POSSIBILITY OF SUCH DAMAGE.
34 */
35
36#ifndef LIBBSP_ARM_SHARED_LPC_EMC_H
37#define LIBBSP_ARM_SHARED_LPC_EMC_H
38
39#include <bsp/utility.h>
40
41#ifdef __cplusplus
42extern "C" {
43#endif /* __cplusplus */
44
62#define EMC_CTRL_E BSP_BIT32(0)
63#define EMC_CTRL_M BSP_BIT32(0)
64#define EMC_CTRL_L BSP_BIT32(2)
65
74#define EMC_DYN_CTRL_CE BSP_BIT32(0)
75#define EMC_DYN_CTRL_CS BSP_BIT32(1)
76#define EMC_DYN_CTRL_SR BSP_BIT32(2)
77#define EMC_DYN_CTRL_SRMCC BSP_BIT32(3)
78#define EMC_DYN_CTRL_IMCC BSP_BIT32(4)
79#define EMC_DYN_CTRL_MCC BSP_BIT32(5)
80#define EMC_DYN_CTRL_I_MASK BSP_MSK32(7, 8)
81#define EMC_DYN_CTRL_I_NORMAL BSP_FLD32(0x0, 7, 8)
82#define EMC_DYN_CTRL_I_MODE BSP_FLD32(0x1, 7, 8)
83#define EMC_DYN_CTRL_I_PALL BSP_FLD32(0x2, 7, 8)
84#define EMC_DYN_CTRL_I_NOP BSP_FLD32(0x3, 7, 8)
85#define EMC_DYN_CTRL_DP BSP_BIT32(13)
86
95#define EMC_DYN_READ_CONFIG_SDR_STRAT(val) BSP_FLD32(val, 0, 1)
96#define EMC_DYN_READ_CONFIG_SDR_POL_POS BSP_BIT32(4)
97#define EMC_DYN_READ_CONFIG_DDR_STRAT(val) BSP_FLD32(val, 8, 9)
98#define EMC_DYN_READ_CONFIG_DDR_POL_POS BSP_BIT32(12)
99
108#define EMC_DYN_CFG_MD_LPC24XX(val) BSP_FLD32(val, 3, 4)
109#define EMC_DYN_CFG_MD_LPC32XX(val) BSP_FLD32(val, 0, 2)
110#define EMC_DYN_CFG_AM(val) BSP_FLD32(val, 7, 14)
111#define EMC_DYN_CFG_B BSP_BIT32(19)
112#define EMC_DYN_CFG_P BSP_BIT32(20)
113
122#define EMC_DYN_RASCAS_RAS(val) BSP_FLD32(val, 0, 3)
123#define EMC_DYN_RASCAS_CAS(val, half) BSP_FLD32(((val) << 1) | (half), 7, 10)
124
127#define EMC_DYN_CHIP_COUNT 4
128
129#define EMC_STATIC_CHIP_COUNT 4
130
131typedef struct {
132 uint32_t config;
133 uint32_t rascas;
134 uint32_t reserved_0 [6];
136
137typedef struct {
138 uint32_t config;
139 uint32_t waitwen;
140 uint32_t waitoen;
141 uint32_t waitrd;
142 uint32_t waitpage;
143 uint32_t waitwr;
144 uint32_t waitturn;
145 uint32_t reserved_0 [1];
147
148typedef struct {
149 uint32_t control;
150 uint32_t status;
151 uint32_t config;
152 uint32_t reserved_0 [5];
153 uint32_t dynamiccontrol;
154 uint32_t dynamicrefresh;
155 uint32_t dynamicreadconfig;
156 uint32_t reserved_1;
157 uint32_t dynamictrp;
158 uint32_t dynamictras;
159 uint32_t dynamictsrex;
160 uint32_t dynamictapr;
161 uint32_t dynamictdal;
162 uint32_t dynamictwr;
163 uint32_t dynamictrc;
164 uint32_t dynamictrfc;
165 uint32_t dynamictxsr;
166 uint32_t dynamictrrd;
167 uint32_t dynamictmrd;
168 uint32_t dynamictcdlr;
169 uint32_t reserved_3 [8];
170 uint32_t staticextendedwait;
171 uint32_t reserved_4 [31];
172 lpc_emc_dynamic dynamic [EMC_DYN_CHIP_COUNT];
173 uint32_t reserved_5 [32];
174 lpc_emc_static emcstatic [EMC_STATIC_CHIP_COUNT];
175} lpc_emc;
176
179#ifdef __cplusplus
180}
181#endif /* __cplusplus */
182
183#endif /* LIBBSP_ARM_SHARED_LPC_EMC_H */
This header file provides utility macros for BSPs.
Definition: deflate.c:114
Definition: intercom.c:87
Definition: lpc-emc.h:131
Definition: lpc-emc.h:137
Definition: lpc-emc.h:148