diff options
author | David Howells <dhowells@redhat.com> | 2010-10-07 09:08:49 -0400 |
---|---|---|
committer | David Howells <dhowells@redhat.com> | 2010-10-07 09:08:49 -0400 |
commit | 3dcc1e7f9fd48f20beefd41a684cd471a96565c5 (patch) | |
tree | 02ab916ad68feafdbd3fa5013958c9f4ec6f8457 /arch/blackfin/mach-bf533 | |
parent | cb655d0f3d57c23db51b981648e452988c0223f9 (diff) |
Blackfin: Split PLL code from mach-specific cdef headers
Split the PLL control code from the Blackfin machine-specific cdef headers so
that the irqflags functions can be renamed without incurring a header loop.
Signed-off-by: David Howells <dhowells@redhat.com>
Diffstat (limited to 'arch/blackfin/mach-bf533')
-rw-r--r-- | arch/blackfin/mach-bf533/include/mach/cdefBF532.h | 44 | ||||
-rw-r--r-- | arch/blackfin/mach-bf533/include/mach/pll.h | 57 |
2 files changed, 57 insertions, 44 deletions
diff --git a/arch/blackfin/mach-bf533/include/mach/cdefBF532.h b/arch/blackfin/mach-bf533/include/mach/cdefBF532.h index feb2392c43ea..8edad6d60f64 100644 --- a/arch/blackfin/mach-bf533/include/mach/cdefBF532.h +++ b/arch/blackfin/mach-bf533/include/mach/cdefBF532.h | |||
@@ -697,48 +697,4 @@ BFIN_READ_FIO_FLAG(T) | |||
697 | #define bfin_read_FIO_FLAG_D() bfin_read16(FIO_FLAG_D) | 697 | #define bfin_read_FIO_FLAG_D() bfin_read16(FIO_FLAG_D) |
698 | #endif | 698 | #endif |
699 | 699 | ||
700 | /* Writing to PLL_CTL initiates a PLL relock sequence. */ | ||
701 | static __inline__ void bfin_write_PLL_CTL(unsigned int val) | ||
702 | { | ||
703 | unsigned long flags, iwr; | ||
704 | |||
705 | if (val == bfin_read_PLL_CTL()) | ||
706 | return; | ||
707 | |||
708 | local_irq_save_hw(flags); | ||
709 | /* Enable the PLL Wakeup bit in SIC IWR */ | ||
710 | iwr = bfin_read32(SIC_IWR); | ||
711 | /* Only allow PPL Wakeup) */ | ||
712 | bfin_write32(SIC_IWR, IWR_ENABLE(0)); | ||
713 | |||
714 | bfin_write16(PLL_CTL, val); | ||
715 | SSYNC(); | ||
716 | asm("IDLE;"); | ||
717 | |||
718 | bfin_write32(SIC_IWR, iwr); | ||
719 | local_irq_restore_hw(flags); | ||
720 | } | ||
721 | |||
722 | /* Writing to VR_CTL initiates a PLL relock sequence. */ | ||
723 | static __inline__ void bfin_write_VR_CTL(unsigned int val) | ||
724 | { | ||
725 | unsigned long flags, iwr; | ||
726 | |||
727 | if (val == bfin_read_VR_CTL()) | ||
728 | return; | ||
729 | |||
730 | local_irq_save_hw(flags); | ||
731 | /* Enable the PLL Wakeup bit in SIC IWR */ | ||
732 | iwr = bfin_read32(SIC_IWR); | ||
733 | /* Only allow PPL Wakeup) */ | ||
734 | bfin_write32(SIC_IWR, IWR_ENABLE(0)); | ||
735 | |||
736 | bfin_write16(VR_CTL, val); | ||
737 | SSYNC(); | ||
738 | asm("IDLE;"); | ||
739 | |||
740 | bfin_write32(SIC_IWR, iwr); | ||
741 | local_irq_restore_hw(flags); | ||
742 | } | ||
743 | |||
744 | #endif /* _CDEF_BF532_H */ | 700 | #endif /* _CDEF_BF532_H */ |
diff --git a/arch/blackfin/mach-bf533/include/mach/pll.h b/arch/blackfin/mach-bf533/include/mach/pll.h new file mode 100644 index 000000000000..9a0c9a2f1278 --- /dev/null +++ b/arch/blackfin/mach-bf533/include/mach/pll.h | |||
@@ -0,0 +1,57 @@ | |||
1 | /* | ||
2 | * Copyright 2005-2008 Analog Devices Inc. | ||
3 | * | ||
4 | * Licensed under the GPL-2 or later | ||
5 | */ | ||
6 | |||
7 | #ifndef _MACH_PLL_H | ||
8 | #define _MACH_PLL_H | ||
9 | |||
10 | #include <asm/blackfin.h> | ||
11 | #include <asm/irqflags.h> | ||
12 | |||
13 | /* Writing to PLL_CTL initiates a PLL relock sequence. */ | ||
14 | static __inline__ void bfin_write_PLL_CTL(unsigned int val) | ||
15 | { | ||
16 | unsigned long flags, iwr; | ||
17 | |||
18 | if (val == bfin_read_PLL_CTL()) | ||
19 | return; | ||
20 | |||
21 | local_irq_save_hw(flags); | ||
22 | /* Enable the PLL Wakeup bit in SIC IWR */ | ||
23 | iwr = bfin_read32(SIC_IWR); | ||
24 | /* Only allow PPL Wakeup) */ | ||
25 | bfin_write32(SIC_IWR, IWR_ENABLE(0)); | ||
26 | |||
27 | bfin_write16(PLL_CTL, val); | ||
28 | SSYNC(); | ||
29 | asm("IDLE;"); | ||
30 | |||
31 | bfin_write32(SIC_IWR, iwr); | ||
32 | local_irq_restore_hw(flags); | ||
33 | } | ||
34 | |||
35 | /* Writing to VR_CTL initiates a PLL relock sequence. */ | ||
36 | static __inline__ void bfin_write_VR_CTL(unsigned int val) | ||
37 | { | ||
38 | unsigned long flags, iwr; | ||
39 | |||
40 | if (val == bfin_read_VR_CTL()) | ||
41 | return; | ||
42 | |||
43 | local_irq_save_hw(flags); | ||
44 | /* Enable the PLL Wakeup bit in SIC IWR */ | ||
45 | iwr = bfin_read32(SIC_IWR); | ||
46 | /* Only allow PPL Wakeup) */ | ||
47 | bfin_write32(SIC_IWR, IWR_ENABLE(0)); | ||
48 | |||
49 | bfin_write16(VR_CTL, val); | ||
50 | SSYNC(); | ||
51 | asm("IDLE;"); | ||
52 | |||
53 | bfin_write32(SIC_IWR, iwr); | ||
54 | local_irq_restore_hw(flags); | ||
55 | } | ||
56 | |||
57 | #endif /* _MACH_PLL_H */ | ||