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