Skip to contentSkip to conversation

lpfc 8.3.24: Add request-firmware support

PATCH In review James Smart 1 participant 1 message May 24, 2011

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 4/8 lpfc 8.3.24: Add request-firmware support

Add request-firmware support:
- Add support for request_firmware interface for INTF2 SLI4 ports.
- Add ability to reset SLI4 INTF2 ports.

---

 lpfc_attr.c |   33 ++++++++++++-------
 lpfc_crtn.h |    1 
 lpfc_hw4.h  |   44 +++++++++++++++++++++++++
 lpfc_init.c |  102 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 lpfc_sli.c  |   90 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 5 files changed, 259 insertions(+), 11 deletions(-)
drivers/scsi/lpfc/lpfc_attr.c +22 -11
diff -upNr a/drivers/scsi/lpfc/lpfc_attr.c b/drivers/scsi/lpfc/lpfc_attr.c
@@ -755,18 +755,18 @@ lpfc_issue_reset(struct device *dev, str
 }
 
 /**
- * lpfc_sli4_fw_dump_request - Request firmware to perform a firmware dump
+ * lpfc_sli4_pdev_reg_request - Request physical dev to perform a register acc
  * @phba: lpfc_hba pointer.
  *
  * Description:
- * Request SLI4 interface type-2 device to perform a dump of firmware dump
- * object into it's /dbg directory of the flash file system.
+ * Request SLI4 interface type-2 device to perform a physical register set
+ * access.
  *
  * Returns:
  * zero for success
  **/
 static ssize_t
-lpfc_sli4_fw_dump_request(struct lpfc_hba *phba)
+lpfc_sli4_pdev_reg_request(struct lpfc_hba *phba, uint32_t opcode)
 {
 	struct completion online_compl;
 	uint32_t reg_val;
@@ -776,6 +776,11 @@ lpfc_sli4_fw_dump_request(struct lpfc_hb
 	if (!phba->cfg_enable_hba_reset)
 		return -EIO;
 
+	if ((phba->sli_rev < LPFC_SLI_REV4) ||
+	    (bf_get(lpfc_sli_intf_if_type, &phba->sli4_hba.sli_intf) !=
+	     LPFC_SLI_INTF_IF_TYPE_2))
+		return -EPERM;
+
 	status = lpfc_do_offline(phba, LPFC_EVT_OFFLINE);
 
 	if (status != 0)
@@ -786,7 +791,14 @@ lpfc_sli4_fw_dump_request(struct lpfc_hb
 
 	reg_val = readl(phba->sli4_hba.conf_regs_memmap_p +
 			LPFC_CTL_PDEV_CTL_OFFSET);
-	reg_val |= LPFC_FW_DUMP_REQUEST;
+
+	if (opcode == LPFC_FW_DUMP)
+		reg_val |= LPFC_FW_DUMP_REQUEST;
+	else if (opcode == LPFC_FW_RESET)
+		reg_val |= LPFC_CTL_PDEV_CTL_FRST;
+	else if (opcode == LPFC_DV_RESET)
+		reg_val |= LPFC_CTL_PDEV_CTL_DRST;
+
 	writel(reg_val, phba->sli4_hba.conf_regs_memmap_p +
 	       LPFC_CTL_PDEV_CTL_OFFSET);
 	/* flush */
@@ -904,12 +916,11 @@ lpfc_board_mode_store(struct device *dev
 		else
 			status = lpfc_do_offline(phba, LPFC_EVT_KILL);
 	else if (strncmp(buf, "dump", sizeof("dump") - 1) == 0)
-		if ((phba->sli_rev < LPFC_SLI_REV4) ||
-		    (bf_get(lpfc_sli_intf_if_type, &phba->sli4_hba.sli_intf) !=
-		     LPFC_SLI_INTF_IF_TYPE_2))
-			return -EPERM;
-		else
-			status = lpfc_sli4_fw_dump_request(phba);
+		status = lpfc_sli4_pdev_reg_request(phba, LPFC_FW_DUMP);
+	else if (strncmp(buf, "fw_reset", sizeof("fw_reset") - 1) == 0)
+		status = lpfc_sli4_pdev_reg_request(phba, LPFC_FW_RESET);
+	else if (strncmp(buf, "dv_reset", sizeof("dv_reset") - 1) == 0)
+		status = lpfc_sli4_pdev_reg_request(phba, LPFC_DV_RESET);
 	else
 		return -EINVAL;
 
drivers/scsi/lpfc/lpfc_crtn.h +1 -0
diff -upNr a/drivers/scsi/lpfc/lpfc_crtn.h b/drivers/scsi/lpfc/lpfc_crtn.h
@@ -430,5 +430,6 @@ void lpfc_cleanup_wt_rrqs(struct lpfc_hb
 void lpfc_cleanup_vports_rrqs(struct lpfc_vport *, struct lpfc_nodelist *);
 struct lpfc_node_rrq *lpfc_get_active_rrq(struct lpfc_vport *, uint16_t,
 	uint32_t);
+int lpfc_wr_object(struct lpfc_hba *, struct list_head *, uint32_t, uint32_t *);
 /* functions to support SR-IOV */
 int lpfc_sli_probe_sriov_nr_virtfn(struct lpfc_hba *, int);
drivers/scsi/lpfc/lpfc_hw4.h +44 -0

71 lines not on this page · raw message

drivers/scsi/lpfc/lpfc_init.c +102 -0

126 lines not on this page · raw message

drivers/scsi/lpfc/lpfc_sli.c +90 -0

96 lines not on this page · raw message