diff options
author | Christoph Hellwig <hch@infradead.org> | 2011-03-27 20:07:54 -0400 |
---|---|---|
committer | Dan Williams <dan.j.williams@intel.com> | 2011-07-03 07:00:36 -0400 |
commit | bc99aa47108e9fd759071d4741c7abdf7b903579 (patch) | |
tree | 4d0c7dc1dd2755e7ae8d0f6882734ca98c7eea37 | |
parent | 4393aa4e6b9517a666f0ef6b774fd421a9dc4c68 (diff) |
isci: remove mmio wrappers
Remove a couple of layers around read/writel to make the driver readable.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
-rw-r--r-- | drivers/scsi/isci/core/scic_sds_controller.c | 225 | ||||
-rw-r--r-- | drivers/scsi/isci/core/scic_sds_controller.h | 34 | ||||
-rw-r--r-- | drivers/scsi/isci/core/scic_sds_controller_registers.h | 463 | ||||
-rw-r--r-- | drivers/scsi/isci/core/scic_sds_pci.h | 94 | ||||
-rw-r--r-- | drivers/scsi/isci/core/scic_sds_phy.c | 146 | ||||
-rw-r--r-- | drivers/scsi/isci/core/scic_sds_phy_registers.h | 248 | ||||
-rw-r--r-- | drivers/scsi/isci/core/scic_sds_port.c | 95 | ||||
-rw-r--r-- | drivers/scsi/isci/core/scic_sds_port.h | 23 | ||||
-rw-r--r-- | drivers/scsi/isci/core/scic_sds_port_registers.h | 81 | ||||
-rw-r--r-- | drivers/scsi/isci/core/scic_sds_request.c | 11 | ||||
-rw-r--r-- | drivers/scsi/isci/core/scic_sds_unsolicited_frame_control.c | 5 |
11 files changed, 258 insertions, 1167 deletions
diff --git a/drivers/scsi/isci/core/scic_sds_controller.c b/drivers/scsi/isci/core/scic_sds_controller.c index 9266fbee79e7..774c4b3b0dfb 100644 --- a/drivers/scsi/isci/core/scic_sds_controller.c +++ b/drivers/scsi/isci/core/scic_sds_controller.c | |||
@@ -59,8 +59,7 @@ | |||
59 | #include "scic_port.h" | 59 | #include "scic_port.h" |
60 | #include "scic_remote_device.h" | 60 | #include "scic_remote_device.h" |
61 | #include "scic_sds_controller.h" | 61 | #include "scic_sds_controller.h" |
62 | #include "scic_sds_controller_registers.h" | 62 | #include "scu_registers.h" |
63 | #include "scic_sds_pci.h" | ||
64 | #include "scic_sds_phy.h" | 63 | #include "scic_sds_phy.h" |
65 | #include "scic_sds_port_configuration_agent.h" | 64 | #include "scic_sds_port_configuration_agent.h" |
66 | #include "scic_sds_port.h" | 65 | #include "scic_sds_port.h" |
@@ -355,7 +354,10 @@ static void scic_sds_controller_ram_initialization( | |||
355 | * Therefore it no longer comes out of memory in the MDL. */ | 354 | * Therefore it no longer comes out of memory in the MDL. */ |
356 | mde = &this_controller->memory_descriptors[SCU_MDE_COMPLETION_QUEUE]; | 355 | mde = &this_controller->memory_descriptors[SCU_MDE_COMPLETION_QUEUE]; |
357 | this_controller->completion_queue = (u32 *)mde->virtual_address; | 356 | this_controller->completion_queue = (u32 *)mde->virtual_address; |
358 | SMU_CQBAR_WRITE(this_controller, mde->physical_address); | 357 | writel(lower_32_bits(mde->physical_address), \ |
358 | &this_controller->smu_registers->completion_queue_lower); | ||
359 | writel(upper_32_bits(mde->physical_address), | ||
360 | &this_controller->smu_registers->completion_queue_upper); | ||
359 | 361 | ||
360 | /* | 362 | /* |
361 | * Program the location of the Remote Node Context table | 363 | * Program the location of the Remote Node Context table |
@@ -363,13 +365,19 @@ static void scic_sds_controller_ram_initialization( | |||
363 | mde = &this_controller->memory_descriptors[SCU_MDE_REMOTE_NODE_CONTEXT]; | 365 | mde = &this_controller->memory_descriptors[SCU_MDE_REMOTE_NODE_CONTEXT]; |
364 | this_controller->remote_node_context_table = (union scu_remote_node_context *) | 366 | this_controller->remote_node_context_table = (union scu_remote_node_context *) |
365 | mde->virtual_address; | 367 | mde->virtual_address; |
366 | SMU_RNCBAR_WRITE(this_controller, mde->physical_address); | 368 | writel(lower_32_bits(mde->physical_address), |
369 | &this_controller->smu_registers->remote_node_context_lower); | ||
370 | writel(upper_32_bits(mde->physical_address), | ||
371 | &this_controller->smu_registers->remote_node_context_upper); | ||
367 | 372 | ||
368 | /* Program the location of the Task Context table into the SCU. */ | 373 | /* Program the location of the Task Context table into the SCU. */ |
369 | mde = &this_controller->memory_descriptors[SCU_MDE_TASK_CONTEXT]; | 374 | mde = &this_controller->memory_descriptors[SCU_MDE_TASK_CONTEXT]; |
370 | this_controller->task_context_table = (struct scu_task_context *) | 375 | this_controller->task_context_table = (struct scu_task_context *) |
371 | mde->virtual_address; | 376 | mde->virtual_address; |
372 | SMU_HTTBAR_WRITE(this_controller, mde->physical_address); | 377 | writel(lower_32_bits(mde->physical_address), |
378 | &this_controller->smu_registers->host_task_table_lower); | ||
379 | writel(upper_32_bits(mde->physical_address), | ||
380 | &this_controller->smu_registers->host_task_table_upper); | ||
373 | 381 | ||
374 | mde = &this_controller->memory_descriptors[SCU_MDE_UF_BUFFER]; | 382 | mde = &this_controller->memory_descriptors[SCU_MDE_UF_BUFFER]; |
375 | scic_sds_unsolicited_frame_control_construct( | 383 | scic_sds_unsolicited_frame_control_construct( |
@@ -378,13 +386,17 @@ static void scic_sds_controller_ram_initialization( | |||
378 | 386 | ||
379 | /* | 387 | /* |
380 | * Inform the silicon as to the location of the UF headers and | 388 | * Inform the silicon as to the location of the UF headers and |
381 | * address table. */ | 389 | * address table. |
382 | SCU_UFHBAR_WRITE( | 390 | */ |
383 | this_controller, | 391 | writel(lower_32_bits(this_controller->uf_control.headers.physical_address), |
384 | this_controller->uf_control.headers.physical_address); | 392 | &this_controller->scu_registers->sdma.uf_header_base_address_lower); |
385 | SCU_PUFATHAR_WRITE( | 393 | writel(upper_32_bits(this_controller->uf_control.headers.physical_address), |
386 | this_controller, | 394 | &this_controller->scu_registers->sdma.uf_header_base_address_upper); |
387 | this_controller->uf_control.address_table.physical_address); | 395 | |
396 | writel(lower_32_bits(this_controller->uf_control.address_table.physical_address), | ||
397 | &this_controller->scu_registers->sdma.uf_address_table_lower); | ||
398 | writel(upper_32_bits(this_controller->uf_control.address_table.physical_address), | ||
399 | &this_controller->scu_registers->sdma.uf_address_table_upper); | ||
388 | } | 400 | } |
389 | 401 | ||
390 | /** | 402 | /** |
@@ -392,25 +404,26 @@ static void scic_sds_controller_ram_initialization( | |||
392 | * @this_controller: | 404 | * @this_controller: |
393 | * | 405 | * |
394 | */ | 406 | */ |
395 | static void scic_sds_controller_assign_task_entries( | 407 | static void |
396 | struct scic_sds_controller *this_controller) | 408 | scic_sds_controller_assign_task_entries(struct scic_sds_controller *controller) |
397 | { | 409 | { |
398 | u32 task_assignment; | 410 | u32 task_assignment; |
399 | 411 | ||
400 | /* | 412 | /* |
401 | * Assign all the TCs to function 0 | 413 | * Assign all the TCs to function 0 |
402 | * TODO: Do we actually need to read this register to write it back? */ | 414 | * TODO: Do we actually need to read this register to write it back? |
403 | task_assignment = SMU_TCA_READ(this_controller, 0); | 415 | */ |
404 | 416 | ||
405 | task_assignment = | 417 | task_assignment = |
406 | ( | 418 | readl(&controller->smu_registers->task_context_assignment[0]); |
407 | task_assignment | 419 | |
408 | | (SMU_TCA_GEN_VAL(STARTING, 0)) | 420 | task_assignment |= (SMU_TCA_GEN_VAL(STARTING, 0)) | |
409 | | (SMU_TCA_GEN_VAL(ENDING, this_controller->task_context_entries - 1)) | 421 | (SMU_TCA_GEN_VAL(ENDING, controller->task_context_entries - 1)) | |
410 | | (SMU_TCA_GEN_BIT(RANGE_CHECK_ENABLE)) | 422 | (SMU_TCA_GEN_BIT(RANGE_CHECK_ENABLE)); |
411 | ); | 423 | |
424 | writel(task_assignment, | ||
425 | &controller->smu_registers->task_context_assignment[0]); | ||
412 | 426 | ||
413 | SMU_TCA_WRITE(this_controller, 0, task_assignment); | ||
414 | } | 427 | } |
415 | 428 | ||
416 | /** | 429 | /** |
@@ -433,7 +446,9 @@ static void scic_sds_controller_initialize_completion_queue( | |||
433 | | SMU_CQC_EVENT_LIMIT_SET(this_controller->completion_event_entries - 1) | 446 | | SMU_CQC_EVENT_LIMIT_SET(this_controller->completion_event_entries - 1) |
434 | ); | 447 | ); |
435 | 448 | ||
436 | SMU_CQC_WRITE(this_controller, completion_queue_control_value); | 449 | writel(completion_queue_control_value, |
450 | &this_controller->smu_registers->completion_queue_control); | ||
451 | |||
437 | 452 | ||
438 | /* Set the completion queue get pointer and enable the queue */ | 453 | /* Set the completion queue get pointer and enable the queue */ |
439 | completion_queue_get_value = ( | 454 | completion_queue_get_value = ( |
@@ -443,7 +458,8 @@ static void scic_sds_controller_initialize_completion_queue( | |||
443 | | (SMU_CQGR_GEN_BIT(EVENT_ENABLE)) | 458 | | (SMU_CQGR_GEN_BIT(EVENT_ENABLE)) |
444 | ); | 459 | ); |
445 | 460 | ||
446 | SMU_CQGR_WRITE(this_controller, completion_queue_get_value); | 461 | writel(completion_queue_get_value, |
462 | &this_controller->smu_registers->completion_queue_get); | ||
447 | 463 | ||
448 | /* Set the completion queue put pointer */ | 464 | /* Set the completion queue put pointer */ |
449 | completion_queue_put_value = ( | 465 | completion_queue_put_value = ( |
@@ -451,7 +467,9 @@ static void scic_sds_controller_initialize_completion_queue( | |||
451 | | (SMU_CQPR_GEN_VAL(EVENT_POINTER, 0)) | 467 | | (SMU_CQPR_GEN_VAL(EVENT_POINTER, 0)) |
452 | ); | 468 | ); |
453 | 469 | ||
454 | SMU_CQPR_WRITE(this_controller, completion_queue_put_value); | 470 | writel(completion_queue_put_value, |
471 | &this_controller->smu_registers->completion_queue_put); | ||
472 | |||
455 | 473 | ||
456 | /* Initialize the cycle bit of the completion queue entries */ | 474 | /* Initialize the cycle bit of the completion queue entries */ |
457 | for (index = 0; index < this_controller->completion_queue_entries; index++) { | 475 | for (index = 0; index < this_controller->completion_queue_entries; index++) { |
@@ -479,7 +497,8 @@ static void scic_sds_controller_initialize_unsolicited_frame_queue( | |||
479 | frame_queue_control_value = | 497 | frame_queue_control_value = |
480 | SCU_UFQC_GEN_VAL(QUEUE_SIZE, this_controller->uf_control.address_table.count); | 498 | SCU_UFQC_GEN_VAL(QUEUE_SIZE, this_controller->uf_control.address_table.count); |
481 | 499 | ||
482 | SCU_UFQC_WRITE(this_controller, frame_queue_control_value); | 500 | writel(frame_queue_control_value, |
501 | &this_controller->scu_registers->sdma.unsolicited_frame_queue_control); | ||
483 | 502 | ||
484 | /* Setup the get pointer for the unsolicited frame queue */ | 503 | /* Setup the get pointer for the unsolicited frame queue */ |
485 | frame_queue_get_value = ( | 504 | frame_queue_get_value = ( |
@@ -487,12 +506,12 @@ static void scic_sds_controller_initialize_unsolicited_frame_queue( | |||
487 | | SCU_UFQGP_GEN_BIT(ENABLE_BIT) | 506 | | SCU_UFQGP_GEN_BIT(ENABLE_BIT) |
488 | ); | 507 | ); |
489 | 508 | ||
490 | SCU_UFQGP_WRITE(this_controller, frame_queue_get_value); | 509 | writel(frame_queue_get_value, |
491 | 510 | &this_controller->scu_registers->sdma.unsolicited_frame_get_pointer); | |
492 | /* Setup the put pointer for the unsolicited frame queue */ | 511 | /* Setup the put pointer for the unsolicited frame queue */ |
493 | frame_queue_put_value = SCU_UFQPP_GEN_VAL(POINTER, 0); | 512 | frame_queue_put_value = SCU_UFQPP_GEN_VAL(POINTER, 0); |
494 | 513 | writel(frame_queue_put_value, | |
495 | SCU_UFQPP_WRITE(this_controller, frame_queue_put_value); | 514 | &this_controller->scu_registers->sdma.unsolicited_frame_put_pointer); |
496 | } | 515 | } |
497 | 516 | ||
498 | /** | 517 | /** |
@@ -505,12 +524,12 @@ static void scic_sds_controller_enable_port_task_scheduler( | |||
505 | { | 524 | { |
506 | u32 port_task_scheduler_value; | 525 | u32 port_task_scheduler_value; |
507 | 526 | ||
508 | port_task_scheduler_value = SCU_PTSGCR_READ(this_controller); | 527 | port_task_scheduler_value = |
509 | 528 | readl(&this_controller->scu_registers->peg0.ptsg.control); | |
510 | port_task_scheduler_value |= | 529 | port_task_scheduler_value |= |
511 | (SCU_PTSGCR_GEN_BIT(ETM_ENABLE) | SCU_PTSGCR_GEN_BIT(PTSG_ENABLE)); | 530 | (SCU_PTSGCR_GEN_BIT(ETM_ENABLE) | SCU_PTSGCR_GEN_BIT(PTSG_ENABLE)); |
512 | 531 | writel(port_task_scheduler_value, | |
513 | SCU_PTSGCR_WRITE(this_controller, port_task_scheduler_value); | 532 | &this_controller->scu_registers->peg0.ptsg.control); |
514 | } | 533 | } |
515 | 534 | ||
516 | /** | 535 | /** |
@@ -531,35 +550,34 @@ static void scic_sds_controller_afe_initialization(struct scic_sds_controller *s | |||
531 | u32 phy_id; | 550 | u32 phy_id; |
532 | 551 | ||
533 | /* Clear DFX Status registers */ | 552 | /* Clear DFX Status registers */ |
534 | scu_afe_register_write(scic, afe_dfx_master_control0, 0x0081000f); | 553 | writel(0x0081000f, &scic->scu_registers->afe.afe_dfx_master_control0); |
535 | udelay(AFE_REGISTER_WRITE_DELAY); | 554 | udelay(AFE_REGISTER_WRITE_DELAY); |
536 | 555 | ||
537 | /* Configure bias currents to normal */ | 556 | /* Configure bias currents to normal */ |
538 | if (is_a0()) | 557 | if (is_a0()) |
539 | scu_afe_register_write(scic, afe_bias_control, 0x00005500); | 558 | writel(0x00005500, &scic->scu_registers->afe.afe_bias_control); |
540 | else | 559 | else |
541 | scu_afe_register_write(scic, afe_bias_control, 0x00005A00); | 560 | writel(0x00005A00, &scic->scu_registers->afe.afe_bias_control); |
542 | 561 | ||
543 | udelay(AFE_REGISTER_WRITE_DELAY); | 562 | udelay(AFE_REGISTER_WRITE_DELAY); |
544 | 563 | ||
545 | /* Enable PLL */ | 564 | /* Enable PLL */ |
546 | if (is_b0()) | 565 | if (is_b0()) |
547 | scu_afe_register_write(scic, afe_pll_control0, 0x80040A08); | 566 | writel(0x80040A08, &scic->scu_registers->afe.afe_pll_control0); |
548 | else | 567 | else |
549 | scu_afe_register_write(scic, afe_pll_control0, 0x80040908); | 568 | writel(0x80040908, &scic->scu_registers->afe.afe_pll_control0); |
550 | 569 | ||
551 | udelay(AFE_REGISTER_WRITE_DELAY); | 570 | udelay(AFE_REGISTER_WRITE_DELAY); |
552 | 571 | ||
553 | /* Wait for the PLL to lock */ | 572 | /* Wait for the PLL to lock */ |
554 | do { | 573 | do { |
555 | afe_status = scu_afe_register_read( | 574 | afe_status = readl(&scic->scu_registers->afe.afe_common_block_status); |
556 | scic, afe_common_block_status); | ||
557 | udelay(AFE_REGISTER_WRITE_DELAY); | 575 | udelay(AFE_REGISTER_WRITE_DELAY); |
558 | } while ((afe_status & 0x00001000) == 0); | 576 | } while ((afe_status & 0x00001000) == 0); |
559 | 577 | ||
560 | if (is_b0()) { | 578 | if (is_b0()) { |
561 | /* Shorten SAS SNW lock time (RxLock timer value from 76 us to 50 us) */ | 579 | /* Shorten SAS SNW lock time (RxLock timer value from 76 us to 50 us) */ |
562 | scu_afe_register_write(scic, afe_pmsn_master_control0, 0x7bcc96ad); | 580 | writel(0x7bcc96ad, &scic->scu_registers->afe.afe_pmsn_master_control0); |
563 | udelay(AFE_REGISTER_WRITE_DELAY); | 581 | udelay(AFE_REGISTER_WRITE_DELAY); |
564 | } | 582 | } |
565 | 583 | ||
@@ -568,16 +586,16 @@ static void scic_sds_controller_afe_initialization(struct scic_sds_controller *s | |||
568 | 586 | ||
569 | if (is_b0()) { | 587 | if (is_b0()) { |
570 | /* Configure transmitter SSC parameters */ | 588 | /* Configure transmitter SSC parameters */ |
571 | scu_afe_txreg_write(scic, phy_id, afe_tx_ssc_control, 0x00030000); | 589 | writel(0x00030000, &scic->scu_registers->afe.scu_afe_xcvr[phy_id].afe_tx_ssc_control); |
572 | udelay(AFE_REGISTER_WRITE_DELAY); | 590 | udelay(AFE_REGISTER_WRITE_DELAY); |
573 | } else { | 591 | } else { |
574 | /* | 592 | /* |
575 | * All defaults, except the Receive Word Alignament/Comma Detect | 593 | * All defaults, except the Receive Word Alignament/Comma Detect |
576 | * Enable....(0xe800) */ | 594 | * Enable....(0xe800) */ |
577 | scu_afe_txreg_write(scic, phy_id, afe_xcvr_control0, 0x00004512); | 595 | writel(0x00004512, &scic->scu_registers->afe.scu_afe_xcvr[phy_id].afe_xcvr_control0); |
578 | udelay(AFE_REGISTER_WRITE_DELAY); | 596 | udelay(AFE_REGISTER_WRITE_DELAY); |
579 | 597 | ||
580 | scu_afe_txreg_write(scic, phy_id, afe_xcvr_control1, 0x0050100F); | 598 | writel(0x0050100F, &scic->scu_registers->afe.scu_afe_xcvr[phy_id].afe_xcvr_control1); |
581 | udelay(AFE_REGISTER_WRITE_DELAY); | 599 | udelay(AFE_REGISTER_WRITE_DELAY); |
582 | } | 600 | } |
583 | 601 | ||
@@ -585,61 +603,65 @@ static void scic_sds_controller_afe_initialization(struct scic_sds_controller *s | |||
585 | * Power up TX and RX out from power down (PWRDNTX and PWRDNRX) | 603 | * Power up TX and RX out from power down (PWRDNTX and PWRDNRX) |
586 | * & increase TX int & ext bias 20%....(0xe85c) */ | 604 | * & increase TX int & ext bias 20%....(0xe85c) */ |
587 | if (is_a0()) | 605 | if (is_a0()) |
588 | scu_afe_txreg_write(scic, phy_id, afe_channel_control, 0x000003D4); | 606 | writel(0x000003D4, &scic->scu_registers->afe.scu_afe_xcvr[phy_id].afe_channel_control); |
589 | else if (is_a2()) | 607 | else if (is_a2()) |
590 | scu_afe_txreg_write(scic, phy_id, afe_channel_control, 0x000003F0); | 608 | writel(0x000003F0, &scic->scu_registers->afe.scu_afe_xcvr[phy_id].afe_channel_control); |
591 | else { | 609 | else { |
592 | /* Power down TX and RX (PWRDNTX and PWRDNRX) */ | 610 | /* Power down TX and RX (PWRDNTX and PWRDNRX) */ |
593 | scu_afe_txreg_write(scic, phy_id, afe_channel_control, 0x000003d7); | 611 | writel(0x000003d7, &scic->scu_registers->afe.scu_afe_xcvr[phy_id].afe_channel_control); |
594 | udelay(AFE_REGISTER_WRITE_DELAY); | 612 | udelay(AFE_REGISTER_WRITE_DELAY); |
595 | 613 | ||
596 | /* | 614 | /* |
597 | * Power up TX and RX out from power down (PWRDNTX and PWRDNRX) | 615 | * Power up TX and RX out from power down (PWRDNTX and PWRDNRX) |
598 | * & increase TX int & ext bias 20%....(0xe85c) */ | 616 | * & increase TX int & ext bias 20%....(0xe85c) */ |
599 | scu_afe_txreg_write(scic, phy_id, afe_channel_control, 0x000003d4); | 617 | writel(0x000003d4, &scic->scu_registers->afe.scu_afe_xcvr[phy_id].afe_channel_control); |
600 | } | 618 | } |
601 | udelay(AFE_REGISTER_WRITE_DELAY); | 619 | udelay(AFE_REGISTER_WRITE_DELAY); |
602 | 620 | ||
603 | if (is_a0() || is_a2()) { | 621 | if (is_a0() || is_a2()) { |
604 | /* Enable TX equalization (0xe824) */ | 622 | /* Enable TX equalization (0xe824) */ |
605 | scu_afe_txreg_write(scic, phy_id, afe_tx_control, 0x00040000); | 623 | writel(0x00040000, &scic->scu_registers->afe.scu_afe_xcvr[phy_id].afe_tx_control); |
606 | udelay(AFE_REGISTER_WRITE_DELAY); | 624 | udelay(AFE_REGISTER_WRITE_DELAY); |
607 | } | 625 | } |
608 | 626 | ||
609 | /* | 627 | /* |
610 | * RDPI=0x0(RX Power On), RXOOBDETPDNC=0x0, TPD=0x0(TX Power On), | 628 | * RDPI=0x0(RX Power On), RXOOBDETPDNC=0x0, TPD=0x0(TX Power On), |
611 | * RDD=0x0(RX Detect Enabled) ....(0xe800) */ | 629 | * RDD=0x0(RX Detect Enabled) ....(0xe800) */ |
612 | scu_afe_txreg_write(scic, phy_id, afe_xcvr_control0, 0x00004100); | 630 | writel(0x00004100, &scic->scu_registers->afe.scu_afe_xcvr[phy_id].afe_xcvr_control0); |
613 | udelay(AFE_REGISTER_WRITE_DELAY); | 631 | udelay(AFE_REGISTER_WRITE_DELAY); |
614 | 632 | ||
615 | /* Leave DFE/FFE on */ | 633 | /* Leave DFE/FFE on */ |
616 | if (is_a0()) | 634 | if (is_a0()) |
617 | scu_afe_txreg_write(scic, phy_id, afe_rx_ssc_control0, 0x3F09983F); | 635 | writel(0x3F09983F, &scic->scu_registers->afe.scu_afe_xcvr[phy_id].afe_rx_ssc_control0); |
618 | else if (is_a2()) | 636 | else if (is_a2()) |
619 | scu_afe_txreg_write(scic, phy_id, afe_rx_ssc_control0, 0x3F11103F); | 637 | writel(0x3F11103F, &scic->scu_registers->afe.scu_afe_xcvr[phy_id].afe_rx_ssc_control0); |
620 | else { | 638 | else { |
621 | scu_afe_txreg_write(scic, phy_id, afe_rx_ssc_control0, 0x3F11103F); | 639 | writel(0x3F11103F, &scic->scu_registers->afe.scu_afe_xcvr[phy_id].afe_rx_ssc_control0); |
622 | udelay(AFE_REGISTER_WRITE_DELAY); | 640 | udelay(AFE_REGISTER_WRITE_DELAY); |
623 | /* Enable TX equalization (0xe824) */ | 641 | /* Enable TX equalization (0xe824) */ |
624 | scu_afe_txreg_write(scic, phy_id, afe_tx_control, 0x00040000); | 642 | writel(0x00040000, &scic->scu_registers->afe.scu_afe_xcvr[phy_id].afe_tx_control); |
625 | } | 643 | } |
626 | udelay(AFE_REGISTER_WRITE_DELAY); | 644 | udelay(AFE_REGISTER_WRITE_DELAY); |
627 | 645 | ||
628 | scu_afe_txreg_write(scic, phy_id, afe_tx_amp_control0, oem_phy->afe_tx_amp_control0); | 646 | writel(oem_phy->afe_tx_amp_control0, |
647 | &scic->scu_registers->afe.scu_afe_xcvr[phy_id].afe_tx_amp_control0); | ||
629 | udelay(AFE_REGISTER_WRITE_DELAY); | 648 | udelay(AFE_REGISTER_WRITE_DELAY); |
630 | 649 | ||
631 | scu_afe_txreg_write(scic, phy_id, afe_tx_amp_control0, oem_phy->afe_tx_amp_control1); | 650 | writel(oem_phy->afe_tx_amp_control1, |
651 | &scic->scu_registers->afe.scu_afe_xcvr[phy_id].afe_tx_amp_control1); | ||
632 | udelay(AFE_REGISTER_WRITE_DELAY); | 652 | udelay(AFE_REGISTER_WRITE_DELAY); |
633 | 653 | ||
634 | scu_afe_txreg_write(scic, phy_id, afe_tx_amp_control0, oem_phy->afe_tx_amp_control2); | 654 | writel(oem_phy->afe_tx_amp_control2, |
655 | &scic->scu_registers->afe.scu_afe_xcvr[phy_id].afe_tx_amp_control2); | ||
635 | udelay(AFE_REGISTER_WRITE_DELAY); | 656 | udelay(AFE_REGISTER_WRITE_DELAY); |
636 | 657 | ||
637 | scu_afe_txreg_write(scic, phy_id, afe_tx_amp_control0, oem_phy->afe_tx_amp_control3); | 658 | writel(oem_phy->afe_tx_amp_control3, |
659 | &scic->scu_registers->afe.scu_afe_xcvr[phy_id].afe_tx_amp_control3); | ||
638 | udelay(AFE_REGISTER_WRITE_DELAY); | 660 | udelay(AFE_REGISTER_WRITE_DELAY); |
639 | } | 661 | } |
640 | 662 | ||
641 | /* Transfer control to the PEs */ | 663 | /* Transfer control to the PEs */ |
642 | scu_afe_register_write(scic, afe_dfx_master_control0, 0x00010f00); | 664 | writel(0x00010f00, &scic->scu_registers->afe.afe_dfx_master_control0); |
643 | udelay(AFE_REGISTER_WRITE_DELAY); | 665 | udelay(AFE_REGISTER_WRITE_DELAY); |
644 | } | 666 | } |
645 | 667 | ||
@@ -1437,8 +1459,9 @@ static void scic_sds_controller_process_completions( | |||
1437 | | event_cycle | SMU_CQGR_GEN_VAL(EVENT_POINTER, event_index) | 1459 | | event_cycle | SMU_CQGR_GEN_VAL(EVENT_POINTER, event_index) |
1438 | | get_cycle | SMU_CQGR_GEN_VAL(POINTER, get_index); | 1460 | | get_cycle | SMU_CQGR_GEN_VAL(POINTER, get_index); |
1439 | 1461 | ||
1440 | SMU_CQGR_WRITE(this_controller, | 1462 | writel(this_controller->completion_queue_get, |
1441 | this_controller->completion_queue_get); | 1463 | &this_controller->smu_registers->completion_queue_get); |
1464 | |||
1442 | } | 1465 | } |
1443 | 1466 | ||
1444 | dev_dbg(scic_to_dev(this_controller), | 1467 | dev_dbg(scic_to_dev(this_controller), |
@@ -1456,15 +1479,15 @@ bool scic_sds_controller_isr(struct scic_sds_controller *scic) | |||
1456 | /* | 1479 | /* |
1457 | * we have a spurious interrupt it could be that we have already | 1480 | * we have a spurious interrupt it could be that we have already |
1458 | * emptied the completion queue from a previous interrupt */ | 1481 | * emptied the completion queue from a previous interrupt */ |
1459 | SMU_ISR_WRITE(scic, SMU_ISR_COMPLETION); | 1482 | writel(SMU_ISR_COMPLETION, &scic->smu_registers->interrupt_status); |
1460 | 1483 | ||
1461 | /* | 1484 | /* |
1462 | * There is a race in the hardware that could cause us not to be notified | 1485 | * There is a race in the hardware that could cause us not to be notified |
1463 | * of an interrupt completion if we do not take this step. We will mask | 1486 | * of an interrupt completion if we do not take this step. We will mask |
1464 | * then unmask the interrupts so if there is another interrupt pending | 1487 | * then unmask the interrupts so if there is another interrupt pending |
1465 | * the clearing of the interrupt source we get the next interrupt message. */ | 1488 | * the clearing of the interrupt source we get the next interrupt message. */ |
1466 | SMU_IMR_WRITE(scic, 0xFF000000); | 1489 | writel(0xFF000000, &scic->smu_registers->interrupt_mask); |
1467 | SMU_IMR_WRITE(scic, 0x00000000); | 1490 | writel(0, &scic->smu_registers->interrupt_mask); |
1468 | } | 1491 | } |
1469 | 1492 | ||
1470 | return false; | 1493 | return false; |
@@ -1477,18 +1500,18 @@ void scic_sds_controller_completion_handler(struct scic_sds_controller *scic) | |||
1477 | scic_sds_controller_process_completions(scic); | 1500 | scic_sds_controller_process_completions(scic); |
1478 | 1501 | ||
1479 | /* Clear the interrupt and enable all interrupts again */ | 1502 | /* Clear the interrupt and enable all interrupts again */ |
1480 | SMU_ISR_WRITE(scic, SMU_ISR_COMPLETION); | 1503 | writel(SMU_ISR_COMPLETION, &scic->smu_registers->interrupt_status); |
1481 | /* Could we write the value of SMU_ISR_COMPLETION? */ | 1504 | /* Could we write the value of SMU_ISR_COMPLETION? */ |
1482 | SMU_IMR_WRITE(scic, 0xFF000000); | 1505 | writel(0xFF000000, &scic->smu_registers->interrupt_mask); |
1483 | SMU_IMR_WRITE(scic, 0x00000000); | 1506 | writel(0, &scic->smu_registers->interrupt_mask); |
1484 | } | 1507 | } |
1485 | 1508 | ||
1486 | bool scic_sds_controller_error_isr(struct scic_sds_controller *scic) | 1509 | bool scic_sds_controller_error_isr(struct scic_sds_controller *scic) |
1487 | { | 1510 | { |
1488 | u32 interrupt_status; | 1511 | u32 interrupt_status; |
1489 | 1512 | ||
1490 | interrupt_status = SMU_ISR_READ(scic); | 1513 | interrupt_status = |
1491 | 1514 | readl(&scic->smu_registers->interrupt_status); | |
1492 | interrupt_status &= (SMU_ISR_QUEUE_ERROR | SMU_ISR_QUEUE_SUSPEND); | 1515 | interrupt_status &= (SMU_ISR_QUEUE_ERROR | SMU_ISR_QUEUE_SUSPEND); |
1493 | 1516 | ||
1494 | if (interrupt_status != 0) { | 1517 | if (interrupt_status != 0) { |
@@ -1504,8 +1527,8 @@ bool scic_sds_controller_error_isr(struct scic_sds_controller *scic) | |||
1504 | * then unmask the error interrupts so if there was another interrupt | 1527 | * then unmask the error interrupts so if there was another interrupt |
1505 | * pending we will be notified. | 1528 | * pending we will be notified. |
1506 | * Could we write the value of (SMU_ISR_QUEUE_ERROR | SMU_ISR_QUEUE_SUSPEND)? */ | 1529 | * Could we write the value of (SMU_ISR_QUEUE_ERROR | SMU_ISR_QUEUE_SUSPEND)? */ |
1507 | SMU_IMR_WRITE(scic, 0x000000FF); | 1530 | writel(0xff, &scic->smu_registers->interrupt_mask); |
1508 | SMU_IMR_WRITE(scic, 0x00000000); | 1531 | writel(0, &scic->smu_registers->interrupt_mask); |
1509 | 1532 | ||
1510 | return false; | 1533 | return false; |
1511 | } | 1534 | } |
@@ -1514,14 +1537,14 @@ void scic_sds_controller_error_handler(struct scic_sds_controller *scic) | |||
1514 | { | 1537 | { |
1515 | u32 interrupt_status; | 1538 | u32 interrupt_status; |
1516 | 1539 | ||
1517 | interrupt_status = SMU_ISR_READ(scic); | 1540 | interrupt_status = |
1541 | readl(&scic->smu_registers->interrupt_status); | ||
1518 | 1542 | ||
1519 | if ((interrupt_status & SMU_ISR_QUEUE_SUSPEND) && | 1543 | if ((interrupt_status & SMU_ISR_QUEUE_SUSPEND) && |
1520 | scic_sds_controller_completion_queue_has_entries(scic)) { | 1544 | scic_sds_controller_completion_queue_has_entries(scic)) { |
1521 | 1545 | ||
1522 | scic_sds_controller_process_completions(scic); | 1546 | scic_sds_controller_process_completions(scic); |
1523 | SMU_ISR_WRITE(scic, SMU_ISR_QUEUE_SUSPEND); | 1547 | writel(SMU_ISR_QUEUE_SUSPEND, &scic->smu_registers->interrupt_status); |
1524 | |||
1525 | } else { | 1548 | } else { |
1526 | dev_err(scic_to_dev(scic), "%s: status: %#x\n", __func__, | 1549 | dev_err(scic_to_dev(scic), "%s: status: %#x\n", __func__, |
1527 | interrupt_status); | 1550 | interrupt_status); |
@@ -1535,7 +1558,7 @@ void scic_sds_controller_error_handler(struct scic_sds_controller *scic) | |||
1535 | /* If we dont process any completions I am not sure that we want to do this. | 1558 | /* If we dont process any completions I am not sure that we want to do this. |
1536 | * We are in the middle of a hardware fault and should probably be reset. | 1559 | * We are in the middle of a hardware fault and should probably be reset. |
1537 | */ | 1560 | */ |
1538 | SMU_IMR_WRITE(scic, 0x00000000); | 1561 | writel(0, &scic->smu_registers->interrupt_mask); |
1539 | } | 1562 | } |
1540 | 1563 | ||
1541 | 1564 | ||
@@ -1648,7 +1671,7 @@ void scic_sds_controller_post_request( | |||
1648 | this_controller, | 1671 | this_controller, |
1649 | request); | 1672 | request); |
1650 | 1673 | ||
1651 | SMU_PCP_WRITE(this_controller, request); | 1674 | writel(request, &this_controller->smu_registers->post_context_port); |
1652 | } | 1675 | } |
1653 | 1676 | ||
1654 | /** | 1677 | /** |
@@ -1871,7 +1894,8 @@ void scic_sds_controller_release_frame( | |||
1871 | { | 1894 | { |
1872 | if (scic_sds_unsolicited_frame_control_release_frame( | 1895 | if (scic_sds_unsolicited_frame_control_release_frame( |
1873 | &this_controller->uf_control, frame_index) == true) | 1896 | &this_controller->uf_control, frame_index) == true) |
1874 | SCU_UFQGP_WRITE(this_controller, this_controller->uf_control.get); | 1897 | writel(this_controller->uf_control.get, |
1898 | &this_controller->scu_registers->sdma.unsolicited_frame_get_pointer); | ||
1875 | } | 1899 | } |
1876 | 1900 | ||
1877 | /** | 1901 | /** |
@@ -2478,14 +2502,14 @@ void scic_controller_enable_interrupts( | |||
2478 | struct scic_sds_controller *scic) | 2502 | struct scic_sds_controller *scic) |
2479 | { | 2503 | { |
2480 | BUG_ON(scic->smu_registers == NULL); | 2504 | BUG_ON(scic->smu_registers == NULL); |
2481 | SMU_IMR_WRITE(scic, 0x00000000); | 2505 | writel(0, &scic->smu_registers->interrupt_mask); |
2482 | } | 2506 | } |
2483 | 2507 | ||
2484 | void scic_controller_disable_interrupts( | 2508 | void scic_controller_disable_interrupts( |
2485 | struct scic_sds_controller *scic) | 2509 | struct scic_sds_controller *scic) |
2486 | { | 2510 | { |
2487 | BUG_ON(scic->smu_registers == NULL); | 2511 | BUG_ON(scic->smu_registers == NULL); |
2488 | SMU_IMR_WRITE(scic, 0xffffffff); | 2512 | writel(0xffffffff, &scic->smu_registers->interrupt_mask); |
2489 | } | 2513 | } |
2490 | 2514 | ||
2491 | static enum sci_status scic_controller_set_mode( | 2515 | static enum sci_status scic_controller_set_mode( |
@@ -2543,16 +2567,16 @@ static void scic_sds_controller_reset_hardware( | |||
2543 | scic_controller_disable_interrupts(scic); | 2567 | scic_controller_disable_interrupts(scic); |
2544 | 2568 | ||
2545 | /* Reset the SCU */ | 2569 | /* Reset the SCU */ |
2546 | SMU_SMUSRCR_WRITE(scic, 0xFFFFFFFF); | 2570 | writel(0xFFFFFFFF, &scic->smu_registers->soft_reset_control); |
2547 | 2571 | ||
2548 | /* Delay for 1ms to before clearing the CQP and UFQPR. */ | 2572 | /* Delay for 1ms to before clearing the CQP and UFQPR. */ |
2549 | udelay(1000); | 2573 | udelay(1000); |
2550 | 2574 | ||
2551 | /* The write to the CQGR clears the CQP */ | 2575 | /* The write to the CQGR clears the CQP */ |
2552 | SMU_CQGR_WRITE(scic, 0x00000000); | 2576 | writel(0x00000000, &scic->smu_registers->completion_queue_get); |
2553 | 2577 | ||
2554 | /* The write to the UFQGP clears the UFQPR */ | 2578 | /* The write to the UFQGP clears the UFQPR */ |
2555 | SCU_UFQGP_WRITE(scic, 0x00000000); | 2579 | writel(0, &scic->scu_registers->sdma.unsolicited_frame_get_pointer); |
2556 | } | 2580 | } |
2557 | 2581 | ||
2558 | enum sci_status scic_user_parameters_set( | 2582 | enum sci_status scic_user_parameters_set( |
@@ -2778,11 +2802,10 @@ static enum sci_status scic_controller_set_interrupt_coalescence( | |||
2778 | return SCI_FAILURE_INVALID_PARAMETER_VALUE; | 2802 | return SCI_FAILURE_INVALID_PARAMETER_VALUE; |
2779 | } | 2803 | } |
2780 | 2804 | ||
2781 | SMU_ICC_WRITE( | 2805 | writel(SMU_ICC_GEN_VAL(NUMBER, coalesce_number) | |
2782 | scic_controller, | 2806 | SMU_ICC_GEN_VAL(TIMER, timeout_encode), |
2783 | (SMU_ICC_GEN_VAL(NUMBER, coalesce_number) | | 2807 | &scic_controller->smu_registers->interrupt_coalesce_control); |
2784 | SMU_ICC_GEN_VAL(TIMER, timeout_encode)) | 2808 | |
2785 | ); | ||
2786 | 2809 | ||
2787 | scic_controller->interrupt_coalesce_number = (u16)coalesce_number; | 2810 | scic_controller->interrupt_coalesce_number = (u16)coalesce_number; |
2788 | scic_controller->interrupt_coalesce_timeout = coalesce_timeout / 100; | 2811 | scic_controller->interrupt_coalesce_timeout = coalesce_timeout / 100; |
@@ -2868,7 +2891,7 @@ static enum sci_status scic_sds_controller_reset_state_initialize_handler(struct | |||
2868 | u32 terminate_loop; | 2891 | u32 terminate_loop; |
2869 | 2892 | ||
2870 | /* Take the hardware out of reset */ | 2893 | /* Take the hardware out of reset */ |
2871 | SMU_SMUSRCR_WRITE(scic, 0x00000000); | 2894 | writel(0, &scic->smu_registers->soft_reset_control); |
2872 | 2895 | ||
2873 | /* | 2896 | /* |
2874 | * / @todo Provide meaningfull error code for hardware failure | 2897 | * / @todo Provide meaningfull error code for hardware failure |
@@ -2879,7 +2902,7 @@ static enum sci_status scic_sds_controller_reset_state_initialize_handler(struct | |||
2879 | while (terminate_loop-- && (result != SCI_SUCCESS)) { | 2902 | while (terminate_loop-- && (result != SCI_SUCCESS)) { |
2880 | /* Loop until the hardware reports success */ | 2903 | /* Loop until the hardware reports success */ |
2881 | udelay(SCU_CONTEXT_RAM_INIT_STALL_TIME); | 2904 | udelay(SCU_CONTEXT_RAM_INIT_STALL_TIME); |
2882 | status = SMU_SMUCSR_READ(scic); | 2905 | status = readl(&scic->smu_registers->control_status); |
2883 | 2906 | ||
2884 | if ((status & SCU_RAM_INIT_COMPLETED) == | 2907 | if ((status & SCU_RAM_INIT_COMPLETED) == |
2885 | SCU_RAM_INIT_COMPLETED) | 2908 | SCU_RAM_INIT_COMPLETED) |
@@ -2896,7 +2919,9 @@ static enum sci_status scic_sds_controller_reset_state_initialize_handler(struct | |||
2896 | /* | 2919 | /* |
2897 | * Determine what are the actaul device capacities that the | 2920 | * Determine what are the actaul device capacities that the |
2898 | * hardware will support */ | 2921 | * hardware will support */ |
2899 | device_context_capacity = SMU_DCC_READ(scic); | 2922 | device_context_capacity = |
2923 | readl(&scic->smu_registers->device_context_capacity); | ||
2924 | |||
2900 | 2925 | ||
2901 | max_supported_ports = smu_dcc_get_max_ports(device_context_capacity); | 2926 | max_supported_ports = smu_dcc_get_max_ports(device_context_capacity); |
2902 | max_supported_devices = smu_dcc_get_max_remote_node_context(device_context_capacity); | 2927 | max_supported_devices = smu_dcc_get_max_remote_node_context(device_context_capacity); |
@@ -2910,9 +2935,7 @@ static enum sci_status scic_sds_controller_reset_state_initialize_handler(struct | |||
2910 | struct scu_port_task_scheduler_group_registers *ptsg = | 2935 | struct scu_port_task_scheduler_group_registers *ptsg = |
2911 | &scic->scu_registers->peg0.ptsg; | 2936 | &scic->scu_registers->peg0.ptsg; |
2912 | 2937 | ||
2913 | scu_register_write(scic, | 2938 | writel(index, &ptsg->protocol_engine[index]); |
2914 | ptsg->protocol_engine[index], | ||
2915 | index); | ||
2916 | } | 2939 | } |
2917 | 2940 | ||
2918 | /* Record the smaller of the two capacity values */ | 2941 | /* Record the smaller of the two capacity values */ |
@@ -2939,16 +2962,20 @@ static enum sci_status scic_sds_controller_reset_state_initialize_handler(struct | |||
2939 | u32 dma_configuration; | 2962 | u32 dma_configuration; |
2940 | 2963 | ||
2941 | /* Configure the payload DMA */ | 2964 | /* Configure the payload DMA */ |
2942 | dma_configuration = SCU_PDMACR_READ(scic); | 2965 | dma_configuration = |
2966 | readl(&scic->scu_registers->sdma.pdma_configuration); | ||
2943 | dma_configuration |= | 2967 | dma_configuration |= |
2944 | SCU_PDMACR_GEN_BIT(PCI_RELAXED_ORDERING_ENABLE); | 2968 | SCU_PDMACR_GEN_BIT(PCI_RELAXED_ORDERING_ENABLE); |
2945 | SCU_PDMACR_WRITE(scic, dma_configuration); | 2969 | writel(dma_configuration, |
2970 | &scic->scu_registers->sdma.pdma_configuration); | ||
2946 | 2971 | ||
2947 | /* Configure the control DMA */ | 2972 | /* Configure the control DMA */ |
2948 | dma_configuration = SCU_CDMACR_READ(scic); | 2973 | dma_configuration = |
2974 | readl(&scic->scu_registers->sdma.cdma_configuration); | ||
2949 | dma_configuration |= | 2975 | dma_configuration |= |
2950 | SCU_CDMACR_GEN_BIT(PCI_RELAXED_ORDERING_ENABLE); | 2976 | SCU_CDMACR_GEN_BIT(PCI_RELAXED_ORDERING_ENABLE); |
2951 | SCU_CDMACR_WRITE(scic, dma_configuration); | 2977 | writel(dma_configuration, |
2978 | &scic->scu_registers->sdma.cdma_configuration); | ||
2952 | } | 2979 | } |
2953 | 2980 | ||
2954 | /* | 2981 | /* |
diff --git a/drivers/scsi/isci/core/scic_sds_controller.h b/drivers/scsi/isci/core/scic_sds_controller.h index fd78148d93d9..baf0b9ededec 100644 --- a/drivers/scsi/isci/core/scic_sds_controller.h +++ b/drivers/scsi/isci/core/scic_sds_controller.h | |||
@@ -57,6 +57,7 @@ | |||
57 | #define _SCIC_SDS_CONTROLLER_H_ | 57 | #define _SCIC_SDS_CONTROLLER_H_ |
58 | 58 | ||
59 | #include <linux/string.h> | 59 | #include <linux/string.h> |
60 | #include <linux/io.h> | ||
60 | 61 | ||
61 | /** | 62 | /** |
62 | * This file contains the structures, constants and prototypes used for the | 63 | * This file contains the structures, constants and prototypes used for the |
@@ -80,7 +81,6 @@ | |||
80 | #include "scu_unsolicited_frame.h" | 81 | #include "scu_unsolicited_frame.h" |
81 | #include "scic_sds_unsolicited_frame_control.h" | 82 | #include "scic_sds_unsolicited_frame_control.h" |
82 | #include "scic_sds_port_configuration_agent.h" | 83 | #include "scic_sds_port_configuration_agent.h" |
83 | #include "scic_sds_pci.h" | ||
84 | 84 | ||
85 | struct scic_sds_remote_device; | 85 | struct scic_sds_remote_device; |
86 | struct scic_sds_request; | 86 | struct scic_sds_request; |
@@ -428,38 +428,6 @@ extern const struct scic_sds_controller_state_handler | |||
428 | (&(controller)->port_agent) | 428 | (&(controller)->port_agent) |
429 | 429 | ||
430 | /** | 430 | /** |
431 | * smu_register_write() - | ||
432 | * | ||
433 | * This macro writes to the smu_register for this controller | ||
434 | */ | ||
435 | #define smu_register_write(controller, reg, value) \ | ||
436 | scic_sds_pci_write_smu_dword((controller), &(reg), (value)) | ||
437 | |||
438 | /** | ||
439 | * smu_register_read() - | ||
440 | * | ||
441 | * This macro reads the smu_register for this controller | ||
442 | */ | ||
443 | #define smu_register_read(controller, reg) \ | ||
444 | scic_sds_pci_read_smu_dword((controller), &(reg)) | ||
445 | |||
446 | /** | ||
447 | * scu_register_write() - | ||
448 | * | ||
449 | * This mcaro writes the scu_register for this controller | ||
450 | */ | ||
451 | #define scu_register_write(controller, reg, value) \ | ||
452 | scic_sds_pci_write_scu_dword((controller), &(reg), (value)) | ||
453 | |||
454 | /** | ||
455 | * scu_register_read() - | ||
456 | * | ||
457 | * This macro reads the scu_register for this controller | ||
458 | */ | ||
459 | #define scu_register_read(controller, reg) \ | ||
460 | scic_sds_pci_read_scu_dword((controller), &(reg)) | ||
461 | |||
462 | /** | ||
463 | * scic_sds_controller_get_protocol_engine_group() - | 431 | * scic_sds_controller_get_protocol_engine_group() - |
464 | * | 432 | * |
465 | * This macro returns the protocol engine group for this controller object. | 433 | * This macro returns the protocol engine group for this controller object. |
diff --git a/drivers/scsi/isci/core/scic_sds_controller_registers.h b/drivers/scsi/isci/core/scic_sds_controller_registers.h deleted file mode 100644 index b7bec92ee59c..000000000000 --- a/drivers/scsi/isci/core/scic_sds_controller_registers.h +++ /dev/null | |||
@@ -1,463 +0,0 @@ | |||
1 | /* | ||
2 | * This file is provided under a dual BSD/GPLv2 license. When using or | ||
3 | * redistributing this file, you may do so under either license. | ||
4 | * | ||
5 | * GPL LICENSE SUMMARY | ||
6 | * | ||
7 | * Copyright(c) 2008 - 2011 Intel Corporation. All rights reserved. | ||
8 | * | ||
9 | * This program is free software; you can redistribute it and/or modify | ||
10 | * it under the terms of version 2 of the GNU General Public License as | ||
11 | * published by the Free Software Foundation. | ||
12 | * | ||
13 | * This program is distributed in the hope that it will be useful, but | ||
14 | * WITHOUT ANY WARRANTY; without even the implied warranty of | ||
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
16 | * General Public License for more details. | ||
17 | * | ||
18 | * You should have received a copy of the GNU General Public License | ||
19 | * along with this program; if not, write to the Free Software | ||
20 | * Foundation, Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. | ||
21 | * The full GNU General Public License is included in this distribution | ||
22 | * in the file called LICENSE.GPL. | ||
23 | * | ||
24 | * BSD LICENSE | ||
25 | * | ||
26 | * Copyright(c) 2008 - 2011 Intel Corporation. All rights reserved. | ||
27 | * All rights reserved. | ||
28 | * | ||
29 | * Redistribution and use in source and binary forms, with or without | ||
30 | * modification, are permitted provided that the following conditions | ||
31 | * are met: | ||
32 | * | ||
33 | * * Redistributions of source code must retain the above copyright | ||
34 | * notice, this list of conditions and the following disclaimer. | ||
35 | * * Redistributions in binary form must reproduce the above copyright | ||
36 | * notice, this list of conditions and the following disclaimer in | ||
37 | * the documentation and/or other materials provided with the | ||
38 | * distribution. | ||
39 | * * Neither the name of Intel Corporation nor the names of its | ||
40 | * contributors may be used to endorse or promote products derived | ||
41 | * from this software without specific prior written permission. | ||
42 | * | ||
43 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | ||
44 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | ||
45 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | ||
46 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | ||
47 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
48 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | ||
49 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | ||
50 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | ||
51 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
52 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | ||
53 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
54 | */ | ||
55 | |||
56 | #ifndef _SCIC_SDS_CONTROLLER_REGISTERS_H_ | ||
57 | #define _SCIC_SDS_CONTROLLER_REGISTERS_H_ | ||
58 | |||
59 | /** | ||
60 | * This file contains macros used to perform the register reads/writes to the | ||
61 | * SCU hardware. | ||
62 | * | ||
63 | * | ||
64 | */ | ||
65 | |||
66 | #include "scu_registers.h" | ||
67 | #include "scic_sds_controller.h" | ||
68 | |||
69 | /** | ||
70 | * scic_sds_controller_smu_register_read() - | ||
71 | * | ||
72 | * SMU_REGISTER_ACCESS_MACROS | ||
73 | */ | ||
74 | #define scic_sds_controller_smu_register_read(controller, reg) \ | ||
75 | smu_register_read(\ | ||
76 | (controller), \ | ||
77 | (controller)->smu_registers->reg \ | ||
78 | ) | ||
79 | |||
80 | #define scic_sds_controller_smu_register_write(controller, reg, value) \ | ||
81 | smu_register_write(\ | ||
82 | (controller), \ | ||
83 | (controller)->smu_registers->reg, \ | ||
84 | (value) \ | ||
85 | ) | ||
86 | |||
87 | /** | ||
88 | * scu_afe_register_write() - | ||
89 | * | ||
90 | * AFE_REGISTER_ACCESS_MACROS | ||
91 | */ | ||
92 | #define scu_afe_register_write(controller, reg, value) \ | ||
93 | scu_register_write(\ | ||
94 | (controller), \ | ||
95 | (controller)->scu_registers->afe.reg, \ | ||
96 | (value) \ | ||
97 | ) | ||
98 | |||
99 | #define scu_afe_txreg_write(controller, phy, reg, value) \ | ||
100 | scu_register_write(\ | ||
101 | (controller), \ | ||
102 | (controller)->scu_registers->afe.scu_afe_xcvr[phy].reg,\ | ||
103 | (value) \ | ||
104 | ) | ||
105 | |||
106 | #define scu_afe_register_read(controller, reg) \ | ||
107 | scu_register_read(\ | ||
108 | (controller), \ | ||
109 | (controller)->scu_registers->afe.reg \ | ||
110 | ) | ||
111 | |||
112 | /** | ||
113 | * scu_controller_viit_register_write() - | ||
114 | * | ||
115 | * VIIT_REGISTER_ACCESS_MACROS | ||
116 | */ | ||
117 | #define scu_controller_viit_register_write(controller, index, reg, value) \ | ||
118 | scu_register_write(\ | ||
119 | (controller), \ | ||
120 | (controller)->scu_registers->peg0.viit[index].reg, \ | ||
121 | value \ | ||
122 | ) | ||
123 | |||
124 | /* | ||
125 | * ***************************************************************************** | ||
126 | * * SMU REGISTERS | ||
127 | * ***************************************************************************** */ | ||
128 | |||
129 | /** | ||
130 | * SMU_PCP_WRITE() - | ||
131 | * | ||
132 | * struct smu_registers | ||
133 | */ | ||
134 | #define SMU_PCP_WRITE(controller, value) \ | ||
135 | scic_sds_controller_smu_register_write(\ | ||
136 | controller, post_context_port, value \ | ||
137 | ) | ||
138 | |||
139 | #define SMU_TCR_READ(controller, value) \ | ||
140 | scic_sds_controller_smu_register_read(\ | ||
141 | controller, task_context_range \ | ||
142 | ) | ||
143 | |||
144 | #define SMU_TCR_WRITE(controller, value) \ | ||
145 | scic_sds_controller_smu_register_write(\ | ||
146 | controller, task_context_range, value \ | ||
147 | ) | ||
148 | |||
149 | #define SMU_HTTBAR_WRITE(controller, address) \ | ||
150 | { \ | ||
151 | scic_sds_controller_smu_register_write(\ | ||
152 | controller, \ | ||
153 | host_task_table_lower, \ | ||
154 | lower_32_bits(address) \ | ||
155 | ); \ | ||
156 | scic_sds_controller_smu_register_write(\ | ||
157 | controller, \ | ||
158 | host_task_table_upper, \ | ||
159 | upper_32_bits(address) \ | ||
160 | ); \ | ||
161 | } | ||
162 | |||
163 | #define SMU_CQBAR_WRITE(controller, address) \ | ||
164 | { \ | ||
165 | scic_sds_controller_smu_register_write(\ | ||
166 | controller, \ | ||
167 | completion_queue_lower, \ | ||
168 | lower_32_bits(address) \ | ||
169 | ); \ | ||
170 | scic_sds_controller_smu_register_write(\ | ||
171 | controller, \ | ||
172 | completion_queue_upper, \ | ||
173 | upper_32_bits(address) \ | ||
174 | ); \ | ||
175 | } | ||
176 | |||
177 | #define SMU_CQGR_WRITE(controller, value) \ | ||
178 | scic_sds_controller_smu_register_write(\ | ||
179 | controller, completion_queue_get, value \ | ||
180 | ) | ||
181 | |||
182 | #define SMU_CQGR_READ(controller, value) \ | ||
183 | scic_sds_controller_smu_register_read(\ | ||
184 | controller, completion_queue_get \ | ||
185 | ) | ||
186 | |||
187 | #define SMU_CQPR_WRITE(controller, value) \ | ||
188 | scic_sds_controller_smu_register_write(\ | ||
189 | controller, completion_queue_put, value \ | ||
190 | ) | ||
191 | |||
192 | #define SMU_RNCBAR_WRITE(controller, address) \ | ||
193 | { \ | ||
194 | scic_sds_controller_smu_register_write(\ | ||
195 | controller, \ | ||
196 | remote_node_context_lower, \ | ||
197 | lower_32_bits(address) \ | ||
198 | ); \ | ||
199 | scic_sds_controller_smu_register_write(\ | ||
200 | controller, \ | ||
201 | remote_node_context_upper, \ | ||
202 | upper_32_bits(address) \ | ||
203 | ); \ | ||
204 | } | ||
205 | |||
206 | #define SMU_AMR_READ(controller) \ | ||
207 | scic_sds_controller_smu_register_read(\ | ||
208 | controller, address_modifier \ | ||
209 | ) | ||
210 | |||
211 | #define SMU_IMR_READ(controller) \ | ||
212 | scic_sds_controller_smu_register_read(\ | ||
213 | controller, interrupt_mask \ | ||
214 | ) | ||
215 | |||
216 | #define SMU_IMR_WRITE(controller, mask) \ | ||
217 | scic_sds_controller_smu_register_write(\ | ||
218 | controller, interrupt_mask, mask \ | ||
219 | ) | ||
220 | |||
221 | #define SMU_ISR_READ(controller) \ | ||
222 | scic_sds_controller_smu_register_read(\ | ||
223 | controller, interrupt_status \ | ||
224 | ) | ||
225 | |||
226 | #define SMU_ISR_WRITE(controller, status) \ | ||
227 | scic_sds_controller_smu_register_write(\ | ||
228 | controller, interrupt_status, status \ | ||
229 | ) | ||
230 | |||
231 | #define SMU_ICC_READ(controller) \ | ||
232 | scic_sds_controller_smu_register_read(\ | ||
233 | controller, interrupt_coalesce_control \ | ||
234 | ) | ||
235 | |||
236 | #define SMU_ICC_WRITE(controller, value) \ | ||
237 | scic_sds_controller_smu_register_write(\ | ||
238 | controller, interrupt_coalesce_control, value \ | ||
239 | ) | ||
240 | |||
241 | #define SMU_CQC_WRITE(controller, value) \ | ||
242 | scic_sds_controller_smu_register_write(\ | ||
243 | controller, completion_queue_control, value \ | ||
244 | ) | ||
245 | |||
246 | #define SMU_SMUSRCR_WRITE(controller, value) \ | ||
247 | scic_sds_controller_smu_register_write(\ | ||
248 | controller, soft_reset_control, value \ | ||
249 | ) | ||
250 | |||
251 | #define SMU_TCA_WRITE(controller, index, value) \ | ||
252 | scic_sds_controller_smu_register_write(\ | ||
253 | controller, task_context_assignment[index], value \ | ||
254 | ) | ||
255 | |||
256 | #define SMU_TCA_READ(controller, index) \ | ||
257 | scic_sds_controller_smu_register_read(\ | ||
258 | controller, task_context_assignment[index] \ | ||
259 | ) | ||
260 | |||
261 | #define SMU_DCC_READ(controller) \ | ||
262 | scic_sds_controller_smu_register_read(\ | ||
263 | controller, device_context_capacity \ | ||
264 | ) | ||
265 | |||
266 | #define SMU_DFC_READ(controller) \ | ||
267 | scic_sds_controller_smu_register_read(\ | ||
268 | controller, device_function_capacity \ | ||
269 | ) | ||
270 | |||
271 | #define SMU_SMUCSR_READ(controller) \ | ||
272 | scic_sds_controller_smu_register_read(\ | ||
273 | controller, control_status \ | ||
274 | ) | ||
275 | |||
276 | #define SMU_CQPR_READ(controller) \ | ||
277 | scic_sds_controller_smu_register_read(\ | ||
278 | controller, completion_queue_put \ | ||
279 | ) | ||
280 | |||
281 | |||
282 | /** | ||
283 | * scic_sds_controller_scu_register_read() - | ||
284 | * | ||
285 | * SCU_REGISTER_ACCESS_MACROS | ||
286 | */ | ||
287 | #define scic_sds_controller_scu_register_read(controller, reg) \ | ||
288 | scu_register_read(\ | ||
289 | (controller), \ | ||
290 | (controller)->scu_registers->reg \ | ||
291 | ) | ||
292 | |||
293 | #define scic_sds_controller_scu_register_write(controller, reg, value) \ | ||
294 | scu_register_write(\ | ||
295 | (controller), \ | ||
296 | (controller)->scu_registers->reg, \ | ||
297 | (value) \ | ||
298 | ) | ||
299 | |||
300 | |||
301 | /* | ||
302 | * **************************************************************************** | ||
303 | * * SCU SDMA REGISTERS | ||
304 | * **************************************************************************** */ | ||
305 | |||
306 | /** | ||
307 | * scu_sdma_register_read() - | ||
308 | * | ||
309 | * SCU_SDMA_REGISTER_ACCESS_MACROS | ||
310 | */ | ||
311 | #define scu_sdma_register_read(controller, reg) \ | ||
312 | scu_register_read(\ | ||
313 | (controller), \ | ||
314 | (controller)->scu_registers->sdma.reg \ | ||
315 | ) | ||
316 | |||
317 | #define scu_sdma_register_write(controller, reg, value) \ | ||
318 | scu_register_write(\ | ||
319 | (controller), \ | ||
320 | (controller)->scu_registers->sdma.reg, \ | ||
321 | (value) \ | ||
322 | ) | ||
323 | |||
324 | /** | ||
325 | * SCU_PUFATHAR_WRITE() - | ||
326 | * | ||
327 | * struct scu_sdma_registers | ||
328 | */ | ||
329 | #define SCU_PUFATHAR_WRITE(controller, address) \ | ||
330 | { \ | ||
331 | scu_sdma_register_write(\ | ||
332 | controller, \ | ||
333 | uf_address_table_lower, \ | ||
334 | lower_32_bits(address) \ | ||
335 | ); \ | ||
336 | scu_sdma_register_write(\ | ||
337 | controller, \ | ||
338 | uf_address_table_upper, \ | ||
339 | upper_32_bits(address) \ | ||
340 | ); \ | ||
341 | } | ||
342 | |||
343 | #define SCU_UFHBAR_WRITE(controller, address) \ | ||
344 | { \ | ||
345 | scu_sdma_register_write(\ | ||
346 | controller, \ | ||
347 | uf_header_base_address_lower, \ | ||
348 | lower_32_bits(address) \ | ||
349 | ); \ | ||
350 | scu_sdma_register_write(\ | ||
351 | controller, \ | ||
352 | uf_header_base_address_upper, \ | ||
353 | upper_32_bits(address) \ | ||
354 | ); \ | ||
355 | } | ||
356 | |||
357 | #define SCU_UFQC_READ(controller) \ | ||
358 | scu_sdma_register_read(\ | ||
359 | controller, \ | ||
360 | unsolicited_frame_queue_control \ | ||
361 | ) | ||
362 | |||
363 | #define SCU_UFQC_WRITE(controller, value) \ | ||
364 | scu_sdma_register_write(\ | ||
365 | controller, \ | ||
366 | unsolicited_frame_queue_control, \ | ||
367 | value \ | ||
368 | ) | ||
369 | |||
370 | #define SCU_UFQPP_READ(controller) \ | ||
371 | scu_sdma_register_read(\ | ||
372 | controller, \ | ||
373 | unsolicited_frame_put_pointer \ | ||
374 | ) | ||
375 | |||
376 | #define SCU_UFQPP_WRITE(controller, value) \ | ||
377 | scu_sdma_register_write(\ | ||
378 | controller, \ | ||
379 | unsolicited_frame_put_pointer, \ | ||
380 | value \ | ||
381 | ) | ||
382 | |||
383 | #define SCU_UFQGP_WRITE(controller, value) \ | ||
384 | scu_sdma_register_write(\ | ||
385 | controller, \ | ||
386 | unsolicited_frame_get_pointer, \ | ||
387 | value \ | ||
388 | ) | ||
389 | |||
390 | #define SCU_PDMACR_READ(controller) \ | ||
391 | scu_sdma_register_read(\ | ||
392 | controller, \ | ||
393 | pdma_configuration \ | ||
394 | ) | ||
395 | |||
396 | #define SCU_PDMACR_WRITE(controller, value) \ | ||
397 | scu_sdma_register_write(\ | ||
398 | controller, \ | ||
399 | pdma_configuration, \ | ||
400 | value \ | ||
401 | ) | ||
402 | |||
403 | #define SCU_CDMACR_READ(controller) \ | ||
404 | scu_sdma_register_read(\ | ||
405 | controller, \ | ||
406 | cdma_configuration \ | ||
407 | ) | ||
408 | |||
409 | #define SCU_CDMACR_WRITE(controller, value) \ | ||
410 | scu_sdma_register_write(\ | ||
411 | controller, \ | ||
412 | cdma_configuration, \ | ||
413 | value \ | ||
414 | ) | ||
415 | |||
416 | /* | ||
417 | * ***************************************************************************** | ||
418 | * * SCU Port Task Scheduler Group Registers | ||
419 | * ***************************************************************************** */ | ||
420 | |||
421 | /** | ||
422 | * scu_ptsg_register_read() - | ||
423 | * | ||
424 | * SCU_PTSG_REGISTER_ACCESS_MACROS | ||
425 | */ | ||
426 | #define scu_ptsg_register_read(controller, reg) \ | ||
427 | scu_register_read(\ | ||
428 | (controller), \ | ||
429 | (controller)->scu_registers->peg0.ptsg.reg \ | ||
430 | ) | ||
431 | |||
432 | #define scu_ptsg_register_write(controller, reg, value) \ | ||
433 | scu_register_write(\ | ||
434 | (controller), \ | ||
435 | (controller)->scu_registers->peg0.ptsg.reg, \ | ||
436 | (value) \ | ||
437 | ) | ||
438 | |||
439 | /** | ||
440 | * SCU_PTSGCR_READ() - | ||
441 | * | ||
442 | * SCU_PTSG_REGISTERS | ||
443 | */ | ||
444 | #define SCU_PTSGCR_READ(controller) \ | ||
445 | scu_ptsg_register_read(\ | ||
446 | (controller), \ | ||
447 | control \ | ||
448 | ) | ||
449 | |||
450 | #define SCU_PTSGCR_WRITE(controller, value) \ | ||
451 | scu_ptsg_register_write(\ | ||
452 | (controller), \ | ||
453 | control, \ | ||
454 | value \ | ||
455 | ) | ||
456 | |||
457 | #define SCU_PTSGRTC_READ(controller) \ | ||
458 | scu_ptsg_register_read(\ | ||
459 | contoller, \ | ||
460 | real_time_clock \ | ||
461 | ) | ||
462 | |||
463 | #endif /* _SCIC_SDS_CONTROLLER_REGISTERS_H_ */ | ||
diff --git a/drivers/scsi/isci/core/scic_sds_pci.h b/drivers/scsi/isci/core/scic_sds_pci.h deleted file mode 100644 index bf0cbcaac526..000000000000 --- a/drivers/scsi/isci/core/scic_sds_pci.h +++ /dev/null | |||
@@ -1,94 +0,0 @@ | |||
1 | /* | ||
2 | * This file is provided under a dual BSD/GPLv2 license. When using or | ||
3 | * redistributing this file, you may do so under either license. | ||
4 | * | ||
5 | * GPL LICENSE SUMMARY | ||
6 | * | ||
7 | * Copyright(c) 2008 - 2011 Intel Corporation. All rights reserved. | ||
8 | * | ||
9 | * This program is free software; you can redistribute it and/or modify | ||
10 | * it under the terms of version 2 of the GNU General Public License as | ||
11 | * published by the Free Software Foundation. | ||
12 | * | ||
13 | * This program is distributed in the hope that it will be useful, but | ||
14 | * WITHOUT ANY WARRANTY; without even the implied warranty of | ||
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
16 | * General Public License for more details. | ||
17 | * | ||
18 | * You should have received a copy of the GNU General Public License | ||
19 | * along with this program; if not, write to the Free Software | ||
20 | * Foundation, Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. | ||
21 | * The full GNU General Public License is included in this distribution | ||
22 | * in the file called LICENSE.GPL. | ||
23 | * | ||
24 | * BSD LICENSE | ||
25 | * | ||
26 | * Copyright(c) 2008 - 2011 Intel Corporation. All rights reserved. | ||
27 | * All rights reserved. | ||
28 | * | ||
29 | * Redistribution and use in source and binary forms, with or without | ||
30 | * modification, are permitted provided that the following conditions | ||
31 | * are met: | ||
32 | * | ||
33 | * * Redistributions of source code must retain the above copyright | ||
34 | * notice, this list of conditions and the following disclaimer. | ||
35 | * * Redistributions in binary form must reproduce the above copyright | ||
36 | * notice, this list of conditions and the following disclaimer in | ||
37 | * the documentation and/or other materials provided with the | ||
38 | * distribution. | ||
39 | * * Neither the name of Intel Corporation nor the names of its | ||
40 | * contributors may be used to endorse or promote products derived | ||
41 | * from this software without specific prior written permission. | ||
42 | * | ||
43 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | ||
44 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | ||
45 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | ||
46 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | ||
47 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
48 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | ||
49 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | ||
50 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | ||
51 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
52 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | ||
53 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
54 | */ | ||
55 | |||
56 | #ifndef _SCIC_SDS_PCI_H_ | ||
57 | #define _SCIC_SDS_PCI_H_ | ||
58 | |||
59 | /** | ||
60 | * This file contains the prototypes/macros utilized in writing out PCI data | ||
61 | * for the SCI core. | ||
62 | * | ||
63 | * | ||
64 | */ | ||
65 | |||
66 | #include <asm/io.h> | ||
67 | |||
68 | struct scic_sds_controller; | ||
69 | |||
70 | void scic_sds_pci_bar_initialization(struct scic_sds_controller *scic); | ||
71 | |||
72 | /* for debug we separate scu and smu accesses and require a controller */ | ||
73 | static inline u32 scic_sds_pci_read_smu_dword(struct scic_sds_controller *scic, void __iomem *addr) | ||
74 | { | ||
75 | return readl(addr); | ||
76 | } | ||
77 | |||
78 | static inline void scic_sds_pci_write_smu_dword(struct scic_sds_controller *scic, void __iomem *addr, u32 value) | ||
79 | { | ||
80 | writel(value, addr); | ||
81 | } | ||
82 | |||
83 | static inline u32 scic_sds_pci_read_scu_dword(struct scic_sds_controller *scic, void __iomem *addr) | ||
84 | { | ||
85 | return readl(addr); | ||
86 | } | ||
87 | |||
88 | static inline void scic_sds_pci_write_scu_dword(struct scic_sds_controller *scic, void __iomem *addr, u32 value) | ||
89 | { | ||
90 | writel(value, addr); | ||
91 | } | ||
92 | |||
93 | |||
94 | #endif /* _SCIC_SDS_PCI_H_ */ | ||
diff --git a/drivers/scsi/isci/core/scic_sds_phy.c b/drivers/scsi/isci/core/scic_sds_phy.c index 532338eb302b..c26e5df18142 100644 --- a/drivers/scsi/isci/core/scic_sds_phy.c +++ b/drivers/scsi/isci/core/scic_sds_phy.c | |||
@@ -60,7 +60,6 @@ | |||
60 | #include "scic_phy.h" | 60 | #include "scic_phy.h" |
61 | #include "scic_sds_controller.h" | 61 | #include "scic_sds_controller.h" |
62 | #include "scic_sds_phy.h" | 62 | #include "scic_sds_phy.h" |
63 | #include "scic_sds_phy_registers.h" | ||
64 | #include "scic_sds_port.h" | 63 | #include "scic_sds_port.h" |
65 | #include "scic_sds_remote_node_context.h" | 64 | #include "scic_sds_remote_node_context.h" |
66 | #include "sci_environment.h" | 65 | #include "sci_environment.h" |
@@ -98,12 +97,13 @@ static enum sci_status scic_sds_phy_transport_layer_initialization( | |||
98 | 97 | ||
99 | this_phy->transport_layer_registers = transport_layer_registers; | 98 | this_phy->transport_layer_registers = transport_layer_registers; |
100 | 99 | ||
101 | SCU_STPTLDARNI_WRITE(this_phy, SCIC_SDS_REMOTE_NODE_CONTEXT_INVALID_INDEX); | 100 | writel(SCIC_SDS_REMOTE_NODE_CONTEXT_INVALID_INDEX, |
101 | &this_phy->transport_layer_registers->stp_rni); | ||
102 | 102 | ||
103 | /* Hardware team recommends that we enable the STP prefetch for all transports */ | 103 | /* Hardware team recommends that we enable the STP prefetch for all transports */ |
104 | tl_control = SCU_TLCR_READ(this_phy); | 104 | tl_control = readl(&this_phy->transport_layer_registers->control); |
105 | tl_control |= SCU_TLCR_GEN_BIT(STP_WRITE_DATA_PREFETCH); | 105 | tl_control |= SCU_TLCR_GEN_BIT(STP_WRITE_DATA_PREFETCH); |
106 | SCU_TLCR_WRITE(this_phy, tl_control); | 106 | writel(tl_control, &this_phy->transport_layer_registers->control); |
107 | 107 | ||
108 | return SCI_SUCCESS; | 108 | return SCI_SUCCESS; |
109 | } | 109 | } |
@@ -135,30 +135,36 @@ scic_sds_phy_link_layer_initialization(struct scic_sds_phy *sci_phy, | |||
135 | /* Set our IDENTIFY frame data */ | 135 | /* Set our IDENTIFY frame data */ |
136 | #define SCI_END_DEVICE 0x01 | 136 | #define SCI_END_DEVICE 0x01 |
137 | 137 | ||
138 | SCU_SAS_TIID_WRITE(sci_phy, (SCU_SAS_TIID_GEN_BIT(SMP_INITIATOR) | | 138 | writel(SCU_SAS_TIID_GEN_BIT(SMP_INITIATOR) | |
139 | SCU_SAS_TIID_GEN_BIT(SSP_INITIATOR) | | 139 | SCU_SAS_TIID_GEN_BIT(SSP_INITIATOR) | |
140 | SCU_SAS_TIID_GEN_BIT(STP_INITIATOR) | | 140 | SCU_SAS_TIID_GEN_BIT(STP_INITIATOR) | |
141 | SCU_SAS_TIID_GEN_BIT(DA_SATA_HOST) | | 141 | SCU_SAS_TIID_GEN_BIT(DA_SATA_HOST) | |
142 | SCU_SAS_TIID_GEN_VAL(DEVICE_TYPE, SCI_END_DEVICE))); | 142 | SCU_SAS_TIID_GEN_VAL(DEVICE_TYPE, SCI_END_DEVICE), |
143 | &sci_phy->link_layer_registers->transmit_identification); | ||
143 | 144 | ||
144 | /* Write the device SAS Address */ | 145 | /* Write the device SAS Address */ |
145 | SCU_SAS_TIDNH_WRITE(sci_phy, 0xFEDCBA98); | 146 | writel(0xFEDCBA98, &sci_phy->link_layer_registers->sas_device_name_high); |
146 | SCU_SAS_TIDNL_WRITE(sci_phy, phy_idx); | 147 | writel(phy_idx, &sci_phy->link_layer_registers->sas_device_name_low); |
147 | 148 | ||
148 | /* Write the source SAS Address */ | 149 | /* Write the source SAS Address */ |
149 | SCU_SAS_TISSAH_WRITE(sci_phy, phy_oem->sas_address.high); | 150 | writel(phy_oem->sas_address.high, |
150 | SCU_SAS_TISSAL_WRITE(sci_phy, phy_oem->sas_address.low); | 151 | &sci_phy->link_layer_registers->source_sas_address_high); |
152 | writel(phy_oem->sas_address.low, | ||
153 | &sci_phy->link_layer_registers->source_sas_address_low); | ||
151 | 154 | ||
152 | /* Clear and Set the PHY Identifier */ | 155 | /* Clear and Set the PHY Identifier */ |
153 | SCU_SAS_TIPID_WRITE(sci_phy, 0x00000000); | 156 | writel(0, &sci_phy->link_layer_registers->identify_frame_phy_id); |
154 | SCU_SAS_TIPID_WRITE(sci_phy, SCU_SAS_TIPID_GEN_VALUE(ID, phy_idx)); | 157 | writel(SCU_SAS_TIPID_GEN_VALUE(ID, phy_idx), |
158 | &sci_phy->link_layer_registers->identify_frame_phy_id); | ||
155 | 159 | ||
156 | /* Change the initial state of the phy configuration register */ | 160 | /* Change the initial state of the phy configuration register */ |
157 | phy_configuration = SCU_SAS_PCFG_READ(sci_phy); | 161 | phy_configuration = |
162 | readl(&sci_phy->link_layer_registers->phy_configuration); | ||
158 | 163 | ||
159 | /* Hold OOB state machine in reset */ | 164 | /* Hold OOB state machine in reset */ |
160 | phy_configuration |= SCU_SAS_PCFG_GEN_BIT(OOB_RESET); | 165 | phy_configuration |= SCU_SAS_PCFG_GEN_BIT(OOB_RESET); |
161 | SCU_SAS_PCFG_WRITE(sci_phy, phy_configuration); | 166 | writel(phy_configuration, |
167 | &sci_phy->link_layer_registers->phy_configuration); | ||
162 | 168 | ||
163 | /* Configure the SNW capabilities */ | 169 | /* Configure the SNW capabilities */ |
164 | phy_capabilities.u.all = 0; | 170 | phy_capabilities.u.all = 0; |
@@ -188,13 +194,15 @@ scic_sds_phy_link_layer_initialization(struct scic_sds_phy *sci_phy, | |||
188 | if ((parity_count % 2) != 0) | 194 | if ((parity_count % 2) != 0) |
189 | phy_capabilities.u.bits.parity = 1; | 195 | phy_capabilities.u.bits.parity = 1; |
190 | 196 | ||
191 | SCU_SAS_PHYCAP_WRITE(sci_phy, phy_capabilities.u.all); | 197 | writel(phy_capabilities.u.all, |
198 | &sci_phy->link_layer_registers->phy_capabilities); | ||
192 | 199 | ||
193 | /* Set the enable spinup period but disable the ability to send | 200 | /* Set the enable spinup period but disable the ability to send |
194 | * notify enable spinup | 201 | * notify enable spinup |
195 | */ | 202 | */ |
196 | SCU_SAS_ENSPINUP_WRITE(sci_phy, SCU_ENSPINUP_GEN_VAL(COUNT, | 203 | writel(SCU_ENSPINUP_GEN_VAL(COUNT, |
197 | phy_user->notify_enable_spin_up_insertion_frequency)); | 204 | phy_user->notify_enable_spin_up_insertion_frequency), |
205 | &sci_phy->link_layer_registers->notify_enable_spinup_control); | ||
198 | 206 | ||
199 | /* Write the ALIGN Insertion Ferequency for connected phy and | 207 | /* Write the ALIGN Insertion Ferequency for connected phy and |
200 | * inpendent of connected state | 208 | * inpendent of connected state |
@@ -205,10 +213,11 @@ scic_sds_phy_link_layer_initialization(struct scic_sds_phy *sci_phy, | |||
205 | clksm_value |= SCU_ALIGN_INSERTION_FREQUENCY_GEN_VAL(GENERAL, | 213 | clksm_value |= SCU_ALIGN_INSERTION_FREQUENCY_GEN_VAL(GENERAL, |
206 | phy_user->align_insertion_frequency); | 214 | phy_user->align_insertion_frequency); |
207 | 215 | ||
208 | SCU_SAS_CLKSM_WRITE(sci_phy, clksm_value); | 216 | writel(clksm_value, &sci_phy->link_layer_registers->clock_skew_management); |
209 | 217 | ||
210 | /* @todo Provide a way to write this register correctly */ | 218 | /* @todo Provide a way to write this register correctly */ |
211 | scu_link_layer_register_write(sci_phy, afe_lookup_table_control, 0x02108421); | 219 | writel(0x02108421, |
220 | &sci_phy->link_layer_registers->afe_lookup_table_control); | ||
212 | 221 | ||
213 | llctl = SCU_SAS_LLCTL_GEN_VAL(NO_OUTBOUND_TASK_TIMEOUT, | 222 | llctl = SCU_SAS_LLCTL_GEN_VAL(NO_OUTBOUND_TASK_TIMEOUT, |
214 | (u8)scic->user_parameters.sds1.no_outbound_task_timeout); | 223 | (u8)scic->user_parameters.sds1.no_outbound_task_timeout); |
@@ -225,8 +234,7 @@ scic_sds_phy_link_layer_initialization(struct scic_sds_phy *sci_phy, | |||
225 | break; | 234 | break; |
226 | } | 235 | } |
227 | llctl |= SCU_SAS_LLCTL_GEN_VAL(MAX_LINK_RATE, link_rate); | 236 | llctl |= SCU_SAS_LLCTL_GEN_VAL(MAX_LINK_RATE, link_rate); |
228 | 237 | writel(llctl, &sci_phy->link_layer_registers->link_layer_control); | |
229 | scu_link_layer_register_write(sci_phy, link_layer_control, llctl); | ||
230 | 238 | ||
231 | if (is_a0() || is_a2()) { | 239 | if (is_a0() || is_a2()) { |
232 | /* Program the max ARB time for the PHY to 700us so we inter-operate with | 240 | /* Program the max ARB time for the PHY to 700us so we inter-operate with |
@@ -234,16 +242,15 @@ scic_sds_phy_link_layer_initialization(struct scic_sds_phy *sci_phy, | |||
234 | * many breaks. This time value will guarantee that the initiator PHY will | 242 | * many breaks. This time value will guarantee that the initiator PHY will |
235 | * generate the break. | 243 | * generate the break. |
236 | */ | 244 | */ |
237 | scu_link_layer_register_write(sci_phy, | 245 | writel(SCIC_SDS_PHY_MAX_ARBITRATION_WAIT_TIME, |
238 | maximum_arbitration_wait_timer_timeout, | 246 | &sci_phy->link_layer_registers->maximum_arbitration_wait_timer_timeout); |
239 | SCIC_SDS_PHY_MAX_ARBITRATION_WAIT_TIME); | ||
240 | } | 247 | } |
241 | 248 | ||
242 | /* | 249 | /* |
243 | * Set the link layer hang detection to 500ms (0x1F4) from its default | 250 | * Set the link layer hang detection to 500ms (0x1F4) from its default |
244 | * value of 128ms. Max value is 511 ms. */ | 251 | * value of 128ms. Max value is 511 ms. |
245 | scu_link_layer_register_write(sci_phy, link_layer_hang_detection_timeout, | 252 | */ |
246 | 0x1F4); | 253 | writel(0x1F4, &sci_phy->link_layer_registers->link_layer_hang_detection_timeout); |
247 | 254 | ||
248 | /* We can exit the initial state to the stopped state */ | 255 | /* We can exit the initial state to the stopped state */ |
249 | sci_base_state_machine_change_state(&sci_phy->parent.state_machine, | 256 | sci_base_state_machine_change_state(&sci_phy->parent.state_machine, |
@@ -367,15 +374,15 @@ void scic_sds_phy_setup_transport( | |||
367 | { | 374 | { |
368 | u32 tl_control; | 375 | u32 tl_control; |
369 | 376 | ||
370 | SCU_STPTLDARNI_WRITE(this_phy, device_id); | 377 | writel(device_id, &this_phy->transport_layer_registers->stp_rni); |
371 | 378 | ||
372 | /* | 379 | /* |
373 | * The read should guarantee that the first write gets posted | 380 | * The read should guarantee that the first write gets posted |
374 | * before the next write | 381 | * before the next write |
375 | */ | 382 | */ |
376 | tl_control = SCU_TLCR_READ(this_phy); | 383 | tl_control = readl(&this_phy->transport_layer_registers->control); |
377 | tl_control |= SCU_TLCR_GEN_BIT(CLEAR_TCI_NCQ_MAPPING_TABLE); | 384 | tl_control |= SCU_TLCR_GEN_BIT(CLEAR_TCI_NCQ_MAPPING_TABLE); |
378 | SCU_TLCR_WRITE(this_phy, tl_control); | 385 | writel(tl_control, &this_phy->transport_layer_registers->control); |
379 | } | 386 | } |
380 | 387 | ||
381 | /** | 388 | /** |
@@ -390,9 +397,12 @@ static void scic_sds_phy_suspend( | |||
390 | { | 397 | { |
391 | u32 scu_sas_pcfg_value; | 398 | u32 scu_sas_pcfg_value; |
392 | 399 | ||
393 | scu_sas_pcfg_value = SCU_SAS_PCFG_READ(this_phy); | 400 | scu_sas_pcfg_value = |
401 | readl(&this_phy->link_layer_registers->phy_configuration); | ||
394 | scu_sas_pcfg_value |= SCU_SAS_PCFG_GEN_BIT(SUSPEND_PROTOCOL_ENGINE); | 402 | scu_sas_pcfg_value |= SCU_SAS_PCFG_GEN_BIT(SUSPEND_PROTOCOL_ENGINE); |
395 | SCU_SAS_PCFG_WRITE(this_phy, scu_sas_pcfg_value); | 403 | writel(scu_sas_pcfg_value, |
404 | &this_phy->link_layer_registers->phy_configuration); | ||
405 | |||
396 | scic_sds_phy_setup_transport(this_phy, SCIC_SDS_REMOTE_NODE_CONTEXT_INVALID_INDEX); | 406 | scic_sds_phy_setup_transport(this_phy, SCIC_SDS_REMOTE_NODE_CONTEXT_INVALID_INDEX); |
397 | } | 407 | } |
398 | 408 | ||
@@ -408,11 +418,11 @@ void scic_sds_phy_resume( | |||
408 | { | 418 | { |
409 | u32 scu_sas_pcfg_value; | 419 | u32 scu_sas_pcfg_value; |
410 | 420 | ||
411 | scu_sas_pcfg_value = SCU_SAS_PCFG_READ(this_phy); | 421 | scu_sas_pcfg_value = |
412 | 422 | readl(&this_phy->link_layer_registers->phy_configuration); | |
413 | scu_sas_pcfg_value &= ~SCU_SAS_PCFG_GEN_BIT(SUSPEND_PROTOCOL_ENGINE); | 423 | scu_sas_pcfg_value &= ~SCU_SAS_PCFG_GEN_BIT(SUSPEND_PROTOCOL_ENGINE); |
414 | 424 | writel(scu_sas_pcfg_value, | |
415 | SCU_SAS_PCFG_WRITE(this_phy, scu_sas_pcfg_value); | 425 | &this_phy->link_layer_registers->phy_configuration); |
416 | } | 426 | } |
417 | 427 | ||
418 | /** | 428 | /** |
@@ -427,8 +437,8 @@ void scic_sds_phy_get_sas_address( | |||
427 | struct scic_sds_phy *this_phy, | 437 | struct scic_sds_phy *this_phy, |
428 | struct sci_sas_address *sas_address) | 438 | struct sci_sas_address *sas_address) |
429 | { | 439 | { |
430 | sas_address->high = SCU_SAS_TISSAH_READ(this_phy); | 440 | sas_address->high = readl(&this_phy->link_layer_registers->source_sas_address_high); |
431 | sas_address->low = SCU_SAS_TISSAL_READ(this_phy); | 441 | sas_address->low = readl(&this_phy->link_layer_registers->source_sas_address_low); |
432 | } | 442 | } |
433 | 443 | ||
434 | /** | 444 | /** |
@@ -460,7 +470,10 @@ void scic_sds_phy_get_protocols( | |||
460 | struct scic_sds_phy *this_phy, | 470 | struct scic_sds_phy *this_phy, |
461 | struct sci_sas_identify_address_frame_protocols *protocols) | 471 | struct sci_sas_identify_address_frame_protocols *protocols) |
462 | { | 472 | { |
463 | protocols->u.all = (u16)(SCU_SAS_TIID_READ(this_phy) & 0x0000FFFF); | 473 | protocols->u.all = |
474 | (u16)(readl(&this_phy-> | ||
475 | link_layer_registers->transmit_identification) & | ||
476 | 0x0000FFFF); | ||
464 | } | 477 | } |
465 | 478 | ||
466 | /** | 479 | /** |
@@ -589,8 +602,8 @@ enum sci_status scic_sas_phy_get_properties( | |||
589 | sizeof(struct sci_sas_identify_address_frame) | 602 | sizeof(struct sci_sas_identify_address_frame) |
590 | ); | 603 | ); |
591 | 604 | ||
592 | properties->received_capabilities.u.all | 605 | properties->received_capabilities.u.all = |
593 | = SCU_SAS_RECPHYCAP_READ(sci_phy); | 606 | readl(&sci_phy->link_layer_registers->receive_phycap); |
594 | 607 | ||
595 | return SCI_SUCCESS; | 608 | return SCI_SUCCESS; |
596 | } | 609 | } |
@@ -639,9 +652,11 @@ static void scic_sds_phy_start_sas_link_training( | |||
639 | { | 652 | { |
640 | u32 phy_control; | 653 | u32 phy_control; |
641 | 654 | ||
642 | phy_control = SCU_SAS_PCFG_READ(this_phy); | 655 | phy_control = |
656 | readl(&this_phy->link_layer_registers->phy_configuration); | ||
643 | phy_control |= SCU_SAS_PCFG_GEN_BIT(SATA_SPINUP_HOLD); | 657 | phy_control |= SCU_SAS_PCFG_GEN_BIT(SATA_SPINUP_HOLD); |
644 | SCU_SAS_PCFG_WRITE(this_phy, phy_control); | 658 | writel(phy_control, |
659 | &this_phy->link_layer_registers->phy_configuration); | ||
645 | 660 | ||
646 | sci_base_state_machine_change_state( | 661 | sci_base_state_machine_change_state( |
647 | &this_phy->starting_substate_machine, | 662 | &this_phy->starting_substate_machine, |
@@ -1331,9 +1346,9 @@ static enum sci_status scic_sds_phy_starting_substate_await_sas_power_consume_po | |||
1331 | { | 1346 | { |
1332 | u32 enable_spinup; | 1347 | u32 enable_spinup; |
1333 | 1348 | ||
1334 | enable_spinup = SCU_SAS_ENSPINUP_READ(sci_phy); | 1349 | enable_spinup = readl(&sci_phy->link_layer_registers->notify_enable_spinup_control); |
1335 | enable_spinup |= SCU_ENSPINUP_GEN_BIT(ENABLE); | 1350 | enable_spinup |= SCU_ENSPINUP_GEN_BIT(ENABLE); |
1336 | SCU_SAS_ENSPINUP_WRITE(sci_phy, enable_spinup); | 1351 | writel(enable_spinup, &sci_phy->link_layer_registers->notify_enable_spinup_control); |
1337 | 1352 | ||
1338 | /* Change state to the final state this substate machine has run to completion */ | 1353 | /* Change state to the final state this substate machine has run to completion */ |
1339 | sci_base_state_machine_change_state(&sci_phy->starting_substate_machine, | 1354 | sci_base_state_machine_change_state(&sci_phy->starting_substate_machine, |
@@ -1357,16 +1372,19 @@ static enum sci_status scic_sds_phy_starting_substate_await_sata_power_consume_p | |||
1357 | u32 scu_sas_pcfg_value; | 1372 | u32 scu_sas_pcfg_value; |
1358 | 1373 | ||
1359 | /* Release the spinup hold state and reset the OOB state machine */ | 1374 | /* Release the spinup hold state and reset the OOB state machine */ |
1360 | scu_sas_pcfg_value = SCU_SAS_PCFG_READ(sci_phy); | 1375 | scu_sas_pcfg_value = |
1376 | readl(&sci_phy->link_layer_registers->phy_configuration); | ||
1361 | scu_sas_pcfg_value &= | 1377 | scu_sas_pcfg_value &= |
1362 | ~(SCU_SAS_PCFG_GEN_BIT(SATA_SPINUP_HOLD) | SCU_SAS_PCFG_GEN_BIT(OOB_ENABLE)); | 1378 | ~(SCU_SAS_PCFG_GEN_BIT(SATA_SPINUP_HOLD) | SCU_SAS_PCFG_GEN_BIT(OOB_ENABLE)); |
1363 | scu_sas_pcfg_value |= SCU_SAS_PCFG_GEN_BIT(OOB_RESET); | 1379 | scu_sas_pcfg_value |= SCU_SAS_PCFG_GEN_BIT(OOB_RESET); |
1364 | SCU_SAS_PCFG_WRITE(sci_phy, scu_sas_pcfg_value); | 1380 | writel(scu_sas_pcfg_value, |
1381 | &sci_phy->link_layer_registers->phy_configuration); | ||
1365 | 1382 | ||
1366 | /* Now restart the OOB operation */ | 1383 | /* Now restart the OOB operation */ |
1367 | scu_sas_pcfg_value &= ~SCU_SAS_PCFG_GEN_BIT(OOB_RESET); | 1384 | scu_sas_pcfg_value &= ~SCU_SAS_PCFG_GEN_BIT(OOB_RESET); |
1368 | scu_sas_pcfg_value |= SCU_SAS_PCFG_GEN_BIT(OOB_ENABLE); | 1385 | scu_sas_pcfg_value |= SCU_SAS_PCFG_GEN_BIT(OOB_ENABLE); |
1369 | SCU_SAS_PCFG_WRITE(sci_phy, scu_sas_pcfg_value); | 1386 | writel(scu_sas_pcfg_value, |
1387 | &sci_phy->link_layer_registers->phy_configuration); | ||
1370 | 1388 | ||
1371 | /* Change state to the final state this substate machine has run to completion */ | 1389 | /* Change state to the final state this substate machine has run to completion */ |
1372 | sci_base_state_machine_change_state(&sci_phy->starting_substate_machine, | 1390 | sci_base_state_machine_change_state(&sci_phy->starting_substate_machine, |
@@ -2120,18 +2138,20 @@ static void scu_link_layer_stop_protocol_engine( | |||
2120 | u32 enable_spinup_value; | 2138 | u32 enable_spinup_value; |
2121 | 2139 | ||
2122 | /* Suspend the protocol engine and place it in a sata spinup hold state */ | 2140 | /* Suspend the protocol engine and place it in a sata spinup hold state */ |
2123 | scu_sas_pcfg_value = SCU_SAS_PCFG_READ(this_phy); | 2141 | scu_sas_pcfg_value = |
2142 | readl(&this_phy->link_layer_registers->phy_configuration); | ||
2124 | scu_sas_pcfg_value |= ( | 2143 | scu_sas_pcfg_value |= ( |
2125 | SCU_SAS_PCFG_GEN_BIT(OOB_RESET) | 2144 | SCU_SAS_PCFG_GEN_BIT(OOB_RESET) |
2126 | | SCU_SAS_PCFG_GEN_BIT(SUSPEND_PROTOCOL_ENGINE) | 2145 | | SCU_SAS_PCFG_GEN_BIT(SUSPEND_PROTOCOL_ENGINE) |
2127 | | SCU_SAS_PCFG_GEN_BIT(SATA_SPINUP_HOLD) | 2146 | | SCU_SAS_PCFG_GEN_BIT(SATA_SPINUP_HOLD) |
2128 | ); | 2147 | ); |
2129 | SCU_SAS_PCFG_WRITE(this_phy, scu_sas_pcfg_value); | 2148 | writel(scu_sas_pcfg_value, |
2149 | &this_phy->link_layer_registers->phy_configuration); | ||
2130 | 2150 | ||
2131 | /* Disable the notify enable spinup primitives */ | 2151 | /* Disable the notify enable spinup primitives */ |
2132 | enable_spinup_value = SCU_SAS_ENSPINUP_READ(this_phy); | 2152 | enable_spinup_value = readl(&this_phy->link_layer_registers->notify_enable_spinup_control); |
2133 | enable_spinup_value &= ~SCU_ENSPINUP_GEN_BIT(ENABLE); | 2153 | enable_spinup_value &= ~SCU_ENSPINUP_GEN_BIT(ENABLE); |
2134 | SCU_SAS_ENSPINUP_WRITE(this_phy, enable_spinup_value); | 2154 | writel(enable_spinup_value, &this_phy->link_layer_registers->notify_enable_spinup_control); |
2135 | } | 2155 | } |
2136 | 2156 | ||
2137 | /** | 2157 | /** |
@@ -2144,12 +2164,13 @@ static void scu_link_layer_start_oob( | |||
2144 | { | 2164 | { |
2145 | u32 scu_sas_pcfg_value; | 2165 | u32 scu_sas_pcfg_value; |
2146 | 2166 | ||
2147 | scu_sas_pcfg_value = SCU_SAS_PCFG_READ(this_phy); | 2167 | scu_sas_pcfg_value = |
2168 | readl(&this_phy->link_layer_registers->phy_configuration); | ||
2148 | scu_sas_pcfg_value |= SCU_SAS_PCFG_GEN_BIT(OOB_ENABLE); | 2169 | scu_sas_pcfg_value |= SCU_SAS_PCFG_GEN_BIT(OOB_ENABLE); |
2149 | scu_sas_pcfg_value &= | 2170 | scu_sas_pcfg_value &= |
2150 | ~(SCU_SAS_PCFG_GEN_BIT(OOB_RESET) | SCU_SAS_PCFG_GEN_BIT(HARD_RESET)); | 2171 | ~(SCU_SAS_PCFG_GEN_BIT(OOB_RESET) | SCU_SAS_PCFG_GEN_BIT(HARD_RESET)); |
2151 | 2172 | writel(scu_sas_pcfg_value, | |
2152 | SCU_SAS_PCFG_WRITE(this_phy, scu_sas_pcfg_value); | 2173 | &this_phy->link_layer_registers->phy_configuration); |
2153 | } | 2174 | } |
2154 | 2175 | ||
2155 | /** | 2176 | /** |
@@ -2168,15 +2189,18 @@ static void scu_link_layer_tx_hard_reset( | |||
2168 | /* | 2189 | /* |
2169 | * SAS Phys must wait for the HARD_RESET_TX event notification to transition | 2190 | * SAS Phys must wait for the HARD_RESET_TX event notification to transition |
2170 | * to the starting state. */ | 2191 | * to the starting state. */ |
2171 | phy_configuration_value = SCU_SAS_PCFG_READ(this_phy); | 2192 | phy_configuration_value = |
2193 | readl(&this_phy->link_layer_registers->phy_configuration); | ||
2172 | phy_configuration_value |= | 2194 | phy_configuration_value |= |
2173 | (SCU_SAS_PCFG_GEN_BIT(HARD_RESET) | SCU_SAS_PCFG_GEN_BIT(OOB_RESET)); | 2195 | (SCU_SAS_PCFG_GEN_BIT(HARD_RESET) | SCU_SAS_PCFG_GEN_BIT(OOB_RESET)); |
2174 | SCU_SAS_PCFG_WRITE(this_phy, phy_configuration_value); | 2196 | writel(phy_configuration_value, |
2197 | &this_phy->link_layer_registers->phy_configuration); | ||
2175 | 2198 | ||
2176 | /* Now take the OOB state machine out of reset */ | 2199 | /* Now take the OOB state machine out of reset */ |
2177 | phy_configuration_value |= SCU_SAS_PCFG_GEN_BIT(OOB_ENABLE); | 2200 | phy_configuration_value |= SCU_SAS_PCFG_GEN_BIT(OOB_ENABLE); |
2178 | phy_configuration_value &= ~SCU_SAS_PCFG_GEN_BIT(OOB_RESET); | 2201 | phy_configuration_value &= ~SCU_SAS_PCFG_GEN_BIT(OOB_RESET); |
2179 | SCU_SAS_PCFG_WRITE(this_phy, phy_configuration_value); | 2202 | writel(phy_configuration_value, |
2203 | &this_phy->link_layer_registers->phy_configuration); | ||
2180 | } | 2204 | } |
2181 | 2205 | ||
2182 | /* | 2206 | /* |
diff --git a/drivers/scsi/isci/core/scic_sds_phy_registers.h b/drivers/scsi/isci/core/scic_sds_phy_registers.h deleted file mode 100644 index ddbb2361510d..000000000000 --- a/drivers/scsi/isci/core/scic_sds_phy_registers.h +++ /dev/null | |||
@@ -1,248 +0,0 @@ | |||
1 | /* | ||
2 | * This file is provided under a dual BSD/GPLv2 license. When using or | ||
3 | * redistributing this file, you may do so under either license. | ||
4 | * | ||
5 | * GPL LICENSE SUMMARY | ||
6 | * | ||
7 | * Copyright(c) 2008 - 2011 Intel Corporation. All rights reserved. | ||
8 | * | ||
9 | * This program is free software; you can redistribute it and/or modify | ||
10 | * it under the terms of version 2 of the GNU General Public License as | ||
11 | * published by the Free Software Foundation. | ||
12 | * | ||
13 | * This program is distributed in the hope that it will be useful, but | ||
14 | * WITHOUT ANY WARRANTY; without even the implied warranty of | ||
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
16 | * General Public License for more details. | ||
17 | * | ||
18 | * You should have received a copy of the GNU General Public License | ||
19 | * along with this program; if not, write to the Free Software | ||
20 | * Foundation, Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. | ||
21 | * The full GNU General Public License is included in this distribution | ||
22 | * in the file called LICENSE.GPL. | ||
23 | * | ||
24 | * BSD LICENSE | ||
25 | * | ||
26 | * Copyright(c) 2008 - 2011 Intel Corporation. All rights reserved. | ||
27 | * All rights reserved. | ||
28 | * | ||
29 | * Redistribution and use in source and binary forms, with or without | ||
30 | * modification, are permitted provided that the following conditions | ||
31 | * are met: | ||
32 | * | ||
33 | * * Redistributions of source code must retain the above copyright | ||
34 | * notice, this list of conditions and the following disclaimer. | ||
35 | * * Redistributions in binary form must reproduce the above copyright | ||
36 | * notice, this list of conditions and the following disclaimer in | ||
37 | * the documentation and/or other materials provided with the | ||
38 | * distribution. | ||
39 | * * Neither the name of Intel Corporation nor the names of its | ||
40 | * contributors may be used to endorse or promote products derived | ||
41 | * from this software without specific prior written permission. | ||
42 | * | ||
43 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | ||
44 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | ||
45 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | ||
46 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | ||
47 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
48 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | ||
49 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | ||
50 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | ||
51 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
52 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | ||
53 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
54 | */ | ||
55 | |||
56 | #ifndef _SCIC_SDS_PHY_REGISTERS_H_ | ||
57 | #define _SCIC_SDS_PHY_REGISTERS_H_ | ||
58 | |||
59 | /** | ||
60 | * This file contains the macros used by the phy object to read/write to the | ||
61 | * SCU link layer registers. | ||
62 | * | ||
63 | * | ||
64 | */ | ||
65 | |||
66 | #include "scic_sds_controller.h" | ||
67 | |||
68 | /* ************************************************************************** | ||
69 | * * SCU TRANSPORT LAYER REGISTER OPERATIONS | ||
70 | * ************************************************************************** */ | ||
71 | |||
72 | /** | ||
73 | * Macro to read the transport layer register associated with this phy | ||
74 | * object. | ||
75 | */ | ||
76 | #define scu_transport_layer_read(phy, reg) \ | ||
77 | scu_register_read( \ | ||
78 | scic_sds_phy_get_controller(phy), \ | ||
79 | (phy)->transport_layer_registers->reg \ | ||
80 | ) | ||
81 | |||
82 | /** | ||
83 | * Macro to write the transport layer register associated with this phy | ||
84 | * object. | ||
85 | */ | ||
86 | #define scu_transport_layer_write(phy, reg, value) \ | ||
87 | scu_register_write( \ | ||
88 | scic_sds_phy_get_controller(phy), \ | ||
89 | (phy)->transport_layer_registers->reg, \ | ||
90 | (value) \ | ||
91 | ) | ||
92 | |||
93 | /* ************************************************************************** | ||
94 | * * Transport Layer registers controlled by the phy object | ||
95 | * ************************************************************************** */ | ||
96 | |||
97 | /* This macro reads the Transport layer control register */ | ||
98 | #define SCU_TLCR_READ(phy) \ | ||
99 | scu_transport_layer_read(phy, control) | ||
100 | |||
101 | /* This macro writes the Transport layer control register */ | ||
102 | #define SCU_TLCR_WRITE(phy, value) \ | ||
103 | scu_transport_layer_write(phy, control, value) | ||
104 | |||
105 | /* This macro reads the Transport layer address translation register */ | ||
106 | #define SCU_TLADTR_READ(phy) \ | ||
107 | scu_transport_layer_read(phy, address_translation) | ||
108 | |||
109 | /* This macro writes the Transport layer address translation register */ | ||
110 | #define SCU_TLADTR_WRITE(phy) \ | ||
111 | scu_transport_layer_write(phy, address_translation, value) | ||
112 | |||
113 | /* This macro writes the STP Transport Layer Direct Attached RNi register */ | ||
114 | #define SCU_STPTLDARNI_WRITE(phy, index) \ | ||
115 | scu_transport_layer_write(phy, stp_rni, index) | ||
116 | |||
117 | /* This macro reads the STP Transport Layer Direct Attached RNi register */ | ||
118 | #define SCU_STPTLDARNI_READ(phy) \ | ||
119 | scu_transport_layer_read(phy, stp_rni) | ||
120 | |||
121 | /* | ||
122 | * ***************************************************************************** | ||
123 | * * SCU LINK LAYER REGISTER OPERATIONS | ||
124 | * ***************************************************************************** */ | ||
125 | |||
126 | /** | ||
127 | * scu_link_layer_register_read() - | ||
128 | * | ||
129 | * THis macro requests the SCU register write for the specified link layer | ||
130 | * register. | ||
131 | */ | ||
132 | #define scu_link_layer_register_read(phy, reg) \ | ||
133 | scu_register_read(\ | ||
134 | scic_sds_phy_get_controller(phy), \ | ||
135 | (phy)->link_layer_registers->reg \ | ||
136 | ) | ||
137 | |||
138 | /** | ||
139 | * scu_link_layer_register_write() - | ||
140 | * | ||
141 | * This macro requests the SCU register read for the specified link layer | ||
142 | * register. | ||
143 | */ | ||
144 | #define scu_link_layer_register_write(phy, reg, value) \ | ||
145 | scu_register_write(\ | ||
146 | scic_sds_phy_get_controller(phy), \ | ||
147 | (phy)->link_layer_registers->reg, \ | ||
148 | (value) \ | ||
149 | ) | ||
150 | |||
151 | /* | ||
152 | * ***************************************************************************** | ||
153 | * * SCU LINK LAYER REGISTERS | ||
154 | * ***************************************************************************** */ | ||
155 | |||
156 | /* / This macro reads from the SAS Identify Frame PHY Identifier register */ | ||
157 | #define SCU_SAS_TIPID_READ(phy) \ | ||
158 | scu_link_layer_register_read(phy, identify_frame_phy_id) | ||
159 | |||
160 | /* / This macro writes to the SAS Identify Frame PHY Identifier register */ | ||
161 | #define SCU_SAS_TIPID_WRITE(phy, value) \ | ||
162 | scu_link_layer_register_write(phy, identify_frame_phy_id, value) | ||
163 | |||
164 | /* / This macro reads from the SAS Identification register */ | ||
165 | #define SCU_SAS_TIID_READ(phy) \ | ||
166 | scu_link_layer_register_read(phy, transmit_identification) | ||
167 | |||
168 | /* / This macro writes to the SAS Identification register */ | ||
169 | #define SCU_SAS_TIID_WRITE(phy, value) \ | ||
170 | scu_link_layer_register_write(phy, transmit_identification, value) | ||
171 | |||
172 | /* / This macro reads the SAS Device Name High register */ | ||
173 | #define SCU_SAS_TIDNH_READ(phy) \ | ||
174 | scu_link_layer_register_read(phy, sas_device_name_high) | ||
175 | |||
176 | /* / This macro writes the SAS Device Name High register */ | ||
177 | #define SCU_SAS_TIDNH_WRITE(phy, value) \ | ||
178 | scu_link_layer_register_write(phy, sas_device_name_high, value) | ||
179 | |||
180 | /* / This macro reads the SAS Device Name Low register */ | ||
181 | #define SCU_SAS_TIDNL_READ(phy) \ | ||
182 | scu_link_layer_register_read(phy, sas_device_name_low) | ||
183 | |||
184 | /* / This macro writes the SAS Device Name Low register */ | ||
185 | #define SCU_SAS_TIDNL_WRITE(phy, value) \ | ||
186 | scu_link_layer_register_write(phy, sas_device_name_low, value) | ||
187 | |||
188 | /* / This macro reads the Source SAS Address High register */ | ||
189 | #define SCU_SAS_TISSAH_READ(phy) \ | ||
190 | scu_link_layer_register_read(phy, source_sas_address_high) | ||
191 | |||
192 | /* / This macro writes the Source SAS Address High register */ | ||
193 | #define SCU_SAS_TISSAH_WRITE(phy, value) \ | ||
194 | scu_link_layer_register_write(phy, source_sas_address_high, value) | ||
195 | |||
196 | /* / This macro reads the Source SAS Address Low register */ | ||
197 | #define SCU_SAS_TISSAL_READ(phy) \ | ||
198 | scu_link_layer_register_read(phy, source_sas_address_low) | ||
199 | |||
200 | /* / This macro writes the Source SAS Address Low register */ | ||
201 | #define SCU_SAS_TISSAL_WRITE(phy, value) \ | ||
202 | scu_link_layer_register_write(phy, source_sas_address_low, value) | ||
203 | |||
204 | /* / This macro reads the PHY Configuration register */ | ||
205 | #define SCU_SAS_PCFG_READ(phy) \ | ||
206 | scu_link_layer_register_read(phy, phy_configuration); | ||
207 | |||
208 | /* / This macro writes the PHY Configuration register */ | ||
209 | #define SCU_SAS_PCFG_WRITE(phy, value) \ | ||
210 | scu_link_layer_register_write(phy, phy_configuration, value) | ||
211 | |||
212 | /* / This macro reads the PHY Enable Spinup register */ | ||
213 | #define SCU_SAS_ENSPINUP_READ(phy) \ | ||
214 | scu_link_layer_register_read(phy, notify_enable_spinup_control) | ||
215 | |||
216 | /* / This macro writes the PHY Enable Spinup register */ | ||
217 | #define SCU_SAS_ENSPINUP_WRITE(phy, value) \ | ||
218 | scu_link_layer_register_write(phy, notify_enable_spinup_control, value) | ||
219 | |||
220 | /* This macro reads the CLKSM register */ | ||
221 | #define SCU_SAS_CLKSM_READ(phy) \ | ||
222 | scu_link_layer_register_read(phy, clock_skew_management) | ||
223 | |||
224 | /* This macro writes the CLKSM register */ | ||
225 | #define SCU_SAS_CLKSM_WRITE(phy, value) \ | ||
226 | scu_link_layer_register_write(phy, clock_skew_management, value) | ||
227 | |||
228 | /* / This macro reads the PHY Capacity register */ | ||
229 | #define SCU_SAS_PHYCAP_READ(phy) \ | ||
230 | scu_link_layer_register_read(phy, phy_capabilities) | ||
231 | |||
232 | /* / This macro writes the PHY Capacity register */ | ||
233 | #define SCU_SAS_PHYCAP_WRITE(phy, value) \ | ||
234 | scu_link_layer_register_write(phy, phy_capabilities, value) | ||
235 | |||
236 | /* / This macro reads the Recieved PHY Capacity register */ | ||
237 | #define SCU_SAS_RECPHYCAP_READ(phy) \ | ||
238 | scu_link_layer_register_read(phy, receive_phycap) | ||
239 | |||
240 | /* / This macro reads the link layer control register */ | ||
241 | #define SCU_SAS_LLCTL_READ(phy) \ | ||
242 | scu_link_layer_register_read(phy, link_layer_control); | ||
243 | |||
244 | /* / This macro writes the link layer control register */ | ||
245 | #define SCU_SAS_LLCTL_WRITE(phy, value) \ | ||
246 | scu_link_layer_register_write(phy, link_layer_control, value); | ||
247 | |||
248 | #endif /* _SCIC_SDS_PHY_REGISTERS_H_ */ | ||
diff --git a/drivers/scsi/isci/core/scic_sds_port.c b/drivers/scsi/isci/core/scic_sds_port.c index 88b892de5de4..8e3983ebc4dc 100644 --- a/drivers/scsi/isci/core/scic_sds_port.c +++ b/drivers/scsi/isci/core/scic_sds_port.c | |||
@@ -60,14 +60,12 @@ | |||
60 | #include "scic_port.h" | 60 | #include "scic_port.h" |
61 | #include "scic_sds_controller.h" | 61 | #include "scic_sds_controller.h" |
62 | #include "scic_sds_phy.h" | 62 | #include "scic_sds_phy.h" |
63 | #include "scic_sds_phy_registers.h" | ||
64 | #include "scic_sds_port.h" | 63 | #include "scic_sds_port.h" |
65 | #include "scic_sds_port_registers.h" | ||
66 | #include "scic_sds_remote_device.h" | 64 | #include "scic_sds_remote_device.h" |
67 | #include "scic_sds_remote_node_context.h" | 65 | #include "scic_sds_remote_node_context.h" |
68 | #include "scic_sds_request.h" | 66 | #include "scic_sds_request.h" |
69 | #include "sci_environment.h" | 67 | #include "sci_environment.h" |
70 | #include "scic_sds_controller_registers.h" | 68 | #include "scu_registers.h" |
71 | 69 | ||
72 | #define SCIC_SDS_PORT_MIN_TIMER_COUNT (SCI_MAX_PORTS) | 70 | #define SCIC_SDS_PORT_MIN_TIMER_COUNT (SCI_MAX_PORTS) |
73 | #define SCIC_SDS_PORT_MAX_TIMER_COUNT (SCI_MAX_PORTS) | 71 | #define SCIC_SDS_PORT_MAX_TIMER_COUNT (SCI_MAX_PORTS) |
@@ -706,7 +704,8 @@ void scic_sds_port_deactivate_phy(struct scic_sds_port *sci_port, | |||
706 | sci_phy->max_negotiated_speed = SCI_SAS_NO_LINK_RATE; | 704 | sci_phy->max_negotiated_speed = SCI_SAS_NO_LINK_RATE; |
707 | 705 | ||
708 | /* Re-assign the phy back to the LP as if it were a narrow port */ | 706 | /* Re-assign the phy back to the LP as if it were a narrow port */ |
709 | SCU_PCSPExCR_WRITE(sci_port, sci_phy->phy_index, sci_phy->phy_index); | 707 | writel(sci_phy->phy_index, |
708 | &sci_port->port_pe_configuration_register[sci_phy->phy_index]); | ||
710 | 709 | ||
711 | if (do_notify_user == true) | 710 | if (do_notify_user == true) |
712 | isci_port_link_down(ihost, iphy, iport); | 711 | isci_port_link_down(ihost, iphy, iport); |
@@ -969,25 +968,20 @@ static void scic_sds_port_update_viit_entry(struct scic_sds_port *this_port) | |||
969 | 968 | ||
970 | scic_sds_port_get_sas_address(this_port, &sas_address); | 969 | scic_sds_port_get_sas_address(this_port, &sas_address); |
971 | 970 | ||
972 | scu_port_viit_register_write( | 971 | writel(sas_address.high, |
973 | this_port, initiator_sas_address_hi, sas_address.high); | 972 | &this_port->viit_registers->initiator_sas_address_hi); |
974 | 973 | writel(sas_address.low, | |
975 | scu_port_viit_register_write( | 974 | &this_port->viit_registers->initiator_sas_address_lo); |
976 | this_port, initiator_sas_address_lo, sas_address.low); | ||
977 | 975 | ||
978 | /* This value get cleared just in case its not already cleared */ | 976 | /* This value get cleared just in case its not already cleared */ |
979 | scu_port_viit_register_write( | 977 | writel(0, &this_port->viit_registers->reserved); |
980 | this_port, reserved, 0); | ||
981 | 978 | ||
982 | /* We are required to update the status register last */ | 979 | /* We are required to update the status register last */ |
983 | scu_port_viit_register_write( | 980 | writel(SCU_VIIT_ENTRY_ID_VIIT | |
984 | this_port, status, ( | 981 | SCU_VIIT_IPPT_INITIATOR | |
985 | SCU_VIIT_ENTRY_ID_VIIT | 982 | ((1 << this_port->physical_port_index) << SCU_VIIT_ENTRY_LPVIE_SHIFT) | |
986 | | SCU_VIIT_IPPT_INITIATOR | 983 | SCU_VIIT_STATUS_ALL_VALID, |
987 | | ((1 << this_port->physical_port_index) << SCU_VIIT_ENTRY_LPVIE_SHIFT) | 984 | &this_port->viit_registers->status); |
988 | | SCU_VIIT_STATUS_ALL_VALID | ||
989 | ) | ||
990 | ); | ||
991 | } | 985 | } |
992 | 986 | ||
993 | /** | 987 | /** |
@@ -1059,10 +1053,12 @@ void scic_port_enable_broadcast_change_notification( | |||
1059 | for (index = 0; index < SCI_MAX_PHYS; index++) { | 1053 | for (index = 0; index < SCI_MAX_PHYS; index++) { |
1060 | phy = port->phy_table[index]; | 1054 | phy = port->phy_table[index]; |
1061 | if (phy != NULL) { | 1055 | if (phy != NULL) { |
1062 | register_value = SCU_SAS_LLCTL_READ(phy); | 1056 | register_value = |
1057 | readl(&phy->link_layer_registers->link_layer_control); | ||
1063 | 1058 | ||
1064 | /* clear the bit by writing 1. */ | 1059 | /* clear the bit by writing 1. */ |
1065 | SCU_SAS_LLCTL_WRITE(phy, register_value); | 1060 | writel(register_value, |
1061 | &phy->link_layer_registers->link_layer_control); | ||
1066 | } | 1062 | } |
1067 | } | 1063 | } |
1068 | } | 1064 | } |
@@ -1618,16 +1614,14 @@ scic_sds_port_ready_substate_handler_table[SCIC_SDS_PORT_READY_MAX_SUBSTATES] = | |||
1618 | * | 1614 | * |
1619 | * This method will susped the port task scheduler for this port object. none | 1615 | * This method will susped the port task scheduler for this port object. none |
1620 | */ | 1616 | */ |
1621 | static void scic_sds_port_suspend_port_task_scheduler( | 1617 | static void |
1622 | struct scic_sds_port *this_port) | 1618 | scic_sds_port_suspend_port_task_scheduler(struct scic_sds_port *port) |
1623 | { | 1619 | { |
1624 | u32 pts_control_value; | 1620 | u32 pts_control_value; |
1625 | 1621 | ||
1626 | pts_control_value = scu_port_task_scheduler_read(this_port, control); | 1622 | pts_control_value = readl(&port->port_task_scheduler_registers->control); |
1627 | |||
1628 | pts_control_value |= SCU_PTSxCR_GEN_BIT(SUSPEND); | 1623 | pts_control_value |= SCU_PTSxCR_GEN_BIT(SUSPEND); |
1629 | 1624 | writel(pts_control_value, &port->port_task_scheduler_registers->control); | |
1630 | scu_port_task_scheduler_write(this_port, control, pts_control_value); | ||
1631 | } | 1625 | } |
1632 | 1626 | ||
1633 | /** | 1627 | /** |
@@ -1688,16 +1682,14 @@ static void scic_sds_port_abort_dummy_request(struct scic_sds_port *sci_port) | |||
1688 | * | 1682 | * |
1689 | * This method will resume the port task scheduler for this port object. none | 1683 | * This method will resume the port task scheduler for this port object. none |
1690 | */ | 1684 | */ |
1691 | static void scic_sds_port_resume_port_task_scheduler( | 1685 | static void |
1692 | struct scic_sds_port *this_port) | 1686 | scic_sds_port_resume_port_task_scheduler(struct scic_sds_port *port) |
1693 | { | 1687 | { |
1694 | u32 pts_control_value; | 1688 | u32 pts_control_value; |
1695 | 1689 | ||
1696 | pts_control_value = scu_port_task_scheduler_read(this_port, control); | 1690 | pts_control_value = readl(&port->port_task_scheduler_registers->control); |
1697 | |||
1698 | pts_control_value &= ~SCU_PTSxCR_GEN_BIT(SUSPEND); | 1691 | pts_control_value &= ~SCU_PTSxCR_GEN_BIT(SUSPEND); |
1699 | 1692 | writel(pts_control_value, &port->port_task_scheduler_registers->control); | |
1700 | scu_port_task_scheduler_write(this_port, control, pts_control_value); | ||
1701 | } | 1693 | } |
1702 | 1694 | ||
1703 | /* | 1695 | /* |
@@ -1763,10 +1755,11 @@ static void scic_sds_port_ready_substate_operational_enter( | |||
1763 | isci_port_ready(ihost, iport); | 1755 | isci_port_ready(ihost, iport); |
1764 | 1756 | ||
1765 | for (index = 0; index < SCI_MAX_PHYS; index++) { | 1757 | for (index = 0; index < SCI_MAX_PHYS; index++) { |
1766 | if (sci_port->phy_table[index] != NULL) | 1758 | if (sci_port->phy_table[index]) { |
1767 | scic_sds_port_write_phy_assignment( | 1759 | writel(sci_port->physical_port_index, |
1768 | sci_port, | 1760 | &sci_port->port_pe_configuration_register[ |
1769 | sci_port->phy_table[index]); | 1761 | sci_port->phy_table[index]->phy_index]); |
1762 | } | ||
1770 | } | 1763 | } |
1771 | 1764 | ||
1772 | scic_sds_port_update_viit_entry(sci_port); | 1765 | scic_sds_port_update_viit_entry(sci_port); |
@@ -2308,16 +2301,14 @@ scic_sds_port_state_handler_table[SCI_BASE_PORT_MAX_STATES] = | |||
2308 | * This method will enable the SCU Port Task Scheduler for this port object but | 2301 | * This method will enable the SCU Port Task Scheduler for this port object but |
2309 | * will leave the port task scheduler in a suspended state. none | 2302 | * will leave the port task scheduler in a suspended state. none |
2310 | */ | 2303 | */ |
2311 | static void scic_sds_port_enable_port_task_scheduler( | 2304 | static void |
2312 | struct scic_sds_port *this_port) | 2305 | scic_sds_port_enable_port_task_scheduler(struct scic_sds_port *port) |
2313 | { | 2306 | { |
2314 | u32 pts_control_value; | 2307 | u32 pts_control_value; |
2315 | 2308 | ||
2316 | pts_control_value = scu_port_task_scheduler_read(this_port, control); | 2309 | pts_control_value = readl(&port->port_task_scheduler_registers->control); |
2317 | |||
2318 | pts_control_value |= SCU_PTSxCR_GEN_BIT(ENABLE) | SCU_PTSxCR_GEN_BIT(SUSPEND); | 2310 | pts_control_value |= SCU_PTSxCR_GEN_BIT(ENABLE) | SCU_PTSxCR_GEN_BIT(SUSPEND); |
2319 | 2311 | writel(pts_control_value, &port->port_task_scheduler_registers->control); | |
2320 | scu_port_task_scheduler_write(this_port, control, pts_control_value); | ||
2321 | } | 2312 | } |
2322 | 2313 | ||
2323 | /** | 2314 | /** |
@@ -2327,17 +2318,15 @@ static void scic_sds_port_enable_port_task_scheduler( | |||
2327 | * This method will disable the SCU port task scheduler for this port object. | 2318 | * This method will disable the SCU port task scheduler for this port object. |
2328 | * none | 2319 | * none |
2329 | */ | 2320 | */ |
2330 | static void scic_sds_port_disable_port_task_scheduler( | 2321 | static void |
2331 | struct scic_sds_port *this_port) | 2322 | scic_sds_port_disable_port_task_scheduler(struct scic_sds_port *port) |
2332 | { | 2323 | { |
2333 | u32 pts_control_value; | 2324 | u32 pts_control_value; |
2334 | 2325 | ||
2335 | pts_control_value = scu_port_task_scheduler_read(this_port, control); | 2326 | pts_control_value = readl(&port->port_task_scheduler_registers->control); |
2336 | 2327 | pts_control_value &= | |
2337 | pts_control_value &= ~(SCU_PTSxCR_GEN_BIT(ENABLE) | 2328 | ~(SCU_PTSxCR_GEN_BIT(ENABLE) | SCU_PTSxCR_GEN_BIT(SUSPEND)); |
2338 | | SCU_PTSxCR_GEN_BIT(SUSPEND)); | 2329 | writel(pts_control_value, &port->port_task_scheduler_registers->control); |
2339 | |||
2340 | scu_port_task_scheduler_write(this_port, control, pts_control_value); | ||
2341 | } | 2330 | } |
2342 | 2331 | ||
2343 | static void scic_sds_port_post_dummy_remote_node(struct scic_sds_port *sci_port) | 2332 | static void scic_sds_port_post_dummy_remote_node(struct scic_sds_port *sci_port) |
@@ -2359,7 +2348,7 @@ static void scic_sds_port_post_dummy_remote_node(struct scic_sds_port *sci_port) | |||
2359 | /* ensure hardware has seen the post rnc command and give it | 2348 | /* ensure hardware has seen the post rnc command and give it |
2360 | * ample time to act before sending the suspend | 2349 | * ample time to act before sending the suspend |
2361 | */ | 2350 | */ |
2362 | SMU_ISR_READ(scic); /* flush */ | 2351 | readl(&scic->smu_registers->interrupt_status); /* flush */ |
2363 | udelay(10); | 2352 | udelay(10); |
2364 | 2353 | ||
2365 | command = SCU_CONTEXT_COMMAND_POST_RNC_SUSPEND_TX_RX | | 2354 | command = SCU_CONTEXT_COMMAND_POST_RNC_SUSPEND_TX_RX | |
@@ -2384,7 +2373,7 @@ static void scic_sds_port_invalidate_dummy_remote_node(struct scic_sds_port *sci | |||
2384 | * controller and give it ample time to act before posting the rnc | 2373 | * controller and give it ample time to act before posting the rnc |
2385 | * invalidate | 2374 | * invalidate |
2386 | */ | 2375 | */ |
2387 | SMU_ISR_READ(scic); /* flush */ | 2376 | readl(&scic->smu_registers->interrupt_status); /* flush */ |
2388 | udelay(10); | 2377 | udelay(10); |
2389 | 2378 | ||
2390 | command = SCU_CONTEXT_COMMAND_POST_RNC_INVALIDATE | | 2379 | command = SCU_CONTEXT_COMMAND_POST_RNC_INVALIDATE | |
diff --git a/drivers/scsi/isci/core/scic_sds_port.h b/drivers/scsi/isci/core/scic_sds_port.h index a5aa9e102242..4cd6bbb0b570 100644 --- a/drivers/scsi/isci/core/scic_sds_port.h +++ b/drivers/scsi/isci/core/scic_sds_port.h | |||
@@ -289,29 +289,6 @@ static inline void scic_sds_port_decrement_request_count(struct scic_sds_port *s | |||
289 | sci_port->started_request_count--; | 289 | sci_port->started_request_count--; |
290 | } | 290 | } |
291 | 291 | ||
292 | /** | ||
293 | * scic_sds_port_write_phy_assignment() - | ||
294 | * | ||
295 | * Helper macro to write the phys port assignment | ||
296 | */ | ||
297 | #define scic_sds_port_write_phy_assignment(port, phy) \ | ||
298 | SCU_PCSPExCR_WRITE(\ | ||
299 | (port), \ | ||
300 | (phy)->phy_index, \ | ||
301 | (port)->physical_port_index \ | ||
302 | ) | ||
303 | |||
304 | /** | ||
305 | * scic_sds_port_read_phy_assignment() - | ||
306 | * | ||
307 | * Helper macro to read the phys port assignment | ||
308 | */ | ||
309 | #define scic_sds_port_read_phy_assignment(port, phy) \ | ||
310 | SCU_PCSPExCR_READ(\ | ||
311 | (port), \ | ||
312 | (phy)->phy_index \ | ||
313 | ) | ||
314 | |||
315 | #define scic_sds_port_active_phy(port, phy) \ | 292 | #define scic_sds_port_active_phy(port, phy) \ |
316 | (((port)->active_phy_mask & (1 << (phy)->phy_index)) != 0) | 293 | (((port)->active_phy_mask & (1 << (phy)->phy_index)) != 0) |
317 | 294 | ||
diff --git a/drivers/scsi/isci/core/scic_sds_port_registers.h b/drivers/scsi/isci/core/scic_sds_port_registers.h index dbe82d864eac..01e24e52990c 100644 --- a/drivers/scsi/isci/core/scic_sds_port_registers.h +++ b/drivers/scsi/isci/core/scic_sds_port_registers.h | |||
@@ -63,85 +63,4 @@ | |||
63 | * | 63 | * |
64 | */ | 64 | */ |
65 | 65 | ||
66 | /** | ||
67 | * scu_port_task_scheduler_read() - | ||
68 | * | ||
69 | * Macro to read the port task scheduler register associated with this port | ||
70 | * object | ||
71 | */ | ||
72 | #define scu_port_task_scheduler_read(port, reg) \ | ||
73 | scu_register_read(\ | ||
74 | scic_sds_port_get_controller(port), \ | ||
75 | (port)->port_task_scheduler_registers->reg \ | ||
76 | ) | ||
77 | |||
78 | /** | ||
79 | * scu_port_task_scheduler_write() - | ||
80 | * | ||
81 | * Macro to write the port task scheduler register associated with this port | ||
82 | * object | ||
83 | */ | ||
84 | #define scu_port_task_scheduler_write(port, reg, value) \ | ||
85 | scu_register_write(\ | ||
86 | scic_sds_port_get_controller(port), \ | ||
87 | (port)->port_task_scheduler_registers->reg, \ | ||
88 | (value) \ | ||
89 | ) | ||
90 | |||
91 | #define scu_port_viit_register_write(port, reg, value) \ | ||
92 | scu_register_write(\ | ||
93 | scic_sds_port_get_controller(port), \ | ||
94 | (port)->viit_registers->reg, \ | ||
95 | (value) \ | ||
96 | ) | ||
97 | |||
98 | /* | ||
99 | * **************************************************************************** | ||
100 | * * Port Task Scheduler registers controlled by the port object | ||
101 | * **************************************************************************** */ | ||
102 | |||
103 | /** | ||
104 | * SCU_PTSxCR_READ() - | ||
105 | * | ||
106 | * Macro to read the port task scheduler control register | ||
107 | */ | ||
108 | #define SCU_PTSxCR_READ(port) \ | ||
109 | scu_port_task_scheduler_read(port, control) | ||
110 | |||
111 | /** | ||
112 | * SCU_PTSxCR_WRITE() - | ||
113 | * | ||
114 | * Macro to write the port task scheduler control regsister | ||
115 | */ | ||
116 | #define SCU_PTSxCR_WRITE(port, value) \ | ||
117 | scu_port_task_scheduler_write(port, control, value) | ||
118 | |||
119 | /* | ||
120 | * **************************************************************************** | ||
121 | * * Port PE Configuration registers | ||
122 | * **************************************************************************** */ | ||
123 | |||
124 | /** | ||
125 | * SCU_PCSPExCR_WRITE() - | ||
126 | * | ||
127 | * Macro to write the PE Port Configuration Register | ||
128 | */ | ||
129 | #define SCU_PCSPExCR_WRITE(port, phy_id, value) \ | ||
130 | scu_register_write(\ | ||
131 | scic_sds_port_get_controller(port), \ | ||
132 | (port)->port_pe_configuration_register[phy_id], \ | ||
133 | (value) \ | ||
134 | ) | ||
135 | |||
136 | /** | ||
137 | * SCU_PCSPExCR_READ() - | ||
138 | * | ||
139 | * Macro to read the PE Port Configuration Regsiter | ||
140 | */ | ||
141 | #define SCU_PCSPExCR_READ(port, phy_id) \ | ||
142 | scu_register_read(\ | ||
143 | scic_sds_port_get_controller(port), \ | ||
144 | (port)->port_pe_configuration_register[phy_id] \ | ||
145 | ) | ||
146 | |||
147 | #endif /* _SCIC_SDS_PORT_REGISTERS_H_ */ | 66 | #endif /* _SCIC_SDS_PORT_REGISTERS_H_ */ |
diff --git a/drivers/scsi/isci/core/scic_sds_request.c b/drivers/scsi/isci/core/scic_sds_request.c index 45b8571726f7..d0cbb97b63a7 100644 --- a/drivers/scsi/isci/core/scic_sds_request.c +++ b/drivers/scsi/isci/core/scic_sds_request.c | |||
@@ -62,8 +62,7 @@ | |||
62 | #include "scic_io_request.h" | 62 | #include "scic_io_request.h" |
63 | #include "scic_remote_device.h" | 63 | #include "scic_remote_device.h" |
64 | #include "scic_sds_controller.h" | 64 | #include "scic_sds_controller.h" |
65 | #include "scic_sds_controller_registers.h" | 65 | #include "scu_registers.h" |
66 | #include "scic_sds_pci.h" | ||
67 | #include "scic_sds_port.h" | 66 | #include "scic_sds_port.h" |
68 | #include "scic_sds_remote_device.h" | 67 | #include "scic_sds_remote_device.h" |
69 | #include "scic_sds_request.h" | 68 | #include "scic_sds_request.h" |
@@ -862,20 +861,16 @@ u32 scic_io_request_get_number_of_bytes_transferred( | |||
862 | { | 861 | { |
863 | u32 ret_val = 0; | 862 | u32 ret_val = 0; |
864 | 863 | ||
865 | if (SMU_AMR_READ(scic_sds_request->owning_controller) == 0) { | 864 | if (readl(&scic_sds_request->owning_controller->smu_registers->address_modifier) == 0) { |
866 | /* | 865 | /* |
867 | * get the bytes of data from the Address == BAR1 + 20002Ch + (256*TCi) where | 866 | * get the bytes of data from the Address == BAR1 + 20002Ch + (256*TCi) where |
868 | * BAR1 is the scu_registers | 867 | * BAR1 is the scu_registers |
869 | * 0x20002C = 0x200000 + 0x2c | 868 | * 0x20002C = 0x200000 + 0x2c |
870 | * = start of task context SRAM + offset of (type.ssp.data_offset) | 869 | * = start of task context SRAM + offset of (type.ssp.data_offset) |
871 | * TCi is the io_tag of struct scic_sds_request */ | 870 | * TCi is the io_tag of struct scic_sds_request */ |
872 | ret_val = scic_sds_pci_read_scu_dword( | 871 | ret_val = readl((u8 *)scic_sds_request->owning_controller->scu_registers + |
873 | scic_sds_request->owning_controller, | ||
874 | ( | ||
875 | (u8 *)scic_sds_request->owning_controller->scu_registers + | ||
876 | (SCU_TASK_CONTEXT_SRAM + SCI_FIELD_OFFSET(struct scu_task_context, type.ssp.data_offset)) + | 872 | (SCU_TASK_CONTEXT_SRAM + SCI_FIELD_OFFSET(struct scu_task_context, type.ssp.data_offset)) + |
877 | ((sizeof(struct scu_task_context)) * scic_sds_io_tag_get_index(scic_sds_request->io_tag)) | 873 | ((sizeof(struct scu_task_context)) * scic_sds_io_tag_get_index(scic_sds_request->io_tag)) |
878 | ) | ||
879 | ); | 874 | ); |
880 | } | 875 | } |
881 | 876 | ||
diff --git a/drivers/scsi/isci/core/scic_sds_unsolicited_frame_control.c b/drivers/scsi/isci/core/scic_sds_unsolicited_frame_control.c index 66be58b002d9..31a3516ddebe 100644 --- a/drivers/scsi/isci/core/scic_sds_unsolicited_frame_control.c +++ b/drivers/scsi/isci/core/scic_sds_unsolicited_frame_control.c | |||
@@ -315,10 +315,7 @@ enum sci_status scic_sds_unsolicited_frame_control_get_buffer( | |||
315 | * @frame_index: This parameter specifies the frame index to attempt to release. | 315 | * @frame_index: This parameter specifies the frame index to attempt to release. |
316 | * | 316 | * |
317 | * This method returns an indication to the caller as to whether the | 317 | * This method returns an indication to the caller as to whether the |
318 | * unsolicited frame get pointer should be updated. true This value indicates | 318 | * unsolicited frame get pointer should be updated. |
319 | * the unsolicited frame get pointer should be updated (i.e. write | ||
320 | * SCU_UFQGP_WRITE). false This value indicates the get pointer should not be | ||
321 | * updated. | ||
322 | */ | 319 | */ |
323 | bool scic_sds_unsolicited_frame_control_release_frame( | 320 | bool scic_sds_unsolicited_frame_control_release_frame( |
324 | struct scic_sds_unsolicited_frame_control *uf_control, | 321 | struct scic_sds_unsolicited_frame_control *uf_control, |