mpc86xx.h 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. /*
  2. * Copyright 2006 Freescale Semiconductor.
  3. * Jeffrey Brown (jeffrey@freescale.com)
  4. * Srikanth Srinivasan (srikanth.srinivasan@freescale.com)
  5. */
  6. #ifndef __MPC86xx_H__
  7. #define __MPC86xx_H__
  8. #define EXC_OFF_SYS_RESET 0x0100 /* System reset offset */
  9. /*
  10. * l2cr values. Look in config_<BOARD>.h for the actual setup
  11. */
  12. #define l2cr 1017
  13. #define L2CR_L2E 0x80000000 /* bit 0 - enable */
  14. #define L2CR_L2PE 0x40000000 /* bit 1 - data parity */
  15. #define L2CR_L2I 0x00200000 /* bit 10 - global invalidate bit */
  16. #define L2CR_L2CTL 0x00100000 /* bit 11 - l2 ram control */
  17. #define L2CR_L2DO 0x00010000 /* bit 15 - data-only mode */
  18. #define L2CR_REP 0x00001000 /* bit 19 - l2 replacement alg */
  19. #define L2CR_HWF 0x00000800 /* bit 20 - hardware flush */
  20. #define L2CR_L2IP 0x00000001 /* global invalidate in progress */
  21. /*
  22. * BAT settings. Look in config_<BOARD>.h for the actual setup
  23. */
  24. #define BATU_BL_128K 0x00000000
  25. #define BATU_BL_256K 0x00000004
  26. #define BATU_BL_512K 0x0000000c
  27. #define BATU_BL_1M 0x0000001c
  28. #define BATU_BL_2M 0x0000003c
  29. #define BATU_BL_4M 0x0000007c
  30. #define BATU_BL_8M 0x000000fc
  31. #define BATU_BL_16M 0x000001fc
  32. #define BATU_BL_32M 0x000003fc
  33. #define BATU_BL_64M 0x000007fc
  34. #define BATU_BL_128M 0x00000ffc
  35. #define BATU_BL_256M 0x00001ffc
  36. #define BATU_BL_512M 0x00003ffc
  37. #define BATU_BL_1G 0x00007ffc
  38. #define BATU_BL_2G 0x0000fffc
  39. #define BATU_BL_4G 0x0001fffc
  40. #define BATU_VS 0x00000002
  41. #define BATU_VP 0x00000001
  42. #define BATU_INVALID 0x00000000
  43. #define BATL_WRITETHROUGH 0x00000040
  44. #define BATL_CACHEINHIBIT 0x00000020
  45. #define BATL_MEMCOHERENCE 0x00000010
  46. #define BATL_GUARDEDSTORAGE 0x00000008
  47. #define BATL_NO_ACCESS 0x00000000
  48. #define BATL_PP_MSK 0x00000003
  49. #define BATL_PP_00 0x00000000 /* No access */
  50. #define BATL_PP_01 0x00000001 /* Read-only */
  51. #define BATL_PP_10 0x00000002 /* Read-write */
  52. #define BATL_PP_11 0x00000003
  53. #define BATL_PP_NO_ACCESS BATL_PP_00
  54. #define BATL_PP_RO BATL_PP_01
  55. #define BATL_PP_RW BATL_PP_10
  56. #define HID0_XBSEN 0x00000100
  57. #define HID0_HIGH_BAT_EN 0x00800000
  58. #define HID0_XAEN 0x00020000
  59. #ifndef __ASSEMBLY__
  60. typedef struct
  61. {
  62. unsigned long freqProcessor;
  63. unsigned long freqSystemBus;
  64. } MPC86xx_SYS_INFO;
  65. #define l1icache_enable icache_enable
  66. void l2cache_enable(void);
  67. void l1dcache_enable(void);
  68. static __inline__ unsigned long get_hid0 (void)
  69. {
  70. unsigned long hid0;
  71. asm volatile("mfspr %0, 1008" : "=r" (hid0) :);
  72. return hid0;
  73. }
  74. static __inline__ unsigned long get_hid1 (void)
  75. {
  76. unsigned long hid1;
  77. asm volatile("mfspr %0, 1009" : "=r" (hid1) :);
  78. return hid1;
  79. }
  80. static __inline__ void set_hid0 (unsigned long hid0)
  81. {
  82. asm volatile("mtspr 1008, %0" : : "r" (hid0));
  83. }
  84. static __inline__ void set_hid1 (unsigned long hid1)
  85. {
  86. asm volatile("mtspr 1009, %0" : : "r" (hid1));
  87. }
  88. static __inline__ unsigned long get_l2cr (void)
  89. {
  90. unsigned long l2cr_val;
  91. asm volatile("mfspr %0, 1017" : "=r" (l2cr_val) :);
  92. return l2cr_val;
  93. }
  94. #endif /* _ASMLANGUAGE */
  95. #endif /* __MPC86xx_H__ */