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-bf548 | |
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-bf548')
-rw-r--r-- | arch/blackfin/mach-bf548/include/mach/cdefBF54x_base.h | 56 | ||||
-rw-r--r-- | arch/blackfin/mach-bf548/include/mach/pll.h | 69 |
2 files changed, 69 insertions, 56 deletions
diff --git a/arch/blackfin/mach-bf548/include/mach/cdefBF54x_base.h b/arch/blackfin/mach-bf548/include/mach/cdefBF54x_base.h index ea3ec4ea9e2b..0c16067df4f3 100644 --- a/arch/blackfin/mach-bf548/include/mach/cdefBF54x_base.h +++ b/arch/blackfin/mach-bf548/include/mach/cdefBF54x_base.h | |||
@@ -2648,61 +2648,5 @@ | |||
2648 | /* These need to be last due to the cdef/linux inter-dependencies */ | 2648 | /* These need to be last due to the cdef/linux inter-dependencies */ |
2649 | #include <asm/irq.h> | 2649 | #include <asm/irq.h> |
2650 | 2650 | ||
2651 | /* Writing to PLL_CTL initiates a PLL relock sequence. */ | ||
2652 | static __inline__ void bfin_write_PLL_CTL(unsigned int val) | ||
2653 | { | ||
2654 | unsigned long flags, iwr0, iwr1, iwr2; | ||
2655 | |||
2656 | if (val == bfin_read_PLL_CTL()) | ||
2657 | return; | ||
2658 | |||
2659 | local_irq_save_hw(flags); | ||
2660 | /* Enable the PLL Wakeup bit in SIC IWR */ | ||
2661 | iwr0 = bfin_read32(SIC_IWR0); | ||
2662 | iwr1 = bfin_read32(SIC_IWR1); | ||
2663 | iwr2 = bfin_read32(SIC_IWR2); | ||
2664 | /* Only allow PPL Wakeup) */ | ||
2665 | bfin_write32(SIC_IWR0, IWR_ENABLE(0)); | ||
2666 | bfin_write32(SIC_IWR1, 0); | ||
2667 | bfin_write32(SIC_IWR2, 0); | ||
2668 | |||
2669 | bfin_write16(PLL_CTL, val); | ||
2670 | SSYNC(); | ||
2671 | asm("IDLE;"); | ||
2672 | |||
2673 | bfin_write32(SIC_IWR0, iwr0); | ||
2674 | bfin_write32(SIC_IWR1, iwr1); | ||
2675 | bfin_write32(SIC_IWR2, iwr2); | ||
2676 | local_irq_restore_hw(flags); | ||
2677 | } | ||
2678 | |||
2679 | /* Writing to VR_CTL initiates a PLL relock sequence. */ | ||
2680 | static __inline__ void bfin_write_VR_CTL(unsigned int val) | ||
2681 | { | ||
2682 | unsigned long flags, iwr0, iwr1, iwr2; | ||
2683 | |||
2684 | if (val == bfin_read_VR_CTL()) | ||
2685 | return; | ||
2686 | |||
2687 | local_irq_save_hw(flags); | ||
2688 | /* Enable the PLL Wakeup bit in SIC IWR */ | ||
2689 | iwr0 = bfin_read32(SIC_IWR0); | ||
2690 | iwr1 = bfin_read32(SIC_IWR1); | ||
2691 | iwr2 = bfin_read32(SIC_IWR2); | ||
2692 | /* Only allow PPL Wakeup) */ | ||
2693 | bfin_write32(SIC_IWR0, IWR_ENABLE(0)); | ||
2694 | bfin_write32(SIC_IWR1, 0); | ||
2695 | bfin_write32(SIC_IWR2, 0); | ||
2696 | |||
2697 | bfin_write16(VR_CTL, val); | ||
2698 | SSYNC(); | ||
2699 | asm("IDLE;"); | ||
2700 | |||
2701 | bfin_write32(SIC_IWR0, iwr0); | ||
2702 | bfin_write32(SIC_IWR1, iwr1); | ||
2703 | bfin_write32(SIC_IWR2, iwr2); | ||
2704 | local_irq_restore_hw(flags); | ||
2705 | } | ||
2706 | |||
2707 | #endif /* _CDEF_BF54X_H */ | 2651 | #endif /* _CDEF_BF54X_H */ |
2708 | 2652 | ||
diff --git a/arch/blackfin/mach-bf548/include/mach/pll.h b/arch/blackfin/mach-bf548/include/mach/pll.h new file mode 100644 index 000000000000..777fee61fab8 --- /dev/null +++ b/arch/blackfin/mach-bf548/include/mach/pll.h | |||
@@ -0,0 +1,69 @@ | |||
1 | /* | ||
2 | * Copyright 2007-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, iwr0, iwr1, iwr2; | ||
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 | iwr0 = bfin_read32(SIC_IWR0); | ||
24 | iwr1 = bfin_read32(SIC_IWR1); | ||
25 | iwr2 = bfin_read32(SIC_IWR2); | ||
26 | /* Only allow PPL Wakeup) */ | ||
27 | bfin_write32(SIC_IWR0, IWR_ENABLE(0)); | ||
28 | bfin_write32(SIC_IWR1, 0); | ||
29 | bfin_write32(SIC_IWR2, 0); | ||
30 | |||
31 | bfin_write16(PLL_CTL, val); | ||
32 | SSYNC(); | ||
33 | asm("IDLE;"); | ||
34 | |||
35 | bfin_write32(SIC_IWR0, iwr0); | ||
36 | bfin_write32(SIC_IWR1, iwr1); | ||
37 | bfin_write32(SIC_IWR2, iwr2); | ||
38 | local_irq_restore_hw(flags); | ||
39 | } | ||
40 | |||
41 | /* Writing to VR_CTL initiates a PLL relock sequence. */ | ||
42 | static __inline__ void bfin_write_VR_CTL(unsigned int val) | ||
43 | { | ||
44 | unsigned long flags, iwr0, iwr1, iwr2; | ||
45 | |||
46 | if (val == bfin_read_VR_CTL()) | ||
47 | return; | ||
48 | |||
49 | local_irq_save_hw(flags); | ||
50 | /* Enable the PLL Wakeup bit in SIC IWR */ | ||
51 | iwr0 = bfin_read32(SIC_IWR0); | ||
52 | iwr1 = bfin_read32(SIC_IWR1); | ||
53 | iwr2 = bfin_read32(SIC_IWR2); | ||
54 | /* Only allow PPL Wakeup) */ | ||
55 | bfin_write32(SIC_IWR0, IWR_ENABLE(0)); | ||
56 | bfin_write32(SIC_IWR1, 0); | ||
57 | bfin_write32(SIC_IWR2, 0); | ||
58 | |||
59 | bfin_write16(VR_CTL, val); | ||
60 | SSYNC(); | ||
61 | asm("IDLE;"); | ||
62 | |||
63 | bfin_write32(SIC_IWR0, iwr0); | ||
64 | bfin_write32(SIC_IWR1, iwr1); | ||
65 | bfin_write32(SIC_IWR2, iwr2); | ||
66 | local_irq_restore_hw(flags); | ||
67 | } | ||
68 | |||
69 | #endif /* _MACH_PLL_H */ | ||