]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - include/asm-powerpc/reg.h
Merge master.kernel.org:/pub/scm/linux/kernel/git/sam/kbuild
[linux-2.6-omap-h63xx.git] / include / asm-powerpc / reg.h
index a9a76857f5aa04e5188b3369b8ee9be0c78172d7..72bfe3af0460fa65f1f1c232ac3e56fcd86bd236 100644 (file)
 #define SPRN_CTR       0x009   /* Count Register */
 #define SPRN_CTRLF     0x088
 #define SPRN_CTRLT     0x098
+#define   CTRL_CT      0xc0000000      /* current thread */
+#define   CTRL_CT0     0x80000000      /* thread 0 */
+#define   CTRL_CT1     0x40000000      /* thread 1 */
+#define   CTRL_TE      0x00c00000      /* thread enable */
 #define   CTRL_RUNLATCH        0x1
 #define SPRN_DABR      0x3F5   /* Data Address Breakpoint Register */
 #define   DABR_TRANSLATION     (1UL << 2)
 #define        SPRN_HID6       0x3F9   /* BE HID 6 */
 #define          HID6_LB       (0x0F<<12) /* Concurrent Large Page Modes */
 #define          HID6_DLP      (1<<20) /* Disable all large page modes (4K only) */
-#define        SPRN_TSCR       0x399   /* Thread switch control on BE */
-#define        SPRN_TTR        0x39A   /* Thread switch timeout on BE */
-#define          TSCR_DEC_ENABLE       0x200000 /* Decrementer Interrupt */
-#define          TSCR_EE_ENABLE        0x100000 /* External Interrupt */
-#define          TSCR_EE_BOOST         0x080000 /* External Interrupt Boost */
+#define        SPRN_TSC_CELL   0x399   /* Thread switch control on Cell */
+#define          TSC_CELL_DEC_ENABLE_0 0x400000 /* Decrementer Interrupt */
+#define          TSC_CELL_DEC_ENABLE_1 0x200000 /* Decrementer Interrupt */
+#define          TSC_CELL_EE_ENABLE    0x100000 /* External Interrupt */
+#define          TSC_CELL_EE_BOOST     0x080000 /* External Interrupt Boost */
 #define        SPRN_TSC        0x3FD   /* Thread switch control on others */
 #define        SPRN_TST        0x3FC   /* Thread switch timeout on others */
 #if !defined(SPRN_IAC1) && !defined(SPRN_IAC2)
 #define SPRN_SPRG7     0x117   /* Special Purpose Register General 7 */
 #define SPRN_SRR0      0x01A   /* Save/Restore Register 0 */
 #define SPRN_SRR1      0x01B   /* Save/Restore Register 1 */
+#define   SRR1_WAKEMASK                0x00380000 /* reason for wakeup */
+#define   SRR1_WAKERESET       0x00380000 /* System reset */
+#define   SRR1_WAKESYSERR      0x00300000 /* System error */
+#define   SRR1_WAKEEE          0x00200000 /* External interrupt */
+#define   SRR1_WAKEMT          0x00280000 /* mtctrl */
+#define   SRR1_WAKEDEC         0x00180000 /* Decrementer interrupt */
+#define   SRR1_WAKETHERM       0x00100000 /* Thermal management interrupt */
+
 #ifndef SPRN_SVR
 #define SPRN_SVR       0x11E   /* System Version Register */
 #endif
 #define proc_trap()    asm volatile("trap")
 
 #ifdef CONFIG_PPC64
-static inline void ppc64_runlatch_on(void)
-{
-       unsigned long ctrl;
-
-       if (cpu_has_feature(CPU_FTR_CTRL)) {
-               ctrl = mfspr(SPRN_CTRLF);
-               ctrl |= CTRL_RUNLATCH;
-               mtspr(SPRN_CTRLT, ctrl);
-       }
-}
-
-static inline void ppc64_runlatch_off(void)
-{
-       unsigned long ctrl;
-
-       if (cpu_has_feature(CPU_FTR_CTRL)) {
-               ctrl = mfspr(SPRN_CTRLF);
-               ctrl &= ~CTRL_RUNLATCH;
-               mtspr(SPRN_CTRLT, ctrl);
-       }
-}
+
+extern void ppc64_runlatch_on(void);
+extern void ppc64_runlatch_off(void);
 
 extern unsigned long scom970_read(unsigned int address);
 extern void scom970_write(unsigned int address, unsigned long value);
@@ -633,15 +627,6 @@ extern void scom970_write(unsigned int address, unsigned long value);
 #define __get_SP()     ({unsigned long sp; \
                        asm volatile("mr %0,1": "=r" (sp)); sp;})
 
-#else /* __ASSEMBLY__ */
-
-#define RUNLATCH_ON(REG)                       \
-BEGIN_FTR_SECTION                              \
-       mfspr   (REG),SPRN_CTRLF;               \
-       ori     (REG),(REG),CTRL_RUNLATCH;      \
-       mtspr   SPRN_CTRLT,(REG);               \
-END_FTR_SECTION_IFSET(CPU_FTR_CTRL)
-
 #endif /* __ASSEMBLY__ */
 #endif /* __KERNEL__ */
 #endif /* _ASM_POWERPC_REG_H */