]>
Commit | Line | Data |
---|---|---|
1394f032 | 1 | /* |
96f1050d | 2 | * Global extern defines for blackfin |
1394f032 | 3 | * |
96f1050d | 4 | * Copyright 2006-2009 Analog Devices Inc. |
1394f032 | 5 | * |
96f1050d | 6 | * Licensed under the GPL-2 or later. |
1394f032 BW |
7 | */ |
8 | ||
9 | #ifndef _BFIN_GLOBAL_H_ | |
10 | #define _BFIN_GLOBAL_H_ | |
11 | ||
12 | #ifndef __ASSEMBLY__ | |
13 | ||
1394f032 BW |
14 | #include <linux/linkage.h> |
15 | #include <linux/types.h> | |
16 | ||
86ad7932 CC |
17 | #if defined(CONFIG_DMA_UNCACHED_4M) |
18 | # define DMA_UNCACHED_REGION (4 * 1024 * 1024) | |
19 | #elif defined(CONFIG_DMA_UNCACHED_2M) | |
1394f032 BW |
20 | # define DMA_UNCACHED_REGION (2 * 1024 * 1024) |
21 | #elif defined(CONFIG_DMA_UNCACHED_1M) | |
22 | # define DMA_UNCACHED_REGION (1024 * 1024) | |
c45c0659 BS |
23 | #elif defined(CONFIG_DMA_UNCACHED_512K) |
24 | # define DMA_UNCACHED_REGION (512 * 1024) | |
25 | #elif defined(CONFIG_DMA_UNCACHED_256K) | |
26 | # define DMA_UNCACHED_REGION (256 * 1024) | |
27 | #elif defined(CONFIG_DMA_UNCACHED_128K) | |
28 | # define DMA_UNCACHED_REGION (128 * 1024) | |
1394f032 BW |
29 | #else |
30 | # define DMA_UNCACHED_REGION (0) | |
31 | #endif | |
32 | ||
6b3087c6 GY |
33 | extern void bfin_setup_caches(unsigned int cpu); |
34 | extern void bfin_setup_cpudata(unsigned int cpu); | |
35 | ||
1394f032 BW |
36 | extern unsigned long get_cclk(void); |
37 | extern unsigned long get_sclk(void); | |
2f6cf7bf MF |
38 | extern unsigned long sclk_to_usecs(unsigned long sclk); |
39 | extern unsigned long usecs_to_sclk(unsigned long usecs); | |
1394f032 | 40 | |
bbc51e97 | 41 | struct pt_regs; |
49dce912 | 42 | extern void dump_bfin_process(struct pt_regs *regs); |
b03b08ba | 43 | extern void dump_bfin_mem(struct pt_regs *regs); |
1394f032 BW |
44 | extern void dump_bfin_trace_buffer(void); |
45 | ||
ee32664d | 46 | /* init functions only */ |
1394f032 | 47 | extern int init_arch_irq(void); |
8be80ed3 | 48 | extern void init_exception_vectors(void); |
1394f032 | 49 | extern void program_IAR(void); |
ee32664d | 50 | |
ee32664d MF |
51 | extern asmlinkage void lower_to_irq14(void); |
52 | extern asmlinkage void bfin_return_from_exception(void); | |
1394f032 | 53 | extern asmlinkage void asm_do_IRQ(unsigned int irq, struct pt_regs *regs); |
cfefe3c6 | 54 | extern int bfin_internal_set_wake(unsigned int irq, unsigned int state); |
1394f032 BW |
55 | |
56 | extern void *l1_data_A_sram_alloc(size_t); | |
57 | extern void *l1_data_B_sram_alloc(size_t); | |
58 | extern void *l1_inst_sram_alloc(size_t); | |
59 | extern void *l1_data_sram_alloc(size_t); | |
60 | extern void *l1_data_sram_zalloc(size_t); | |
262c3825 SZ |
61 | extern void *l2_sram_alloc(size_t); |
62 | extern void *l2_sram_zalloc(size_t); | |
1394f032 BW |
63 | extern int l1_data_A_sram_free(const void*); |
64 | extern int l1_data_B_sram_free(const void*); | |
65 | extern int l1_inst_sram_free(const void*); | |
66 | extern int l1_data_sram_free(const void*); | |
262c3825 | 67 | extern int l2_sram_free(const void *); |
1394f032 BW |
68 | extern int sram_free(const void*); |
69 | ||
70 | #define L1_INST_SRAM 0x00000001 | |
71 | #define L1_DATA_A_SRAM 0x00000002 | |
72 | #define L1_DATA_B_SRAM 0x00000004 | |
73 | #define L1_DATA_SRAM 0x00000006 | |
262c3825 | 74 | #define L2_SRAM 0x00000008 |
1394f032 BW |
75 | extern void *sram_alloc_with_lsl(size_t, unsigned long); |
76 | extern int sram_free_with_lsl(const void*); | |
77 | ||
9df10281 RG |
78 | extern void *isram_memcpy(void *dest, const void *src, size_t n); |
79 | ||
066954a3 | 80 | extern const char bfin_board_name[]; |
1394f032 | 81 | |
cfefe3c6 | 82 | extern unsigned long bfin_sic_iwr[]; |
4a88d0ce | 83 | extern unsigned vr_wakeup; |
a9c59c27 | 84 | extern u16 _bfin_swrst; /* shadow for Software Reset Register (SWRST) */ |
1394f032 BW |
85 | |
86 | #endif | |
87 | ||
88 | #endif /* _BLACKFIN_H_ */ |