aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/message/fusion/mptbase.c
diff options
context:
space:
mode:
authorEric Moore <eric.moore@lsil.com>2006-06-27 18:09:26 -0400
committerJames Bottomley <jejb@mulgrave.il.steeleye.com>2006-06-28 12:41:52 -0400
commit87cf89866790a373edcf88c12b64d6d38560acdd (patch)
tree8ba41c842efdbff03b8753241fa1dd6919a16a33 /drivers/message/fusion/mptbase.c
parent547f9a218436ea35baf9a52e981753e44d9cff1f (diff)
[SCSI] mptsas: Adding 1078 ROC support
* Adding 1078 ROC (Raid On Chip) Support - New host adapter * Moving all PCI Vendor/Device ids to using internal defines; a request from Christoph/James B. some time ago for when the next chip was added. * Removing SAS 1066/1066E Vendor/Device IDs, as there are no plans to manufacture that controller. Signed-off-by: Eric Moore <Eric.Moore@lsil.com> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers/message/fusion/mptbase.c')
-rw-r--r--drivers/message/fusion/mptbase.c60
1 files changed, 40 insertions, 20 deletions
diff --git a/drivers/message/fusion/mptbase.c b/drivers/message/fusion/mptbase.c
index 12dd8d493ee2..8ac77caf9337 100644
--- a/drivers/message/fusion/mptbase.c
+++ b/drivers/message/fusion/mptbase.c
@@ -1220,31 +1220,25 @@ mpt_attach(struct pci_dev *pdev, const struct pci_device_id *id)
1220 port = psize = 0; 1220 port = psize = 0;
1221 for (ii=0; ii < DEVICE_COUNT_RESOURCE; ii++) { 1221 for (ii=0; ii < DEVICE_COUNT_RESOURCE; ii++) {
1222 if (pci_resource_flags(pdev, ii) & PCI_BASE_ADDRESS_SPACE_IO) { 1222 if (pci_resource_flags(pdev, ii) & PCI_BASE_ADDRESS_SPACE_IO) {
1223 if (psize)
1224 continue;
1223 /* Get I/O space! */ 1225 /* Get I/O space! */
1224 port = pci_resource_start(pdev, ii); 1226 port = pci_resource_start(pdev, ii);
1225 psize = pci_resource_len(pdev,ii); 1227 psize = pci_resource_len(pdev,ii);
1226 } else { 1228 } else {
1229 if (msize)
1230 continue;
1227 /* Get memmap */ 1231 /* Get memmap */
1228 mem_phys = pci_resource_start(pdev, ii); 1232 mem_phys = pci_resource_start(pdev, ii);
1229 msize = pci_resource_len(pdev,ii); 1233 msize = pci_resource_len(pdev,ii);
1230 break;
1231 } 1234 }
1232 } 1235 }
1233 ioc->mem_size = msize; 1236 ioc->mem_size = msize;
1234 1237
1235 if (ii == DEVICE_COUNT_RESOURCE) {
1236 printk(KERN_ERR MYNAM ": ERROR - MPT adapter has no memory regions defined!\n");
1237 kfree(ioc);
1238 return -EINVAL;
1239 }
1240
1241 dinitprintk((KERN_INFO MYNAM ": MPT adapter @ %lx, msize=%dd bytes\n", mem_phys, msize));
1242 dinitprintk((KERN_INFO MYNAM ": (port i/o @ %lx, psize=%dd bytes)\n", port, psize));
1243
1244 mem = NULL; 1238 mem = NULL;
1245 /* Get logical ptr for PciMem0 space */ 1239 /* Get logical ptr for PciMem0 space */
1246 /*mem = ioremap(mem_phys, msize);*/ 1240 /*mem = ioremap(mem_phys, msize);*/
1247 mem = ioremap(mem_phys, 0x100); 1241 mem = ioremap(mem_phys, msize);
1248 if (mem == NULL) { 1242 if (mem == NULL) {
1249 printk(KERN_ERR MYNAM ": ERROR - Unable to map adapter memory!\n"); 1243 printk(KERN_ERR MYNAM ": ERROR - Unable to map adapter memory!\n");
1250 kfree(ioc); 1244 kfree(ioc);
@@ -1344,11 +1338,6 @@ mpt_attach(struct pci_dev *pdev, const struct pci_device_id *id)
1344 ioc->bus_type = SAS; 1338 ioc->bus_type = SAS;
1345 ioc->errata_flag_1064 = 1; 1339 ioc->errata_flag_1064 = 1;
1346 } 1340 }
1347 else if (pdev->device == MPI_MANUFACTPAGE_DEVID_SAS1066) {
1348 ioc->prod_name = "LSISAS1066";
1349 ioc->bus_type = SAS;
1350 ioc->errata_flag_1064 = 1;
1351 }
1352 else if (pdev->device == MPI_MANUFACTPAGE_DEVID_SAS1068) { 1341 else if (pdev->device == MPI_MANUFACTPAGE_DEVID_SAS1068) {
1353 ioc->prod_name = "LSISAS1068"; 1342 ioc->prod_name = "LSISAS1068";
1354 ioc->bus_type = SAS; 1343 ioc->bus_type = SAS;
@@ -1358,14 +1347,14 @@ mpt_attach(struct pci_dev *pdev, const struct pci_device_id *id)
1358 ioc->prod_name = "LSISAS1064E"; 1347 ioc->prod_name = "LSISAS1064E";
1359 ioc->bus_type = SAS; 1348 ioc->bus_type = SAS;
1360 } 1349 }
1361 else if (pdev->device == MPI_MANUFACTPAGE_DEVID_SAS1066E) {
1362 ioc->prod_name = "LSISAS1066E";
1363 ioc->bus_type = SAS;
1364 }
1365 else if (pdev->device == MPI_MANUFACTPAGE_DEVID_SAS1068E) { 1350 else if (pdev->device == MPI_MANUFACTPAGE_DEVID_SAS1068E) {
1366 ioc->prod_name = "LSISAS1068E"; 1351 ioc->prod_name = "LSISAS1068E";
1367 ioc->bus_type = SAS; 1352 ioc->bus_type = SAS;
1368 } 1353 }
1354 else if (pdev->device == MPI_MANUFACTPAGE_DEVID_SAS1078) {
1355 ioc->prod_name = "LSISAS1078";
1356 ioc->bus_type = SAS;
1357 }
1369 1358
1370 if (ioc->errata_flag_1064) 1359 if (ioc->errata_flag_1064)
1371 pci_disable_io_access(pdev); 1360 pci_disable_io_access(pdev);
@@ -3185,6 +3174,37 @@ mpt_diag_reset(MPT_ADAPTER *ioc, int ignore, int sleepFlag)
3185 u32 diag1val = 0; 3174 u32 diag1val = 0;
3186#endif 3175#endif
3187 3176
3177 if (ioc->pcidev->device == MPI_MANUFACTPAGE_DEVID_SAS1078) {
3178 drsprintk((MYIOC_s_WARN_FMT "%s: Doorbell=%p; 1078 reset "
3179 "address=%p\n", ioc->name, __FUNCTION__,
3180 &ioc->chip->Doorbell, &ioc->chip->Reset_1078));
3181 CHIPREG_WRITE32(&ioc->chip->Reset_1078, 0x07);
3182 if (sleepFlag == CAN_SLEEP)
3183 msleep(1);
3184 else
3185 mdelay(1);
3186
3187 for (count = 0; count < 60; count ++) {
3188 doorbell = CHIPREG_READ32(&ioc->chip->Doorbell);
3189 doorbell &= MPI_IOC_STATE_MASK;
3190
3191 drsprintk((MYIOC_s_INFO_FMT
3192 "looking for READY STATE: doorbell=%x"
3193 " count=%d\n",
3194 ioc->name, doorbell, count));
3195 if (doorbell == MPI_IOC_STATE_READY) {
3196 return 0;
3197 }
3198
3199 /* wait 1 sec */
3200 if (sleepFlag == CAN_SLEEP)
3201 msleep(1000);
3202 else
3203 mdelay(1000);
3204 }
3205 return -1;
3206 }
3207
3188 /* Clear any existing interrupts */ 3208 /* Clear any existing interrupts */
3189 CHIPREG_WRITE32(&ioc->chip->IntStatus, 0); 3209 CHIPREG_WRITE32(&ioc->chip->IntStatus, 0);
3190 3210