aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/lpfc/lpfc_mbox.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi/lpfc/lpfc_mbox.c')
-rw-r--r--drivers/scsi/lpfc/lpfc_mbox.c51
1 files changed, 32 insertions, 19 deletions
diff --git a/drivers/scsi/lpfc/lpfc_mbox.c b/drivers/scsi/lpfc/lpfc_mbox.c
index 72e6adb0643e..a6b7f5a0210b 100644
--- a/drivers/scsi/lpfc/lpfc_mbox.c
+++ b/drivers/scsi/lpfc/lpfc_mbox.c
@@ -1216,7 +1216,7 @@ lpfc_config_port(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmb)
1216 phba->pcb->feature = FEATURE_INITIAL_SLI2; 1216 phba->pcb->feature = FEATURE_INITIAL_SLI2;
1217 1217
1218 /* Setup Mailbox pointers */ 1218 /* Setup Mailbox pointers */
1219 phba->pcb->mailBoxSize = sizeof(MAILBOX_t); 1219 phba->pcb->mailBoxSize = sizeof(MAILBOX_t) + MAILBOX_EXT_SIZE;
1220 offset = (uint8_t *)phba->mbox - (uint8_t *)phba->slim2p.virt; 1220 offset = (uint8_t *)phba->mbox - (uint8_t *)phba->slim2p.virt;
1221 pdma_addr = phba->slim2p.phys + offset; 1221 pdma_addr = phba->slim2p.phys + offset;
1222 phba->pcb->mbAddrHigh = putPaddrHigh(pdma_addr); 1222 phba->pcb->mbAddrHigh = putPaddrHigh(pdma_addr);
@@ -1272,28 +1272,41 @@ lpfc_config_port(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmb)
1272 * 1272 *
1273 */ 1273 */
1274 1274
1275 if (phba->sli_rev == 3) { 1275 if (phba->cfg_hostmem_hgp && phba->sli_rev != 3) {
1276 phba->host_gp = &mb_slim->us.s3.host[0]; 1276 phba->host_gp = &phba->mbox->us.s2.host[0];
1277 phba->hbq_put = &mb_slim->us.s3.hbq_put[0];
1278 } else {
1279 phba->host_gp = &mb_slim->us.s2.host[0];
1280 phba->hbq_put = NULL; 1277 phba->hbq_put = NULL;
1281 } 1278 offset = (uint8_t *)&phba->mbox->us.s2.host -
1279 (uint8_t *)phba->slim2p.virt;
1280 pdma_addr = phba->slim2p.phys + offset;
1281 phba->pcb->hgpAddrHigh = putPaddrHigh(pdma_addr);
1282 phba->pcb->hgpAddrLow = putPaddrLow(pdma_addr);
1283 } else {
1284 /* Always Host Group Pointer is in SLIM */
1285 mb->un.varCfgPort.hps = 1;
1282 1286
1283 /* mask off BAR0's flag bits 0 - 3 */ 1287 if (phba->sli_rev == 3) {
1284 phba->pcb->hgpAddrLow = (bar_low & PCI_BASE_ADDRESS_MEM_MASK) + 1288 phba->host_gp = &mb_slim->us.s3.host[0];
1285 (void __iomem *)phba->host_gp - 1289 phba->hbq_put = &mb_slim->us.s3.hbq_put[0];
1286 (void __iomem *)phba->MBslimaddr; 1290 } else {
1287 if (bar_low & PCI_BASE_ADDRESS_MEM_TYPE_64) 1291 phba->host_gp = &mb_slim->us.s2.host[0];
1288 phba->pcb->hgpAddrHigh = bar_high; 1292 phba->hbq_put = NULL;
1289 else 1293 }
1290 phba->pcb->hgpAddrHigh = 0;
1291 /* write HGP data to SLIM at the required longword offset */
1292 memset(&hgp, 0, sizeof(struct lpfc_hgp));
1293 1294
1294 for (i=0; i < phba->sli.num_rings; i++) { 1295 /* mask off BAR0's flag bits 0 - 3 */
1295 lpfc_memcpy_to_slim(phba->host_gp + i, &hgp, 1296 phba->pcb->hgpAddrLow = (bar_low & PCI_BASE_ADDRESS_MEM_MASK) +
1297 (void __iomem *)phba->host_gp -
1298 (void __iomem *)phba->MBslimaddr;
1299 if (bar_low & PCI_BASE_ADDRESS_MEM_TYPE_64)
1300 phba->pcb->hgpAddrHigh = bar_high;
1301 else
1302 phba->pcb->hgpAddrHigh = 0;
1303 /* write HGP data to SLIM at the required longword offset */
1304 memset(&hgp, 0, sizeof(struct lpfc_hgp));
1305
1306 for (i = 0; i < phba->sli.num_rings; i++) {
1307 lpfc_memcpy_to_slim(phba->host_gp + i, &hgp,
1296 sizeof(*phba->host_gp)); 1308 sizeof(*phba->host_gp));
1309 }
1297 } 1310 }
1298 1311
1299 /* Setup Port Group offset */ 1312 /* Setup Port Group offset */