2 * (C) Copyright 2006-2009
3 * Texas Instruments, <www.ti.com>
4 * Richard Woodruff <r-woodruff2@ti.com>
6 * See file CREDITS for list of people who contributed to this
9 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License
11 * version 2 as published by the Free Software Foundation.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
24 #ifndef _OMAP44XX_MEM_H_
25 #define _OMAP44XX_MEM_H_
36 /* Memory that can be connected to GPMC */
40 #define GPMC_ONENAND 3
44 #define GPMC_ONENAND_TRY 7
49 /* New and compatability speed defines */
50 #if defined(PRCM_CLK_CFG2_200MHZ) || defined(PRCM_CONFIG_II)\
51 || defined(PRCM_CONFIG_5B)
52 # define L3_100MHZ /* Use with <= 100MHz SDRAM */
53 #elif defined(PRCM_CLK_CFG2_266MHZ) || defined(PRCM_CONFIG_III)\
54 || defined(PRCM_CONFIG_5A)
55 # define L3_133MHZ /* Use with <= 133MHz SDRAM*/
56 #elif defined(PRCM_CLK_CFG2_332MHZ) || defined(PRCM_CONFIG_I) \
57 || defined(PRCM_CONFIG_2)
58 # define L3_165MHZ /* Use with <= 165MHz SDRAM (L3=166 on 4430) */
63 * Definitions is as per the following format
64 * # define <PART>_GPMC_CONFIG<x> <value>
66 * PART is the part name e.g. STNOR - Intel Strata Flash
67 * x is GPMC config registers from 1 to 6 (there will be 6 macros)
68 * Value is corresponding value
70 * For every valid PRCM configuration there should be only one definition of
71 * the same. if values are independent of the board, this definition will be
72 * present in this file if values are dependent on the board, then this should
73 * go into corresponding mem-boardName.h file
75 * Currently valid part Names are (PART):
76 * STNOR - Intel Strata Flash
77 * SMNAND - Samsung NAND
78 * M_NAND - Micron Large page x16 NAND
79 * MPDB - H4 MPDB board
81 * ONNAND - Samsung One NAND
83 * include/configs/file.h contains the defn - for all CS we are interested
84 * #define OMAP44XX_GPMC_CSx PART
85 * #define OMAP44XX_GPMC_CSx_SIZE Size
86 * #define OMAP44XX_GPMC_CSx_MAP Map
89 * PART - Part Name as defined above
90 * SIZE - how big is the mapping to be
91 * GPMC_SIZE_128M - 0x8
95 * MAP - Map this CS to which address(GPMC address space)- Absolute address
96 * >>24 before being used.
98 #define GPMC_SIZE_128M 0x8
99 #define GPMC_SIZE_64M 0xC
100 #define GPMC_SIZE_32M 0xE
101 #define GPMC_SIZE_16M 0xF
103 #if defined(L3_100MHZ)
104 # define SMNAND_GPMC_CONFIG1 0x0
105 # define SMNAND_GPMC_CONFIG2 0x00141400
106 # define SMNAND_GPMC_CONFIG3 0x00141400
107 # define SMNAND_GPMC_CONFIG4 0x0F010F01
108 # define SMNAND_GPMC_CONFIG5 0x010C1414
109 # define SMNAND_GPMC_CONFIG6 0x00000A80
111 # define M_NAND_GPMC_CONFIG1 0x00001800
112 # define M_NAND_GPMC_CONFIG2 0x00141400
113 # define M_NAND_GPMC_CONFIG3 0x00141400
114 # define M_NAND_GPMC_CONFIG4 0x0F010F01
115 # define M_NAND_GPMC_CONFIG5 0x010C1414
116 # define M_NAND_GPMC_CONFIG6 0x1f0f0A80
118 # define STNOR_GPMC_CONFIG1 0x3
119 # define STNOR_GPMC_CONFIG2 0x000f0f01
120 # define STNOR_GPMC_CONFIG3 0x00050502
121 # define STNOR_GPMC_CONFIG4 0x0C060C06
122 # define STNOR_GPMC_CONFIG5 0x01131F1F
123 # define STNOR_GPMC_CONFIG6 0x1F0F0000
125 # define MPDB_GPMC_CONFIG1 0x00011000
126 # define MPDB_GPMC_CONFIG2 0x001F1F00
127 # define MPDB_GPMC_CONFIG3 0x00080802
128 # define MPDB_GPMC_CONFIG4 0x1C091C09
129 # define MPDB_GPMC_CONFIG5 0x031A1F1F
130 # define MPDB_GPMC_CONFIG6 0x000003C2
133 #if defined(L3_133MHZ)
134 # define SMNAND_GPMC_CONFIG1 0x00000800
135 # define SMNAND_GPMC_CONFIG2 0x00141400
136 # define SMNAND_GPMC_CONFIG3 0x00141400
137 # define SMNAND_GPMC_CONFIG4 0x0F010F01
138 # define SMNAND_GPMC_CONFIG5 0x010C1414
139 # define SMNAND_GPMC_CONFIG6 0x1F0F0A80
140 # define SMNAND_GPMC_CONFIG7 0x00000C44
142 # define M_NAND_GPMC_CONFIG1 0x00001800 /* might reuse smnand, with |= 1000 */
143 # define M_NAND_GPMC_CONFIG2 0x00141400
144 # define M_NAND_GPMC_CONFIG3 0x00141400
145 # define M_NAND_GPMC_CONFIG4 0x0F010F01
146 # define M_NAND_GPMC_CONFIG5 0x010C1414
147 # define M_NAND_GPMC_CONFIG6 0x1F0F0A80
148 # define M_NAND_GPMC_CONFIG7 0x00000C44
150 # define STNOR_GPMC_CONFIG1 0x1203
151 # define STNOR_GPMC_CONFIG2 0x00151501
152 # define STNOR_GPMC_CONFIG3 0x00060602
153 # define STNOR_GPMC_CONFIG4 0x10081008
154 # define STNOR_GPMC_CONFIG5 0x01131F1F
155 # define STNOR_GPMC_CONFIG6 0x1F0F04c4
157 # define SIBNOR_GPMC_CONFIG1 0x1200
158 # define SIBNOR_GPMC_CONFIG2 0x001f1f00
159 # define SIBNOR_GPMC_CONFIG3 0x00080802
160 # define SIBNOR_GPMC_CONFIG4 0x1C091C09
161 # define SIBNOR_GPMC_CONFIG5 0x01131F1F
162 # define SIBNOR_GPMC_CONFIG6 0x1F0F03C2
164 /* ES1 SDP and ES1 chip Debug FPGA */
165 # define MPDB_GPMC_CONFIG1 0x00011000
166 # define MPDB_GPMC_CONFIG2 0x001f1f01
167 # define MPDB_GPMC_CONFIG3 0x00080803
168 # define MPDB_GPMC_CONFIG4 0x1C091C09
169 # define MPDB_GPMC_CONFIG5 0x041f1F1F
170 # define MPDB_GPMC_CONFIG6 0x000004C4
172 /* ES2 SDP and ES2 chip Debug FPGA */
173 # define SDPV2_MPDB_GPMC_CONFIG1 0x00611200
174 # define SDPV2_MPDB_GPMC_CONFIG2 0x001F1F01
175 # define SDPV2_MPDB_GPMC_CONFIG3 0x00080803
176 # define SDPV2_MPDB_GPMC_CONFIG4 0x1D091D09
177 # define SDPV2_MPDB_GPMC_CONFIG5 0x041D1F1F
178 # define SDPV2_MPDB_GPMC_CONFIG6 0x1D0904C4
180 # define P2_GPMC_CONFIG1 0x0
181 # define P2_GPMC_CONFIG2 0x0
182 # define P2_GPMC_CONFIG3 0x0
183 # define P2_GPMC_CONFIG4 0x0
184 # define P2_GPMC_CONFIG5 0x0
185 # define P2_GPMC_CONFIG6 0x0
187 # define ONENAND_GPMC_CONFIG1 0x00001200
188 # define ONENAND_GPMC_CONFIG2 0x000c0c01
189 # define ONENAND_GPMC_CONFIG3 0x00030301
190 # define ONENAND_GPMC_CONFIG4 0x0c040c04
191 # define ONENAND_GPMC_CONFIG5 0x010C1010
192 # define ONENAND_GPMC_CONFIG6 0x1F060000
194 #endif /* endif L3_133MHZ */
196 #if defined(L3_165MHZ)
197 # define SMNAND_GPMC_CONFIG1 0x00000800
198 # define SMNAND_GPMC_CONFIG2 0x00060600
199 # define SMNAND_GPMC_CONFIG3 0x00060401
200 # define SMNAND_GPMC_CONFIG4 0x05010801
201 # define SMNAND_GPMC_CONFIG5 0x00090B0B
202 # define SMNAND_GPMC_CONFIG6 0x050001C0
203 # define SMNAND_GPMC_CONFIG7 0x00000C44
205 # define M_NAND_GPMC_CONFIG1 0x00001800
206 # define M_NAND_GPMC_CONFIG2 0x00141400
207 # define M_NAND_GPMC_CONFIG3 0x00141400
208 # define M_NAND_GPMC_CONFIG4 0x0F010F01
209 # define M_NAND_GPMC_CONFIG5 0x010C1414
210 # define M_NAND_GPMC_CONFIG6 0x1F0F0A80
211 # define M_NAND_GPMC_CONFIG7 0x00000C44
213 # define STNOR_GPMC_CONFIG1 0x3
214 # define STNOR_GPMC_CONFIG2 0x00151501
215 # define STNOR_GPMC_CONFIG3 0x00060602
216 # define STNOR_GPMC_CONFIG4 0x11091109
217 # define STNOR_GPMC_CONFIG5 0x01141F1F
218 # define STNOR_GPMC_CONFIG6 0x1F0F04c4
220 # define SIBNOR_GPMC_CONFIG1 0x1200
221 # define SIBNOR_GPMC_CONFIG2 0x001f1f00
222 # define SIBNOR_GPMC_CONFIG3 0x00080802
223 # define SIBNOR_GPMC_CONFIG4 0x1C091C09
224 # define SIBNOR_GPMC_CONFIG5 0x01131F1F
225 # define SIBNOR_GPMC_CONFIG6 0x1F0F03C2
227 # define SDPV2_MPDB_GPMC_CONFIG1 0x00611200
228 # define SDPV2_MPDB_GPMC_CONFIG2 0x001F1F01
229 # define SDPV2_MPDB_GPMC_CONFIG3 0x00080803
230 # define SDPV2_MPDB_GPMC_CONFIG4 0x1D091D09
231 # define SDPV2_MPDB_GPMC_CONFIG5 0x041D1F1F
232 # define SDPV2_MPDB_GPMC_CONFIG6 0x1D0904C4
234 # define MPDB_GPMC_CONFIG1 0x00011000
235 # define MPDB_GPMC_CONFIG2 0x001f1f01
236 # define MPDB_GPMC_CONFIG3 0x00080803
237 # define MPDB_GPMC_CONFIG4 0x1c0b1c0a
238 # define MPDB_GPMC_CONFIG5 0x041f1F1F
239 # define MPDB_GPMC_CONFIG6 0x1F0F04C4
241 # define LAB_ENET_GPMC_CONFIG1 0x00611000
242 # define LAB_ENET_GPMC_CONFIG2 0x001F1F01
243 # define LAB_ENET_GPMC_CONFIG3 0x00080803
244 # define LAB_ENET_GPMC_CONFIG4 0x1D091D09
245 # define LAB_ENET_GPMC_CONFIG5 0x041D1F1F
246 # define LAB_ENET_GPMC_CONFIG6 0x1D0904C4
248 # define P2_GPMC_CONFIG1 0x0
249 # define P2_GPMC_CONFIG2 0x0
250 # define P2_GPMC_CONFIG3 0x0
251 # define P2_GPMC_CONFIG4 0x0
252 # define P2_GPMC_CONFIG5 0x0
253 # define P2_GPMC_CONFIG6 0x0
255 # define ONENAND_GPMC_CONFIG1 0x00001200
256 # define ONENAND_GPMC_CONFIG2 0x000F0F01
257 # define ONENAND_GPMC_CONFIG3 0x00030301
258 # define ONENAND_GPMC_CONFIG4 0x0F040F04
259 # define ONENAND_GPMC_CONFIG5 0x010F1010
260 # define ONENAND_GPMC_CONFIG6 0x1F060000
264 /* max number of GPMC Chip Selects */
265 #define GPMC_MAX_CS 8
266 /* max number of GPMC regs */
267 #define GPMC_MAX_REG 7
270 #define PISMO1_NAND 2
273 #define PISMO1_ONENAND 5
275 #define PISMO2_NAND_CS0 7
276 #define PISMO2_NAND_CS1 8
278 /* make it readable for the gpmc_init */
279 #define PISMO1_NOR_BASE FLASH_BASE
280 #define PISMO1_NAND_BASE NAND_BASE
281 #define PISMO2_CS0_BASE PISMO2_MAP1
282 #define PISMO1_ONEN_BASE ONENAND_MAP
283 #define DBG_MPDB_BASE DEBUG_BASE
285 #endif /* endif _OMAP44XX_MEM_H_ */