diff options
Diffstat (limited to 'arch/blackfin/include/asm')
-rw-r--r-- | arch/blackfin/include/asm/bfin-global.h | 6 | ||||
-rw-r--r-- | arch/blackfin/include/asm/bug.h | 7 | ||||
-rw-r--r-- | arch/blackfin/include/asm/cache.h | 2 | ||||
-rw-r--r-- | arch/blackfin/include/asm/gpio.h | 22 | ||||
-rw-r--r-- | arch/blackfin/include/asm/pgtable.h | 3 | ||||
-rw-r--r-- | arch/blackfin/include/asm/pseudo_instructions.h | 18 | ||||
-rw-r--r-- | arch/blackfin/include/asm/scatterlist.h | 22 | ||||
-rw-r--r-- | arch/blackfin/include/asm/string.h | 113 | ||||
-rw-r--r-- | arch/blackfin/include/asm/tlbflush.h | 1 | ||||
-rw-r--r-- | arch/blackfin/include/asm/trace.h | 7 |
10 files changed, 58 insertions, 143 deletions
diff --git a/arch/blackfin/include/asm/bfin-global.h b/arch/blackfin/include/asm/bfin-global.h index e6485c305ea6..121cc04d877d 100644 --- a/arch/blackfin/include/asm/bfin-global.h +++ b/arch/blackfin/include/asm/bfin-global.h | |||
@@ -39,9 +39,15 @@ extern unsigned long sclk_to_usecs(unsigned long sclk); | |||
39 | extern unsigned long usecs_to_sclk(unsigned long usecs); | 39 | extern unsigned long usecs_to_sclk(unsigned long usecs); |
40 | 40 | ||
41 | struct pt_regs; | 41 | struct pt_regs; |
42 | #if defined(CONFIG_DEBUG_VERBOSE) | ||
42 | extern void dump_bfin_process(struct pt_regs *regs); | 43 | extern void dump_bfin_process(struct pt_regs *regs); |
43 | extern void dump_bfin_mem(struct pt_regs *regs); | 44 | extern void dump_bfin_mem(struct pt_regs *regs); |
44 | extern void dump_bfin_trace_buffer(void); | 45 | extern void dump_bfin_trace_buffer(void); |
46 | #else | ||
47 | #define dump_bfin_process(regs) | ||
48 | #define dump_bfin_mem(regs) | ||
49 | #define dump_bfin_trace_buffer() | ||
50 | #endif | ||
45 | 51 | ||
46 | /* init functions only */ | 52 | /* init functions only */ |
47 | extern int init_arch_irq(void); | 53 | extern int init_arch_irq(void); |
diff --git a/arch/blackfin/include/asm/bug.h b/arch/blackfin/include/asm/bug.h index 75f6dc336d46..8d9b1eba89c4 100644 --- a/arch/blackfin/include/asm/bug.h +++ b/arch/blackfin/include/asm/bug.h | |||
@@ -9,7 +9,12 @@ | |||
9 | 9 | ||
10 | #ifdef CONFIG_BUG | 10 | #ifdef CONFIG_BUG |
11 | 11 | ||
12 | #define BFIN_BUG_OPCODE 0xefcd | 12 | /* |
13 | * This can be any undefined 16-bit opcode, meaning | ||
14 | * ((opcode & 0xc000) != 0xc000) | ||
15 | * Anything from 0x0001 to 0x000A (inclusive) will work | ||
16 | */ | ||
17 | #define BFIN_BUG_OPCODE 0x0001 | ||
13 | 18 | ||
14 | #ifdef CONFIG_DEBUG_BUGVERBOSE | 19 | #ifdef CONFIG_DEBUG_BUGVERBOSE |
15 | 20 | ||
diff --git a/arch/blackfin/include/asm/cache.h b/arch/blackfin/include/asm/cache.h index 8542bc31f63c..93f6c634fdf4 100644 --- a/arch/blackfin/include/asm/cache.h +++ b/arch/blackfin/include/asm/cache.h | |||
@@ -15,6 +15,8 @@ | |||
15 | #define L1_CACHE_BYTES (1 << L1_CACHE_SHIFT) | 15 | #define L1_CACHE_BYTES (1 << L1_CACHE_SHIFT) |
16 | #define SMP_CACHE_BYTES L1_CACHE_BYTES | 16 | #define SMP_CACHE_BYTES L1_CACHE_BYTES |
17 | 17 | ||
18 | #define ARCH_KMALLOC_MINALIGN L1_CACHE_BYTES | ||
19 | |||
18 | #ifdef CONFIG_SMP | 20 | #ifdef CONFIG_SMP |
19 | #define __cacheline_aligned | 21 | #define __cacheline_aligned |
20 | #else | 22 | #else |
diff --git a/arch/blackfin/include/asm/gpio.h b/arch/blackfin/include/asm/gpio.h index 91bd2d7b9d55..01b19d0cf509 100644 --- a/arch/blackfin/include/asm/gpio.h +++ b/arch/blackfin/include/asm/gpio.h | |||
@@ -167,23 +167,23 @@ int bfin_special_gpio_request(unsigned gpio, const char *label); | |||
167 | #endif | 167 | #endif |
168 | 168 | ||
169 | #ifdef CONFIG_PM | 169 | #ifdef CONFIG_PM |
170 | int bfin_pm_standby_ctrl(unsigned ctrl); | ||
170 | 171 | ||
171 | unsigned int bfin_pm_standby_setup(void); | 172 | static inline int bfin_pm_standby_setup(void) |
172 | void bfin_pm_standby_restore(void); | 173 | { |
174 | return bfin_pm_standby_ctrl(1); | ||
175 | } | ||
176 | |||
177 | static inline void bfin_pm_standby_restore(void) | ||
178 | { | ||
179 | bfin_pm_standby_ctrl(0); | ||
180 | } | ||
173 | 181 | ||
174 | void bfin_gpio_pm_hibernate_restore(void); | 182 | void bfin_gpio_pm_hibernate_restore(void); |
175 | void bfin_gpio_pm_hibernate_suspend(void); | 183 | void bfin_gpio_pm_hibernate_suspend(void); |
176 | 184 | ||
177 | #ifndef CONFIG_BF54x | 185 | #ifndef CONFIG_BF54x |
178 | #define PM_WAKE_RISING 0x1 | 186 | int gpio_pm_wakeup_ctrl(unsigned gpio, unsigned ctrl); |
179 | #define PM_WAKE_FALLING 0x2 | ||
180 | #define PM_WAKE_HIGH 0x4 | ||
181 | #define PM_WAKE_LOW 0x8 | ||
182 | #define PM_WAKE_BOTH_EDGES (PM_WAKE_RISING | PM_WAKE_FALLING) | ||
183 | #define PM_WAKE_IGNORE 0xF0 | ||
184 | |||
185 | int gpio_pm_wakeup_request(unsigned gpio, unsigned char type); | ||
186 | void gpio_pm_wakeup_free(unsigned gpio); | ||
187 | 187 | ||
188 | struct gpio_port_s { | 188 | struct gpio_port_s { |
189 | unsigned short data; | 189 | unsigned short data; |
diff --git a/arch/blackfin/include/asm/pgtable.h b/arch/blackfin/include/asm/pgtable.h index 821c699c2238..dcca3e6d6e80 100644 --- a/arch/blackfin/include/asm/pgtable.h +++ b/arch/blackfin/include/asm/pgtable.h | |||
@@ -80,7 +80,8 @@ PTE_BIT_FUNC(mkyoung, |= _PAGE_ACCESSED); | |||
80 | * ZERO_PAGE is a global shared page that is always zero: used | 80 | * ZERO_PAGE is a global shared page that is always zero: used |
81 | * for zero-mapped memory areas etc.. | 81 | * for zero-mapped memory areas etc.. |
82 | */ | 82 | */ |
83 | #define ZERO_PAGE(vaddr) (virt_to_page(0)) | 83 | #define ZERO_PAGE(vaddr) virt_to_page(empty_zero_page) |
84 | extern char empty_zero_page[]; | ||
84 | 85 | ||
85 | extern unsigned int kobjsize(const void *objp); | 86 | extern unsigned int kobjsize(const void *objp); |
86 | 87 | ||
diff --git a/arch/blackfin/include/asm/pseudo_instructions.h b/arch/blackfin/include/asm/pseudo_instructions.h new file mode 100644 index 000000000000..b00adfa08169 --- /dev/null +++ b/arch/blackfin/include/asm/pseudo_instructions.h | |||
@@ -0,0 +1,18 @@ | |||
1 | /* | ||
2 | * header file for pseudo instructions | ||
3 | * | ||
4 | * Copyright 2010 Analog Devices Inc. | ||
5 | * | ||
6 | * Licensed under the GPL-2 or later. | ||
7 | */ | ||
8 | |||
9 | #ifndef _BLACKFIN_PSEUDO_ | ||
10 | #define _BLACKFIN_PSEUDO_ | ||
11 | |||
12 | #include <linux/types.h> | ||
13 | #include <asm/ptrace.h> | ||
14 | |||
15 | extern bool execute_pseudodbg_assert(struct pt_regs *fp, unsigned int opcode); | ||
16 | extern bool execute_pseudodbg(struct pt_regs *fp, unsigned int opcode); | ||
17 | |||
18 | #endif | ||
diff --git a/arch/blackfin/include/asm/scatterlist.h b/arch/blackfin/include/asm/scatterlist.h index 04f448711cd0..64d41d34ab0b 100644 --- a/arch/blackfin/include/asm/scatterlist.h +++ b/arch/blackfin/include/asm/scatterlist.h | |||
@@ -1,27 +1,7 @@ | |||
1 | #ifndef _BLACKFIN_SCATTERLIST_H | 1 | #ifndef _BLACKFIN_SCATTERLIST_H |
2 | #define _BLACKFIN_SCATTERLIST_H | 2 | #define _BLACKFIN_SCATTERLIST_H |
3 | 3 | ||
4 | #include <linux/mm.h> | 4 | #include <asm-generic/scatterlist.h> |
5 | |||
6 | struct scatterlist { | ||
7 | #ifdef CONFIG_DEBUG_SG | ||
8 | unsigned long sg_magic; | ||
9 | #endif | ||
10 | unsigned long page_link; | ||
11 | unsigned int offset; | ||
12 | dma_addr_t dma_address; | ||
13 | unsigned int length; | ||
14 | }; | ||
15 | |||
16 | /* | ||
17 | * These macros should be used after a pci_map_sg call has been done | ||
18 | * to get bus addresses of each of the SG entries and their lengths. | ||
19 | * You should only work with the number of sg entries pci_map_sg | ||
20 | * returns, or alternatively stop on the first sg_dma_len(sg) which | ||
21 | * is 0. | ||
22 | */ | ||
23 | #define sg_dma_address(sg) ((sg)->dma_address) | ||
24 | #define sg_dma_len(sg) ((sg)->length) | ||
25 | 5 | ||
26 | #define ISA_DMA_THRESHOLD (0xffffffff) | 6 | #define ISA_DMA_THRESHOLD (0xffffffff) |
27 | 7 | ||
diff --git a/arch/blackfin/include/asm/string.h b/arch/blackfin/include/asm/string.h index d7f0ccb418c3..423c099aa988 100644 --- a/arch/blackfin/include/asm/string.h +++ b/arch/blackfin/include/asm/string.h | |||
@@ -12,121 +12,16 @@ | |||
12 | #ifdef __KERNEL__ /* only set these up for kernel code */ | 12 | #ifdef __KERNEL__ /* only set these up for kernel code */ |
13 | 13 | ||
14 | #define __HAVE_ARCH_STRCPY | 14 | #define __HAVE_ARCH_STRCPY |
15 | extern inline char *strcpy(char *dest, const char *src) | 15 | extern char *strcpy(char *dest, const char *src); |
16 | { | ||
17 | char *xdest = dest; | ||
18 | char temp = 0; | ||
19 | |||
20 | __asm__ __volatile__ ( | ||
21 | "1:" | ||
22 | "%2 = B [%1++] (Z);" | ||
23 | "B [%0++] = %2;" | ||
24 | "CC = %2;" | ||
25 | "if cc jump 1b (bp);" | ||
26 | : "+&a" (dest), "+&a" (src), "=&d" (temp) | ||
27 | : | ||
28 | : "memory", "CC"); | ||
29 | |||
30 | return xdest; | ||
31 | } | ||
32 | 16 | ||
33 | #define __HAVE_ARCH_STRNCPY | 17 | #define __HAVE_ARCH_STRNCPY |
34 | extern inline char *strncpy(char *dest, const char *src, size_t n) | 18 | extern char *strncpy(char *dest, const char *src, size_t n); |
35 | { | ||
36 | char *xdest = dest; | ||
37 | char temp = 0; | ||
38 | |||
39 | if (n == 0) | ||
40 | return xdest; | ||
41 | |||
42 | __asm__ __volatile__ ( | ||
43 | "1:" | ||
44 | "%3 = B [%1++] (Z);" | ||
45 | "B [%0++] = %3;" | ||
46 | "CC = %3;" | ||
47 | "if ! cc jump 2f;" | ||
48 | "%2 += -1;" | ||
49 | "CC = %2 == 0;" | ||
50 | "if ! cc jump 1b (bp);" | ||
51 | "jump 4f;" | ||
52 | "2:" | ||
53 | /* if src is shorter than n, we need to null pad bytes now */ | ||
54 | "%3 = 0;" | ||
55 | "3:" | ||
56 | "%2 += -1;" | ||
57 | "CC = %2 == 0;" | ||
58 | "if cc jump 4f;" | ||
59 | "B [%0++] = %3;" | ||
60 | "jump 3b;" | ||
61 | "4:" | ||
62 | : "+&a" (dest), "+&a" (src), "+&da" (n), "=&d" (temp) | ||
63 | : | ||
64 | : "memory", "CC"); | ||
65 | |||
66 | return xdest; | ||
67 | } | ||
68 | 19 | ||
69 | #define __HAVE_ARCH_STRCMP | 20 | #define __HAVE_ARCH_STRCMP |
70 | extern inline int strcmp(const char *cs, const char *ct) | 21 | extern int strcmp(const char *cs, const char *ct); |
71 | { | ||
72 | /* need to use int's here so the char's in the assembly don't get | ||
73 | * sign extended incorrectly when we don't want them to be | ||
74 | */ | ||
75 | int __res1, __res2; | ||
76 | |||
77 | __asm__ __volatile__ ( | ||
78 | "1:" | ||
79 | "%2 = B[%0++] (Z);" /* get *cs */ | ||
80 | "%3 = B[%1++] (Z);" /* get *ct */ | ||
81 | "CC = %2 == %3;" /* compare a byte */ | ||
82 | "if ! cc jump 2f;" /* not equal, break out */ | ||
83 | "CC = %2;" /* at end of cs? */ | ||
84 | "if cc jump 1b (bp);" /* no, keep going */ | ||
85 | "jump.s 3f;" /* strings are equal */ | ||
86 | "2:" | ||
87 | "%2 = %2 - %3;" /* *cs - *ct */ | ||
88 | "3:" | ||
89 | : "+&a" (cs), "+&a" (ct), "=&d" (__res1), "=&d" (__res2) | ||
90 | : | ||
91 | : "memory", "CC"); | ||
92 | |||
93 | return __res1; | ||
94 | } | ||
95 | 22 | ||
96 | #define __HAVE_ARCH_STRNCMP | 23 | #define __HAVE_ARCH_STRNCMP |
97 | extern inline int strncmp(const char *cs, const char *ct, size_t count) | 24 | extern int strncmp(const char *cs, const char *ct, size_t count); |
98 | { | ||
99 | /* need to use int's here so the char's in the assembly don't get | ||
100 | * sign extended incorrectly when we don't want them to be | ||
101 | */ | ||
102 | int __res1, __res2; | ||
103 | |||
104 | if (!count) | ||
105 | return 0; | ||
106 | |||
107 | __asm__ __volatile__ ( | ||
108 | "1:" | ||
109 | "%3 = B[%0++] (Z);" /* get *cs */ | ||
110 | "%4 = B[%1++] (Z);" /* get *ct */ | ||
111 | "CC = %3 == %4;" /* compare a byte */ | ||
112 | "if ! cc jump 3f;" /* not equal, break out */ | ||
113 | "CC = %3;" /* at end of cs? */ | ||
114 | "if ! cc jump 4f;" /* yes, all done */ | ||
115 | "%2 += -1;" /* no, adjust count */ | ||
116 | "CC = %2 == 0;" | ||
117 | "if ! cc jump 1b;" /* more to do, keep going */ | ||
118 | "2:" | ||
119 | "%3 = 0;" /* strings are equal */ | ||
120 | "jump.s 4f;" | ||
121 | "3:" | ||
122 | "%3 = %3 - %4;" /* *cs - *ct */ | ||
123 | "4:" | ||
124 | : "+&a" (cs), "+&a" (ct), "+&da" (count), "=&d" (__res1), "=&d" (__res2) | ||
125 | : | ||
126 | : "memory", "CC"); | ||
127 | |||
128 | return __res1; | ||
129 | } | ||
130 | 25 | ||
131 | #define __HAVE_ARCH_MEMSET | 26 | #define __HAVE_ARCH_MEMSET |
132 | extern void *memset(void *s, int c, size_t count); | 27 | extern void *memset(void *s, int c, size_t count); |
diff --git a/arch/blackfin/include/asm/tlbflush.h b/arch/blackfin/include/asm/tlbflush.h index f1a06c006ed0..7c368682c0a3 100644 --- a/arch/blackfin/include/asm/tlbflush.h +++ b/arch/blackfin/include/asm/tlbflush.h | |||
@@ -1 +1,2 @@ | |||
1 | #include <asm-generic/tlbflush.h> | 1 | #include <asm-generic/tlbflush.h> |
2 | #define flush_tlb_kernel_range(s, e) do { } while (0) | ||
diff --git a/arch/blackfin/include/asm/trace.h b/arch/blackfin/include/asm/trace.h index dc0aa55ae773..33589a29b8d8 100644 --- a/arch/blackfin/include/asm/trace.h +++ b/arch/blackfin/include/asm/trace.h | |||
@@ -23,6 +23,13 @@ | |||
23 | #ifndef __ASSEMBLY__ | 23 | #ifndef __ASSEMBLY__ |
24 | extern unsigned long trace_buff_offset; | 24 | extern unsigned long trace_buff_offset; |
25 | extern unsigned long software_trace_buff[]; | 25 | extern unsigned long software_trace_buff[]; |
26 | #if defined(CONFIG_DEBUG_VERBOSE) | ||
27 | extern void decode_address(char *buf, unsigned long address); | ||
28 | extern bool get_instruction(unsigned int *val, unsigned short *address); | ||
29 | #else | ||
30 | static inline void decode_address(char *buf, unsigned long address) { } | ||
31 | static inline bool get_instruction(unsigned int *val, unsigned short *address) { return false; } | ||
32 | #endif | ||
26 | 33 | ||
27 | /* Trace Macros for C files */ | 34 | /* Trace Macros for C files */ |
28 | 35 | ||