aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/isci/host.c
diff options
context:
space:
mode:
authorDan Williams <dan.j.williams@intel.com>2011-03-08 12:52:49 -0500
committerDan Williams <dan.j.williams@intel.com>2011-07-03 06:55:30 -0400
commitd044af17aacd03a1f4fced1af4b7570d205c8fd9 (patch)
tree1304fd0c7fa979fb229a4bf57771e9e6cde7b37d /drivers/scsi/isci/host.c
parent9affa289e2f9ef4721e85edbde86466524bfe957 (diff)
isci: Add support for probing OROM for OEM params
We need to scan the OROM for signature and grab the OEM parameters. We also need to do the same for EFI. If all fails then we resort to user binary blob, and if that fails then we go to the defaults. Share the format with the create_fw utility so that all possible sources of the parameters are in-sync. Signed-off-by: Dave Jiang <dave.jiang@intel.com> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'drivers/scsi/isci/host.c')
-rw-r--r--drivers/scsi/isci/host.c47
1 files changed, 20 insertions, 27 deletions
diff --git a/drivers/scsi/isci/host.c b/drivers/scsi/isci/host.c
index dc231c22ea93..bb5b54d361b0 100644
--- a/drivers/scsi/isci/host.c
+++ b/drivers/scsi/isci/host.c
@@ -61,6 +61,7 @@
61#include "port.h" 61#include "port.h"
62#include "request.h" 62#include "request.h"
63#include "host.h" 63#include "host.h"
64#include "probe_roms.h"
64 65
65irqreturn_t isci_msix_isr(int vec, void *data) 66irqreturn_t isci_msix_isr(int vec, void *data)
66{ 67{
@@ -419,6 +420,7 @@ int isci_host_init(struct isci_host *isci_host)
419 struct scic_sds_controller *controller; 420 struct scic_sds_controller *controller;
420 union scic_oem_parameters scic_oem_params; 421 union scic_oem_parameters scic_oem_params;
421 union scic_user_parameters scic_user_params; 422 union scic_user_parameters scic_user_params;
423 struct isci_pci_info *pci_info = to_pci_info(isci_host->pdev);
422 424
423 isci_timer_list_construct(isci_host); 425 isci_timer_list_construct(isci_host);
424 426
@@ -461,31 +463,32 @@ int isci_host_init(struct isci_host *isci_host)
461 sci_object_set_association(isci_host->core_controller, 463 sci_object_set_association(isci_host->core_controller,
462 (void *)isci_host); 464 (void *)isci_host);
463 465
464 /* grab initial values stored in the controller object for OEM and USER 466 /*
465 * parameters */ 467 * grab initial values stored in the controller object for OEM and USER
466 scic_oem_parameters_get(controller, &scic_oem_params); 468 * parameters
469 */
467 scic_user_parameters_get(controller, &scic_user_params); 470 scic_user_parameters_get(controller, &scic_user_params);
471 status = scic_user_parameters_set(isci_host->core_controller,
472 &scic_user_params);
473 if (status != SCI_SUCCESS) {
474 dev_warn(&isci_host->pdev->dev,
475 "%s: scic_user_parameters_set failed\n",
476 __func__);
477 return -ENODEV;
478 }
479
480 scic_oem_parameters_get(controller, &scic_oem_params);
468 481
469 if (isci_firmware) { 482 /* grab any OEM parameters specified in orom */
470 /* grab any OEM and USER parameters specified in binary blob */ 483 if (pci_info->orom) {
471 status = isci_parse_oem_parameters(&scic_oem_params, 484 status = isci_parse_oem_parameters(&scic_oem_params,
472 isci_host->id, 485 pci_info->orom,
473 isci_firmware); 486 isci_host->id);
474 if (status != SCI_SUCCESS) { 487 if (status != SCI_SUCCESS) {
475 dev_warn(&isci_host->pdev->dev, 488 dev_warn(&isci_host->pdev->dev,
476 "parsing firmware oem parameters failed\n"); 489 "parsing firmware oem parameters failed\n");
477 return -EINVAL; 490 return -EINVAL;
478 } 491 }
479
480 status = isci_parse_user_parameters(&scic_user_params,
481 isci_host->id,
482 isci_firmware);
483 if (status != SCI_SUCCESS) {
484 dev_warn(&isci_host->pdev->dev,
485 "%s: isci_parse_user_parameters"
486 " failed\n", __func__);
487 return -EINVAL;
488 }
489 } else { 492 } else {
490 status = scic_oem_parameters_set(isci_host->core_controller, 493 status = scic_oem_parameters_set(isci_host->core_controller,
491 &scic_oem_params); 494 &scic_oem_params);
@@ -495,16 +498,6 @@ int isci_host_init(struct isci_host *isci_host)
495 __func__); 498 __func__);
496 return -ENODEV; 499 return -ENODEV;
497 } 500 }
498
499
500 status = scic_user_parameters_set(isci_host->core_controller,
501 &scic_user_params);
502 if (status != SCI_SUCCESS) {
503 dev_warn(&isci_host->pdev->dev,
504 "%s: scic_user_parameters_set failed\n",
505 __func__);
506 return -ENODEV;
507 }
508 } 501 }
509 502
510 tasklet_init(&isci_host->completion_tasklet, 503 tasklet_init(&isci_host->completion_tasklet,