bfin-global.h 3.9 KB
Newer Older
B
Bryan Wu 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
/*
 * File:         include/asm-blackfin/bfin-global.h
 * Based on:
 * Author: *
 * Created:
 * Description:  Global extern defines for blackfin
 *
 * Modified:
 *               Copyright 2004-2006 Analog Devices Inc.
 *
 * Bugs:         Enter bugs at http://blackfin.uclinux.org/
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, see the file COPYING, or write
 * to the Free Software Foundation, Inc.,
 * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 */

#ifndef _BFIN_GLOBAL_H_
#define _BFIN_GLOBAL_H_

#ifndef __ASSEMBLY__

#include <asm-generic/sections.h>
#include <asm/ptrace.h>
#include <asm/user.h>
#include <linux/linkage.h>
#include <linux/types.h>

40 41 42
#if defined(CONFIG_DMA_UNCACHED_4M)
# define DMA_UNCACHED_REGION (4 * 1024 * 1024)
#elif defined(CONFIG_DMA_UNCACHED_2M)
B
Bryan Wu 已提交
43 44 45 46 47 48 49 50 51
# define DMA_UNCACHED_REGION (2 * 1024 * 1024)
#elif defined(CONFIG_DMA_UNCACHED_1M)
# define DMA_UNCACHED_REGION (1024 * 1024)
#else
# define DMA_UNCACHED_REGION (0)
#endif

extern unsigned long get_cclk(void);
extern unsigned long get_sclk(void);
52 53
extern unsigned long sclk_to_usecs(unsigned long sclk);
extern unsigned long usecs_to_sclk(unsigned long usecs);
B
Bryan Wu 已提交
54

55
extern void dump_bfin_process(struct pt_regs *regs);
56
extern void dump_bfin_mem(struct pt_regs *regs);
B
Bryan Wu 已提交
57 58
extern void dump_bfin_trace_buffer(void);

59
/* init functions only */
B
Bryan Wu 已提交
60 61 62
extern int init_arch_irq(void);
extern void bfin_icache_init(void);
extern void bfin_dcache_init(void);
63
extern void init_exception_vectors(void);
B
Bryan Wu 已提交
64
extern void program_IAR(void);
65 66 67 68 69

extern void bfin_reset(void);
extern asmlinkage void lower_to_irq14(void);
extern asmlinkage void bfin_return_from_exception(void);
extern asmlinkage void evt14_softirq(void);
B
Bryan Wu 已提交
70
extern asmlinkage void asm_do_IRQ(unsigned int irq, struct pt_regs *regs);
71
extern int bfin_internal_set_wake(unsigned int irq, unsigned int state);
B
Bryan Wu 已提交
72 73 74 75 76 77

extern void *l1_data_A_sram_alloc(size_t);
extern void *l1_data_B_sram_alloc(size_t);
extern void *l1_inst_sram_alloc(size_t);
extern void *l1_data_sram_alloc(size_t);
extern void *l1_data_sram_zalloc(size_t);
78 79
extern void *l2_sram_alloc(size_t);
extern void *l2_sram_zalloc(size_t);
B
Bryan Wu 已提交
80 81 82 83
extern int l1_data_A_sram_free(const void*);
extern int l1_data_B_sram_free(const void*);
extern int l1_inst_sram_free(const void*);
extern int l1_data_sram_free(const void*);
84
extern int l2_sram_free(const void *);
B
Bryan Wu 已提交
85 86 87 88 89 90
extern int sram_free(const void*);

#define L1_INST_SRAM		0x00000001
#define L1_DATA_A_SRAM		0x00000002
#define L1_DATA_B_SRAM		0x00000004
#define L1_DATA_SRAM		0x00000006
91
#define L2_SRAM			0x00000008
B
Bryan Wu 已提交
92 93 94
extern void *sram_alloc_with_lsl(size_t, unsigned long);
extern int sram_free_with_lsl(const void*);

95
extern const char bfin_board_name[];
B
Bryan Wu 已提交
96

97
extern unsigned long bfin_sic_iwr[];
98
extern unsigned vr_wakeup;
99
extern u16 _bfin_swrst; /* shadow for Software Reset Register (SWRST) */
B
Bryan Wu 已提交
100 101 102
extern unsigned long _ramstart, _ramend, _rambase;
extern unsigned long memory_start, memory_end, physical_mem_end;
extern char _stext_l1[], _etext_l1[], _sdata_l1[], _edata_l1[], _sbss_l1[],
103 104 105
	_ebss_l1[], _l1_lma_start[], _sdata_b_l1[], _ebss_b_l1[],
	_stext_l2[], _etext_l2[], _sdata_l2[], _edata_l2[], _sbss_l2[],
	_ebss_l2[], _l2_lma_start[];
B
Bryan Wu 已提交
106

107
/* only used when CONFIG_MTD_UCLINUX */
B
Bryan Wu 已提交
108 109
extern unsigned long memory_mtd_start, memory_mtd_end, mtd_size;

110 111 112 113 114
#ifdef CONFIG_BFIN_ICACHE_LOCK
extern void cache_grab_lock(int way);
extern void cache_lock(int way);
#endif

B
Bryan Wu 已提交
115 116 117
#endif

#endif				/* _BLACKFIN_H_ */