Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 1 | /* |
| 2 | * File: include/asm-blackfin/bfin-global.h |
| 3 | * Based on: |
| 4 | * Author: * |
| 5 | * Created: |
| 6 | * Description: Global extern defines for blackfin |
| 7 | * |
| 8 | * Modified: |
| 9 | * Copyright 2004-2006 Analog Devices Inc. |
| 10 | * |
| 11 | * Bugs: Enter bugs at http://blackfin.uclinux.org/ |
| 12 | * |
| 13 | * This program is free software; you can redistribute it and/or modify |
| 14 | * it under the terms of the GNU General Public License as published by |
| 15 | * the Free Software Foundation; either version 2 of the License, or |
| 16 | * (at your option) any later version. |
| 17 | * |
| 18 | * This program is distributed in the hope that it will be useful, |
| 19 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 21 | * GNU General Public License for more details. |
| 22 | * |
| 23 | * You should have received a copy of the GNU General Public License |
| 24 | * along with this program; if not, see the file COPYING, or write |
| 25 | * to the Free Software Foundation, Inc., |
| 26 | * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
| 27 | */ |
| 28 | |
| 29 | #ifndef _BFIN_GLOBAL_H_ |
| 30 | #define _BFIN_GLOBAL_H_ |
| 31 | |
| 32 | #ifndef __ASSEMBLY__ |
| 33 | |
| 34 | #include <asm-generic/sections.h> |
| 35 | #include <asm/ptrace.h> |
| 36 | #include <asm/user.h> |
| 37 | #include <linux/linkage.h> |
| 38 | #include <linux/types.h> |
| 39 | |
Cliff Cai | 86ad793 | 2008-05-17 16:36:52 +0800 | [diff] [blame] | 40 | #if defined(CONFIG_DMA_UNCACHED_4M) |
| 41 | # define DMA_UNCACHED_REGION (4 * 1024 * 1024) |
| 42 | #elif defined(CONFIG_DMA_UNCACHED_2M) |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 43 | # define DMA_UNCACHED_REGION (2 * 1024 * 1024) |
| 44 | #elif defined(CONFIG_DMA_UNCACHED_1M) |
| 45 | # define DMA_UNCACHED_REGION (1024 * 1024) |
| 46 | #else |
| 47 | # define DMA_UNCACHED_REGION (0) |
| 48 | #endif |
| 49 | |
| 50 | extern unsigned long get_cclk(void); |
| 51 | extern unsigned long get_sclk(void); |
Mike Frysinger | 2f6cf7bf | 2007-10-21 22:59:49 +0800 | [diff] [blame] | 52 | extern unsigned long sclk_to_usecs(unsigned long sclk); |
| 53 | extern unsigned long usecs_to_sclk(unsigned long usecs); |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 54 | |
Mike Frysinger | 49dce91 | 2007-11-21 16:46:49 +0800 | [diff] [blame] | 55 | extern void dump_bfin_process(struct pt_regs *regs); |
Robin Getz | b03b08b | 2007-12-23 22:57:01 +0800 | [diff] [blame] | 56 | extern void dump_bfin_mem(struct pt_regs *regs); |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 57 | extern void dump_bfin_trace_buffer(void); |
| 58 | |
Mike Frysinger | ee32664 | 2008-08-14 14:37:32 +0800 | [diff] [blame] | 59 | /* init functions only */ |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 60 | extern int init_arch_irq(void); |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 61 | extern void bfin_icache_init(void); |
| 62 | extern void bfin_dcache_init(void); |
Mike Frysinger | ee32664 | 2008-08-14 14:37:32 +0800 | [diff] [blame] | 63 | extern void init_exception_vectors(void); |
| 64 | extern void program_IAR(void); |
| 65 | |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 66 | extern asmlinkage void lower_to_irq14(void); |
Mike Frysinger | 8d6c242 | 2007-11-21 15:53:49 +0800 | [diff] [blame] | 67 | extern asmlinkage void bfin_return_from_exception(void); |
Mike Frysinger | ee32664 | 2008-08-14 14:37:32 +0800 | [diff] [blame] | 68 | extern asmlinkage void evt14_softirq(void); |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 69 | extern asmlinkage void asm_do_IRQ(unsigned int irq, struct pt_regs *regs); |
Michael Hennerich | cfefe3c | 2008-02-09 04:12:37 +0800 | [diff] [blame] | 70 | extern int bfin_internal_set_wake(unsigned int irq, unsigned int state); |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 71 | |
| 72 | extern void *l1_data_A_sram_alloc(size_t); |
| 73 | extern void *l1_data_B_sram_alloc(size_t); |
| 74 | extern void *l1_inst_sram_alloc(size_t); |
| 75 | extern void *l1_data_sram_alloc(size_t); |
| 76 | extern void *l1_data_sram_zalloc(size_t); |
Sonic Zhang | 262c382 | 2008-07-19 15:42:41 +0800 | [diff] [blame] | 77 | extern void *l2_sram_alloc(size_t); |
| 78 | extern void *l2_sram_zalloc(size_t); |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 79 | extern int l1_data_A_sram_free(const void*); |
| 80 | extern int l1_data_B_sram_free(const void*); |
| 81 | extern int l1_inst_sram_free(const void*); |
| 82 | extern int l1_data_sram_free(const void*); |
Sonic Zhang | 262c382 | 2008-07-19 15:42:41 +0800 | [diff] [blame] | 83 | extern int l2_sram_free(const void *); |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 84 | extern int sram_free(const void*); |
| 85 | |
| 86 | #define L1_INST_SRAM 0x00000001 |
| 87 | #define L1_DATA_A_SRAM 0x00000002 |
| 88 | #define L1_DATA_B_SRAM 0x00000004 |
| 89 | #define L1_DATA_SRAM 0x00000006 |
Sonic Zhang | 262c382 | 2008-07-19 15:42:41 +0800 | [diff] [blame] | 90 | #define L2_SRAM 0x00000008 |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 91 | extern void *sram_alloc_with_lsl(size_t, unsigned long); |
| 92 | extern int sram_free_with_lsl(const void*); |
| 93 | |
Robin Getz | 9df1028 | 2008-10-08 18:03:33 +0800 | [diff] [blame] | 94 | extern void *isram_memcpy(void *dest, const void *src, size_t n); |
| 95 | |
Mike Frysinger | 066954a | 2007-10-21 22:36:06 +0800 | [diff] [blame] | 96 | extern const char bfin_board_name[]; |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 97 | |
Michael Hennerich | cfefe3c | 2008-02-09 04:12:37 +0800 | [diff] [blame] | 98 | extern unsigned long bfin_sic_iwr[]; |
Michael Hennerich | 4a88d0c | 2008-08-05 17:38:41 +0800 | [diff] [blame] | 99 | extern unsigned vr_wakeup; |
Mike Frysinger | a9c59c2 | 2007-05-21 18:09:32 +0800 | [diff] [blame] | 100 | extern u16 _bfin_swrst; /* shadow for Software Reset Register (SWRST) */ |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 101 | extern unsigned long _ramstart, _ramend, _rambase; |
| 102 | extern unsigned long memory_start, memory_end, physical_mem_end; |
| 103 | extern char _stext_l1[], _etext_l1[], _sdata_l1[], _edata_l1[], _sbss_l1[], |
Mike Frysinger | 3b1f26a | 2008-10-27 18:21:43 +0800 | [diff] [blame^] | 104 | _ebss_l1[], _l1_lma_start[], _sdata_b_l1[], _sbss_b_l1[], _ebss_b_l1[], |
Sonic Zhang | 262c382 | 2008-07-19 15:42:41 +0800 | [diff] [blame] | 105 | _stext_l2[], _etext_l2[], _sdata_l2[], _edata_l2[], _sbss_l2[], |
| 106 | _ebss_l2[], _l2_lma_start[]; |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 107 | |
Mike Frysinger | 6c3fc69 | 2008-10-09 17:13:39 +0800 | [diff] [blame] | 108 | /* only used when MTD_UCLINUX */ |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 109 | extern unsigned long memory_mtd_start, memory_mtd_end, mtd_size; |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 110 | |
Mike Frysinger | 0e06b50 | 2008-08-14 14:29:57 +0800 | [diff] [blame] | 111 | #ifdef CONFIG_BFIN_ICACHE_LOCK |
| 112 | extern void cache_grab_lock(int way); |
| 113 | extern void cache_lock(int way); |
| 114 | #endif |
| 115 | |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 116 | #endif |
| 117 | |
| 118 | #endif /* _BLACKFIN_H_ */ |