aboutsummaryrefslogtreecommitdiffstats
path: root/arch/blackfin
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2010-10-26 22:55:28 -0400
committerMike Frysinger <vapier@gentoo.org>2011-01-10 07:18:08 -0500
commit51946b10cfc741bfdcb82ea6ba65e775702f3a27 (patch)
tree312392434dafe3a63638335e54034c3f9cb7dc3b /arch/blackfin
parentc31b3f73855821d8292904a7c36f5ec9d2ba2c5b (diff)
Blackfin: bf533: merge fio_flag back into normal mach headers
We don't want the BF533 to be different in terms of its MMR headers, so merge the FIO_FLAG helpers back into the normal place. To avoid circular dependencies with headers, turn the inline C funcs into CPP defines. Not like there will be any code size differences. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Diffstat (limited to 'arch/blackfin')
-rw-r--r--arch/blackfin/mach-bf533/include/mach/cdefBF532.h41
-rw-r--r--arch/blackfin/mach-bf533/include/mach/fio_flag.h55
2 files changed, 41 insertions, 55 deletions
diff --git a/arch/blackfin/mach-bf533/include/mach/cdefBF532.h b/arch/blackfin/mach-bf533/include/mach/cdefBF532.h
index e14955073b5d..12b6a3d7d92c 100644
--- a/arch/blackfin/mach-bf533/include/mach/cdefBF532.h
+++ b/arch/blackfin/mach-bf533/include/mach/cdefBF532.h
@@ -99,6 +99,47 @@
99#define bfin_read_FIO_MASKB_T() bfin_read16(FIO_MASKB_T) 99#define bfin_read_FIO_MASKB_T() bfin_read16(FIO_MASKB_T)
100#define bfin_write_FIO_MASKB_T(val) bfin_write16(FIO_MASKB_T,val) 100#define bfin_write_FIO_MASKB_T(val) bfin_write16(FIO_MASKB_T,val)
101 101
102#if ANOMALY_05000311
103/* Keep at the CPP expansion to avoid circular header dependency loops */
104#define BFIN_WRITE_FIO_FLAG(name, val) \
105 do { \
106 unsigned long __flags; \
107 __flags = hard_local_irq_save(); \
108 bfin_write16(FIO_FLAG_##name, val); \
109 bfin_read_CHIPID(); \
110 hard_local_irq_restore(__flags); \
111 } while (0)
112#define bfin_write_FIO_FLAG_D(val) BFIN_WRITE_FIO_FLAG(D, val)
113#define bfin_write_FIO_FLAG_C(val) BFIN_WRITE_FIO_FLAG(C, val)
114#define bfin_write_FIO_FLAG_S(val) BFIN_WRITE_FIO_FLAG(S, val)
115#define bfin_write_FIO_FLAG_T(val) BFIN_WRITE_FIO_FLAG(T, val)
116
117#define BFIN_READ_FIO_FLAG(name) \
118 ({ \
119 unsigned long __flags; \
120 u16 __ret; \
121 __flags = hard_local_irq_save(); \
122 __ret = bfin_read16(FIO_FLAG_##name); \
123 bfin_read_CHIPID(); \
124 hard_local_irq_restore(__flags); \
125 __ret; \
126 })
127#define bfin_read_FIO_FLAG_D() BFIN_READ_FIO_FLAG(D)
128#define bfin_read_FIO_FLAG_C() BFIN_READ_FIO_FLAG(C)
129#define bfin_read_FIO_FLAG_S() BFIN_READ_FIO_FLAG(S)
130#define bfin_read_FIO_FLAG_T() BFIN_READ_FIO_FLAG(T)
131
132#else
133#define bfin_write_FIO_FLAG_D(val) bfin_write16(FIO_FLAG_D, val)
134#define bfin_write_FIO_FLAG_C(val) bfin_write16(FIO_FLAG_C, val)
135#define bfin_write_FIO_FLAG_S(val) bfin_write16(FIO_FLAG_S, val)
136#define bfin_write_FIO_FLAG_T(val) bfin_write16(FIO_FLAG_T, val)
137#define bfin_read_FIO_FLAG_D() bfin_read16(FIO_FLAG_D)
138#define bfin_read_FIO_FLAG_C() bfin_read16(FIO_FLAG_C)
139#define bfin_read_FIO_FLAG_S() bfin_read16(FIO_FLAG_S)
140#define bfin_read_FIO_FLAG_T() bfin_read16(FIO_FLAG_T)
141#endif
142
102/* DMA Controller */ 143/* DMA Controller */
103#define bfin_read_DMA0_CONFIG() bfin_read16(DMA0_CONFIG) 144#define bfin_read_DMA0_CONFIG() bfin_read16(DMA0_CONFIG)
104#define bfin_write_DMA0_CONFIG(val) bfin_write16(DMA0_CONFIG,val) 145#define bfin_write_DMA0_CONFIG(val) bfin_write16(DMA0_CONFIG,val)
diff --git a/arch/blackfin/mach-bf533/include/mach/fio_flag.h b/arch/blackfin/mach-bf533/include/mach/fio_flag.h
deleted file mode 100644
index d0bfba0b083b..000000000000
--- a/arch/blackfin/mach-bf533/include/mach/fio_flag.h
+++ /dev/null
@@ -1,55 +0,0 @@
1/*
2 * Copyright 2005-2008 Analog Devices Inc.
3 *
4 * Licensed under the GPL-2 or later
5 */
6
7#ifndef _MACH_FIO_FLAG_H
8#define _MACH_FIO_FLAG_H
9
10#include <asm/blackfin.h>
11#include <asm/irqflags.h>
12
13#if ANOMALY_05000311
14#define BFIN_WRITE_FIO_FLAG(name) \
15static inline void bfin_write_FIO_FLAG_##name(unsigned short val) \
16{ \
17 unsigned long flags; \
18 flags = hard_local_irq_save(); \
19 bfin_write16(FIO_FLAG_##name, val); \
20 bfin_read_CHIPID(); \
21 hard_local_irq_restore(flags); \
22}
23BFIN_WRITE_FIO_FLAG(D)
24BFIN_WRITE_FIO_FLAG(C)
25BFIN_WRITE_FIO_FLAG(S)
26BFIN_WRITE_FIO_FLAG(T)
27
28#define BFIN_READ_FIO_FLAG(name) \
29static inline u16 bfin_read_FIO_FLAG_##name(void) \
30{ \
31 unsigned long flags; \
32 u16 ret; \
33 flags = hard_local_irq_save(); \
34 ret = bfin_read16(FIO_FLAG_##name); \
35 bfin_read_CHIPID(); \
36 hard_local_irq_restore(flags); \
37 return ret; \
38}
39BFIN_READ_FIO_FLAG(D)
40BFIN_READ_FIO_FLAG(C)
41BFIN_READ_FIO_FLAG(S)
42BFIN_READ_FIO_FLAG(T)
43
44#else
45#define bfin_write_FIO_FLAG_D(val) bfin_write16(FIO_FLAG_D, val)
46#define bfin_write_FIO_FLAG_C(val) bfin_write16(FIO_FLAG_C, val)
47#define bfin_write_FIO_FLAG_S(val) bfin_write16(FIO_FLAG_S, val)
48#define bfin_write_FIO_FLAG_T(val) bfin_write16(FIO_FLAG_T, val)
49#define bfin_read_FIO_FLAG_T() bfin_read16(FIO_FLAG_T)
50#define bfin_read_FIO_FLAG_C() bfin_read16(FIO_FLAG_C)
51#define bfin_read_FIO_FLAG_S() bfin_read16(FIO_FLAG_S)
52#define bfin_read_FIO_FLAG_D() bfin_read16(FIO_FLAG_D)
53#endif
54
55#endif /* _MACH_FIO_FLAG_H */