aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorMike Frysinger <vapier.adi@gmail.com>2008-11-18 04:48:22 -0500
committerBryan Wu <cooloney@kernel.org>2008-11-18 04:48:22 -0500
commitb60705765a635728187e5cea5f36914886675013 (patch)
tree400a8fd966f117140511bf4606f96084c208c14f /arch
parentb1271d31a59e73a70284c2cdcbe2b0589f6479c7 (diff)
Blackfin arch: move out irq related functions
move irq related functions into asm/irq.h and out of the mondo asm/system.h Signed-off-by: Mike Frysinger <vapier.adi@gmail.com> Signed-off-by: Bryan Wu <cooloney@kernel.org>
Diffstat (limited to 'arch')
-rw-r--r--arch/blackfin/include/asm/irq.h92
-rw-r--r--arch/blackfin/include/asm/pda.h2
-rw-r--r--arch/blackfin/include/asm/system.h92
-rw-r--r--arch/blackfin/kernel/vmlinux.lds.S1
-rw-r--r--arch/blackfin/mach-bf518/include/mach/cdefBF51x_base.h2
-rw-r--r--arch/blackfin/mach-bf527/include/mach/cdefBF52x_base.h2
-rw-r--r--arch/blackfin/mach-bf533/include/mach/cdefBF532.h2
-rw-r--r--arch/blackfin/mach-bf537/include/mach/cdefBF534.h2
-rw-r--r--arch/blackfin/mach-bf538/include/mach/cdefBF538.h2
-rw-r--r--arch/blackfin/mach-bf548/include/mach/cdefBF54x_base.h2
-rw-r--r--arch/blackfin/mach-bf561/include/mach/cdefBF561.h2
11 files changed, 101 insertions, 100 deletions
diff --git a/arch/blackfin/include/asm/irq.h b/arch/blackfin/include/asm/irq.h
index 9377816fa18a..e43c20583fcd 100644
--- a/arch/blackfin/include/asm/irq.h
+++ b/arch/blackfin/include/asm/irq.h
@@ -19,11 +19,101 @@
19 19
20/* SYS_IRQS and NR_IRQS are defined in <mach-bf5xx/irq.h>*/ 20/* SYS_IRQS and NR_IRQS are defined in <mach-bf5xx/irq.h>*/
21#include <mach/irq.h> 21#include <mach/irq.h>
22#include <asm/ptrace.h> 22#include <asm/pda.h>
23#include <asm/processor.h>
23 24
24static __inline__ int irq_canonicalize(int irq) 25static __inline__ int irq_canonicalize(int irq)
25{ 26{
26 return irq; 27 return irq;
27} 28}
28 29
30/*
31 * Interrupt configuring macros.
32 */
33#define local_irq_disable() \
34 do { \
35 int __tmp_dummy; \
36 __asm__ __volatile__( \
37 "cli %0;" \
38 : "=d" (__tmp_dummy) \
39 ); \
40 } while (0)
41
42#if ANOMALY_05000244 && defined(CONFIG_BFIN_ICACHE)
43# define NOP_PAD_ANOMALY_05000244 "nop; nop;"
44#else
45# define NOP_PAD_ANOMALY_05000244
46#endif
47
48#ifdef CONFIG_SMP
49/* Forward decl needed due to cdef inter dependencies */
50static inline uint32_t __pure bfin_dspid(void);
51# define blackfin_core_id() (bfin_dspid() & 0xff)
52# define irq_flags cpu_pda[blackfin_core_id()].imask
53#else
54extern unsigned long irq_flags;
55#endif
56
57#define local_irq_enable() \
58 __asm__ __volatile__( \
59 "sti %0;" \
60 : \
61 : "d" (irq_flags) \
62 )
63
64#define idle_with_irq_disabled() \
65 __asm__ __volatile__( \
66 NOP_PAD_ANOMALY_05000244 \
67 ".align 8;" \
68 "sti %0;" \
69 "idle;" \
70 : \
71 : "d" (irq_flags) \
72 )
73
74#ifdef CONFIG_DEBUG_HWERR
75# define __save_and_cli(x) \
76 __asm__ __volatile__( \
77 "cli %0;" \
78 "sti %1;" \
79 : "=&d" (x) \
80 : "d" (0x3F) \
81 )
82#else
83# define __save_and_cli(x) \
84 __asm__ __volatile__( \
85 "cli %0;" \
86 : "=&d" (x) \
87 )
88#endif
89
90#define local_save_flags(x) \
91 __asm__ __volatile__( \
92 "cli %0;" \
93 "sti %0;" \
94 : "=d" (x) \
95 )
96
97#ifdef CONFIG_DEBUG_HWERR
98#define irqs_enabled_from_flags(x) (((x) & ~0x3f) != 0)
99#else
100#define irqs_enabled_from_flags(x) ((x) != 0x1f)
101#endif
102
103#define local_irq_restore(x) \
104 do { \
105 if (irqs_enabled_from_flags(x)) \
106 local_irq_enable(); \
107 } while (0)
108
109/* For spinlocks etc */
110#define local_irq_save(x) __save_and_cli(x)
111
112#define irqs_disabled() \
113({ \
114 unsigned long flags; \
115 local_save_flags(flags); \
116 !irqs_enabled_from_flags(flags); \
117})
118
29#endif /* _BFIN_IRQ_H_ */ 119#endif /* _BFIN_IRQ_H_ */
diff --git a/arch/blackfin/include/asm/pda.h b/arch/blackfin/include/asm/pda.h
index a24d130c30f0..bd8d4a7efeb2 100644
--- a/arch/blackfin/include/asm/pda.h
+++ b/arch/blackfin/include/asm/pda.h
@@ -23,7 +23,7 @@
23#ifndef _ASM_BLACKFIN_PDA_H 23#ifndef _ASM_BLACKFIN_PDA_H
24#define _ASM_BLACKFIN_PDA_H 24#define _ASM_BLACKFIN_PDA_H
25 25
26#include <asm/mem_map.h> 26#include <mach/anomaly.h>
27 27
28#ifndef __ASSEMBLY__ 28#ifndef __ASSEMBLY__
29 29
diff --git a/arch/blackfin/include/asm/system.h b/arch/blackfin/include/asm/system.h
index 6b368faf30c3..e8bcfa4ee5c0 100644
--- a/arch/blackfin/include/asm/system.h
+++ b/arch/blackfin/include/asm/system.h
@@ -39,95 +39,7 @@
39#include <mach/anomaly.h> 39#include <mach/anomaly.h>
40#include <asm/pda.h> 40#include <asm/pda.h>
41#include <asm/processor.h> 41#include <asm/processor.h>
42 42#include <asm/irq.h>
43/* Forward decl needed due to cdef inter dependencies */
44static inline uint32_t __pure bfin_dspid(void);
45#define blackfin_core_id() (bfin_dspid() & 0xff)
46
47/*
48 * Interrupt configuring macros.
49 */
50#define local_irq_disable() \
51 do { \
52 int __tmp_dummy; \
53 __asm__ __volatile__( \
54 "cli %0;" \
55 : "=d" (__tmp_dummy) \
56 ); \
57 } while (0)
58
59#if ANOMALY_05000244 && defined(CONFIG_BFIN_ICACHE)
60# define NOP_PAD_ANOMALY_05000244 "nop; nop;"
61#else
62# define NOP_PAD_ANOMALY_05000244
63#endif
64
65#ifdef CONFIG_SMP
66# define irq_flags cpu_pda[blackfin_core_id()].imask
67#else
68extern unsigned long irq_flags;
69#endif
70
71#define local_irq_enable() \
72 __asm__ __volatile__( \
73 "sti %0;" \
74 : \
75 : "d" (irq_flags) \
76 )
77#define idle_with_irq_disabled() \
78 __asm__ __volatile__( \
79 NOP_PAD_ANOMALY_05000244 \
80 ".align 8;" \
81 "sti %0;" \
82 "idle;" \
83 : \
84 : "d" (irq_flags) \
85 )
86
87#ifdef CONFIG_DEBUG_HWERR
88# define __save_and_cli(x) \
89 __asm__ __volatile__( \
90 "cli %0;" \
91 "sti %1;" \
92 : "=&d" (x) \
93 : "d" (0x3F) \
94 )
95#else
96# define __save_and_cli(x) \
97 __asm__ __volatile__( \
98 "cli %0;" \
99 : "=&d" (x) \
100 )
101#endif
102
103#define local_save_flags(x) \
104 __asm__ __volatile__( \
105 "cli %0;" \
106 "sti %0;" \
107 : "=d" (x) \
108 )
109
110#ifdef CONFIG_DEBUG_HWERR
111#define irqs_enabled_from_flags(x) (((x) & ~0x3f) != 0)
112#else
113#define irqs_enabled_from_flags(x) ((x) != 0x1f)
114#endif
115
116#define local_irq_restore(x) \
117 do { \
118 if (irqs_enabled_from_flags(x)) \
119 local_irq_enable(); \
120 } while (0)
121
122/* For spinlocks etc */
123#define local_irq_save(x) __save_and_cli(x)
124
125#define irqs_disabled() \
126({ \
127 unsigned long flags; \
128 local_save_flags(flags); \
129 !irqs_enabled_from_flags(flags); \
130})
131 43
132/* 44/*
133 * Force strict CPU ordering. 45 * Force strict CPU ordering.
@@ -279,7 +191,7 @@ static inline unsigned long __xchg(unsigned long x, volatile void *ptr,
279 * ptr isn't the current task, in which case it does nothing. 191 * ptr isn't the current task, in which case it does nothing.
280 */ 192 */
281 193
282#include <asm/blackfin.h> 194#include <asm/l1layout.h>
283 195
284asmlinkage struct task_struct *resume(struct task_struct *prev, struct task_struct *next); 196asmlinkage struct task_struct *resume(struct task_struct *prev, struct task_struct *next);
285 197
diff --git a/arch/blackfin/kernel/vmlinux.lds.S b/arch/blackfin/kernel/vmlinux.lds.S
index 2a485352ec14..3a1f73794aa8 100644
--- a/arch/blackfin/kernel/vmlinux.lds.S
+++ b/arch/blackfin/kernel/vmlinux.lds.S
@@ -109,7 +109,6 @@ SECTIONS
109#endif 109#endif
110 110
111 DATA_DATA 111 DATA_DATA
112 *(.data)
113 CONSTRUCTORS 112 CONSTRUCTORS
114 113
115 /* make sure the init_task is aligned to the 114 /* make sure the init_task is aligned to the
diff --git a/arch/blackfin/mach-bf518/include/mach/cdefBF51x_base.h b/arch/blackfin/mach-bf518/include/mach/cdefBF51x_base.h
index 45a7ff88d863..9fbcd2221986 100644
--- a/arch/blackfin/mach-bf518/include/mach/cdefBF51x_base.h
+++ b/arch/blackfin/mach-bf518/include/mach/cdefBF51x_base.h
@@ -1153,7 +1153,7 @@
1153#define bfin_write_NFC_DATA_RD(val) bfin_write16(NFC_DATA_RD, val) 1153#define bfin_write_NFC_DATA_RD(val) bfin_write16(NFC_DATA_RD, val)
1154 1154
1155/* These need to be last due to the cdef/linux inter-dependencies */ 1155/* These need to be last due to the cdef/linux inter-dependencies */
1156#include <asm/system.h> 1156#include <asm/irq.h>
1157 1157
1158/* Writing to PLL_CTL initiates a PLL relock sequence. */ 1158/* Writing to PLL_CTL initiates a PLL relock sequence. */
1159static __inline__ void bfin_write_PLL_CTL(unsigned int val) 1159static __inline__ void bfin_write_PLL_CTL(unsigned int val)
diff --git a/arch/blackfin/mach-bf527/include/mach/cdefBF52x_base.h b/arch/blackfin/mach-bf527/include/mach/cdefBF52x_base.h
index 008603f332a6..8a374c358edf 100644
--- a/arch/blackfin/mach-bf527/include/mach/cdefBF52x_base.h
+++ b/arch/blackfin/mach-bf527/include/mach/cdefBF52x_base.h
@@ -1153,7 +1153,7 @@
1153#define bfin_write_NFC_DATA_RD(val) bfin_write16(NFC_DATA_RD, val) 1153#define bfin_write_NFC_DATA_RD(val) bfin_write16(NFC_DATA_RD, val)
1154 1154
1155/* These need to be last due to the cdef/linux inter-dependencies */ 1155/* These need to be last due to the cdef/linux inter-dependencies */
1156#include <asm/system.h> 1156#include <asm/irq.h>
1157 1157
1158/* Writing to PLL_CTL initiates a PLL relock sequence. */ 1158/* Writing to PLL_CTL initiates a PLL relock sequence. */
1159static __inline__ void bfin_write_PLL_CTL(unsigned int val) 1159static __inline__ void bfin_write_PLL_CTL(unsigned int val)
diff --git a/arch/blackfin/mach-bf533/include/mach/cdefBF532.h b/arch/blackfin/mach-bf533/include/mach/cdefBF532.h
index b148d2b7e479..d7b08f638ea4 100644
--- a/arch/blackfin/mach-bf533/include/mach/cdefBF532.h
+++ b/arch/blackfin/mach-bf533/include/mach/cdefBF532.h
@@ -677,7 +677,7 @@
677#define bfin_write_PPI_FRAME(val) bfin_write16(PPI_FRAME,val) 677#define bfin_write_PPI_FRAME(val) bfin_write16(PPI_FRAME,val)
678 678
679/* These need to be last due to the cdef/linux inter-dependencies */ 679/* These need to be last due to the cdef/linux inter-dependencies */
680#include <asm/system.h> 680#include <asm/irq.h>
681 681
682#if ANOMALY_05000311 682#if ANOMALY_05000311
683#define BFIN_WRITE_FIO_FLAG(name) \ 683#define BFIN_WRITE_FIO_FLAG(name) \
diff --git a/arch/blackfin/mach-bf537/include/mach/cdefBF534.h b/arch/blackfin/mach-bf537/include/mach/cdefBF534.h
index 76135607e35b..f3416923be69 100644
--- a/arch/blackfin/mach-bf537/include/mach/cdefBF534.h
+++ b/arch/blackfin/mach-bf537/include/mach/cdefBF534.h
@@ -1773,7 +1773,7 @@
1773#define bfin_write_HMDMA1_BCOUNT(val) bfin_write16(HMDMA1_BCOUNT,val) 1773#define bfin_write_HMDMA1_BCOUNT(val) bfin_write16(HMDMA1_BCOUNT,val)
1774 1774
1775/* These need to be last due to the cdef/linux inter-dependencies */ 1775/* These need to be last due to the cdef/linux inter-dependencies */
1776#include <asm/system.h> 1776#include <asm/irq.h>
1777 1777
1778/* Writing to PLL_CTL initiates a PLL relock sequence. */ 1778/* Writing to PLL_CTL initiates a PLL relock sequence. */
1779static __inline__ void bfin_write_PLL_CTL(unsigned int val) 1779static __inline__ void bfin_write_PLL_CTL(unsigned int val)
diff --git a/arch/blackfin/mach-bf538/include/mach/cdefBF538.h b/arch/blackfin/mach-bf538/include/mach/cdefBF538.h
index 1d768a65d139..7e469b8d939c 100644
--- a/arch/blackfin/mach-bf538/include/mach/cdefBF538.h
+++ b/arch/blackfin/mach-bf538/include/mach/cdefBF538.h
@@ -2053,7 +2053,7 @@
2053#define bfin_write_CAN_MB31_ID1(val) bfin_write16(CAN_MB31_ID1, val) 2053#define bfin_write_CAN_MB31_ID1(val) bfin_write16(CAN_MB31_ID1, val)
2054 2054
2055/* These need to be last due to the cdef/linux inter-dependencies */ 2055/* These need to be last due to the cdef/linux inter-dependencies */
2056#include <asm/system.h> 2056#include <asm/irq.h>
2057 2057
2058/* Writing to PLL_CTL initiates a PLL relock sequence. */ 2058/* Writing to PLL_CTL initiates a PLL relock sequence. */
2059static __inline__ void bfin_write_PLL_CTL(unsigned int val) 2059static __inline__ void bfin_write_PLL_CTL(unsigned int val)
diff --git a/arch/blackfin/mach-bf548/include/mach/cdefBF54x_base.h b/arch/blackfin/mach-bf548/include/mach/cdefBF54x_base.h
index c376fb7acda0..0a3b210daadf 100644
--- a/arch/blackfin/mach-bf548/include/mach/cdefBF54x_base.h
+++ b/arch/blackfin/mach-bf548/include/mach/cdefBF54x_base.h
@@ -2692,7 +2692,7 @@
2692#define bfin_write_PINT3_IRQ bfin_write_PINT3_REQUEST 2692#define bfin_write_PINT3_IRQ bfin_write_PINT3_REQUEST
2693 2693
2694/* These need to be last due to the cdef/linux inter-dependencies */ 2694/* These need to be last due to the cdef/linux inter-dependencies */
2695#include <asm/system.h> 2695#include <asm/irq.h>
2696 2696
2697/* Writing to PLL_CTL initiates a PLL relock sequence. */ 2697/* Writing to PLL_CTL initiates a PLL relock sequence. */
2698static __inline__ void bfin_write_PLL_CTL(unsigned int val) 2698static __inline__ void bfin_write_PLL_CTL(unsigned int val)
diff --git a/arch/blackfin/mach-bf561/include/mach/cdefBF561.h b/arch/blackfin/mach-bf561/include/mach/cdefBF561.h
index eb349ca88cc4..b16875d735b3 100644
--- a/arch/blackfin/mach-bf561/include/mach/cdefBF561.h
+++ b/arch/blackfin/mach-bf561/include/mach/cdefBF561.h
@@ -1527,7 +1527,7 @@
1527#define bfin_write_MDMA_D0_START_ADDR(val) bfin_write_MDMA1_D0_START_ADDR(val) 1527#define bfin_write_MDMA_D0_START_ADDR(val) bfin_write_MDMA1_D0_START_ADDR(val)
1528 1528
1529/* These need to be last due to the cdef/linux inter-dependencies */ 1529/* These need to be last due to the cdef/linux inter-dependencies */
1530#include <asm/system.h> 1530#include <asm/irq.h>
1531 1531
1532/* Writing to PLL_CTL initiates a PLL relock sequence. */ 1532/* Writing to PLL_CTL initiates a PLL relock sequence. */
1533static __inline__ void bfin_write_PLL_CTL(unsigned int val) 1533static __inline__ void bfin_write_PLL_CTL(unsigned int val)