aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-blackfin
diff options
context:
space:
mode:
authorMichael Hennerich <michael.hennerich@analog.com>2007-06-20 23:34:16 -0400
committerBryan Wu <bryan.wu@analog.com>2007-06-20 23:34:16 -0400
commit1c5d2265a82f8d3fa0471a60ca98072b3c53c299 (patch)
treed0644427e9d700df594fa8dbcbb1338bfd982ac2 /include/asm-blackfin
parentf8ffe652a01506e85e2dd579c58e50a3ba391921 (diff)
Blackfin arch: add missing implementations SIC_IWR crosses several registers
SIC_IWR crosses several registers - add missing implementations - make sure SIC_IWR is SET after boot Signed-off-by: Michael Hennerich <michael.hennerich@analog.com> Signed-off-by: Bryan Wu <bryan.wu@analog.com>
Diffstat (limited to 'include/asm-blackfin')
-rw-r--r--include/asm-blackfin/mach-bf548/cdefBF54x_base.h27
-rw-r--r--include/asm-blackfin/mach-bf561/cdefBF561.h10
2 files changed, 33 insertions, 4 deletions
diff --git a/include/asm-blackfin/mach-bf548/cdefBF54x_base.h b/include/asm-blackfin/mach-bf548/cdefBF54x_base.h
index b1338000e27b..87f2385ed971 100644
--- a/include/asm-blackfin/mach-bf548/cdefBF54x_base.h
+++ b/include/asm-blackfin/mach-bf548/cdefBF54x_base.h
@@ -32,6 +32,7 @@
32#define _CDEF_BF54X_H 32#define _CDEF_BF54X_H
33 33
34#include "defBF54x_base.h" 34#include "defBF54x_base.h"
35#include <asm/system.h>
35 36
36/* ************************************************************** */ 37/* ************************************************************** */
37/* SYSTEM & MMR ADDRESS DEFINITIONS COMMON TO ALL ADSP-BF54x */ 38/* SYSTEM & MMR ADDRESS DEFINITIONS COMMON TO ALL ADSP-BF54x */
@@ -44,7 +45,31 @@
44#define bfin_read_PLL_DIV() bfin_read16(PLL_DIV) 45#define bfin_read_PLL_DIV() bfin_read16(PLL_DIV)
45#define bfin_write_PLL_DIV(val) bfin_write16(PLL_DIV, val) 46#define bfin_write_PLL_DIV(val) bfin_write16(PLL_DIV, val)
46#define bfin_read_VR_CTL() bfin_read16(VR_CTL) 47#define bfin_read_VR_CTL() bfin_read16(VR_CTL)
47#define bfin_write_VR_CTL(val) bfin_write16(VR_CTL, val) 48/* Writing to VR_CTL initiates a PLL relock sequence. */
49static __inline__ void bfin_write_VR_CTL(unsigned int val)
50{
51 unsigned long flags, iwr0, iwr1, iwr2;
52
53 /* Enable the PLL Wakeup bit in SIC IWR */
54 iwr0 = bfin_read32(SIC_IWR0);
55 iwr1 = bfin_read32(SIC_IWR1);
56 iwr2 = bfin_read32(SIC_IWR2);
57 /* Only allow PPL Wakeup) */
58 bfin_write32(SIC_IWR0, IWR_ENABLE(0));
59 bfin_write32(SIC_IWR1, 0);
60 bfin_write32(SIC_IWR2, 0);
61
62 bfin_write16(VR_CTL, val);
63 __builtin_bfin_ssync();
64
65 local_irq_save(flags);
66 asm("IDLE;");
67 local_irq_restore(flags);
68 bfin_write32(SIC_IWR0, iwr0);
69 bfin_write32(SIC_IWR1, iwr1);
70 bfin_write32(SIC_IWR2, iwr2);
71
72}
48#define bfin_read_PLL_STAT() bfin_read16(PLL_STAT) 73#define bfin_read_PLL_STAT() bfin_read16(PLL_STAT)
49#define bfin_write_PLL_STAT(val) bfin_write16(PLL_STAT, val) 74#define bfin_write_PLL_STAT(val) bfin_write16(PLL_STAT, val)
50#define bfin_read_PLL_LOCKCNT() bfin_read16(PLL_LOCKCNT) 75#define bfin_read_PLL_LOCKCNT() bfin_read16(PLL_LOCKCNT)
diff --git a/include/asm-blackfin/mach-bf561/cdefBF561.h b/include/asm-blackfin/mach-bf561/cdefBF561.h
index b14f872e5703..6e8b8168a97a 100644
--- a/include/asm-blackfin/mach-bf561/cdefBF561.h
+++ b/include/asm-blackfin/mach-bf561/cdefBF561.h
@@ -57,12 +57,14 @@
57/* Writing to VR_CTL initiates a PLL relock sequence. */ 57/* Writing to VR_CTL initiates a PLL relock sequence. */
58static __inline__ void bfin_write_VR_CTL(unsigned int val) 58static __inline__ void bfin_write_VR_CTL(unsigned int val)
59{ 59{
60 unsigned long flags, iwr; 60 unsigned long flags, iwr0, iwr1;
61 61
62 /* Enable the PLL Wakeup bit in SIC IWR */ 62 /* Enable the PLL Wakeup bit in SIC IWR */
63 iwr = bfin_read32(SICA_IWR0); 63 iwr0 = bfin_read32(SICA_IWR0);
64 iwr1 = bfin_read32(SICA_IWR1);
64 /* Only allow PPL Wakeup) */ 65 /* Only allow PPL Wakeup) */
65 bfin_write32(SICA_IWR0, IWR_ENABLE(0)); 66 bfin_write32(SICA_IWR0, IWR_ENABLE(0));
67 bfin_write32(SICA_IWR1, 0);
66 68
67 bfin_write16(VR_CTL, val); 69 bfin_write16(VR_CTL, val);
68 __builtin_bfin_ssync(); 70 __builtin_bfin_ssync();
@@ -70,7 +72,9 @@ static __inline__ void bfin_write_VR_CTL(unsigned int val)
70 local_irq_save(flags); 72 local_irq_save(flags);
71 asm("IDLE;"); 73 asm("IDLE;");
72 local_irq_restore(flags); 74 local_irq_restore(flags);
73 bfin_write32(SICA_IWR0, iwr); 75 bfin_write32(SICA_IWR0, iwr0);
76 bfin_write32(SICA_IWR1, iwr1);
77
74} 78}
75#define bfin_read_PLL_STAT() bfin_read16(PLL_STAT) 79#define bfin_read_PLL_STAT() bfin_read16(PLL_STAT)
76#define bfin_write_PLL_STAT(val) bfin_write16(PLL_STAT,val) 80#define bfin_write_PLL_STAT(val) bfin_write16(PLL_STAT,val)