mpc86xx.h 3.4 KB

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