blob: 5dba3a735596d495fafd8726dcb33e4677418bfc [file] [log] [blame]
Bryan Wu1394f032007-05-06 14:50:22 -07001/*
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
40#if defined(CONFIG_DMA_UNCACHED_2M)
41# define DMA_UNCACHED_REGION (2 * 1024 * 1024)
42#elif defined(CONFIG_DMA_UNCACHED_1M)
43# define DMA_UNCACHED_REGION (1024 * 1024)
44#else
45# define DMA_UNCACHED_REGION (0)
46#endif
47
48extern unsigned long get_cclk(void);
49extern unsigned long get_sclk(void);
Mike Frysinger2f6cf7bf2007-10-21 22:59:49 +080050extern unsigned long sclk_to_usecs(unsigned long sclk);
51extern unsigned long usecs_to_sclk(unsigned long usecs);
Bryan Wu1394f032007-05-06 14:50:22 -070052
Mike Frysinger49dce912007-11-21 16:46:49 +080053extern void dump_bfin_process(struct pt_regs *regs);
Robin Getzb03b08b2007-12-23 22:57:01 +080054extern void dump_bfin_mem(struct pt_regs *regs);
Bryan Wu1394f032007-05-06 14:50:22 -070055extern void dump_bfin_trace_buffer(void);
56
57extern int init_arch_irq(void);
58extern void bfin_reset(void);
59extern void _cplb_hdr(void);
60/* Blackfin cache functions */
61extern void bfin_icache_init(void);
62extern void bfin_dcache_init(void);
63extern int read_iloc(void);
64extern int bfin_console_init(void);
65extern asmlinkage void lower_to_irq14(void);
Mike Frysinger8d6c2422007-11-21 15:53:49 +080066extern asmlinkage void bfin_return_from_exception(void);
Bernd Schmidt8be80ed2007-07-25 14:44:49 +080067extern void init_exception_vectors(void);
Bryan Wu1394f032007-05-06 14:50:22 -070068extern void init_dma(void);
69extern void program_IAR(void);
70extern void evt14_softirq(void);
71extern asmlinkage void asm_do_IRQ(unsigned int irq, struct pt_regs *regs);
72extern void bfin_gpio_interrupt_setup(int irq, int irq_pfx, int type);
Michael Hennerichcfefe3c2008-02-09 04:12:37 +080073extern int bfin_internal_set_wake(unsigned int irq, unsigned int state);
Bryan Wu1394f032007-05-06 14:50:22 -070074
Bernd Schmidt7adfb582007-06-21 11:34:16 +080075extern asmlinkage void finish_atomic_sections (struct pt_regs *regs);
76extern char fixed_code_start;
77extern char fixed_code_end;
78extern int atomic_xchg32(void);
79extern int atomic_cas32(void);
80extern int atomic_add32(void);
81extern int atomic_sub32(void);
82extern int atomic_ior32(void);
83extern int atomic_and32(void);
84extern int atomic_xor32(void);
Robin Getz9f336a52007-10-29 18:23:28 +080085extern void safe_user_instruction(void);
Bernd Schmidt7adfb582007-06-21 11:34:16 +080086extern void sigreturn_stub(void);
87
Bryan Wu1394f032007-05-06 14:50:22 -070088extern void *l1_data_A_sram_alloc(size_t);
89extern void *l1_data_B_sram_alloc(size_t);
90extern void *l1_inst_sram_alloc(size_t);
91extern void *l1_data_sram_alloc(size_t);
92extern void *l1_data_sram_zalloc(size_t);
93extern int l1_data_A_sram_free(const void*);
94extern int l1_data_B_sram_free(const void*);
95extern int l1_inst_sram_free(const void*);
96extern int l1_data_sram_free(const void*);
97extern int sram_free(const void*);
98
99#define L1_INST_SRAM 0x00000001
100#define L1_DATA_A_SRAM 0x00000002
101#define L1_DATA_B_SRAM 0x00000004
102#define L1_DATA_SRAM 0x00000006
103extern void *sram_alloc_with_lsl(size_t, unsigned long);
104extern int sram_free_with_lsl(const void*);
105
106extern void led_on(int);
107extern void led_off(int);
108extern void led_toggle(int);
109extern void led_disp_num(int);
110extern void led_toggle_num(int);
111extern void init_leds(void);
112
Mike Frysinger066954a2007-10-21 22:36:06 +0800113extern const char bfin_board_name[];
Bryan Wu1394f032007-05-06 14:50:22 -0700114extern unsigned long wall_jiffies;
115extern unsigned long ipdt_table[];
116extern unsigned long dpdt_table[];
117extern unsigned long icplb_table[];
118extern unsigned long dcplb_table[];
119
120extern unsigned long ipdt_swapcount_table[];
121extern unsigned long dpdt_swapcount_table[];
122
123extern unsigned long table_start, table_end;
124
Michael Hennerichcfefe3c2008-02-09 04:12:37 +0800125extern unsigned long bfin_sic_iwr[];
Mike Frysingera9c59c22007-05-21 18:09:32 +0800126extern u16 _bfin_swrst; /* shadow for Software Reset Register (SWRST) */
Bryan Wu1394f032007-05-06 14:50:22 -0700127extern struct file_operations dpmc_fops;
128extern char _start;
129extern unsigned long _ramstart, _ramend, _rambase;
130extern unsigned long memory_start, memory_end, physical_mem_end;
131extern char _stext_l1[], _etext_l1[], _sdata_l1[], _edata_l1[], _sbss_l1[],
132 _ebss_l1[], _l1_lma_start[], _sdata_b_l1[], _ebss_b_l1[];
133
134#ifdef CONFIG_MTD_UCLINUX
135extern unsigned long memory_mtd_start, memory_mtd_end, mtd_size;
136#endif
137
138#endif
139
140#endif /* _BLACKFIN_H_ */