Robobo
component_sdramc.h
1 /* ----------------------------------------------------------------------------
2  * SAM Software Package License
3  * ----------------------------------------------------------------------------
4  * Copyright (c) 2012, Atmel Corporation
5  *
6  * All rights reserved.
7  *
8  * Redistribution and use in source and binary forms, with or without
9  * modification, are permitted provided that the following condition is met:
10  *
11  * - Redistributions of source code must retain the above copyright notice,
12  * this list of conditions and the disclaimer below.
13  *
14  * Atmel's name may not be used to endorse or promote products derived from
15  * this software without specific prior written permission.
16  *
17  * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR
18  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
19  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
20  * DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT,
21  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
23  * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
24  * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
25  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
26  * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27  * ----------------------------------------------------------------------------
28  */
29 
30 #ifndef _SAM3XA_SDRAMC_COMPONENT_
31 #define _SAM3XA_SDRAMC_COMPONENT_
32 
33 /* ============================================================================= */
35 /* ============================================================================= */
38 
39 #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__))
40 
41 typedef struct {
45  RoReg Reserved1[1];
54 } Sdramc;
55 #endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */
56 /* -------- SDRAMC_MR : (SDRAMC Offset: 0x00) SDRAMC Mode Register -------- */
57 #define SDRAMC_MR_MODE_Pos 0
58 #define SDRAMC_MR_MODE_Msk (0x7u << SDRAMC_MR_MODE_Pos)
59 #define SDRAMC_MR_MODE_NORMAL (0x0u << 0)
60 #define SDRAMC_MR_MODE_NOP (0x1u << 0)
61 #define SDRAMC_MR_MODE_ALLBANKS_PRECHARGE (0x2u << 0)
62 #define SDRAMC_MR_MODE_LOAD_MODEREG (0x3u << 0)
63 #define SDRAMC_MR_MODE_AUTO_REFRESH (0x4u << 0)
64 #define SDRAMC_MR_MODE_EXT_LOAD_MODEREG (0x5u << 0)
65 #define SDRAMC_MR_MODE_DEEP_POWERDOWN (0x6u << 0)
66 /* -------- SDRAMC_TR : (SDRAMC Offset: 0x04) SDRAMC Refresh Timer Register -------- */
67 #define SDRAMC_TR_COUNT_Pos 0
68 #define SDRAMC_TR_COUNT_Msk (0xfffu << SDRAMC_TR_COUNT_Pos)
69 #define SDRAMC_TR_COUNT(value) ((SDRAMC_TR_COUNT_Msk & ((value) << SDRAMC_TR_COUNT_Pos)))
70 /* -------- SDRAMC_CR : (SDRAMC Offset: 0x08) SDRAMC Configuration Register -------- */
71 #define SDRAMC_CR_NC_Pos 0
72 #define SDRAMC_CR_NC_Msk (0x3u << SDRAMC_CR_NC_Pos)
73 #define SDRAMC_CR_NC_COL8 (0x0u << 0)
74 #define SDRAMC_CR_NC_COL9 (0x1u << 0)
75 #define SDRAMC_CR_NC_COL10 (0x2u << 0)
76 #define SDRAMC_CR_NC_COL11 (0x3u << 0)
77 #define SDRAMC_CR_NR_Pos 2
78 #define SDRAMC_CR_NR_Msk (0x3u << SDRAMC_CR_NR_Pos)
79 #define SDRAMC_CR_NR_ROW11 (0x0u << 2)
80 #define SDRAMC_CR_NR_ROW12 (0x1u << 2)
81 #define SDRAMC_CR_NR_ROW13 (0x2u << 2)
82 #define SDRAMC_CR_NB (0x1u << 4)
83 #define SDRAMC_CR_NB_BANK2 (0x0u << 4)
84 #define SDRAMC_CR_NB_BANK4 (0x1u << 4)
85 #define SDRAMC_CR_CAS_Pos 5
86 #define SDRAMC_CR_CAS_Msk (0x3u << SDRAMC_CR_CAS_Pos)
87 #define SDRAMC_CR_CAS_LATENCY1 (0x1u << 5)
88 #define SDRAMC_CR_CAS_LATENCY2 (0x2u << 5)
89 #define SDRAMC_CR_CAS_LATENCY3 (0x3u << 5)
90 #define SDRAMC_CR_DBW (0x1u << 7)
91 #define SDRAMC_CR_TWR_Pos 8
92 #define SDRAMC_CR_TWR_Msk (0xfu << SDRAMC_CR_TWR_Pos)
93 #define SDRAMC_CR_TWR(value) ((SDRAMC_CR_TWR_Msk & ((value) << SDRAMC_CR_TWR_Pos)))
94 #define SDRAMC_CR_TRC_TRFC_Pos 12
95 #define SDRAMC_CR_TRC_TRFC_Msk (0xfu << SDRAMC_CR_TRC_TRFC_Pos)
96 #define SDRAMC_CR_TRC_TRFC(value) ((SDRAMC_CR_TRC_TRFC_Msk & ((value) << SDRAMC_CR_TRC_TRFC_Pos)))
97 #define SDRAMC_CR_TRP_Pos 16
98 #define SDRAMC_CR_TRP_Msk (0xfu << SDRAMC_CR_TRP_Pos)
99 #define SDRAMC_CR_TRP(value) ((SDRAMC_CR_TRP_Msk & ((value) << SDRAMC_CR_TRP_Pos)))
100 #define SDRAMC_CR_TRCD_Pos 20
101 #define SDRAMC_CR_TRCD_Msk (0xfu << SDRAMC_CR_TRCD_Pos)
102 #define SDRAMC_CR_TRCD(value) ((SDRAMC_CR_TRCD_Msk & ((value) << SDRAMC_CR_TRCD_Pos)))
103 #define SDRAMC_CR_TRAS_Pos 24
104 #define SDRAMC_CR_TRAS_Msk (0xfu << SDRAMC_CR_TRAS_Pos)
105 #define SDRAMC_CR_TRAS(value) ((SDRAMC_CR_TRAS_Msk & ((value) << SDRAMC_CR_TRAS_Pos)))
106 #define SDRAMC_CR_TXSR_Pos 28
107 #define SDRAMC_CR_TXSR_Msk (0xfu << SDRAMC_CR_TXSR_Pos)
108 #define SDRAMC_CR_TXSR(value) ((SDRAMC_CR_TXSR_Msk & ((value) << SDRAMC_CR_TXSR_Pos)))
109 /* -------- SDRAMC_LPR : (SDRAMC Offset: 0x10) SDRAMC Low Power Register -------- */
110 #define SDRAMC_LPR_LPCB_Pos 0
111 #define SDRAMC_LPR_LPCB_Msk (0x3u << SDRAMC_LPR_LPCB_Pos)
112 #define SDRAMC_LPR_LPCB_DISABLED (0x0u << 0)
113 #define SDRAMC_LPR_LPCB_SELF_REFRESH (0x1u << 0)
114 #define SDRAMC_LPR_LPCB_POWER_DOWN (0x2u << 0)
115 #define SDRAMC_LPR_LPCB_DEEP_POWER_DOWN (0x3u << 0)
116 #define SDRAMC_LPR_PASR_Pos 4
117 #define SDRAMC_LPR_PASR_Msk (0x7u << SDRAMC_LPR_PASR_Pos)
118 #define SDRAMC_LPR_PASR(value) ((SDRAMC_LPR_PASR_Msk & ((value) << SDRAMC_LPR_PASR_Pos)))
119 #define SDRAMC_LPR_TCSR_Pos 8
120 #define SDRAMC_LPR_TCSR_Msk (0x3u << SDRAMC_LPR_TCSR_Pos)
121 #define SDRAMC_LPR_TCSR(value) ((SDRAMC_LPR_TCSR_Msk & ((value) << SDRAMC_LPR_TCSR_Pos)))
122 #define SDRAMC_LPR_DS_Pos 10
123 #define SDRAMC_LPR_DS_Msk (0x3u << SDRAMC_LPR_DS_Pos)
124 #define SDRAMC_LPR_DS(value) ((SDRAMC_LPR_DS_Msk & ((value) << SDRAMC_LPR_DS_Pos)))
125 #define SDRAMC_LPR_TIMEOUT_Pos 12
126 #define SDRAMC_LPR_TIMEOUT_Msk (0x3u << SDRAMC_LPR_TIMEOUT_Pos)
127 #define SDRAMC_LPR_TIMEOUT_LP_LAST_XFER (0x0u << 12)
128 #define SDRAMC_LPR_TIMEOUT_LP_LAST_XFER_64 (0x1u << 12)
129 #define SDRAMC_LPR_TIMEOUT_LP_LAST_XFER_128 (0x2u << 12)
130 /* -------- SDRAMC_IER : (SDRAMC Offset: 0x14) SDRAMC Interrupt Enable Register -------- */
131 #define SDRAMC_IER_RES (0x1u << 0)
132 /* -------- SDRAMC_IDR : (SDRAMC Offset: 0x18) SDRAMC Interrupt Disable Register -------- */
133 #define SDRAMC_IDR_RES (0x1u << 0)
134 /* -------- SDRAMC_IMR : (SDRAMC Offset: 0x1C) SDRAMC Interrupt Mask Register -------- */
135 #define SDRAMC_IMR_RES (0x1u << 0)
136 /* -------- SDRAMC_ISR : (SDRAMC Offset: 0x20) SDRAMC Interrupt Status Register -------- */
137 #define SDRAMC_ISR_RES (0x1u << 0)
138 /* -------- SDRAMC_MDR : (SDRAMC Offset: 0x24) SDRAMC Memory Device Register -------- */
139 #define SDRAMC_MDR_MD_Pos 0
140 #define SDRAMC_MDR_MD_Msk (0x3u << SDRAMC_MDR_MD_Pos)
141 #define SDRAMC_MDR_MD_SDRAM (0x0u << 0)
142 #define SDRAMC_MDR_MD_LPSDRAM (0x1u << 0)
143 /* -------- SDRAMC_CR1 : (SDRAMC Offset: 0x28) SDRAMC Configuration Register 1 -------- */
144 #define SDRAMC_CR1_NC_Pos 0
145 #define SDRAMC_CR1_NC_Msk (0x3u << SDRAMC_CR1_NC_Pos)
146 #define SDRAMC_CR1_NC_COL8 (0x0u << 0)
147 #define SDRAMC_CR1_NC_COL9 (0x1u << 0)
148 #define SDRAMC_CR1_NC_COL10 (0x2u << 0)
149 #define SDRAMC_CR1_NC_COL11 (0x3u << 0)
150 #define SDRAMC_CR1_NR_Pos 2
151 #define SDRAMC_CR1_NR_Msk (0x3u << SDRAMC_CR1_NR_Pos)
152 #define SDRAMC_CR1_NR_ROW11 (0x0u << 2)
153 #define SDRAMC_CR1_NR_ROW12 (0x1u << 2)
154 #define SDRAMC_CR1_NR_ROW13 (0x2u << 2)
155 #define SDRAMC_CR1_NB (0x1u << 4)
156 #define SDRAMC_CR1_NB_BANK2 (0x0u << 4)
157 #define SDRAMC_CR1_NB_BANK4 (0x1u << 4)
158 #define SDRAMC_CR1_CAS_Pos 5
159 #define SDRAMC_CR1_CAS_Msk (0x3u << SDRAMC_CR1_CAS_Pos)
160 #define SDRAMC_CR1_CAS_LATENCY1 (0x1u << 5)
161 #define SDRAMC_CR1_CAS_LATENCY2 (0x2u << 5)
162 #define SDRAMC_CR1_CAS_LATENCY3 (0x3u << 5)
163 #define SDRAMC_CR1_DBW (0x1u << 7)
164 #define SDRAMC_CR1_TWR_Pos 8
165 #define SDRAMC_CR1_TWR_Msk (0xfu << SDRAMC_CR1_TWR_Pos)
166 #define SDRAMC_CR1_TWR(value) ((SDRAMC_CR1_TWR_Msk & ((value) << SDRAMC_CR1_TWR_Pos)))
167 #define SDRAMC_CR1_TRC_TRFC_Pos 12
168 #define SDRAMC_CR1_TRC_TRFC_Msk (0xfu << SDRAMC_CR1_TRC_TRFC_Pos)
169 #define SDRAMC_CR1_TRC_TRFC(value) ((SDRAMC_CR1_TRC_TRFC_Msk & ((value) << SDRAMC_CR1_TRC_TRFC_Pos)))
170 #define SDRAMC_CR1_TRP_Pos 16
171 #define SDRAMC_CR1_TRP_Msk (0xfu << SDRAMC_CR1_TRP_Pos)
172 #define SDRAMC_CR1_TRP(value) ((SDRAMC_CR1_TRP_Msk & ((value) << SDRAMC_CR1_TRP_Pos)))
173 #define SDRAMC_CR1_TRCD_Pos 20
174 #define SDRAMC_CR1_TRCD_Msk (0xfu << SDRAMC_CR1_TRCD_Pos)
175 #define SDRAMC_CR1_TRCD(value) ((SDRAMC_CR1_TRCD_Msk & ((value) << SDRAMC_CR1_TRCD_Pos)))
176 #define SDRAMC_CR1_TRAS_Pos 24
177 #define SDRAMC_CR1_TRAS_Msk (0xfu << SDRAMC_CR1_TRAS_Pos)
178 #define SDRAMC_CR1_TRAS(value) ((SDRAMC_CR1_TRAS_Msk & ((value) << SDRAMC_CR1_TRAS_Pos)))
179 #define SDRAMC_CR1_TXSR_Pos 28
180 #define SDRAMC_CR1_TXSR_Msk (0xfu << SDRAMC_CR1_TXSR_Pos)
181 #define SDRAMC_CR1_TXSR(value) ((SDRAMC_CR1_TXSR_Msk & ((value) << SDRAMC_CR1_TXSR_Pos)))
182 /* -------- SDRAMC_OCMS : (SDRAMC Offset: 0x2C) SDRAMC OCMS Register 1 -------- */
183 #define SDRAMC_OCMS_SDR_SE (0x1u << 0)
186 
187 
188 #endif /* _SAM3XA_SDRAMC_COMPONENT_ */
volatile uint32_t RwReg
Definition: sam3n00a.h:54
volatile uint32_t WoReg
Definition: sam3n00a.h:53
RwReg SDRAMC_TR
(Sdramc Offset: 0x04) SDRAMC Refresh Timer Register
Definition: component_sdramc.h:43
RoReg SDRAMC_IMR
(Sdramc Offset: 0x1C) SDRAMC Interrupt Mask Register
Definition: component_sdramc.h:49
RwReg SDRAMC_MR
(Sdramc Offset: 0x00) SDRAMC Mode Register
Definition: component_sdramc.h:42
RwReg SDRAMC_CR1
(Sdramc Offset: 0x28) SDRAMC Configuration Register 1
Definition: component_sdramc.h:52
RwReg SDRAMC_CR
(Sdramc Offset: 0x08) SDRAMC Configuration Register
Definition: component_sdramc.h:44
RoReg SDRAMC_ISR
(Sdramc Offset: 0x20) SDRAMC Interrupt Status Register
Definition: component_sdramc.h:50
RwReg SDRAMC_LPR
(Sdramc Offset: 0x10) SDRAMC Low Power Register
Definition: component_sdramc.h:46
RwReg SDRAMC_OCMS
(Sdramc Offset: 0x2C) SDRAMC OCMS Register 1
Definition: component_sdramc.h:53
WoReg SDRAMC_IDR
(Sdramc Offset: 0x18) SDRAMC Interrupt Disable Register
Definition: component_sdramc.h:48
Sdramc hardware registers.
Definition: component_sdramc.h:41
RwReg SDRAMC_MDR
(Sdramc Offset: 0x24) SDRAMC Memory Device Register
Definition: component_sdramc.h:51
volatile const uint32_t RoReg
Definition: sam3n00a.h:49
WoReg SDRAMC_IER
(Sdramc Offset: 0x14) SDRAMC Interrupt Enable Register
Definition: component_sdramc.h:47