]> err.no Git - linux-2.6/blobdiff - arch/powerpc/platforms/cell/cbe_regs.h
Pull battery into release branch
[linux-2.6] / arch / powerpc / platforms / cell / cbe_regs.h
index bc94e664c6173723a97ac06f19f6438a2e2c01b8..17d5971448770bad9e042b2160f46ffb7c7044b8 100644 (file)
@@ -15,6 +15,8 @@
 #ifndef CBE_REGS_H
 #define CBE_REGS_H
 
+#include <asm/cell-pmu.h>
+
 /*
  *
  * Some HID register definitions
  *
  */
 
-/* Macros for the pm_control register. */
-#define CBE_PM_16BIT_CTR(ctr)                  (1 << (24 - ((ctr) & (NR_PHYS_CTRS - 1))))
-#define CBE_PM_ENABLE_PERF_MON                 0x80000000
-#define CBE_PM_STOP_AT_MAX                     0x40000000
-#define CBE_PM_TRACE_MODE_GET(pm_control)      (((pm_control) >> 28) & 0x3)
-#define CBE_PM_TRACE_MODE_SET(mode)            (((mode)  & 0x3) << 28)
-#define CBE_PM_COUNT_MODE_SET(count)           (((count) & 0x3) << 18)
-#define CBE_PM_FREEZE_ALL_CTRS                 0x00100000
-#define CBE_PM_ENABLE_EXT_TRACE                        0x00008000
-
-/* Macros for the trace_address register. */
-#define CBE_PM_TRACE_BUF_FULL                  0x00000800
-#define CBE_PM_TRACE_BUF_EMPTY                 0x00000400
-#define CBE_PM_TRACE_BUF_DATA_COUNT(ta)                ((ta) & 0x3ff)
-#define CBE_PM_TRACE_BUF_MAX_COUNT             0x400
-
-/* Macros for the pm07_control registers. */
-#define CBE_PM_CTR_INPUT_MUX(pm07_control)     (((pm07_control) >> 26) & 0x3f)
-#define CBE_PM_CTR_INPUT_CONTROL               0x02000000
-#define CBE_PM_CTR_POLARITY                    0x01000000
-#define CBE_PM_CTR_COUNT_CYCLES                        0x00800000
-#define CBE_PM_CTR_ENABLE                      0x00400000
-
-/* Macros for the pm_status register. */
-#define CBE_PM_CTR_OVERFLOW_INTR(ctr)          (1 << (31 - ((ctr) & 7)))
-
 union spe_reg {
        u64 val;
        u8 spe[8];
@@ -160,9 +136,6 @@ extern struct cbe_pmd_regs __iomem *cbe_get_cpu_pmd_regs(int cpu);
  * counters currently have a value waiting to be written.
  */
 
-#define NR_PHYS_CTRS   4
-#define NR_CTRS                (NR_PHYS_CTRS * 2)
-
 struct cbe_pmd_shadow_regs {
        u32 group_control;
        u32 debug_bus_control;
@@ -212,6 +185,14 @@ struct cbe_iic_regs {
        struct  cbe_iic_thread_regs thread[2];                  /* 0x0400 */
 
        u64     iic_ir;                                         /* 0x0440 */
+#define CBE_IIC_IR_PRIO(x)      (((x) & 0xf) << 12)
+#define CBE_IIC_IR_DEST_NODE(x) (((x) & 0xf) << 4)
+#define CBE_IIC_IR_DEST_UNIT(x) ((x) & 0xf)
+#define CBE_IIC_IR_IOC_0        0x0
+#define CBE_IIC_IR_IOC_1S       0xb
+#define CBE_IIC_IR_PT_0         0xe
+#define CBE_IIC_IR_PT_1         0xf
+
        u64     iic_is;                                         /* 0x0448 */
 #define CBE_IIC_IS_PMI         0x2
 
@@ -274,6 +255,11 @@ struct cbe_mic_tm_regs {
 extern struct cbe_mic_tm_regs __iomem *cbe_get_mic_tm_regs(struct device_node *np);
 extern struct cbe_mic_tm_regs __iomem *cbe_get_cpu_mic_tm_regs(int cpu);
 
+/* some utility functions to deal with SMT */
+extern u32 cbe_get_hw_thread_id(int cpu);
+extern u32 cbe_cpu_to_node(int cpu);
+extern u32 cbe_node_to_cpu(int node);
+
 /* Init this module early */
 extern void cbe_regs_init(void);