cbe_regs.h 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  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) 2006 Benjamin Herrenschmidt <benh@kernel.crashing.org>, IBM Corp.
  8. */
  9. #ifndef CBE_REGS_H
  10. #define CBE_REGS_H
  11. /*
  12. *
  13. * Some HID register definitions
  14. *
  15. */
  16. /* CBE specific HID0 bits */
  17. #define HID0_CBE_THERM_WAKEUP 0x0000020000000000ul
  18. #define HID0_CBE_SYSERR_WAKEUP 0x0000008000000000ul
  19. #define HID0_CBE_THERM_INT_EN 0x0000000400000000ul
  20. #define HID0_CBE_SYSERR_INT_EN 0x0000000200000000ul
  21. /*
  22. *
  23. * Pervasive unit register definitions
  24. *
  25. */
  26. struct cbe_pmd_regs {
  27. u8 pad_0x0000_0x0800[0x0800 - 0x0000]; /* 0x0000 */
  28. /* Thermal Sensor Registers */
  29. u64 ts_ctsr1; /* 0x0800 */
  30. u64 ts_ctsr2; /* 0x0808 */
  31. u64 ts_mtsr1; /* 0x0810 */
  32. u64 ts_mtsr2; /* 0x0818 */
  33. u64 ts_itr1; /* 0x0820 */
  34. u64 ts_itr2; /* 0x0828 */
  35. u64 ts_gitr; /* 0x0830 */
  36. u64 ts_isr; /* 0x0838 */
  37. u64 ts_imr; /* 0x0840 */
  38. u64 tm_cr1; /* 0x0848 */
  39. u64 tm_cr2; /* 0x0850 */
  40. u64 tm_simr; /* 0x0858 */
  41. u64 tm_tpr; /* 0x0860 */
  42. u64 tm_str1; /* 0x0868 */
  43. u64 tm_str2; /* 0x0870 */
  44. u64 tm_tsr; /* 0x0878 */
  45. /* Power Management */
  46. u64 pm_control; /* 0x0880 */
  47. #define CBE_PMD_PAUSE_ZERO_CONTROL 0x10000
  48. u64 pm_status; /* 0x0888 */
  49. /* Time Base Register */
  50. u64 tbr; /* 0x0890 */
  51. u8 pad_0x0898_0x0c00 [0x0c00 - 0x0898]; /* 0x0898 */
  52. /* Fault Isolation Registers */
  53. u64 checkstop_fir; /* 0x0c00 */
  54. u64 recoverable_fir;
  55. u64 spec_att_mchk_fir;
  56. u64 fir_mode_reg;
  57. u64 fir_enable_mask;
  58. u8 pad_0x0c28_0x1000 [0x1000 - 0x0c28]; /* 0x0c28 */
  59. };
  60. extern struct cbe_pmd_regs __iomem *cbe_get_pmd_regs(struct device_node *np);
  61. extern struct cbe_pmd_regs __iomem *cbe_get_cpu_pmd_regs(int cpu);
  62. /*
  63. *
  64. * IIC unit register definitions
  65. *
  66. */
  67. struct cbe_iic_pending_bits {
  68. u32 data;
  69. u8 flags;
  70. u8 class;
  71. u8 source;
  72. u8 prio;
  73. };
  74. #define CBE_IIC_IRQ_VALID 0x80
  75. #define CBE_IIC_IRQ_IPI 0x40
  76. struct cbe_iic_thread_regs {
  77. struct cbe_iic_pending_bits pending;
  78. struct cbe_iic_pending_bits pending_destr;
  79. u64 generate;
  80. u64 prio;
  81. };
  82. struct cbe_iic_regs {
  83. u8 pad_0x0000_0x0400[0x0400 - 0x0000]; /* 0x0000 */
  84. /* IIC interrupt registers */
  85. struct cbe_iic_thread_regs thread[2]; /* 0x0400 */
  86. u64 iic_ir; /* 0x0440 */
  87. u64 iic_is; /* 0x0448 */
  88. u8 pad_0x0450_0x0500[0x0500 - 0x0450]; /* 0x0450 */
  89. /* IOC FIR */
  90. u64 ioc_fir_reset; /* 0x0500 */
  91. u64 ioc_fir_set;
  92. u64 ioc_checkstop_enable;
  93. u64 ioc_fir_error_mask;
  94. u64 ioc_syserr_enable;
  95. u64 ioc_fir;
  96. u8 pad_0x0530_0x1000[0x1000 - 0x0530]; /* 0x0530 */
  97. };
  98. extern struct cbe_iic_regs __iomem *cbe_get_iic_regs(struct device_node *np);
  99. extern struct cbe_iic_regs __iomem *cbe_get_cpu_iic_regs(int cpu);
  100. /* Init this module early */
  101. extern void cbe_regs_init(void);
  102. #endif /* CBE_REGS_H */