aboutsummaryrefslogtreecommitdiffstats
path: root/arch/blackfin/mach-common
diff options
context:
space:
mode:
authorSonic Zhang <sonic.zhang@analog.com>2007-12-23 10:02:13 -0500
committerBryan Wu <bryan.wu@analog.com>2007-12-23 10:02:13 -0500
commitfb5f00492a748facc9f069c95621e05c148edf53 (patch)
treecf93dbf8140279e4913eb421dd68922a76ba241f /arch/blackfin/mach-common
parentc50e19f49830fb651b4b702ad2c3abcdf110b576 (diff)
[Blackfin] arch: Fix bug to Enable kernel to build for bf548 with PM.
On BF548-EZKIT, build kernel faills with power management, video and audio enabled. This patch fix this. Signed-off-by: Sonic Zhang <sonic.zhang@analog.com> Signed-off-by: Bryan Wu <bryan.wu@analog.com>
Diffstat (limited to 'arch/blackfin/mach-common')
-rw-r--r--arch/blackfin/mach-common/dpmc.S46
-rw-r--r--arch/blackfin/mach-common/pm.c16
2 files changed, 54 insertions, 8 deletions
diff --git a/arch/blackfin/mach-common/dpmc.S b/arch/blackfin/mach-common/dpmc.S
index 39fbc2861107..301ac1b6681f 100644
--- a/arch/blackfin/mach-common/dpmc.S
+++ b/arch/blackfin/mach-common/dpmc.S
@@ -38,6 +38,9 @@ ENTRY(_unmask_wdog_wakeup_evt)
38#if defined(CONFIG_BF561) 38#if defined(CONFIG_BF561)
39 P0.H = hi(SICA_IWR1); 39 P0.H = hi(SICA_IWR1);
40 P0.L = lo(SICA_IWR1); 40 P0.L = lo(SICA_IWR1);
41#elif defined(CONFIG_BF54x) || defined(CONFIG_BF52x)
42 P0.h = HI(SIC_IWR0);
43 P0.l = LO(SIC_IWR0);
41#else 44#else
42 P0.h = HI(SIC_IWR); 45 P0.h = HI(SIC_IWR);
43 P0.l = LO(SIC_IWR); 46 P0.l = LO(SIC_IWR);
@@ -236,7 +239,7 @@ ENTRY(_deep_sleep)
236 239
237 call _set_sic_iwr; 240 call _set_sic_iwr;
238 241
239 call _set_sdram_srfs; 242 call _set_dram_srfs;
240 243
241 /* Clear all the interrupts,bits sticky */ 244 /* Clear all the interrupts,bits sticky */
242 R0 = 0xFFFF (Z); 245 R0 = 0xFFFF (Z);
@@ -253,7 +256,7 @@ ENTRY(_deep_sleep)
253 SSYNC; 256 SSYNC;
254 IDLE; 257 IDLE;
255 258
256 call _unset_sdram_srfs; 259 call _unset_dram_srfs;
257 260
258 call _test_pll_locked; 261 call _test_pll_locked;
259 262
@@ -285,7 +288,7 @@ ENTRY(_sleep_deeper)
285 P3 = R0; 288 P3 = R0;
286 R0 = IWR_ENABLE(0); 289 R0 = IWR_ENABLE(0);
287 call _set_sic_iwr; 290 call _set_sic_iwr;
288 call _set_sdram_srfs; 291 call _set_dram_srfs;
289 292
290 /* Clear all the interrupts,bits sticky */ 293 /* Clear all the interrupts,bits sticky */
291 R0 = 0xFFFF (Z); 294 R0 = 0xFFFF (Z);
@@ -360,7 +363,7 @@ ENTRY(_sleep_deeper)
360 IDLE; 363 IDLE;
361 call _test_pll_locked; 364 call _test_pll_locked;
362 365
363 call _unset_sdram_srfs; 366 call _unset_dram_srfs;
364 367
365 STI R4; 368 STI R4;
366 369
@@ -368,25 +371,47 @@ ENTRY(_sleep_deeper)
368 ( R7:0, P5:0 ) = [SP++]; 371 ( R7:0, P5:0 ) = [SP++];
369 RTS; 372 RTS;
370 373
371ENTRY(_set_sdram_srfs) 374ENTRY(_set_dram_srfs)
372 /* set the sdram to self refresh mode */ 375 /* set the dram to self refresh mode */
376#if defined(CONFIG_BF54x)
377 P0.H = hi(EBIU_RSTCTL);
378 P0.L = lo(EBIU_RSTCTL);
379 R2 = [P0];
380 R3.H = hi(SRREQ);
381 R3.L = lo(SRREQ);
382#else
373 P0.H = hi(EBIU_SDGCTL); 383 P0.H = hi(EBIU_SDGCTL);
374 P0.L = lo(EBIU_SDGCTL); 384 P0.L = lo(EBIU_SDGCTL);
375 R2 = [P0]; 385 R2 = [P0];
376 R3.H = hi(SRFS); 386 R3.H = hi(SRFS);
377 R3.L = lo(SRFS); 387 R3.L = lo(SRFS);
388#endif
378 R2 = R2|R3; 389 R2 = R2|R3;
379 [P0] = R2; 390 [P0] = R2;
380 ssync; 391 ssync;
392#if defined(CONFIG_BF54x)
393.LSRR_MODE:
394 R2 = [P0];
395 CC = BITTST(R2, 4);
396 if !CC JUMP .LSRR_MODE;
397#endif
381 RTS; 398 RTS;
382 399
383ENTRY(_unset_sdram_srfs) 400ENTRY(_unset_dram_srfs)
384 /* set the sdram out of self refresh mode */ 401 /* set the dram out of self refresh mode */
402#if defined(CONFIG_BF54x)
403 P0.H = hi(EBIU_RSTCTL);
404 P0.L = lo(EBIU_RSTCTL);
405 R2 = [P0];
406 R3.H = hi(SRREQ);
407 R3.L = lo(SRREQ);
408#else
385 P0.H = hi(EBIU_SDGCTL); 409 P0.H = hi(EBIU_SDGCTL);
386 P0.L = lo(EBIU_SDGCTL); 410 P0.L = lo(EBIU_SDGCTL);
387 R2 = [P0]; 411 R2 = [P0];
388 R3.H = hi(SRFS); 412 R3.H = hi(SRFS);
389 R3.L = lo(SRFS); 413 R3.L = lo(SRFS);
414#endif
390 R3 = ~R3; 415 R3 = ~R3;
391 R2 = R2&R3; 416 R2 = R2&R3;
392 [P0] = R2; 417 [P0] = R2;
@@ -394,8 +419,13 @@ ENTRY(_unset_sdram_srfs)
394 RTS; 419 RTS;
395 420
396ENTRY(_set_sic_iwr) 421ENTRY(_set_sic_iwr)
422#if defined(CONFIG_BF54x) || defined(CONFIG_BF52x)
423 P0.H = hi(SIC_IWR0);
424 P0.L = lo(SIC_IWR0);
425#else
397 P0.H = hi(SIC_IWR); 426 P0.H = hi(SIC_IWR);
398 P0.L = lo(SIC_IWR); 427 P0.L = lo(SIC_IWR);
428#endif
399 [P0] = R0; 429 [P0] = R0;
400 SSYNC; 430 SSYNC;
401 RTS; 431 RTS;
diff --git a/arch/blackfin/mach-common/pm.c b/arch/blackfin/mach-common/pm.c
index dac51fb06f22..81930f7d06f1 100644
--- a/arch/blackfin/mach-common/pm.c
+++ b/arch/blackfin/mach-common/pm.c
@@ -77,7 +77,15 @@ void bfin_pm_suspend_standby_enter(void)
77 77
78 gpio_pm_restore(); 78 gpio_pm_restore();
79 79
80#if defined(CONFIG_BF54x) || defined(CONFIG_BF52x)
81 bfin_write_SIC_IWR0(IWR_ENABLE_ALL);
82 bfin_write_SIC_IWR1(IWR_ENABLE_ALL);
83# ifdef CONFIG_BF54x
84 bfin_write_SIC_IWR2(IWR_ENABLE_ALL);
85# endif
86#else
80 bfin_write_SIC_IWR(IWR_ENABLE_ALL); 87 bfin_write_SIC_IWR(IWR_ENABLE_ALL);
88#endif
81 89
82 local_irq_restore(flags); 90 local_irq_restore(flags);
83 } 91 }
@@ -85,7 +93,15 @@ void bfin_pm_suspend_standby_enter(void)
85 93
86#if defined(CONFIG_PM_WAKEUP_GPIO_BY_SIC_IWR) 94#if defined(CONFIG_PM_WAKEUP_GPIO_BY_SIC_IWR)
87 sleep_deeper(CONFIG_PM_WAKEUP_SIC_IWR); 95 sleep_deeper(CONFIG_PM_WAKEUP_SIC_IWR);
96# if defined(CONFIG_BF54x) || defined(CONFIG_BF52x)
97 bfin_write_SIC_IWR0(IWR_ENABLE_ALL);
98 bfin_write_SIC_IWR1(IWR_ENABLE_ALL);
99# ifdef CONFIG_BF54x
100 bfin_write_SIC_IWR2(IWR_ENABLE_ALL);
101# endif
102# else
88 bfin_write_SIC_IWR(IWR_ENABLE_ALL); 103 bfin_write_SIC_IWR(IWR_ENABLE_ALL);
104# endif
89#endif /* CONFIG_PM_WAKEUP_GPIO_BY_SIC_IWR */ 105#endif /* CONFIG_PM_WAKEUP_GPIO_BY_SIC_IWR */
90} 106}
91 107