cbe_regs.h 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220
  1. /*
  2. * cbe_regs.h
  3. *
  4. * This file is intended to hold the various register definitions for CBE
  5. * on-chip system devices (memory controller, IO controller, etc...)
  6. *
  7. * (C) Copyright IBM Corporation 2001,2006
  8. *
  9. * Authors: Maximino Aguilar (maguilar@us.ibm.com)
  10. * David J. Erb (djerb@us.ibm.com)
  11. *
  12. * (c) 2006 Benjamin Herrenschmidt <benh@kernel.crashing.org>, IBM Corp.
  13. */
  14. #ifndef CBE_REGS_H
  15. #define CBE_REGS_H
  16. /*
  17. *
  18. * Some HID register definitions
  19. *
  20. */
  21. /* CBE specific HID0 bits */
  22. #define HID0_CBE_THERM_WAKEUP 0x0000020000000000ul
  23. #define HID0_CBE_SYSERR_WAKEUP 0x0000008000000000ul
  24. #define HID0_CBE_THERM_INT_EN 0x0000000400000000ul
  25. #define HID0_CBE_SYSERR_INT_EN 0x0000000200000000ul
  26. #define MAX_CBE 2
  27. /*
  28. *
  29. * Pervasive unit register definitions
  30. *
  31. */
  32. union spe_reg {
  33. u64 val;
  34. u8 spe[8];
  35. };
  36. union ppe_spe_reg {
  37. u64 val;
  38. struct {
  39. u32 ppe;
  40. u32 spe;
  41. };
  42. };
  43. struct cbe_pmd_regs {
  44. /* Debug Bus Control */
  45. u64 pad_0x0000; /* 0x0000 */
  46. u64 group_control; /* 0x0008 */
  47. u8 pad_0x0010_0x00a8 [0x00a8 - 0x0010]; /* 0x0010 */
  48. u64 debug_bus_control; /* 0x00a8 */
  49. u8 pad_0x00b0_0x0100 [0x0100 - 0x00b0]; /* 0x00b0 */
  50. u64 trace_aux_data; /* 0x0100 */
  51. u64 trace_buffer_0_63; /* 0x0108 */
  52. u64 trace_buffer_64_127; /* 0x0110 */
  53. u64 trace_address; /* 0x0118 */
  54. u64 ext_tr_timer; /* 0x0120 */
  55. u8 pad_0x0128_0x0400 [0x0400 - 0x0128]; /* 0x0128 */
  56. /* Performance Monitor */
  57. u64 pm_status; /* 0x0400 */
  58. u64 pm_control; /* 0x0408 */
  59. u64 pm_interval; /* 0x0410 */
  60. u64 pm_ctr[4]; /* 0x0418 */
  61. u64 pm_start_stop; /* 0x0438 */
  62. u64 pm07_control[8]; /* 0x0440 */
  63. u8 pad_0x0480_0x0800 [0x0800 - 0x0480]; /* 0x0480 */
  64. /* Thermal Sensor Registers */
  65. union spe_reg ts_ctsr1; /* 0x0800 */
  66. u64 ts_ctsr2; /* 0x0808 */
  67. union spe_reg ts_mtsr1; /* 0x0810 */
  68. u64 ts_mtsr2; /* 0x0818 */
  69. union spe_reg ts_itr1; /* 0x0820 */
  70. u64 ts_itr2; /* 0x0828 */
  71. u64 ts_gitr; /* 0x0830 */
  72. u64 ts_isr; /* 0x0838 */
  73. u64 ts_imr; /* 0x0840 */
  74. union spe_reg tm_cr1; /* 0x0848 */
  75. u64 tm_cr2; /* 0x0850 */
  76. u64 tm_simr; /* 0x0858 */
  77. union ppe_spe_reg tm_tpr; /* 0x0860 */
  78. union spe_reg tm_str1; /* 0x0868 */
  79. u64 tm_str2; /* 0x0870 */
  80. union ppe_spe_reg tm_tsr; /* 0x0878 */
  81. /* Power Management */
  82. u64 pmcr; /* 0x0880 */
  83. #define CBE_PMD_PAUSE_ZERO_CONTROL 0x10000
  84. u64 pmsr; /* 0x0888 */
  85. /* Time Base Register */
  86. u64 tbr; /* 0x0890 */
  87. u8 pad_0x0898_0x0c00 [0x0c00 - 0x0898]; /* 0x0898 */
  88. /* Fault Isolation Registers */
  89. u64 checkstop_fir; /* 0x0c00 */
  90. u64 recoverable_fir; /* 0x0c08 */
  91. u64 spec_att_mchk_fir; /* 0x0c10 */
  92. u64 fir_mode_reg; /* 0x0c18 */
  93. u64 fir_enable_mask; /* 0x0c20 */
  94. u8 pad_0x0c28_0x1000 [0x1000 - 0x0c28]; /* 0x0c28 */
  95. };
  96. extern struct cbe_pmd_regs __iomem *cbe_get_pmd_regs(struct device_node *np);
  97. extern struct cbe_pmd_regs __iomem *cbe_get_cpu_pmd_regs(int cpu);
  98. /*
  99. *
  100. * IIC unit register definitions
  101. *
  102. */
  103. struct cbe_iic_pending_bits {
  104. u32 data;
  105. u8 flags;
  106. u8 class;
  107. u8 source;
  108. u8 prio;
  109. };
  110. #define CBE_IIC_IRQ_VALID 0x80
  111. #define CBE_IIC_IRQ_IPI 0x40
  112. struct cbe_iic_thread_regs {
  113. struct cbe_iic_pending_bits pending;
  114. struct cbe_iic_pending_bits pending_destr;
  115. u64 generate;
  116. u64 prio;
  117. };
  118. struct cbe_iic_regs {
  119. u8 pad_0x0000_0x0400[0x0400 - 0x0000]; /* 0x0000 */
  120. /* IIC interrupt registers */
  121. struct cbe_iic_thread_regs thread[2]; /* 0x0400 */
  122. u64 iic_ir; /* 0x0440 */
  123. u64 iic_is; /* 0x0448 */
  124. #define CBE_IIC_IS_PMI 0x2
  125. u8 pad_0x0450_0x0500[0x0500 - 0x0450]; /* 0x0450 */
  126. /* IOC FIR */
  127. u64 ioc_fir_reset; /* 0x0500 */
  128. u64 ioc_fir_set; /* 0x0508 */
  129. u64 ioc_checkstop_enable; /* 0x0510 */
  130. u64 ioc_fir_error_mask; /* 0x0518 */
  131. u64 ioc_syserr_enable; /* 0x0520 */
  132. u64 ioc_fir; /* 0x0528 */
  133. u8 pad_0x0530_0x1000[0x1000 - 0x0530]; /* 0x0530 */
  134. };
  135. extern struct cbe_iic_regs __iomem *cbe_get_iic_regs(struct device_node *np);
  136. extern struct cbe_iic_regs __iomem *cbe_get_cpu_iic_regs(int cpu);
  137. struct cbe_mic_tm_regs {
  138. u8 pad_0x0000_0x0040[0x0040 - 0x0000]; /* 0x0000 */
  139. u64 mic_ctl_cnfg2; /* 0x0040 */
  140. #define CBE_MIC_ENABLE_AUX_TRC 0x8000000000000000LL
  141. #define CBE_MIC_DISABLE_PWR_SAV_2 0x0200000000000000LL
  142. #define CBE_MIC_DISABLE_AUX_TRC_WRAP 0x0100000000000000LL
  143. #define CBE_MIC_ENABLE_AUX_TRC_INT 0x0080000000000000LL
  144. u64 pad_0x0048; /* 0x0048 */
  145. u64 mic_aux_trc_base; /* 0x0050 */
  146. u64 mic_aux_trc_max_addr; /* 0x0058 */
  147. u64 mic_aux_trc_cur_addr; /* 0x0060 */
  148. u64 mic_aux_trc_grf_addr; /* 0x0068 */
  149. u64 mic_aux_trc_grf_data; /* 0x0070 */
  150. u64 pad_0x0078; /* 0x0078 */
  151. u64 mic_ctl_cnfg_0; /* 0x0080 */
  152. #define CBE_MIC_DISABLE_PWR_SAV_0 0x8000000000000000LL
  153. u64 pad_0x0088; /* 0x0088 */
  154. u64 slow_fast_timer_0; /* 0x0090 */
  155. u64 slow_next_timer_0; /* 0x0098 */
  156. u8 pad_0x00a0_0x01c0[0x01c0 - 0x0a0]; /* 0x00a0 */
  157. u64 mic_ctl_cnfg_1; /* 0x01c0 */
  158. #define CBE_MIC_DISABLE_PWR_SAV_1 0x8000000000000000LL
  159. u64 pad_0x01c8; /* 0x01c8 */
  160. u64 slow_fast_timer_1; /* 0x01d0 */
  161. u64 slow_next_timer_1; /* 0x01d8 */
  162. u8 pad_0x01e0_0x1000[0x1000 - 0x01e0]; /* 0x01e0 */
  163. };
  164. extern struct cbe_mic_tm_regs __iomem *cbe_get_mic_tm_regs(struct device_node *np);
  165. extern struct cbe_mic_tm_regs __iomem *cbe_get_cpu_mic_tm_regs(int cpu);
  166. /* Init this module early */
  167. extern void cbe_regs_init(void);
  168. #endif /* CBE_REGS_H */