aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Hennerich <michael.hennerich@analog.com>2008-07-14 04:51:57 -0400
committerBryan Wu <cooloney@kernel.org>2008-07-14 04:51:57 -0400
commit68e2fc78e5055740126df8eab0d31005495756c9 (patch)
tree0d43976ff1d3ae8535445f9bcb1687f657f33337
parent260d5d3517c67c5b68b4e28c5d3e1e3b73976a90 (diff)
Blackfin arch: Fix bug - Kernel does not boot if re-program clocks
Don't write conflicting data to EBIU_SDBCTL after the SDRAM is configured. This can cause data corruption, since we might change SDRAM row and column addressing modes. Signed-off-by: Michael Hennerich <michael.hennerich@analog.com> Signed-off-by: Bryan Wu <cooloney@kernel.org>
-rw-r--r--arch/blackfin/Kconfig14
-rw-r--r--arch/blackfin/mach-bf527/head.S12
-rw-r--r--arch/blackfin/mach-bf533/head.S12
-rw-r--r--arch/blackfin/mach-bf537/head.S12
-rw-r--r--arch/blackfin/mach-bf548/head.S6
-rw-r--r--arch/blackfin/mach-bf561/head.S6
-rw-r--r--include/asm-blackfin/mach-bf527/mem_init.h27
-rw-r--r--include/asm-blackfin/mach-bf533/mem_init.h27
-rw-r--r--include/asm-blackfin/mach-bf537/mem_init.h27
-rw-r--r--include/asm-blackfin/mach-bf561/mem_init.h27
10 files changed, 12 insertions, 158 deletions
diff --git a/arch/blackfin/Kconfig b/arch/blackfin/Kconfig
index b87634e75f20..d0f7ff3dc088 100644
--- a/arch/blackfin/Kconfig
+++ b/arch/blackfin/Kconfig
@@ -315,20 +315,6 @@ config MEM_SIZE
315 depends on BFIN_KERNEL_CLOCK 315 depends on BFIN_KERNEL_CLOCK
316 default 64 316 default 64
317 317
318config MEM_ADD_WIDTH
319 int "Memory Address Width"
320 depends on BFIN_KERNEL_CLOCK
321 depends on (!BF54x)
322 range 8 11
323 default 9 if BFIN533_EZKIT
324 default 9 if BFIN561_EZKIT
325 default 9 if H8606_HVSISTEMAS
326 default 10 if BFIN527_EZKIT
327 default 10 if BFIN537_STAMP
328 default 11 if BFIN533_STAMP
329 default 10 if PNAV10
330 default 10 if BFIN532_IP0X
331
332config PLL_BYPASS 318config PLL_BYPASS
333 bool "Bypass PLL" 319 bool "Bypass PLL"
334 depends on BFIN_KERNEL_CLOCK 320 depends on BFIN_KERNEL_CLOCK
diff --git a/arch/blackfin/mach-bf527/head.S b/arch/blackfin/mach-bf527/head.S
index 57bdb3ba2fed..fe05cc1ef174 100644
--- a/arch/blackfin/mach-bf527/head.S
+++ b/arch/blackfin/mach-bf527/head.S
@@ -32,7 +32,7 @@
32#include <asm/blackfin.h> 32#include <asm/blackfin.h>
33#include <asm/trace.h> 33#include <asm/trace.h>
34 34
35#if CONFIG_BFIN_KERNEL_CLOCK 35#ifdef CONFIG_BFIN_KERNEL_CLOCK
36#include <asm/mach-common/clocks.h> 36#include <asm/mach-common/clocks.h>
37#include <asm/mach/mem_init.h> 37#include <asm/mach/mem_init.h>
38#endif 38#endif
@@ -185,7 +185,7 @@ ENTRY(__start)
185 185
186 /* Put The Code for PLL Programming and SDRAM Programming in L1 ISRAM */ 186 /* Put The Code for PLL Programming and SDRAM Programming in L1 ISRAM */
187 call _bf53x_relocate_l1_mem; 187 call _bf53x_relocate_l1_mem;
188#if CONFIG_BFIN_KERNEL_CLOCK 188#ifdef CONFIG_BFIN_KERNEL_CLOCK
189 call _start_dma_code; 189 call _start_dma_code;
190#endif 190#endif
191 191
@@ -318,7 +318,7 @@ ENDPROC(_real_start)
318__FINIT 318__FINIT
319 319
320.section .l1.text 320.section .l1.text
321#if CONFIG_BFIN_KERNEL_CLOCK 321#ifdef CONFIG_BFIN_KERNEL_CLOCK
322ENTRY(_start_dma_code) 322ENTRY(_start_dma_code)
323 323
324 /* Enable PHY CLK buffer output */ 324 /* Enable PHY CLK buffer output */
@@ -398,12 +398,6 @@ ENTRY(_start_dma_code)
398 w[p0] = r0.l; 398 w[p0] = r0.l;
399 ssync; 399 ssync;
400 400
401 p0.l = LO(EBIU_SDBCTL);
402 p0.h = HI(EBIU_SDBCTL); /* SDRAM Memory Bank Control Register */
403 r0 = mem_SDBCTL;
404 w[p0] = r0.l;
405 ssync;
406
407 P2.H = hi(EBIU_SDGCTL); 401 P2.H = hi(EBIU_SDGCTL);
408 P2.L = lo(EBIU_SDGCTL); 402 P2.L = lo(EBIU_SDGCTL);
409 R0 = [P2]; 403 R0 = [P2];
diff --git a/arch/blackfin/mach-bf533/head.S b/arch/blackfin/mach-bf533/head.S
index 1295deac00a4..c671e8549b17 100644
--- a/arch/blackfin/mach-bf533/head.S
+++ b/arch/blackfin/mach-bf533/head.S
@@ -31,7 +31,7 @@
31#include <linux/init.h> 31#include <linux/init.h>
32#include <asm/blackfin.h> 32#include <asm/blackfin.h>
33#include <asm/trace.h> 33#include <asm/trace.h>
34#if CONFIG_BFIN_KERNEL_CLOCK 34#ifdef CONFIG_BFIN_KERNEL_CLOCK
35#include <asm/mach-common/clocks.h> 35#include <asm/mach-common/clocks.h>
36#include <asm/mach/mem_init.h> 36#include <asm/mach/mem_init.h>
37#endif 37#endif
@@ -186,7 +186,7 @@ ENTRY(__start)
186 186
187 /* Put The Code for PLL Programming and SDRAM Programming in L1 ISRAM */ 187 /* Put The Code for PLL Programming and SDRAM Programming in L1 ISRAM */
188 call _bf53x_relocate_l1_mem; 188 call _bf53x_relocate_l1_mem;
189#if CONFIG_BFIN_KERNEL_CLOCK 189#ifdef CONFIG_BFIN_KERNEL_CLOCK
190 call _start_dma_code; 190 call _start_dma_code;
191#endif 191#endif
192 192
@@ -319,7 +319,7 @@ ENDPROC(_real_start)
319__FINIT 319__FINIT
320 320
321.section .l1.text 321.section .l1.text
322#if CONFIG_BFIN_KERNEL_CLOCK 322#ifdef CONFIG_BFIN_KERNEL_CLOCK
323ENTRY(_start_dma_code) 323ENTRY(_start_dma_code)
324 p0.h = hi(SIC_IWR); 324 p0.h = hi(SIC_IWR);
325 p0.l = lo(SIC_IWR); 325 p0.l = lo(SIC_IWR);
@@ -390,12 +390,6 @@ ENTRY(_start_dma_code)
390 w[p0] = r0.l; 390 w[p0] = r0.l;
391 ssync; 391 ssync;
392 392
393 p0.l = LO(EBIU_SDBCTL);
394 p0.h = HI(EBIU_SDBCTL); /* SDRAM Memory Bank Control Register */
395 r0 = mem_SDBCTL;
396 w[p0] = r0.l;
397 ssync;
398
399 P2.H = hi(EBIU_SDGCTL); 393 P2.H = hi(EBIU_SDGCTL);
400 P2.L = lo(EBIU_SDGCTL); 394 P2.L = lo(EBIU_SDGCTL);
401 R0 = [P2]; 395 R0 = [P2];
diff --git a/arch/blackfin/mach-bf537/head.S b/arch/blackfin/mach-bf537/head.S
index 48cd58a410a0..6b019eaee0b6 100644
--- a/arch/blackfin/mach-bf537/head.S
+++ b/arch/blackfin/mach-bf537/head.S
@@ -32,7 +32,7 @@
32#include <asm/blackfin.h> 32#include <asm/blackfin.h>
33#include <asm/trace.h> 33#include <asm/trace.h>
34 34
35#if CONFIG_BFIN_KERNEL_CLOCK 35#ifdef CONFIG_BFIN_KERNEL_CLOCK
36#include <asm/mach-common/clocks.h> 36#include <asm/mach-common/clocks.h>
37#include <asm/mach/mem_init.h> 37#include <asm/mach/mem_init.h>
38#endif 38#endif
@@ -217,7 +217,7 @@ ENTRY(__start)
217 217
218 /* Put The Code for PLL Programming and SDRAM Programming in L1 ISRAM */ 218 /* Put The Code for PLL Programming and SDRAM Programming in L1 ISRAM */
219 call _bf53x_relocate_l1_mem; 219 call _bf53x_relocate_l1_mem;
220#if CONFIG_BFIN_KERNEL_CLOCK 220#ifdef CONFIG_BFIN_KERNEL_CLOCK
221 call _start_dma_code; 221 call _start_dma_code;
222#endif 222#endif
223 223
@@ -350,7 +350,7 @@ ENDPROC(_real_start)
350__FINIT 350__FINIT
351 351
352.section .l1.text 352.section .l1.text
353#if CONFIG_BFIN_KERNEL_CLOCK 353#ifdef CONFIG_BFIN_KERNEL_CLOCK
354ENTRY(_start_dma_code) 354ENTRY(_start_dma_code)
355 355
356 /* Enable PHY CLK buffer output */ 356 /* Enable PHY CLK buffer output */
@@ -430,12 +430,6 @@ ENTRY(_start_dma_code)
430 w[p0] = r0.l; 430 w[p0] = r0.l;
431 ssync; 431 ssync;
432 432
433 p0.l = LO(EBIU_SDBCTL);
434 p0.h = HI(EBIU_SDBCTL); /* SDRAM Memory Bank Control Register */
435 r0 = mem_SDBCTL;
436 w[p0] = r0.l;
437 ssync;
438
439 P2.H = hi(EBIU_SDGCTL); 433 P2.H = hi(EBIU_SDGCTL);
440 P2.L = lo(EBIU_SDGCTL); 434 P2.L = lo(EBIU_SDGCTL);
441 R0 = [P2]; 435 R0 = [P2];
diff --git a/arch/blackfin/mach-bf548/head.S b/arch/blackfin/mach-bf548/head.S
index f7191141a3ce..06b9178cfcfe 100644
--- a/arch/blackfin/mach-bf548/head.S
+++ b/arch/blackfin/mach-bf548/head.S
@@ -31,7 +31,7 @@
31#include <linux/init.h> 31#include <linux/init.h>
32#include <asm/blackfin.h> 32#include <asm/blackfin.h>
33#include <asm/trace.h> 33#include <asm/trace.h>
34#if CONFIG_BFIN_KERNEL_CLOCK 34#ifdef CONFIG_BFIN_KERNEL_CLOCK
35#include <asm/mach-common/clocks.h> 35#include <asm/mach-common/clocks.h>
36#include <asm/mach/mem_init.h> 36#include <asm/mach/mem_init.h>
37#endif 37#endif
@@ -130,7 +130,7 @@ ENTRY(__start)
130 130
131 /* Put The Code for PLL Programming and SDRAM Programming in L1 ISRAM */ 131 /* Put The Code for PLL Programming and SDRAM Programming in L1 ISRAM */
132 call _bf53x_relocate_l1_mem; 132 call _bf53x_relocate_l1_mem;
133#if CONFIG_BFIN_KERNEL_CLOCK 133#ifdef CONFIG_BFIN_KERNEL_CLOCK
134 call _start_dma_code; 134 call _start_dma_code;
135#endif 135#endif
136 /* Code for initializing Async memory banks */ 136 /* Code for initializing Async memory banks */
@@ -288,7 +288,7 @@ ENDPROC(_real_start)
288__FINIT 288__FINIT
289 289
290.section .l1.text 290.section .l1.text
291#if CONFIG_BFIN_KERNEL_CLOCK 291#ifdef CONFIG_BFIN_KERNEL_CLOCK
292ENTRY(_start_dma_code) 292ENTRY(_start_dma_code)
293 293
294 /* Enable PHY CLK buffer output */ 294 /* Enable PHY CLK buffer output */
diff --git a/arch/blackfin/mach-bf561/head.S b/arch/blackfin/mach-bf561/head.S
index 5b8bd40851dd..cf1a2dff01e7 100644
--- a/arch/blackfin/mach-bf561/head.S
+++ b/arch/blackfin/mach-bf561/head.S
@@ -377,12 +377,6 @@ ENTRY(_start_dma_code)
377 w[p0] = r0.l; 377 w[p0] = r0.l;
378 ssync; 378 ssync;
379 379
380 p0.l = LO(EBIU_SDBCTL);
381 p0.h = HI(EBIU_SDBCTL); /* SDRAM Memory Bank Control Register */
382 r0 = mem_SDBCTL;
383 w[p0] = r0.l;
384 ssync;
385
386 P2.H = hi(EBIU_SDGCTL); 380 P2.H = hi(EBIU_SDGCTL);
387 P2.L = lo(EBIU_SDGCTL); 381 P2.L = lo(EBIU_SDGCTL);
388 R0 = [P2]; 382 R0 = [P2];
diff --git a/include/asm-blackfin/mach-bf527/mem_init.h b/include/asm-blackfin/mach-bf527/mem_init.h
index 008ca66719e2..cbe03f4a5698 100644
--- a/include/asm-blackfin/mach-bf527/mem_init.h
+++ b/include/asm-blackfin/mach-bf527/mem_init.h
@@ -146,33 +146,6 @@
146#define SDRAM_CL CL_3 146#define SDRAM_CL CL_3
147#endif 147#endif
148 148
149#if (CONFIG_MEM_SIZE == 128)
150#define SDRAM_SIZE EBSZ_128
151#endif
152#if (CONFIG_MEM_SIZE == 64)
153#define SDRAM_SIZE EBSZ_64
154#endif
155#if (CONFIG_MEM_SIZE == 32)
156#define SDRAM_SIZE EBSZ_32
157#endif
158#if (CONFIG_MEM_SIZE == 16)
159#define SDRAM_SIZE EBSZ_16
160#endif
161#if (CONFIG_MEM_ADD_WIDTH == 11)
162#define SDRAM_WIDTH EBCAW_11
163#endif
164#if (CONFIG_MEM_ADD_WIDTH == 10)
165#define SDRAM_WIDTH EBCAW_10
166#endif
167#if (CONFIG_MEM_ADD_WIDTH == 9)
168#define SDRAM_WIDTH EBCAW_9
169#endif
170#if (CONFIG_MEM_ADD_WIDTH == 8)
171#define SDRAM_WIDTH EBCAW_8
172#endif
173
174#define mem_SDBCTL (SDRAM_WIDTH | SDRAM_SIZE | EBE)
175
176/* Equation from section 17 (p17-46) of BF533 HRM */ 149/* Equation from section 17 (p17-46) of BF533 HRM */
177#define mem_SDRRC (((CONFIG_SCLK_HZ / 1000) * SDRAM_Tref) / SDRAM_NRA) - (SDRAM_tRAS_num + SDRAM_tRP_num) 150#define mem_SDRRC (((CONFIG_SCLK_HZ / 1000) * SDRAM_Tref) / SDRAM_NRA) - (SDRAM_tRAS_num + SDRAM_tRP_num)
178 151
diff --git a/include/asm-blackfin/mach-bf533/mem_init.h b/include/asm-blackfin/mach-bf533/mem_init.h
index f8f31901fca9..995c06b2b1ef 100644
--- a/include/asm-blackfin/mach-bf533/mem_init.h
+++ b/include/asm-blackfin/mach-bf533/mem_init.h
@@ -133,33 +133,6 @@
133#define SDRAM_CL CL_3 133#define SDRAM_CL CL_3
134#endif 134#endif
135 135
136#if (CONFIG_MEM_SIZE == 128)
137#define SDRAM_SIZE EBSZ_128
138#endif
139#if (CONFIG_MEM_SIZE == 64)
140#define SDRAM_SIZE EBSZ_64
141#endif
142#if (CONFIG_MEM_SIZE == 32)
143#define SDRAM_SIZE EBSZ_32
144#endif
145#if (CONFIG_MEM_SIZE == 16)
146#define SDRAM_SIZE EBSZ_16
147#endif
148#if (CONFIG_MEM_ADD_WIDTH == 11)
149#define SDRAM_WIDTH EBCAW_11
150#endif
151#if (CONFIG_MEM_ADD_WIDTH == 10)
152#define SDRAM_WIDTH EBCAW_10
153#endif
154#if (CONFIG_MEM_ADD_WIDTH == 9)
155#define SDRAM_WIDTH EBCAW_9
156#endif
157#if (CONFIG_MEM_ADD_WIDTH == 8)
158#define SDRAM_WIDTH EBCAW_8
159#endif
160
161#define mem_SDBCTL (SDRAM_WIDTH | SDRAM_SIZE | EBE)
162
163/* Equation from section 17 (p17-46) of BF533 HRM */ 136/* Equation from section 17 (p17-46) of BF533 HRM */
164#define mem_SDRRC (((CONFIG_SCLK_HZ / 1000) * SDRAM_Tref) / SDRAM_NRA) - (SDRAM_tRAS_num + SDRAM_tRP_num) 137#define mem_SDRRC (((CONFIG_SCLK_HZ / 1000) * SDRAM_Tref) / SDRAM_NRA) - (SDRAM_tRAS_num + SDRAM_tRP_num)
165 138
diff --git a/include/asm-blackfin/mach-bf537/mem_init.h b/include/asm-blackfin/mach-bf537/mem_init.h
index 9ad979d416c6..f67698f670ca 100644
--- a/include/asm-blackfin/mach-bf537/mem_init.h
+++ b/include/asm-blackfin/mach-bf537/mem_init.h
@@ -139,33 +139,6 @@
139#define SDRAM_CL CL_3 139#define SDRAM_CL CL_3
140#endif 140#endif
141 141
142#if (CONFIG_MEM_SIZE == 128)
143#define SDRAM_SIZE EBSZ_128
144#endif
145#if (CONFIG_MEM_SIZE == 64)
146#define SDRAM_SIZE EBSZ_64
147#endif
148#if (CONFIG_MEM_SIZE == 32)
149#define SDRAM_SIZE EBSZ_32
150#endif
151#if (CONFIG_MEM_SIZE == 16)
152#define SDRAM_SIZE EBSZ_16
153#endif
154#if (CONFIG_MEM_ADD_WIDTH == 11)
155#define SDRAM_WIDTH EBCAW_11
156#endif
157#if (CONFIG_MEM_ADD_WIDTH == 10)
158#define SDRAM_WIDTH EBCAW_10
159#endif
160#if (CONFIG_MEM_ADD_WIDTH == 9)
161#define SDRAM_WIDTH EBCAW_9
162#endif
163#if (CONFIG_MEM_ADD_WIDTH == 8)
164#define SDRAM_WIDTH EBCAW_8
165#endif
166
167#define mem_SDBCTL (SDRAM_WIDTH | SDRAM_SIZE | EBE)
168
169/* Equation from section 17 (p17-46) of BF533 HRM */ 142/* Equation from section 17 (p17-46) of BF533 HRM */
170#define mem_SDRRC (((CONFIG_SCLK_HZ / 1000) * SDRAM_Tref) / SDRAM_NRA) - (SDRAM_tRAS_num + SDRAM_tRP_num) 143#define mem_SDRRC (((CONFIG_SCLK_HZ / 1000) * SDRAM_Tref) / SDRAM_NRA) - (SDRAM_tRAS_num + SDRAM_tRP_num)
171 144
diff --git a/include/asm-blackfin/mach-bf561/mem_init.h b/include/asm-blackfin/mach-bf561/mem_init.h
index 439a5895b346..e163260bca18 100644
--- a/include/asm-blackfin/mach-bf561/mem_init.h
+++ b/include/asm-blackfin/mach-bf561/mem_init.h
@@ -131,33 +131,6 @@
131#define SDRAM_CL CL_3 131#define SDRAM_CL CL_3
132#endif 132#endif
133 133
134#if (CONFIG_MEM_SIZE == 128)
135#define SDRAM_SIZE EB0_SZ_128
136#endif
137#if (CONFIG_MEM_SIZE == 64)
138#define SDRAM_SIZE EB0_SZ_64
139#endif
140#if ( CONFIG_MEM_SIZE == 32)
141#define SDRAM_SIZE EB0_SZ_32
142#endif
143#if (CONFIG_MEM_SIZE == 16)
144#define SDRAM_SIZE EB0_SZ_16
145#endif
146#if (CONFIG_MEM_ADD_WIDTH == 11)
147#define SDRAM_WIDTH EB0_CAW_11
148#endif
149#if (CONFIG_MEM_ADD_WIDTH == 10)
150#define SDRAM_WIDTH EB0_CAW_10
151#endif
152#if (CONFIG_MEM_ADD_WIDTH == 9)
153#define SDRAM_WIDTH EB0_CAW_9
154#endif
155#if (CONFIG_MEM_ADD_WIDTH == 8)
156#define SDRAM_WIDTH EB0_CAW_8
157#endif
158
159#define mem_SDBCTL (SDRAM_WIDTH | SDRAM_SIZE | EB0_E)
160
161/* Equation from section 17 (p17-46) of BF533 HRM */ 134/* Equation from section 17 (p17-46) of BF533 HRM */
162#define mem_SDRRC (((CONFIG_SCLK_HZ / 1000) * SDRAM_Tref) / SDRAM_NRA) - (SDRAM_tRAS_num + SDRAM_tRP_num) 135#define mem_SDRRC (((CONFIG_SCLK_HZ / 1000) * SDRAM_Tref) / SDRAM_NRA) - (SDRAM_tRAS_num + SDRAM_tRP_num)
163 136