bfin-global.h 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  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. #ifndef _BFIN_GLOBAL_H_
  29. #define _BFIN_GLOBAL_H_
  30. #ifndef __ASSEMBLY__
  31. #include <asm-generic/sections.h>
  32. #include <asm/ptrace.h>
  33. #include <asm/user.h>
  34. #include <linux/linkage.h>
  35. #include <linux/types.h>
  36. #if defined(CONFIG_DMA_UNCACHED_4M)
  37. # define DMA_UNCACHED_REGION (4 * 1024 * 1024)
  38. #elif defined(CONFIG_DMA_UNCACHED_2M)
  39. # define DMA_UNCACHED_REGION (2 * 1024 * 1024)
  40. #elif defined(CONFIG_DMA_UNCACHED_1M)
  41. # define DMA_UNCACHED_REGION (1024 * 1024)
  42. #else
  43. # define DMA_UNCACHED_REGION (0)
  44. #endif
  45. extern unsigned long get_cclk(void);
  46. extern unsigned long get_sclk(void);
  47. extern unsigned long sclk_to_usecs(unsigned long sclk);
  48. extern unsigned long usecs_to_sclk(unsigned long usecs);
  49. extern void dump_bfin_process(struct pt_regs *regs);
  50. extern void dump_bfin_mem(struct pt_regs *regs);
  51. extern void dump_bfin_trace_buffer(void);
  52. /* init functions only */
  53. extern int init_arch_irq(void);
  54. extern void bfin_icache_init(void);
  55. extern void bfin_dcache_init(void);
  56. extern void init_exception_vectors(void);
  57. extern void program_IAR(void);
  58. extern void bfin_reset(void);
  59. extern asmlinkage void lower_to_irq14(void);
  60. extern asmlinkage void bfin_return_from_exception(void);
  61. extern asmlinkage void evt14_softirq(void);
  62. extern asmlinkage void asm_do_IRQ(unsigned int irq, struct pt_regs *regs);
  63. extern int bfin_internal_set_wake(unsigned int irq, unsigned int state);
  64. extern void *l1_data_A_sram_alloc(size_t);
  65. extern void *l1_data_B_sram_alloc(size_t);
  66. extern void *l1_inst_sram_alloc(size_t);
  67. extern void *l1_data_sram_alloc(size_t);
  68. extern void *l1_data_sram_zalloc(size_t);
  69. extern void *l2_sram_alloc(size_t);
  70. extern void *l2_sram_zalloc(size_t);
  71. extern int l1_data_A_sram_free(const void*);
  72. extern int l1_data_B_sram_free(const void*);
  73. extern int l1_inst_sram_free(const void*);
  74. extern int l1_data_sram_free(const void*);
  75. extern int l2_sram_free(const void *);
  76. extern int sram_free(const void*);
  77. #define L1_INST_SRAM 0x00000001
  78. #define L1_DATA_A_SRAM 0x00000002
  79. #define L1_DATA_B_SRAM 0x00000004
  80. #define L1_DATA_SRAM 0x00000006
  81. #define L2_SRAM 0x00000008
  82. extern void *sram_alloc_with_lsl(size_t, unsigned long);
  83. extern int sram_free_with_lsl(const void*);
  84. extern const char bfin_board_name[];
  85. extern unsigned long bfin_sic_iwr[];
  86. extern unsigned vr_wakeup;
  87. extern u16 _bfin_swrst; /* shadow for Software Reset Register (SWRST) */
  88. extern unsigned long _ramstart, _ramend, _rambase;
  89. extern unsigned long memory_start, memory_end, physical_mem_end;
  90. extern char _stext_l1[], _etext_l1[], _sdata_l1[], _edata_l1[], _sbss_l1[],
  91. _ebss_l1[], _l1_lma_start[], _sdata_b_l1[], _ebss_b_l1[],
  92. _stext_l2[], _etext_l2[], _sdata_l2[], _edata_l2[], _sbss_l2[],
  93. _ebss_l2[], _l2_lma_start[];
  94. /* only used when CONFIG_MTD_UCLINUX */
  95. extern unsigned long memory_mtd_start, memory_mtd_end, mtd_size;
  96. #ifdef CONFIG_BFIN_ICACHE_LOCK
  97. extern void cache_grab_lock(int way);
  98. extern void cache_lock(int way);
  99. #endif
  100. #endif
  101. #endif /* _BLACKFIN_H_ */