cplbinit.h 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. /*
  2. * File: include/asm-blackfin/cplbinit.h
  3. * Based on:
  4. * Author:
  5. *
  6. * Created:
  7. * Description:
  8. *
  9. * Modified:
  10. * Copyright 2004-2006 Analog Devices Inc.
  11. *
  12. * Bugs: Enter bugs at http://blackfin.uclinux.org/
  13. *
  14. * This program is free software; you can redistribute it and/or modify
  15. * it under the terms of the GNU General Public License as published by
  16. * the Free Software Foundation; either version 2 of the License, or
  17. * (at your option) any later version.
  18. *
  19. * This program is distributed in the hope that it will be useful,
  20. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  21. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  22. * GNU General Public License for more details.
  23. *
  24. * You should have received a copy of the GNU General Public License
  25. * along with this program; if not, see the file COPYING, or write
  26. * to the Free Software Foundation, Inc.,
  27. * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  28. */
  29. #ifndef __ASM_CPLBINIT_H__
  30. #define __ASM_CPLBINIT_H__
  31. #include <asm/blackfin.h>
  32. #include <asm/cplb.h>
  33. #ifdef CONFIG_MPU
  34. #include <asm/cplb-mpu.h>
  35. #else
  36. #define INITIAL_T 0x1
  37. #define SWITCH_T 0x2
  38. #define I_CPLB 0x4
  39. #define D_CPLB 0x8
  40. #define IN_KERNEL 1
  41. enum
  42. {ZERO_P, L1I_MEM, L1D_MEM, SDRAM_KERN , SDRAM_RAM_MTD, SDRAM_DMAZ, RES_MEM, ASYNC_MEM, L2_MEM};
  43. struct cplb_desc {
  44. u32 start; /* start address */
  45. u32 end; /* end address */
  46. u32 psize; /* prefered size if any otherwise 1MB or 4MB*/
  47. u16 attr;/* attributes */
  48. u16 i_conf;/* I-CPLB DATA */
  49. u16 d_conf;/* D-CPLB DATA */
  50. u16 valid;/* valid */
  51. const s8 name[30];/* name */
  52. };
  53. struct cplb_tab {
  54. u_long *tab;
  55. u16 pos;
  56. u16 size;
  57. };
  58. extern u_long icplb_table[];
  59. extern u_long dcplb_table[];
  60. /* Till here we are discussing about the static memory management model.
  61. * However, the operating envoronments commonly define more CPLB
  62. * descriptors to cover the entire addressable memory than will fit into
  63. * the available on-chip 16 CPLB MMRs. When this happens, the below table
  64. * will be used which will hold all the potentially required CPLB descriptors
  65. *
  66. * This is how Page descriptor Table is implemented in uClinux/Blackfin.
  67. */
  68. extern u_long ipdt_table[];
  69. extern u_long dpdt_table[];
  70. #ifdef CONFIG_CPLB_INFO
  71. extern u_long ipdt_swapcount_table[];
  72. extern u_long dpdt_swapcount_table[];
  73. #endif
  74. #endif /* CONFIG_MPU */
  75. extern unsigned long reserved_mem_dcache_on;
  76. extern unsigned long reserved_mem_icache_on;
  77. extern void generate_cpl_tables(void);
  78. #endif