]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - include/asm-powerpc/pmac_feature.h
on_each_cpu(): kill unused 'retry' parameter
[linux-2.6-omap-h63xx.git] / include / asm-powerpc / pmac_feature.h
index e9683bcff19bcec68c3b5ab16d9ee50f18299bd4..877c35a4356ed954317e1aa0546b07980f57a434 100644 (file)
@@ -28,8 +28,8 @@
  */
 
 #ifdef __KERNEL__
-#ifndef __PPC_ASM_PMAC_FEATURE_H
-#define __PPC_ASM_PMAC_FEATURE_H
+#ifndef __ASM_POWERPC_PMAC_FEATURE_H
+#define __ASM_POWERPC_PMAC_FEATURE_H
 
 #include <asm/macio.h>
 #include <asm/machdep.h>
 #define PMAC_TYPE_IMAC_G5              0x152   /* iMac G5 */
 #define PMAC_TYPE_XSERVE_G5            0x153   /* Xserve G5 */
 #define PMAC_TYPE_UNKNOWN_K2           0x19f   /* Any other K2 based */
+#define PMAC_TYPE_UNKNOWN_SHASTA               0x19e   /* Any other Shasta based */
 
 /*
  * Motherboard flags
@@ -145,7 +146,7 @@ struct device_node;
 static inline long pmac_call_feature(int selector, struct device_node* node,
                                        long param, long value)
 {
-       if (!ppc_md.feature_call)
+       if (!ppc_md.feature_call || !machine_is(powermac))
                return -ENODEV;
        return ppc_md.feature_call(selector, node, param, value);
 }
@@ -304,7 +305,7 @@ extern void pmac_feature_init(void);
 extern void pmac_set_early_video_resume(void (*proc)(void *data), void *data);
 extern void pmac_call_early_video_resume(void);
 
-#define PMAC_FTR_DEF(x) ((_MACH_Pmac << 16) | (x))
+#define PMAC_FTR_DEF(x) ((0x6660000) | (x))
 
 /* The AGP driver registers itself here */
 extern void pmac_register_agp_pm(struct pci_dev *bridge,
@@ -317,10 +318,6 @@ extern void pmac_register_agp_pm(struct pci_dev *bridge,
 extern void pmac_suspend_agp_for_card(struct pci_dev *dev);
 extern void pmac_resume_agp_for_card(struct pci_dev *dev);
 
-/* Used by the via-pmu driver for suspend/resume
- */
-extern void pmac_tweak_clock_spreading(int enable);
-
 /*
  * The part below is for use by macio_asic.c only, do not rely
  * on the data structures or constants below in a normal driver
@@ -341,6 +338,7 @@ enum {
        macio_pangea,
        macio_intrepid,
        macio_keylargo2,
+       macio_shasta,
 };
 
 struct macio_chip
@@ -376,5 +374,32 @@ extern struct macio_chip* macio_find(struct device_node* child, int type);
 #define MACIO_IN8(r)           (in_8(MACIO_FCR8(macio,r)))
 #define MACIO_OUT8(r,v)                (out_8(MACIO_FCR8(macio,r), (v)))
 
-#endif /* __PPC_ASM_PMAC_FEATURE_H */
+/*
+ * Those are exported by pmac feature for internal use by arch code
+ * only like the platform function callbacks, do not use directly in drivers
+ */
+extern spinlock_t feature_lock;
+extern struct device_node *uninorth_node;
+extern u32 __iomem *uninorth_base;
+
+/*
+ * Uninorth reg. access. Note that Uni-N regs are big endian
+ */
+
+#define UN_REG(r)      (uninorth_base + ((r) >> 2))
+#define UN_IN(r)       (in_be32(UN_REG(r)))
+#define UN_OUT(r,v)    (out_be32(UN_REG(r), (v)))
+#define UN_BIS(r,v)    (UN_OUT((r), UN_IN(r) | (v)))
+#define UN_BIC(r,v)    (UN_OUT((r), UN_IN(r) & ~(v)))
+
+/* Uninorth variant:
+ *
+ * 0 = not uninorth
+ * 1 = U1.x or U2.x
+ * 3 = U3
+ * 4 = U4
+ */
+extern int pmac_get_uninorth_variant(void);
+
+#endif /* __ASM_POWERPC_PMAC_FEATURE_H */
 #endif /* __KERNEL__ */