diff options
author | Sonic Zhang <sonic.zhang@analog.com> | 2007-12-23 10:02:13 -0500 |
---|---|---|
committer | Bryan Wu <bryan.wu@analog.com> | 2007-12-23 10:02:13 -0500 |
commit | fb5f00492a748facc9f069c95621e05c148edf53 (patch) | |
tree | cf93dbf8140279e4913eb421dd68922a76ba241f | |
parent | c50e19f49830fb651b4b702ad2c3abcdf110b576 (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>
-rw-r--r-- | arch/blackfin/Kconfig | 2 | ||||
-rw-r--r-- | arch/blackfin/mach-bf548/head.S | 8 | ||||
-rw-r--r-- | arch/blackfin/mach-bf548/ints-priority.c | 2 | ||||
-rw-r--r-- | arch/blackfin/mach-common/dpmc.S | 46 | ||||
-rw-r--r-- | arch/blackfin/mach-common/pm.c | 16 | ||||
-rw-r--r-- | include/asm-blackfin/mach-bf548/irq.h | 4 | ||||
-rw-r--r-- | include/asm-blackfin/mach-bf548/mem_init.h | 1 |
7 files changed, 64 insertions, 15 deletions
diff --git a/arch/blackfin/Kconfig b/arch/blackfin/Kconfig index 25232ba08119..5ebcfd226ed8 100644 --- a/arch/blackfin/Kconfig +++ b/arch/blackfin/Kconfig | |||
@@ -951,6 +951,8 @@ config PM_WAKEUP_SIC_IWR | |||
951 | depends on PM_WAKEUP_GPIO_BY_SIC_IWR | 951 | depends on PM_WAKEUP_GPIO_BY_SIC_IWR |
952 | default 0x80000000 if (BF537 || BF536 || BF534) | 952 | default 0x80000000 if (BF537 || BF536 || BF534) |
953 | default 0x100000 if (BF533 || BF532 || BF531) | 953 | default 0x100000 if (BF533 || BF532 || BF531) |
954 | default 0x800000 if (BF549 || BF548 || BF547 || BF542) | ||
955 | default 0x800000 if (BF527 || BF524 || BF522) | ||
954 | 956 | ||
955 | config PM_WAKEUP_GPIO_NUMBER | 957 | config PM_WAKEUP_GPIO_NUMBER |
956 | int "Wakeup GPIO number" | 958 | int "Wakeup GPIO number" |
diff --git a/arch/blackfin/mach-bf548/head.S b/arch/blackfin/mach-bf548/head.S index 74b34c7f3629..745662e88759 100644 --- a/arch/blackfin/mach-bf548/head.S +++ b/arch/blackfin/mach-bf548/head.S | |||
@@ -298,8 +298,8 @@ ENTRY(_start_dma_code) | |||
298 | w[p0] = r0.l; | 298 | w[p0] = r0.l; |
299 | ssync; | 299 | ssync; |
300 | 300 | ||
301 | p0.h = hi(SIC_IWR); | 301 | p0.h = hi(SIC_IWR0); |
302 | p0.l = lo(SIC_IWR); | 302 | p0.l = lo(SIC_IWR0); |
303 | r0.l = 0x1; | 303 | r0.l = 0x1; |
304 | r0.h = 0x0; | 304 | r0.h = 0x0; |
305 | [p0] = r0; | 305 | [p0] = r0; |
@@ -395,8 +395,8 @@ ENTRY(_start_dma_code) | |||
395 | [P2] = R1; | 395 | [P2] = R1; |
396 | SSYNC; | 396 | SSYNC; |
397 | 397 | ||
398 | p0.h = hi(SIC_IWR); | 398 | p0.h = hi(SIC_IWR0); |
399 | p0.l = lo(SIC_IWR); | 399 | p0.l = lo(SIC_IWR0); |
400 | r0.l = lo(IWR_ENABLE_ALL); | 400 | r0.l = lo(IWR_ENABLE_ALL); |
401 | r0.h = hi(IWR_ENABLE_ALL); | 401 | r0.h = hi(IWR_ENABLE_ALL); |
402 | [p0] = r0; | 402 | [p0] = r0; |
diff --git a/arch/blackfin/mach-bf548/ints-priority.c b/arch/blackfin/mach-bf548/ints-priority.c index cb0ebac53c79..05e3b3cb4c0a 100644 --- a/arch/blackfin/mach-bf548/ints-priority.c +++ b/arch/blackfin/mach-bf548/ints-priority.c | |||
@@ -58,7 +58,7 @@ void program_IAR(void) | |||
58 | ((CONFIG_IRQ_PINT1 - 7) << IRQ_PINT1_POS) | | 58 | ((CONFIG_IRQ_PINT1 - 7) << IRQ_PINT1_POS) | |
59 | ((CONFIG_IRQ_MDMAS0 - 7) << IRQ_MDMAS0_POS) | | 59 | ((CONFIG_IRQ_MDMAS0 - 7) << IRQ_MDMAS0_POS) | |
60 | ((CONFIG_IRQ_MDMAS1 - 7) << IRQ_MDMAS1_POS) | | 60 | ((CONFIG_IRQ_MDMAS1 - 7) << IRQ_MDMAS1_POS) | |
61 | ((CONFIG_IRQ_WATCHDOG - 7) << IRQ_WATCHDOG_POS)); | 61 | ((CONFIG_IRQ_WATCHDOG - 7) << IRQ_WATCH_POS)); |
62 | 62 | ||
63 | bfin_write_SIC_IAR3(((CONFIG_IRQ_DMAC1_ERR - 7) << IRQ_DMAC1_ERR_POS) | | 63 | bfin_write_SIC_IAR3(((CONFIG_IRQ_DMAC1_ERR - 7) << IRQ_DMAC1_ERR_POS) | |
64 | ((CONFIG_IRQ_SPORT2_ERR - 7) << IRQ_SPORT2_ERR_POS) | | 64 | ((CONFIG_IRQ_SPORT2_ERR - 7) << IRQ_SPORT2_ERR_POS) | |
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 | ||
371 | ENTRY(_set_sdram_srfs) | 374 | ENTRY(_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 | ||
383 | ENTRY(_unset_sdram_srfs) | 400 | ENTRY(_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 | ||
396 | ENTRY(_set_sic_iwr) | 421 | ENTRY(_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 | ||
diff --git a/include/asm-blackfin/mach-bf548/irq.h b/include/asm-blackfin/mach-bf548/irq.h index 9fb7bc5399a8..c34507a3f1df 100644 --- a/include/asm-blackfin/mach-bf548/irq.h +++ b/include/asm-blackfin/mach-bf548/irq.h | |||
@@ -88,7 +88,7 @@ Events (highest priority) EMU 0 | |||
88 | #define IRQ_PINT1 BFIN_IRQ(20) /* PINT1 Interrupt */ | 88 | #define IRQ_PINT1 BFIN_IRQ(20) /* PINT1 Interrupt */ |
89 | #define IRQ_MDMAS0 BFIN_IRQ(21) /* MDMA Stream 0 Interrupt */ | 89 | #define IRQ_MDMAS0 BFIN_IRQ(21) /* MDMA Stream 0 Interrupt */ |
90 | #define IRQ_MDMAS1 BFIN_IRQ(22) /* MDMA Stream 1 Interrupt */ | 90 | #define IRQ_MDMAS1 BFIN_IRQ(22) /* MDMA Stream 1 Interrupt */ |
91 | #define IRQ_WATCHDOG BFIN_IRQ(23) /* Watchdog Interrupt */ | 91 | #define IRQ_WATCH BFIN_IRQ(23) /* Watchdog Interrupt */ |
92 | #define IRQ_DMAC1_ERROR BFIN_IRQ(24) /* DMAC1 Status (Error) Interrupt */ | 92 | #define IRQ_DMAC1_ERROR BFIN_IRQ(24) /* DMAC1 Status (Error) Interrupt */ |
93 | #define IRQ_SPORT2_ERROR BFIN_IRQ(25) /* SPORT2 Error Interrupt */ | 93 | #define IRQ_SPORT2_ERROR BFIN_IRQ(25) /* SPORT2 Error Interrupt */ |
94 | #define IRQ_SPORT3_ERROR BFIN_IRQ(26) /* SPORT3 Error Interrupt */ | 94 | #define IRQ_SPORT3_ERROR BFIN_IRQ(26) /* SPORT3 Error Interrupt */ |
@@ -406,7 +406,7 @@ Events (highest priority) EMU 0 | |||
406 | #define IRQ_PINT1_POS 16 | 406 | #define IRQ_PINT1_POS 16 |
407 | #define IRQ_MDMAS0_POS 20 | 407 | #define IRQ_MDMAS0_POS 20 |
408 | #define IRQ_MDMAS1_POS 24 | 408 | #define IRQ_MDMAS1_POS 24 |
409 | #define IRQ_WATCHDOG_POS 28 | 409 | #define IRQ_WATCH_POS 28 |
410 | 410 | ||
411 | /* IAR3 BIT FIELDS */ | 411 | /* IAR3 BIT FIELDS */ |
412 | #define IRQ_DMAC1_ERR_POS 0 | 412 | #define IRQ_DMAC1_ERR_POS 0 |
diff --git a/include/asm-blackfin/mach-bf548/mem_init.h b/include/asm-blackfin/mach-bf548/mem_init.h index 0cb279e973d7..e792eb7ae6a0 100644 --- a/include/asm-blackfin/mach-bf548/mem_init.h +++ b/include/asm-blackfin/mach-bf548/mem_init.h | |||
@@ -30,6 +30,7 @@ | |||
30 | */ | 30 | */ |
31 | 31 | ||
32 | #if (CONFIG_MEM_MT46V32M16) | 32 | #if (CONFIG_MEM_MT46V32M16) |
33 | #endif | ||
33 | 34 | ||
34 | #if defined CONFIG_CLKIN_HALF | 35 | #if defined CONFIG_CLKIN_HALF |
35 | #define CLKIN_HALF 1 | 36 | #define CLKIN_HALF 1 |