]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/infiniband/hw/ipath/ipath_pe800.c
Merge branch 'genirq' of master.kernel.org:/home/rmk/linux-2.6-arm
[linux-2.6-omap-h63xx.git] / drivers / infiniband / hw / ipath / ipath_pe800.c
index e693a7a8266703996f99e5fe58f5e30fe1a244b3..b83f66d8262cfb0830ea61e424ec68822123ce89 100644 (file)
@@ -1,4 +1,5 @@
 /*
+ * Copyright (c) 2006 QLogic, Inc. All rights reserved.
  * Copyright (c) 2003, 2004, 2005, 2006 PathScale, Inc. All rights reserved.
  *
  * This software is available to you under a choice of one of two
@@ -44,7 +45,7 @@
 
 /*
  * This file contains all the chip-specific register information and
- * access functions for the PathScale PE800, the PCI-Express chip.
+ * access functions for the QLogic InfiniPath PE800, the PCI-Express chip.
  *
  * This lists the InfiniPath PE800 registers, in the actual chip layout.
  * This structure should never be directly accessed.
@@ -305,8 +306,8 @@ static const struct ipath_cregs ipath_pe_cregs = {
  * we'll print them and continue.  We reuse the same message buffer as
  * ipath_handle_errors() to avoid excessive stack usage.
  */
-void ipath_pe_handle_hwerrors(struct ipath_devdata *dd, char *msg,
-       size_t msgl)
+static void ipath_pe_handle_hwerrors(struct ipath_devdata *dd, char *msg,
+                                    size_t msgl)
 {
        ipath_err_t hwerrs;
        u32 bits, ctrl;
@@ -532,7 +533,7 @@ static int ipath_pe_boardname(struct ipath_devdata *dd, char *name,
        if (n)
                snprintf(name, namelen, "%s", n);
 
-       if (dd->ipath_majrev != 4 || dd->ipath_minrev != 1) {
+       if (dd->ipath_majrev != 4 || !dd->ipath_minrev || dd->ipath_minrev>2) {
                ipath_dev_err(dd, "Unsupported PE-800 revision %u.%u!\n",
                              dd->ipath_majrev, dd->ipath_minrev);
                ret = 1;
@@ -552,7 +553,7 @@ static int ipath_pe_boardname(struct ipath_devdata *dd, char *name,
  * freeze mode), and enable hardware errors as errors (along with
  * everything else) in errormask
  */
-void ipath_pe_init_hwerrors(struct ipath_devdata *dd)
+static void ipath_pe_init_hwerrors(struct ipath_devdata *dd)
 {
        ipath_err_t val;
        u64 extsval;
@@ -577,7 +578,7 @@ void ipath_pe_init_hwerrors(struct ipath_devdata *dd)
  * ipath_pe_bringup_serdes - bring up the serdes
  * @dd: the infinipath device
  */
-int ipath_pe_bringup_serdes(struct ipath_devdata *dd)
+static int ipath_pe_bringup_serdes(struct ipath_devdata *dd)
 {
        u64 val, tmp, config1;
        int ret = 0, change = 0;
@@ -694,7 +695,7 @@ int ipath_pe_bringup_serdes(struct ipath_devdata *dd)
  * @dd: the infinipath device
  * Called when driver is being unloaded
  */
-void ipath_pe_quiet_serdes(struct ipath_devdata *dd)
+static void ipath_pe_quiet_serdes(struct ipath_devdata *dd)
 {
        u64 val = ipath_read_kreg64(dd, dd->ipath_kregs->kr_serdesconfig0);
 
@@ -972,6 +973,8 @@ static int ipath_setup_pe_reset(struct ipath_devdata *dd)
        /* Use ERROR so it shows up in logs, etc. */
        ipath_dev_err(dd, "Resetting PE-800 unit %u\n",
                      dd->ipath_unit);
+       /* keep chip from being accessed in a few places */
+       dd->ipath_flags &= ~(IPATH_INITTED|IPATH_PRESENT);
        val = dd->ipath_control | INFINIPATH_C_RESET;
        ipath_write_kreg(dd, dd->ipath_kregs->kr_control, val);
        mb();
@@ -997,6 +1000,8 @@ static int ipath_setup_pe_reset(struct ipath_devdata *dd)
                if ((r = pci_enable_device(dd->pcidev)))
                        ipath_dev_err(dd, "pci_enable_device failed after "
                                      "reset: %d\n", r);
+               /* whether it worked or not, mark as present, again */
+               dd->ipath_flags |= IPATH_PRESENT;
                val = ipath_read_kreg64(dd, dd->ipath_kregs->kr_revision);
                if (val == dd->ipath_revision) {
                        ipath_cdbg(VERBOSE, "Got matching revision "
@@ -1176,6 +1181,8 @@ static int ipath_pe_early_init(struct ipath_devdata *dd)
         */
        dd->ipath_rhdrhead_intr_off = 1ULL<<32;
 
+       ipath_get_eeprom_info(dd);
+
        return 0;
 }