cplbinit.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. /*
  2. * Common CPLB definitions for CPLB init
  3. *
  4. * Copyright 2006-2008 Analog Devices Inc.
  5. *
  6. * Licensed under the GPL-2 or later.
  7. */
  8. #ifndef __ASM_CPLBINIT_H__
  9. #define __ASM_CPLBINIT_H__
  10. #include <asm/blackfin.h>
  11. #include <asm/cplb.h>
  12. #include <linux/threads.h>
  13. #ifdef CONFIG_CPLB_SWITCH_TAB_L1
  14. # define PDT_ATTR __attribute__((l1_data))
  15. #else
  16. # define PDT_ATTR
  17. #endif
  18. struct cplb_entry {
  19. unsigned long data, addr;
  20. };
  21. struct cplb_boundary {
  22. unsigned long eaddr; /* End of this region. */
  23. unsigned long data; /* CPLB data value. */
  24. };
  25. extern struct cplb_boundary dcplb_bounds[];
  26. extern struct cplb_boundary icplb_bounds[];
  27. extern int dcplb_nr_bounds, icplb_nr_bounds;
  28. extern struct cplb_entry dcplb_tbl[NR_CPUS][MAX_CPLBS];
  29. extern struct cplb_entry icplb_tbl[NR_CPUS][MAX_CPLBS];
  30. extern int first_switched_icplb;
  31. extern int first_switched_dcplb;
  32. extern int nr_dcplb_miss[], nr_icplb_miss[], nr_icplb_supv_miss[];
  33. extern int nr_dcplb_prot[], nr_cplb_flush[];
  34. #ifdef CONFIG_MPU
  35. extern int first_mask_dcplb;
  36. extern int page_mask_order;
  37. extern int page_mask_nelts;
  38. extern unsigned long *current_rwx_mask[NR_CPUS];
  39. extern void flush_switched_cplbs(unsigned int);
  40. extern void set_mask_dcplbs(unsigned long *, unsigned int);
  41. extern void __noreturn panic_cplb_error(int seqstat, struct pt_regs *);
  42. #endif /* CONFIG_MPU */
  43. extern void bfin_icache_init(struct cplb_entry *icplb_tbl);
  44. extern void bfin_dcache_init(struct cplb_entry *icplb_tbl);
  45. #if defined(CONFIG_BFIN_DCACHE) || defined(CONFIG_BFIN_ICACHE)
  46. extern void generate_cplb_tables_all(void);
  47. extern void generate_cplb_tables_cpu(unsigned int cpu);
  48. #endif
  49. #endif