[PATCH] ppc64: introduce FW_FEATURE_ISERIES
authorStephen Rothwell <sfr@canb.auug.org.au>
Wed, 3 Aug 2005 04:43:21 +0000 (14:43 +1000)
committerPaul Mackerras <paulus@samba.org>
Mon, 29 Aug 2005 00:53:35 +0000 (10:53 +1000)
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Paul Mackerras <paulus@samba.org>
arch/ppc64/kernel/iSeries_setup.c
arch/ppc64/kernel/pSeries_lpar.c
arch/ppc64/kernel/pSeries_setup.c
include/asm-ppc64/firmware.h

index a649edbb23b6605aabe1a981fde2d36649229696..460e7df681a1bebf015c41a064e6494e23244f91 100644 (file)
@@ -39,6 +39,7 @@
 #include <asm/cputable.h>
 #include <asm/sections.h>
 #include <asm/iommu.h>
+#include <asm/firmware.h>
 
 #include <asm/time.h>
 #include "iSeries_setup.h"
@@ -314,6 +315,8 @@ static void __init iSeries_init_early(void)
 
        DBG(" -> iSeries_init_early()\n");
 
+       ppc64_firmware_features = FW_FEATURE_ISERIES;
+
        ppcdbg_initialize();
 
 #if defined(CONFIG_BLK_DEV_INITRD)
index 74dd144dcce8dd18a06d2f84023c4f93e988a6f0..56845543c891b29ba3a178ca6649122e7c9578f2 100644 (file)
@@ -52,7 +52,6 @@ EXPORT_SYMBOL(plpar_hcall_4out);
 EXPORT_SYMBOL(plpar_hcall_norets);
 EXPORT_SYMBOL(plpar_hcall_8arg_2ret);
 
-extern void fw_feature_init(void);
 extern void pSeries_find_serial_port(void);
 
 
index 7ae7a2ca108504335cc6554c9410caa02ab690ba..54e0651ba3fde3f557754dd1f73ecb62005ab846 100644 (file)
@@ -262,7 +262,7 @@ arch_initcall(pSeries_init_panel);
  * using contents of device-tree/ibm,hypertas-functions.
  * Ultimately this functionality may be moved into prom.c prom_init().
  */
-void __init fw_feature_init(void)
+static void __init fw_feature_init(void)
 {
        struct device_node * dn;
        char * hypertas;
index e3725f3c8ea6b6595c6a8486838b256fdf52b95c..22bb85cf60af189a28ed9e3e2d1c6630a04de45f 100644 (file)
 #define FW_FEATURE_XDABR       (1UL<<18)
 #define FW_FEATURE_MULTITCE    (1UL<<19)
 #define FW_FEATURE_SPLPAR      (1UL<<20)
+#define FW_FEATURE_ISERIES     (1UL<<21)
 
 enum {
-       FW_FEATURE_PSERIES = FW_FEATURE_PFT | FW_FEATURE_TCE |
+       FW_FEATURE_PSERIES_POSSIBLE = FW_FEATURE_PFT | FW_FEATURE_TCE |
                FW_FEATURE_SPRG0 | FW_FEATURE_DABR | FW_FEATURE_COPY |
                FW_FEATURE_ASR | FW_FEATURE_DEBUG | FW_FEATURE_TERM |
                FW_FEATURE_PERF | FW_FEATURE_DUMP | FW_FEATURE_INTERRUPT |
@@ -54,11 +55,25 @@ enum {
                FW_FEATURE_VIO | FW_FEATURE_RDMA | FW_FEATURE_LLAN |
                FW_FEATURE_BULK | FW_FEATURE_XDABR | FW_FEATURE_MULTITCE |
                FW_FEATURE_SPLPAR,
+       FW_FEATURE_PSERIES_ALWAYS = 0,
+       FW_FEATURE_ISERIES_POSSIBLE = FW_FEATURE_ISERIES,
+       FW_FEATURE_ISERIES_ALWAYS = FW_FEATURE_ISERIES,
        FW_FEATURE_POSSIBLE =
 #ifdef CONFIG_PPC_PSERIES
-               FW_FEATURE_PSERIES |
+               FW_FEATURE_PSERIES_POSSIBLE |
+#endif
+#ifdef CONFIG_PPC_ISERIES
+               FW_FEATURE_ISERIES_POSSIBLE |
 #endif
                0,
+       FW_FEATURE_ALWAYS =
+#ifdef CONFIG_PPC_PSERIES
+               FW_FEATURE_PSERIES_ALWAYS &
+#endif
+#ifdef CONFIG_PPC_ISERIES
+               FW_FEATURE_ISERIES_ALWAYS &
+#endif
+               FW_FEATURE_POSSIBLE,
 };
 
 /* This is used to identify firmware features which are available
@@ -68,7 +83,8 @@ extern unsigned long  ppc64_firmware_features;
 
 static inline unsigned long firmware_has_feature(unsigned long feature)
 {
-       return ppc64_firmware_features & feature & FW_FEATURE_POSSIBLE;
+       return (FW_FEATURE_ALWAYS & feature) ||
+               (FW_FEATURE_POSSIBLE & ppc64_firmware_features & feature);
 }
 
 #ifdef CONFIG_PPC_PSERIES