Lines Matching +full:sata +full:- +full:oob

7  * Copyright(c) 2008 - 2011 Intel Corporation. All rights reserved.
20 * Foundation, Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
26 * Copyright(c) 2008 - 2011 Intel Corporation. All rights reserved.
72 /* Maximum arbitration wait time in micro-seconds */
77 return iphy->max_negotiated_speed; in sci_phy_linkrate()
82 struct isci_phy *table = iphy - iphy->phy_index; in phy_to_host()
90 return &phy_to_host(iphy)->pdev->dev; in sciphy_to_dev()
99 iphy->transport_layer_registers = reg; in sci_phy_transport_layer_initialization()
102 &iphy->transport_layer_registers->stp_rni); in sci_phy_transport_layer_initialization()
108 tl_control = readl(&iphy->transport_layer_registers->control); in sci_phy_transport_layer_initialization()
110 writel(tl_control, &iphy->transport_layer_registers->control); in sci_phy_transport_layer_initialization()
119 struct isci_host *ihost = iphy->owning_port->owning_controller; in sci_phy_link_layer_initialization()
122 int phy_idx = iphy->phy_index; in sci_phy_link_layer_initialization()
131 phy_user = &ihost->user_parameters.phys[phy_idx]; in sci_phy_link_layer_initialization()
132 phy_oem = &ihost->oem_parameters.phys[phy_idx]; in sci_phy_link_layer_initialization()
133 iphy->link_layer_registers = llr; in sci_phy_link_layer_initialization()
143 &llr->transmit_identification); in sci_phy_link_layer_initialization()
146 writel(0xFEDCBA98, &llr->sas_device_name_high); in sci_phy_link_layer_initialization()
147 writel(phy_idx, &llr->sas_device_name_low); in sci_phy_link_layer_initialization()
150 writel(phy_oem->sas_address.high, &llr->source_sas_address_high); in sci_phy_link_layer_initialization()
151 writel(phy_oem->sas_address.low, &llr->source_sas_address_low); in sci_phy_link_layer_initialization()
154 writel(0, &llr->identify_frame_phy_id); in sci_phy_link_layer_initialization()
155 writel(SCU_SAS_TIPID_GEN_VALUE(ID, phy_idx), &llr->identify_frame_phy_id); in sci_phy_link_layer_initialization()
158 phy_configuration = readl(&llr->phy_configuration); in sci_phy_link_layer_initialization()
160 /* Hold OOB state machine in reset */ in sci_phy_link_layer_initialization()
162 writel(phy_configuration, &llr->phy_configuration); in sci_phy_link_layer_initialization()
170 if (ihost->oem_parameters.controller.do_enable_ssc) { in sci_phy_link_layer_initialization()
171 struct scu_afe_registers __iomem *afe = &ihost->scu_registers->afe; in sci_phy_link_layer_initialization()
172 struct scu_afe_transceiver __iomem *xcvr = &afe->scu_afe_xcvr[phy_idx]; in sci_phy_link_layer_initialization()
173 struct isci_pci_info *pci_info = to_pci_info(ihost->pdev); in sci_phy_link_layer_initialization()
184 if (pci_info->orom->hdr.version < ISCI_ROM_VER_1_1) in sci_phy_link_layer_initialization()
187 sata_spread = ihost->oem_parameters.controller.ssc_sata_tx_spread_level; in sci_phy_link_layer_initialization()
188 sas_spread = ihost->oem_parameters.controller.ssc_sas_tx_spread_level; in sci_phy_link_layer_initialization()
195 sas_type = ihost->oem_parameters.controller.ssc_sas_tx_type; in sci_phy_link_layer_initialization()
203 reg = readl(&xcvr->afe_xcvr_control0); in sci_phy_link_layer_initialization()
205 writel(reg, &xcvr->afe_xcvr_control0); in sci_phy_link_layer_initialization()
207 reg = readl(&xcvr->afe_tx_ssc_control); in sci_phy_link_layer_initialization()
209 writel(reg, &xcvr->afe_tx_ssc_control); in sci_phy_link_layer_initialization()
215 reg = readl(&xcvr->afe_tx_ssc_control); in sci_phy_link_layer_initialization()
217 writel(reg, &xcvr->afe_tx_ssc_control); in sci_phy_link_layer_initialization()
219 reg = readl(&llr->stp_control); in sci_phy_link_layer_initialization()
221 writel(reg, &llr->stp_control); in sci_phy_link_layer_initialization()
241 writel(phy_cap.all, &llr->phy_capabilities); in sci_phy_link_layer_initialization()
247 phy_user->notify_enable_spin_up_insertion_frequency), in sci_phy_link_layer_initialization()
248 &llr->notify_enable_spinup_control); in sci_phy_link_layer_initialization()
254 phy_user->in_connection_align_insertion_frequency); in sci_phy_link_layer_initialization()
257 phy_user->align_insertion_frequency); in sci_phy_link_layer_initialization()
259 writel(clksm_value, &llr->clock_skew_management); in sci_phy_link_layer_initialization()
261 if (is_c0(ihost->pdev) || is_c1(ihost->pdev)) { in sci_phy_link_layer_initialization()
262 writel(0x04210400, &llr->afe_lookup_table_control); in sci_phy_link_layer_initialization()
263 writel(0x020A7C05, &llr->sas_primitive_timeout); in sci_phy_link_layer_initialization()
265 writel(0x02108421, &llr->afe_lookup_table_control); in sci_phy_link_layer_initialization()
268 (u8)ihost->user_parameters.no_outbound_task_timeout); in sci_phy_link_layer_initialization()
270 switch (phy_user->max_speed_generation) { in sci_phy_link_layer_initialization()
282 writel(llctl, &llr->link_layer_control); in sci_phy_link_layer_initialization()
284 sp_timeouts = readl(&llr->sas_phy_timeouts); in sci_phy_link_layer_initialization()
294 writel(sp_timeouts, &llr->sas_phy_timeouts); in sci_phy_link_layer_initialization()
296 if (is_a2(ihost->pdev)) { in sci_phy_link_layer_initialization()
298 * inter-operate with the PMC expander which shuts down in sci_phy_link_layer_initialization()
304 &llr->maximum_arbitration_wait_timer_timeout); in sci_phy_link_layer_initialization()
310 writel(0, &llr->link_layer_hang_detection_timeout); in sci_phy_link_layer_initialization()
313 sci_change_state(&iphy->sm, SCI_PHY_STOPPED); in sci_phy_link_layer_initialization()
322 struct isci_host *ihost = iphy->owning_port->owning_controller; in phy_sata_timeout()
325 spin_lock_irqsave(&ihost->scic_lock, flags); in phy_sata_timeout()
327 if (tmr->cancel) in phy_sata_timeout()
336 sci_change_state(&iphy->sm, SCI_PHY_STARTING); in phy_sata_timeout()
338 spin_unlock_irqrestore(&ihost->scic_lock, flags); in phy_sata_timeout()
342 * phy_get_non_dummy_port() - This method returns the port currently containing
356 struct isci_port *iport = iphy->owning_port; in phy_get_non_dummy_port()
358 if (iport->physical_port_index == SCIC_SDS_DUMMY_PORT) in phy_get_non_dummy_port()
361 return iphy->owning_port; in phy_get_non_dummy_port()
365 * sci_phy_set_port() - This method will assign a port to the phy object.
371 iphy->owning_port = iport; in sci_phy_set_port()
373 if (iphy->bcn_received_while_port_unassigned) { in sci_phy_set_port()
374 iphy->bcn_received_while_port_unassigned = false; in sci_phy_set_port()
375 sci_port_broadcast_change_received(iphy->owning_port, iphy); in sci_phy_set_port()
392 sci_change_state(&iphy->sm, SCI_PHY_STOPPED); in sci_phy_initialize()
398 * sci_phy_setup_transport() - This method assigns the direct attached device ID for this phy.
410 writel(device_id, &iphy->transport_layer_registers->stp_rni); in sci_phy_setup_transport()
416 tl_control = readl(&iphy->transport_layer_registers->control); in sci_phy_setup_transport()
418 writel(tl_control, &iphy->transport_layer_registers->control); in sci_phy_setup_transport()
426 readl(&iphy->link_layer_registers->phy_configuration); in sci_phy_suspend()
429 &iphy->link_layer_registers->phy_configuration); in sci_phy_suspend()
439 readl(&iphy->link_layer_registers->phy_configuration); in sci_phy_resume()
442 &iphy->link_layer_registers->phy_configuration); in sci_phy_resume()
447 sas->high = readl(&iphy->link_layer_registers->source_sas_address_high); in sci_phy_get_sas_address()
448 sas->low = readl(&iphy->link_layer_registers->source_sas_address_low); in sci_phy_get_sas_address()
455 iaf = &iphy->frame_rcvd.iaf; in sci_phy_get_attached_sas_address()
456 memcpy(sas, iaf->sas_addr, SAS_ADDR_SIZE); in sci_phy_get_attached_sas_address()
461 proto->all = readl(&iphy->link_layer_registers->transmit_identification); in sci_phy_get_protocols()
466 enum sci_phy_states state = iphy->sm.current_state_id; in sci_phy_start()
474 sci_change_state(&iphy->sm, SCI_PHY_STARTING); in sci_phy_start()
480 enum sci_phy_states state = iphy->sm.current_state_id; in sci_phy_stop()
500 sci_change_state(&iphy->sm, SCI_PHY_STOPPED); in sci_phy_stop()
506 enum sci_phy_states state = iphy->sm.current_state_id; in sci_phy_reset()
514 sci_change_state(&iphy->sm, SCI_PHY_RESETTING); in sci_phy_reset()
520 enum sci_phy_states state = iphy->sm.current_state_id; in sci_phy_consume_power_handler()
526 enable_spinup = readl(&iphy->link_layer_registers->notify_enable_spinup_control); in sci_phy_consume_power_handler()
528 writel(enable_spinup, &iphy->link_layer_registers->notify_enable_spinup_control); in sci_phy_consume_power_handler()
531 sci_change_state(&iphy->sm, SCI_PHY_SUB_FINAL); in sci_phy_consume_power_handler()
538 /* Release the spinup hold state and reset the OOB state machine */ in sci_phy_consume_power_handler()
540 readl(&iphy->link_layer_registers->phy_configuration); in sci_phy_consume_power_handler()
545 &iphy->link_layer_registers->phy_configuration); in sci_phy_consume_power_handler()
547 /* Now restart the OOB operation */ in sci_phy_consume_power_handler()
551 &iphy->link_layer_registers->phy_configuration); in sci_phy_consume_power_handler()
554 sci_change_state(&iphy->sm, SCI_PHY_SUB_AWAIT_SATA_PHY_EN); in sci_phy_consume_power_handler()
568 * instead of a SATA PHY. This is done because the completion queue had a SAS in sci_phy_start_sas_link_training()
569 * PHY DETECTED event when the state machine was expecting a SATA PHY event. in sci_phy_start_sas_link_training()
573 phy_control = readl(&iphy->link_layer_registers->phy_configuration); in sci_phy_start_sas_link_training()
576 &iphy->link_layer_registers->phy_configuration); in sci_phy_start_sas_link_training()
578 sci_change_state(&iphy->sm, SCI_PHY_SUB_AWAIT_SAS_SPEED_EN); in sci_phy_start_sas_link_training()
580 iphy->protocol = SAS_PROTOCOL_SSP; in sci_phy_start_sas_link_training()
585 /* This method continues the link training for the phy as if it were a SATA PHY in sci_phy_start_sata_link_training()
586 * instead of a SAS PHY. This is done because the completion queue had a SATA in sci_phy_start_sata_link_training()
589 sci_change_state(&iphy->sm, SCI_PHY_SUB_AWAIT_SATA_POWER); in sci_phy_start_sata_link_training()
591 iphy->protocol = SAS_PROTOCOL_SATA; in sci_phy_start_sata_link_training()
595 * sci_phy_complete_link_training - perform processing common to
602 * sub-state machine.
609 iphy->max_negotiated_speed = max_link_rate; in sci_phy_complete_link_training()
611 sci_change_state(&iphy->sm, next_state); in sci_phy_complete_link_training()
630 return "sata spinup hold"; in phy_event_name()
642 return "sata 1.5"; in phy_event_name()
645 return "sata 3.0"; in phy_event_name()
648 return "sata 6.0"; in phy_event_name()
652 return "sata detect"; in phy_event_name()
659 dev_dbg(sciphy_to_dev(iphy), "phy-%d:%d: %s event: %s (%x)\n", \
660 phy_to_host(iphy)->id, iphy->phy_index, \
664 dev_warn(sciphy_to_dev(iphy), "phy-%d:%d: %s event: %s (%x)\n", \
665 phy_to_host(iphy)->id, iphy->phy_index, \
674 val = readl(&iphy->link_layer_registers->transmit_comsas_signal); in scu_link_layer_set_txcomsas_timeout()
678 writel(val, &iphy->link_layer_registers->transmit_comsas_signal); in scu_link_layer_set_txcomsas_timeout()
683 enum sci_phy_states state = iphy->sm.current_state_id; in sci_phy_event_handler()
690 iphy->is_in_link_training = true; in sci_phy_event_handler()
694 iphy->is_in_link_training = true; in sci_phy_event_handler()
700 /* Start the oob/sn state machine over again */ in sci_phy_event_handler()
701 sci_change_state(&iphy->sm, SCI_PHY_STARTING); in sci_phy_event_handler()
713 * We would re-enter this state so just stay here */ in sci_phy_event_handler()
732 * We were doing SAS PHY link training and received a SATA PHY event in sci_phy_event_handler()
733 * continue OOB/SN as if this were a SATA PHY */ in sci_phy_event_handler()
741 sci_change_state(&iphy->sm, SCI_PHY_STARTING); in sci_phy_event_handler()
747 /* Start the oob/sn state machine over again */ in sci_phy_event_handler()
748 sci_change_state(&iphy->sm, SCI_PHY_STARTING); in sci_phy_event_handler()
763 * SATA PHY event continue OOB/SN as if this were a in sci_phy_event_handler()
764 * SATA PHY in sci_phy_event_handler()
772 /* Start the oob/sn state machine over again */ in sci_phy_event_handler()
773 sci_change_state(&iphy->sm, SCI_PHY_STARTING); in sci_phy_event_handler()
779 /* Start the oob/sn state machine over again */ in sci_phy_event_handler()
780 sci_change_state(&iphy->sm, SCI_PHY_STARTING); in sci_phy_event_handler()
794 sci_change_state(&iphy->sm, SCI_PHY_STARTING); in sci_phy_event_handler()
808 sci_change_state(&iphy->sm, SCI_PHY_STARTING); in sci_phy_event_handler()
817 /* There has been a change in the phy type before OOB/SN for the in sci_phy_event_handler()
818 * SATA finished start down the SAS link traning path. in sci_phy_event_handler()
835 sci_change_state(&iphy->sm, SCI_PHY_STARTING); in sci_phy_event_handler()
843 iphy->protocol = SAS_PROTOCOL_SATA; in sci_phy_event_handler()
845 /* We have received the SATA PHY notification change state */ in sci_phy_event_handler()
846 sci_change_state(&iphy->sm, SCI_PHY_SUB_AWAIT_SATA_SPEED_EN); in sci_phy_event_handler()
849 /* There has been a change in the phy type before OOB/SN for the in sci_phy_event_handler()
850 * SATA finished start down the SAS link traning path. in sci_phy_event_handler()
863 * The hardware reports multiple SATA PHY detected events in sci_phy_event_handler()
886 sci_change_state(&iphy->sm, SCI_PHY_STARTING); in sci_phy_event_handler()
890 * There has been a change in the phy type before OOB/SN for the in sci_phy_event_handler()
891 * SATA finished start down the SAS link traning path. */ in sci_phy_event_handler()
904 sci_change_state(&iphy->sm, SCI_PHY_SUB_AWAIT_SATA_SPEED_EN); in sci_phy_event_handler()
912 sci_change_state(&iphy->sm, SCI_PHY_STARTING); in sci_phy_event_handler()
927 sci_change_state(&iphy->sm, SCI_PHY_STARTING); in sci_phy_event_handler()
937 sci_port_broadcast_change_received(iphy->owning_port, iphy); in sci_phy_event_handler()
939 iphy->bcn_received_while_port_unassigned = true; in sci_phy_event_handler()
952 sci_change_state(&iphy->sm, SCI_PHY_STARTING); in sci_phy_event_handler()
968 enum sci_phy_states state = iphy->sm.current_state_id; in sci_phy_frame_handler()
969 struct isci_host *ihost = iphy->owning_port->owning_controller; in sci_phy_frame_handler()
978 result = sci_unsolicited_frame_control_get_header(&ihost->uf_control, in sci_phy_frame_handler()
989 spin_lock_irqsave(&iphy->sas_phy.frame_rcvd_lock, flags); in sci_phy_frame_handler()
990 memcpy(&iphy->frame_rcvd.iaf, &iaf, sizeof(iaf)); in sci_phy_frame_handler()
991 spin_unlock_irqrestore(&iphy->sas_phy.frame_rcvd_lock, flags); in sci_phy_frame_handler()
1004 sci_change_state(&iphy->sm, state); in sci_phy_frame_handler()
1019 result = sci_unsolicited_frame_control_get_header(&ihost->uf_control, in sci_phy_frame_handler()
1026 if ((frame_header->fis_type == FIS_REGD2H) && in sci_phy_frame_handler()
1027 !(frame_header->status & ATA_BUSY)) { in sci_phy_frame_handler()
1028 sci_unsolicited_frame_control_get_buffer(&ihost->uf_control, in sci_phy_frame_handler()
1032 spin_lock_irqsave(&iphy->sas_phy.frame_rcvd_lock, flags); in sci_phy_frame_handler()
1033 sci_controller_copy_sata_response(&iphy->frame_rcvd.fis, in sci_phy_frame_handler()
1036 spin_unlock_irqrestore(&iphy->sas_phy.frame_rcvd_lock, flags); in sci_phy_frame_handler()
1039 sci_change_state(&iphy->sm, SCI_PHY_SUB_FINAL); in sci_phy_frame_handler()
1066 sci_change_state(&iphy->sm, SCI_PHY_SUB_AWAIT_OSSP_EN); in sci_phy_starting_initial_substate_enter()
1072 struct isci_host *ihost = iphy->owning_port->owning_controller; in sci_phy_starting_await_sas_power_substate_enter()
1080 struct isci_host *ihost = iphy->owning_port->owning_controller; in sci_phy_starting_await_sas_power_substate_exit()
1088 struct isci_host *ihost = iphy->owning_port->owning_controller; in sci_phy_starting_await_sata_power_substate_enter()
1096 struct isci_host *ihost = iphy->owning_port->owning_controller; in sci_phy_starting_await_sata_power_substate_exit()
1105 sci_mod_timer(&iphy->sata_timer, SCIC_SDS_SATA_LINK_TRAINING_TIMEOUT); in sci_phy_starting_await_sata_phy_substate_enter()
1112 sci_del_timer(&iphy->sata_timer); in sci_phy_starting_await_sata_phy_substate_exit()
1119 sci_mod_timer(&iphy->sata_timer, SCIC_SDS_SATA_LINK_TRAINING_TIMEOUT); in sci_phy_starting_await_sata_speed_substate_enter()
1126 sci_del_timer(&iphy->sata_timer); in sci_phy_starting_await_sata_speed_substate_exit()
1133 if (sci_port_link_detected(iphy->owning_port, iphy)) { in sci_phy_starting_await_sig_fis_uf_substate_enter()
1143 sci_mod_timer(&iphy->sata_timer, in sci_phy_starting_await_sig_fis_uf_substate_enter()
1146 iphy->is_in_link_training = false; in sci_phy_starting_await_sig_fis_uf_substate_enter()
1153 sci_del_timer(&iphy->sata_timer); in sci_phy_starting_await_sig_fis_uf_substate_exit()
1163 sci_change_state(&iphy->sm, SCI_PHY_READY); in sci_phy_starting_final_substate_enter()
1180 /* Suspend the protocol engine and place it in a sata spinup hold state */ in scu_link_layer_stop_protocol_engine()
1182 readl(&iphy->link_layer_registers->phy_configuration); in scu_link_layer_stop_protocol_engine()
1188 &iphy->link_layer_registers->phy_configuration); in scu_link_layer_stop_protocol_engine()
1191 enable_spinup_value = readl(&iphy->link_layer_registers->notify_enable_spinup_control); in scu_link_layer_stop_protocol_engine()
1193 writel(enable_spinup_value, &iphy->link_layer_registers->notify_enable_spinup_control); in scu_link_layer_stop_protocol_engine()
1198 struct scu_link_layer_registers __iomem *ll = iphy->link_layer_registers; in scu_link_layer_start_oob()
1201 /** Reset OOB sequence - start */ in scu_link_layer_start_oob()
1202 val = readl(&ll->phy_configuration); in scu_link_layer_start_oob()
1206 writel(val, &ll->phy_configuration); in scu_link_layer_start_oob()
1207 readl(&ll->phy_configuration); /* flush */ in scu_link_layer_start_oob()
1208 /** Reset OOB sequence - end */ in scu_link_layer_start_oob()
1210 /** Start OOB sequence - start */ in scu_link_layer_start_oob()
1211 val = readl(&ll->phy_configuration); in scu_link_layer_start_oob()
1213 writel(val, &ll->phy_configuration); in scu_link_layer_start_oob()
1214 readl(&ll->phy_configuration); /* flush */ in scu_link_layer_start_oob()
1215 /** Start OOB sequence - end */ in scu_link_layer_start_oob()
1223 * hardware requires that we reset the OOB state machine and set the hard reset
1224 * bit in the phy configuration register. We then must start OOB over with the
1236 readl(&iphy->link_layer_registers->phy_configuration); in scu_link_layer_tx_hard_reset()
1242 &iphy->link_layer_registers->phy_configuration); in scu_link_layer_tx_hard_reset()
1244 /* Now take the OOB state machine out of reset */ in scu_link_layer_tx_hard_reset()
1248 &iphy->link_layer_registers->phy_configuration); in scu_link_layer_tx_hard_reset()
1254 struct isci_port *iport = iphy->owning_port; in sci_phy_stopped_state_enter()
1255 struct isci_host *ihost = iport->owning_controller; in sci_phy_stopped_state_enter()
1261 sci_del_timer(&iphy->sata_timer); in sci_phy_stopped_state_enter()
1265 if (iphy->sm.previous_state_id != SCI_PHY_INITIAL) in sci_phy_stopped_state_enter()
1272 struct isci_port *iport = iphy->owning_port; in sci_phy_starting_state_enter()
1273 struct isci_host *ihost = iport->owning_controller; in sci_phy_starting_state_enter()
1279 iphy->protocol = SAS_PROTOCOL_NONE; in sci_phy_starting_state_enter()
1280 iphy->bcn_received_while_port_unassigned = false; in sci_phy_starting_state_enter()
1282 if (iphy->sm.previous_state_id == SCI_PHY_READY) in sci_phy_starting_state_enter()
1285 sci_change_state(&iphy->sm, SCI_PHY_SUB_INITIAL); in sci_phy_starting_state_enter()
1291 struct isci_port *iport = iphy->owning_port; in sci_phy_ready_state_enter()
1292 struct isci_host *ihost = iport->owning_controller; in sci_phy_ready_state_enter()
1312 sci_port_deactivate_phy(iphy->owning_port, iphy, false); in sci_phy_resetting_state_enter()
1314 if (iphy->protocol == SAS_PROTOCOL_SSP) { in sci_phy_resetting_state_enter()
1320 sci_change_state(&iphy->sm, SCI_PHY_STARTING); in sci_phy_resetting_state_enter()
1374 sci_init_sm(&iphy->sm, sci_phy_state_table, SCI_PHY_INITIAL); in sci_phy_construct()
1377 iphy->owning_port = iport; in sci_phy_construct()
1378 iphy->phy_index = phy_index; in sci_phy_construct()
1379 iphy->bcn_received_while_port_unassigned = false; in sci_phy_construct()
1380 iphy->protocol = SAS_PROTOCOL_NONE; in sci_phy_construct()
1381 iphy->link_layer_registers = NULL; in sci_phy_construct()
1382 iphy->max_negotiated_speed = SAS_LINK_RATE_UNKNOWN; in sci_phy_construct()
1385 sci_init_timer(&iphy->sata_timer, phy_sata_timeout); in sci_phy_construct()
1390 struct sci_oem_params *oem = &ihost->oem_parameters; in isci_phy_init()
1394 sci_sas_addr = oem->phys[index].sas_address.high; in isci_phy_init()
1396 sci_sas_addr |= oem->phys[index].sas_address.low; in isci_phy_init()
1398 memcpy(iphy->sas_addr, &sas_addr, sizeof(sas_addr)); in isci_phy_init()
1400 iphy->sas_phy.enabled = 0; in isci_phy_init()
1401 iphy->sas_phy.id = index; in isci_phy_init()
1402 iphy->sas_phy.sas_addr = &iphy->sas_addr[0]; in isci_phy_init()
1403 iphy->sas_phy.frame_rcvd = (u8 *)&iphy->frame_rcvd; in isci_phy_init()
1404 iphy->sas_phy.ha = &ihost->sas_ha; in isci_phy_init()
1405 iphy->sas_phy.lldd_phy = iphy; in isci_phy_init()
1406 iphy->sas_phy.enabled = 1; in isci_phy_init()
1407 iphy->sas_phy.iproto = SAS_PROTOCOL_ALL; in isci_phy_init()
1408 iphy->sas_phy.tproto = 0; in isci_phy_init()
1409 iphy->sas_phy.role = PHY_ROLE_INITIATOR; in isci_phy_init()
1410 iphy->sas_phy.oob_mode = OOB_NOT_CONNECTED; in isci_phy_init()
1411 iphy->sas_phy.linkrate = SAS_LINK_RATE_UNKNOWN; in isci_phy_init()
1412 memset(&iphy->frame_rcvd, 0, sizeof(iphy->frame_rcvd)); in isci_phy_init()
1417 * isci_phy_control() - This function is one of the SAS Domain Template
1430 struct isci_phy *iphy = sas_phy->lldd_phy; in isci_phy_control()
1431 struct asd_sas_port *port = sas_phy->port; in isci_phy_control()
1432 struct isci_host *ihost = sas_phy->ha->lldd_ha; in isci_phy_control()
1435 dev_dbg(&ihost->pdev->dev, in isci_phy_control()
1441 spin_lock_irqsave(&ihost->scic_lock, flags); in isci_phy_control()
1444 spin_unlock_irqrestore(&ihost->scic_lock, flags); in isci_phy_control()
1448 spin_lock_irqsave(&ihost->scic_lock, flags); in isci_phy_control()
1452 spin_unlock_irqrestore(&ihost->scic_lock, flags); in isci_phy_control()
1457 return -ENODEV; in isci_phy_control()
1459 ret = isci_port_perform_hard_reset(ihost, port->lldd_port, iphy); in isci_phy_control()
1464 struct sas_phy *phy = sas_phy->phy; in isci_phy_control()
1466 r = iphy->link_layer_registers; in isci_phy_control()
1467 phy->running_disparity_error_count = readl(&r->running_disparity_error_count); in isci_phy_control()
1468 phy->loss_of_dword_sync_count = readl(&r->loss_of_sync_error_count); in isci_phy_control()
1469 phy->phy_reset_problem_count = readl(&r->phy_reset_problem_count); in isci_phy_control()
1470 phy->invalid_dword_count = readl(&r->invalid_dword_counter); in isci_phy_control()
1475 dev_dbg(&ihost->pdev->dev, in isci_phy_control()
1478 ret = -ENOSYS; in isci_phy_control()