bfin-global.h 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. /*
  2. * Global extern defines for blackfin
  3. *
  4. * Copyright 2006-2009 Analog Devices Inc.
  5. *
  6. * Licensed under the GPL-2 or later.
  7. */
  8. #ifndef _BFIN_GLOBAL_H_
  9. #define _BFIN_GLOBAL_H_
  10. #ifndef __ASSEMBLY__
  11. #include <linux/linkage.h>
  12. #include <linux/types.h>
  13. #if defined(CONFIG_DMA_UNCACHED_32M)
  14. # define DMA_UNCACHED_REGION (32 * 1024 * 1024)
  15. #elif defined(CONFIG_DMA_UNCACHED_16M)
  16. # define DMA_UNCACHED_REGION (16 * 1024 * 1024)
  17. #elif defined(CONFIG_DMA_UNCACHED_8M)
  18. # define DMA_UNCACHED_REGION (8 * 1024 * 1024)
  19. #elif defined(CONFIG_DMA_UNCACHED_4M)
  20. # define DMA_UNCACHED_REGION (4 * 1024 * 1024)
  21. #elif defined(CONFIG_DMA_UNCACHED_2M)
  22. # define DMA_UNCACHED_REGION (2 * 1024 * 1024)
  23. #elif defined(CONFIG_DMA_UNCACHED_1M)
  24. # define DMA_UNCACHED_REGION (1024 * 1024)
  25. #elif defined(CONFIG_DMA_UNCACHED_512K)
  26. # define DMA_UNCACHED_REGION (512 * 1024)
  27. #elif defined(CONFIG_DMA_UNCACHED_256K)
  28. # define DMA_UNCACHED_REGION (256 * 1024)
  29. #elif defined(CONFIG_DMA_UNCACHED_128K)
  30. # define DMA_UNCACHED_REGION (128 * 1024)
  31. #else
  32. # define DMA_UNCACHED_REGION (0)
  33. #endif
  34. extern void bfin_setup_caches(unsigned int cpu);
  35. extern void bfin_setup_cpudata(unsigned int cpu);
  36. extern unsigned long get_cclk(void);
  37. extern unsigned long get_sclk(void);
  38. #ifdef CONFIG_BF60x
  39. extern unsigned long get_sclk0(void);
  40. extern unsigned long get_sclk1(void);
  41. extern unsigned long get_dclk(void);
  42. #endif
  43. extern unsigned long sclk_to_usecs(unsigned long sclk);
  44. extern unsigned long usecs_to_sclk(unsigned long usecs);
  45. struct pt_regs;
  46. #if defined(CONFIG_DEBUG_VERBOSE)
  47. extern void dump_bfin_process(struct pt_regs *regs);
  48. extern void dump_bfin_mem(struct pt_regs *regs);
  49. extern void dump_bfin_trace_buffer(void);
  50. #else
  51. #define dump_bfin_process(regs)
  52. #define dump_bfin_mem(regs)
  53. #define dump_bfin_trace_buffer()
  54. #endif
  55. extern void *l1_data_A_sram_alloc(size_t);
  56. extern void *l1_data_B_sram_alloc(size_t);
  57. extern void *l1_inst_sram_alloc(size_t);
  58. extern void *l1_data_sram_alloc(size_t);
  59. extern void *l1_data_sram_zalloc(size_t);
  60. extern void *l2_sram_alloc(size_t);
  61. extern void *l2_sram_zalloc(size_t);
  62. extern int l1_data_A_sram_free(const void*);
  63. extern int l1_data_B_sram_free(const void*);
  64. extern int l1_inst_sram_free(const void*);
  65. extern int l1_data_sram_free(const void*);
  66. extern int l2_sram_free(const void *);
  67. extern int sram_free(const void*);
  68. #define L1_INST_SRAM 0x00000001
  69. #define L1_DATA_A_SRAM 0x00000002
  70. #define L1_DATA_B_SRAM 0x00000004
  71. #define L1_DATA_SRAM 0x00000006
  72. #define L2_SRAM 0x00000008
  73. extern void *sram_alloc_with_lsl(size_t, unsigned long);
  74. extern int sram_free_with_lsl(const void*);
  75. extern void *isram_memcpy(void *dest, const void *src, size_t n);
  76. extern const char bfin_board_name[];
  77. extern unsigned long bfin_sic_iwr[];
  78. extern unsigned vr_wakeup;
  79. extern u16 _bfin_swrst; /* shadow for Software Reset Register (SWRST) */
  80. #endif
  81. #endif /* _BLACKFIN_H_ */