2 * File: include/asm-blackfin/mach-bf548/mem_init.h
12 * Copyright 2004-2006 Analog Devices Inc.
14 * Bugs: Enter bugs at http://blackfin.uclinux.org/
16 * This program is free software; you can redistribute it and/or modify
17 * it under the terms of the GNU General Public License as published by
18 * the Free Software Foundation; either version 2, or (at your option)
21 * This program is distributed in the hope that it will be useful,
22 * but WITHOUT ANY WARRANTY; without even the implied warranty of
23 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24 * GNU General Public License for more details.
26 * You should have received a copy of the GNU General Public License
27 * along with this program; see the file COPYING.
28 * If not, write to the Free Software Foundation,
29 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
32 #if (CONFIG_MEM_MT46V32M16)
34 #if defined CONFIG_CLKIN_HALF
40 #if defined CONFIG_PLL_BYPASS
46 /***************************************Currently Not Being Used *********************************/
47 #define flash_EBIU_AMBCTL_WAT ((CONFIG_FLASH_SPEED_BWAT * 4) / (4000000000 / CONFIG_SCLK_HZ)) + 1
48 #define flash_EBIU_AMBCTL_RAT ((CONFIG_FLASH_SPEED_BRAT * 4) / (4000000000 / CONFIG_SCLK_HZ)) + 1
49 #define flash_EBIU_AMBCTL_HT ((CONFIG_FLASH_SPEED_BHT * 4) / (4000000000 / CONFIG_SCLK_HZ))
50 #define flash_EBIU_AMBCTL_ST ((CONFIG_FLASH_SPEED_BST * 4) / (4000000000 / CONFIG_SCLK_HZ)) + 1
51 #define flash_EBIU_AMBCTL_TT ((CONFIG_FLASH_SPEED_BTT * 4) / (4000000000 / CONFIG_SCLK_HZ)) + 1
53 #if (flash_EBIU_AMBCTL_TT > 3)
54 #define flash_EBIU_AMBCTL0_TT B0TT_4
56 #if (flash_EBIU_AMBCTL_TT == 3)
57 #define flash_EBIU_AMBCTL0_TT B0TT_3
59 #if (flash_EBIU_AMBCTL_TT == 2)
60 #define flash_EBIU_AMBCTL0_TT B0TT_2
62 #if (flash_EBIU_AMBCTL_TT < 2)
63 #define flash_EBIU_AMBCTL0_TT B0TT_1
66 #if (flash_EBIU_AMBCTL_ST > 3)
67 #define flash_EBIU_AMBCTL0_ST B0ST_4
69 #if (flash_EBIU_AMBCTL_ST == 3)
70 #define flash_EBIU_AMBCTL0_ST B0ST_3
72 #if (flash_EBIU_AMBCTL_ST == 2)
73 #define flash_EBIU_AMBCTL0_ST B0ST_2
75 #if (flash_EBIU_AMBCTL_ST < 2)
76 #define flash_EBIU_AMBCTL0_ST B0ST_1
79 #if (flash_EBIU_AMBCTL_HT > 2)
80 #define flash_EBIU_AMBCTL0_HT B0HT_3
82 #if (flash_EBIU_AMBCTL_HT == 2)
83 #define flash_EBIU_AMBCTL0_HT B0HT_2
85 #if (flash_EBIU_AMBCTL_HT == 1)
86 #define flash_EBIU_AMBCTL0_HT B0HT_1
88 #if (flash_EBIU_AMBCTL_HT == 0 && CONFIG_FLASH_SPEED_BHT == 0)
89 #define flash_EBIU_AMBCTL0_HT B0HT_0
91 #if (flash_EBIU_AMBCTL_HT == 0 && CONFIG_FLASH_SPEED_BHT != 0)
92 #define flash_EBIU_AMBCTL0_HT B0HT_1
95 #if (flash_EBIU_AMBCTL_WAT > 14)
96 #define flash_EBIU_AMBCTL0_WAT B0WAT_15
98 #if (flash_EBIU_AMBCTL_WAT == 14)
99 #define flash_EBIU_AMBCTL0_WAT B0WAT_14
101 #if (flash_EBIU_AMBCTL_WAT == 13)
102 #define flash_EBIU_AMBCTL0_WAT B0WAT_13
104 #if (flash_EBIU_AMBCTL_WAT == 12)
105 #define flash_EBIU_AMBCTL0_WAT B0WAT_12
107 #if (flash_EBIU_AMBCTL_WAT == 11)
108 #define flash_EBIU_AMBCTL0_WAT B0WAT_11
110 #if (flash_EBIU_AMBCTL_WAT == 10)
111 #define flash_EBIU_AMBCTL0_WAT B0WAT_10
113 #if (flash_EBIU_AMBCTL_WAT == 9)
114 #define flash_EBIU_AMBCTL0_WAT B0WAT_9
116 #if (flash_EBIU_AMBCTL_WAT == 8)
117 #define flash_EBIU_AMBCTL0_WAT B0WAT_8
119 #if (flash_EBIU_AMBCTL_WAT == 7)
120 #define flash_EBIU_AMBCTL0_WAT B0WAT_7
122 #if (flash_EBIU_AMBCTL_WAT == 6)
123 #define flash_EBIU_AMBCTL0_WAT B0WAT_6
125 #if (flash_EBIU_AMBCTL_WAT == 5)
126 #define flash_EBIU_AMBCTL0_WAT B0WAT_5
128 #if (flash_EBIU_AMBCTL_WAT == 4)
129 #define flash_EBIU_AMBCTL0_WAT B0WAT_4
131 #if (flash_EBIU_AMBCTL_WAT == 3)
132 #define flash_EBIU_AMBCTL0_WAT B0WAT_3
134 #if (flash_EBIU_AMBCTL_WAT == 2)
135 #define flash_EBIU_AMBCTL0_WAT B0WAT_2
137 #if (flash_EBIU_AMBCTL_WAT == 1)
138 #define flash_EBIU_AMBCTL0_WAT B0WAT_1
141 #if (flash_EBIU_AMBCTL_RAT > 14)
142 #define flash_EBIU_AMBCTL0_RAT B0RAT_15
144 #if (flash_EBIU_AMBCTL_RAT == 14)
145 #define flash_EBIU_AMBCTL0_RAT B0RAT_14
147 #if (flash_EBIU_AMBCTL_RAT == 13)
148 #define flash_EBIU_AMBCTL0_RAT B0RAT_13
150 #if (flash_EBIU_AMBCTL_RAT == 12)
151 #define flash_EBIU_AMBCTL0_RAT B0RAT_12
153 #if (flash_EBIU_AMBCTL_RAT == 11)
154 #define flash_EBIU_AMBCTL0_RAT B0RAT_11
156 #if (flash_EBIU_AMBCTL_RAT == 10)
157 #define flash_EBIU_AMBCTL0_RAT B0RAT_10
159 #if (flash_EBIU_AMBCTL_RAT == 9)
160 #define flash_EBIU_AMBCTL0_RAT B0RAT_9
162 #if (flash_EBIU_AMBCTL_RAT == 8)
163 #define flash_EBIU_AMBCTL0_RAT B0RAT_8
165 #if (flash_EBIU_AMBCTL_RAT == 7)
166 #define flash_EBIU_AMBCTL0_RAT B0RAT_7
168 #if (flash_EBIU_AMBCTL_RAT == 6)
169 #define flash_EBIU_AMBCTL0_RAT B0RAT_6
171 #if (flash_EBIU_AMBCTL_RAT == 5)
172 #define flash_EBIU_AMBCTL0_RAT B0RAT_5
174 #if (flash_EBIU_AMBCTL_RAT == 4)
175 #define flash_EBIU_AMBCTL0_RAT B0RAT_4
177 #if (flash_EBIU_AMBCTL_RAT == 3)
178 #define flash_EBIU_AMBCTL0_RAT B0RAT_3
180 #if (flash_EBIU_AMBCTL_RAT == 2)
181 #define flash_EBIU_AMBCTL0_RAT B0RAT_2
183 #if (flash_EBIU_AMBCTL_RAT == 1)
184 #define flash_EBIU_AMBCTL0_RAT B0RAT_1
187 #define flash_EBIU_AMBCTL0 \
188 (flash_EBIU_AMBCTL0_WAT | flash_EBIU_AMBCTL0_RAT | flash_EBIU_AMBCTL0_HT | \
189 flash_EBIU_AMBCTL0_ST | flash_EBIU_AMBCTL0_TT | CONFIG_FLASH_SPEED_RDYEN)