Lines Matching +full:xcvr +full:- +full:setup
1 /*-
2 * SPDX-License-Identifier: BSD-2-Clause OR GPL-2.0
9 * Copyright(c) 2008 - 2011 Intel Corporation. All rights reserved.
22 * Foundation, Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
28 * Copyright(c) 2008 - 2011 Intel Corporation. All rights reserved.
133 (((U32)(SMU_CQGR_CYCLE_BIT & (x))) << (31 - SMU_COMPLETION_QUEUE_GET_CYCLE_BIT_SHIFT))
154 (controller)->completion_queue_entries, \
167 (controller)->completion_event_entries, \
171 //****************************************************************************-
173 //****************************************************************************-
190 this_controller->phy_startup_timer_pending = FALSE; in scic_sds_controller_phy_startup_timeout_handler()
210 this_controller->phy_startup_timer = scic_cb_timer_create( in scic_sds_controller_initialize_phy_startup()
216 if (this_controller->phy_startup_timer == NULL) in scic_sds_controller_initialize_phy_startup()
222 this_controller->next_phy_to_start = 0; in scic_sds_controller_initialize_phy_startup()
223 this_controller->phy_startup_timer_pending = FALSE; in scic_sds_controller_initialize_phy_startup()
239 this_controller->power_control.timer = scic_cb_timer_create( in scic_sds_controller_initialize_power_control()
246 this_controller->power_control.requesters, in scic_sds_controller_initialize_power_control()
248 sizeof(this_controller->power_control.requesters) in scic_sds_controller_initialize_power_control()
251 this_controller->power_control.phys_waiting = 0; in scic_sds_controller_initialize_power_control()
252 this_controller->power_control.remote_devices_granted_power = 0; in scic_sds_controller_initialize_power_control()
255 // ---------------------------------------------------------------------------
263 // ---------------------------------------------------------------------------
279 &this_controller->memory_descriptors[SCU_MDE_COMPLETION_QUEUE], in scic_sds_controller_build_memory_descriptor_table()
281 (sizeof(U32) * this_controller->completion_queue_entries), in scic_sds_controller_build_memory_descriptor_table()
286 &this_controller->memory_descriptors[SCU_MDE_REMOTE_NODE_CONTEXT], in scic_sds_controller_build_memory_descriptor_table()
288 this_controller->remote_node_entries * sizeof(SCU_REMOTE_NODE_CONTEXT_T), in scic_sds_controller_build_memory_descriptor_table()
293 &this_controller->memory_descriptors[SCU_MDE_TASK_CONTEXT], in scic_sds_controller_build_memory_descriptor_table()
295 this_controller->task_context_entries * sizeof(SCU_TASK_CONTEXT_T), in scic_sds_controller_build_memory_descriptor_table()
303 &this_controller->uf_control in scic_sds_controller_build_memory_descriptor_table()
307 &this_controller->memory_descriptors[SCU_MDE_UF_BUFFER], in scic_sds_controller_build_memory_descriptor_table()
309 scic_sds_unsolicited_frame_control_get_mde_size(this_controller->uf_control), in scic_sds_controller_build_memory_descriptor_table()
329 &this_controller->memory_descriptors[SCU_MDE_COMPLETION_QUEUE], in scic_sds_controller_validate_memory_descriptor_table()
331 (sizeof(U32) * this_controller->completion_queue_entries), in scic_sds_controller_validate_memory_descriptor_table()
339 &this_controller->memory_descriptors[SCU_MDE_REMOTE_NODE_CONTEXT], in scic_sds_controller_validate_memory_descriptor_table()
341 this_controller->remote_node_entries * sizeof(SCU_REMOTE_NODE_CONTEXT_T), in scic_sds_controller_validate_memory_descriptor_table()
349 &this_controller->memory_descriptors[SCU_MDE_TASK_CONTEXT], in scic_sds_controller_validate_memory_descriptor_table()
351 this_controller->task_context_entries * sizeof(SCU_TASK_CONTEXT_T), in scic_sds_controller_validate_memory_descriptor_table()
359 &this_controller->memory_descriptors[SCU_MDE_UF_BUFFER], in scic_sds_controller_validate_memory_descriptor_table()
361 scic_sds_unsolicited_frame_control_get_mde_size(this_controller->uf_control), in scic_sds_controller_validate_memory_descriptor_table()
387 mde = &this_controller->memory_descriptors[SCU_MDE_COMPLETION_QUEUE]; in scic_sds_controller_ram_initialization()
388 this_controller->completion_queue = (U32*) mde->virtual_address; in scic_sds_controller_ram_initialization()
389 SMU_CQBAR_WRITE(this_controller, mde->physical_address); in scic_sds_controller_ram_initialization()
393 mde = &this_controller->memory_descriptors[SCU_MDE_REMOTE_NODE_CONTEXT]; in scic_sds_controller_ram_initialization()
394 this_controller->remote_node_context_table = (SCU_REMOTE_NODE_CONTEXT_T *) in scic_sds_controller_ram_initialization()
395 mde->virtual_address; in scic_sds_controller_ram_initialization()
396 SMU_RNCBAR_WRITE(this_controller, mde->physical_address); in scic_sds_controller_ram_initialization()
399 mde = &this_controller->memory_descriptors[SCU_MDE_TASK_CONTEXT]; in scic_sds_controller_ram_initialization()
400 this_controller->task_context_table = (SCU_TASK_CONTEXT_T *) in scic_sds_controller_ram_initialization()
401 mde->virtual_address; in scic_sds_controller_ram_initialization()
402 SMU_HTTBAR_WRITE(this_controller, mde->physical_address); in scic_sds_controller_ram_initialization()
404 mde = &this_controller->memory_descriptors[SCU_MDE_UF_BUFFER]; in scic_sds_controller_ram_initialization()
406 &this_controller->uf_control, mde, this_controller in scic_sds_controller_ram_initialization()
413 this_controller->uf_control.headers.physical_address); in scic_sds_controller_ram_initialization()
416 this_controller->uf_control.address_table.physical_address); in scic_sds_controller_ram_initialization()
452 | (SMU_TCA_GEN_VAL(ENDING, this_controller->task_context_entries - 1)) in scic_sds_controller_assign_task_entries()
473 this_controller->completion_queue_get = 0; in scic_sds_controller_initialize_completion_queue()
476 SMU_CQC_QUEUE_LIMIT_SET(this_controller->completion_queue_entries - 1) in scic_sds_controller_initialize_completion_queue()
477 | SMU_CQC_EVENT_LIMIT_SET(this_controller->completion_event_entries - 1) in scic_sds_controller_initialize_completion_queue()
492 this_controller->completion_queue_get = completion_queue_get_value; in scic_sds_controller_initialize_completion_queue()
503 for (index = 0; index < this_controller->completion_queue_entries; index++) in scic_sds_controller_initialize_completion_queue()
508 this_controller->completion_queue[index] = 0x80000000; in scic_sds_controller_initialize_completion_queue()
527 SCU_UFQC_GEN_VAL(QUEUE_SIZE, this_controller->uf_control.address_table.count); in scic_sds_controller_initialize_unsolicited_frame_queue()
531 // Setup the get pointer for the unsolicited frame queue in scic_sds_controller_initialize_unsolicited_frame_queue()
539 // Setup the put pointer for the unsolicited frame queue in scic_sds_controller_initialize_unsolicited_frame_queue()
564 // ---------------------------------------------------------------------------
581 this_controller, this_controller->lex_registers + 0xC4); in scic_sds_controller_lex_status_read_fence()
602 this_controller, this_controller->lex_registers + 0x28, 0x0020FFFF) ; in scic_sds_controller_lex_atux_initialization()
606 this_controller, this_controller->lex_registers + 0xC0, 0x00000700); in scic_sds_controller_lex_atux_initialization()
612 this_controller, this_controller->lex_registers + 0x70, 0x00000002); in scic_sds_controller_lex_atux_initialization()
616 this_controller, this_controller->lex_registers + 0xC0, 0x00000300); in scic_sds_controller_lex_atux_initialization()
620 // 5.1 Release PHY-A Reg Reset in scic_sds_controller_lex_atux_initialization()
622 this_controller, this_controller->lex_registers + 0x28, 0x0000FFFF); in scic_sds_controller_lex_atux_initialization()
624 // 5.2 Initialize the AFE for PHY-A in scic_sds_controller_lex_atux_initialization()
632 this_controller, this_controller->lex_registers + 0x28, 0x0000FFFF); in scic_sds_controller_lex_atux_initialization()
635 // 6.1 Release PHY-B Reg Reset in scic_sds_controller_lex_atux_initialization()
637 this_controller, this_controller->lex_registers + 0x28, 0x0040FFFF) ; in scic_sds_controller_lex_atux_initialization()
639 // 6.2 Initialize the AFE for PHY-B in scic_sds_controller_lex_atux_initialization()
645 // 6.3 Release PHY-B Reg Reset in scic_sds_controller_lex_atux_initialization()
647 this_controller, this_controller->lex_registers + 0x28, 0x0040FFFF) ; in scic_sds_controller_lex_atux_initialization()
652 this_controller, this_controller->lex_registers + 0xC0, 0x00000100); in scic_sds_controller_lex_atux_initialization()
658 this_controller, this_controller->lex_registers + 0xC0, 0x00000000); in scic_sds_controller_lex_atux_initialization()
663 // 8a. Set legacy interrupts (SCU INTx to PCI-x INTA) in scic_sds_controller_lex_atux_initialization()
665 this_controller, this_controller->lex_registers + 0xC0, 0x00000800); in scic_sds_controller_lex_atux_initialization()
674 this_controller, this_controller->lex_registers + 0xC0, 0x27800000); in scic_sds_controller_lex_atux_initialization()
677 // 10. Release PHY-A & PHY-B Resets in scic_sds_controller_lex_atux_initialization()
679 this_controller, this_controller->lex_registers + 0x28, 0x0000FF77); in scic_sds_controller_lex_atux_initialization()
682 this_controller, this_controller->lex_registers + 0x28, 0x0000FF55); in scic_sds_controller_lex_atux_initialization()
685 this_controller, this_controller->lex_registers + 0x28, 0x0000FF11); in scic_sds_controller_lex_atux_initialization()
688 this_controller, this_controller->lex_registers + 0x28, 0x0000FF00); in scic_sds_controller_lex_atux_initialization()
691 this_controller, this_controller->lex_registers + 0x28, 0x0003FF00); in scic_sds_controller_lex_atux_initialization()
695 // ---------------------------------------------------------------------------
708 this_controller, this_controller->lex_registers + 0x88, 0x09090909); in scic_sds_controller_enable_chipwatch()
711 this_controller, this_controller->lex_registers + 0x8C, 0xcac9c862); in scic_sds_controller_enable_chipwatch()
724 * @todo We need to read the AFE setup from the OEM parameters
748 // 2. Write 0x00000000 to AFE XCVR Ctrl2 in scic_sds_controller_afe_initialization()
980 // DFE1-5 = small in scic_sds_controller_afe_initialization()
1035 (this_controller->pci_revision != SCIC_SDS_PCI_REVISION_A0) in scic_sds_controller_afe_initialization()
1036 && (this_controller->pci_revision != SCIC_SDS_PCI_REVISION_A2) in scic_sds_controller_afe_initialization()
1037 && (this_controller->pci_revision != SCIC_SDS_PCI_REVISION_B0) in scic_sds_controller_afe_initialization()
1038 && (this_controller->pci_revision != SCIC_SDS_PCI_REVISION_C0) in scic_sds_controller_afe_initialization()
1039 && (this_controller->pci_revision != SCIC_SDS_PCI_REVISION_C1) in scic_sds_controller_afe_initialization()
1046 this_controller->pci_revision = SCIC_SDS_PCI_REVISION_C1; in scic_sds_controller_afe_initialization()
1050 this_controller->oem_parameters.sds1.controller.cable_selection_mask; in scic_sds_controller_afe_initialization()
1059 (this_controller->pci_revision == SCIC_SDS_PCI_REVISION_B0) in scic_sds_controller_afe_initialization()
1060 || (this_controller->pci_revision == SCIC_SDS_PCI_REVISION_C0) in scic_sds_controller_afe_initialization()
1061 || (this_controller->pci_revision == SCIC_SDS_PCI_REVISION_C1) in scic_sds_controller_afe_initialization()
1071 if (this_controller->pci_revision == SCIC_SDS_PCI_REVISION_A0) in scic_sds_controller_afe_initialization()
1073 else if (this_controller->pci_revision == SCIC_SDS_PCI_REVISION_A2) in scic_sds_controller_afe_initialization()
1075 else if ( (this_controller->pci_revision == SCIC_SDS_PCI_REVISION_B0) in scic_sds_controller_afe_initialization()
1076 || (this_controller->pci_revision == SCIC_SDS_PCI_REVISION_C0) ) in scic_sds_controller_afe_initialization()
1078 else if (this_controller->pci_revision == SCIC_SDS_PCI_REVISION_C1) in scic_sds_controller_afe_initialization()
1085 if ( (this_controller->pci_revision == SCIC_SDS_PCI_REVISION_A0) in scic_sds_controller_afe_initialization()
1086 || (this_controller->pci_revision == SCIC_SDS_PCI_REVISION_A2) ) in scic_sds_controller_afe_initialization()
1090 else if ( (this_controller->pci_revision == SCIC_SDS_PCI_REVISION_B0) in scic_sds_controller_afe_initialization()
1091 || (this_controller->pci_revision == SCIC_SDS_PCI_REVISION_C0) ) in scic_sds_controller_afe_initialization()
1095 else if (this_controller->pci_revision == SCIC_SDS_PCI_REVISION_C1) in scic_sds_controller_afe_initialization()
1117 if ( (this_controller->pci_revision == SCIC_SDS_PCI_REVISION_A0) in scic_sds_controller_afe_initialization()
1118 || (this_controller->pci_revision == SCIC_SDS_PCI_REVISION_A2) ) in scic_sds_controller_afe_initialization()
1131 if ( (this_controller->pci_revision == SCIC_SDS_PCI_REVISION_A0) in scic_sds_controller_afe_initialization()
1132 || (this_controller->pci_revision == SCIC_SDS_PCI_REVISION_A2) ) in scic_sds_controller_afe_initialization()
1146 else if (this_controller->pci_revision == SCIC_SDS_PCI_REVISION_B0) in scic_sds_controller_afe_initialization()
1154 else if (this_controller->pci_revision == SCIC_SDS_PCI_REVISION_C0) in scic_sds_controller_afe_initialization()
1169 else if (this_controller->pci_revision == SCIC_SDS_PCI_REVISION_C1) in scic_sds_controller_afe_initialization()
1186 if (this_controller->pci_revision == SCIC_SDS_PCI_REVISION_A0) in scic_sds_controller_afe_initialization()
1194 else if (this_controller->pci_revision == SCIC_SDS_PCI_REVISION_A2) in scic_sds_controller_afe_initialization()
1202 else if (this_controller->pci_revision == SCIC_SDS_PCI_REVISION_B0) in scic_sds_controller_afe_initialization()
1221 else if (this_controller->pci_revision == SCIC_SDS_PCI_REVISION_C0) in scic_sds_controller_afe_initialization()
1239 else if (this_controller->pci_revision == SCIC_SDS_PCI_REVISION_C1) in scic_sds_controller_afe_initialization()
1262 if ( (this_controller->pci_revision == SCIC_SDS_PCI_REVISION_A0) in scic_sds_controller_afe_initialization()
1263 || (this_controller->pci_revision == SCIC_SDS_PCI_REVISION_A2) ) in scic_sds_controller_afe_initialization()
1274 if ( (this_controller->pci_revision == SCIC_SDS_PCI_REVISION_A0) in scic_sds_controller_afe_initialization()
1275 || (this_controller->pci_revision == SCIC_SDS_PCI_REVISION_A2) in scic_sds_controller_afe_initialization()
1276 || (this_controller->pci_revision == SCIC_SDS_PCI_REVISION_B0) ) in scic_sds_controller_afe_initialization()
1284 else if (this_controller->pci_revision == SCIC_SDS_PCI_REVISION_C0) in scic_sds_controller_afe_initialization()
1290 else if (this_controller->pci_revision == SCIC_SDS_PCI_REVISION_C1) in scic_sds_controller_afe_initialization()
1298 if (this_controller->pci_revision == SCIC_SDS_PCI_REVISION_A0) in scic_sds_controller_afe_initialization()
1306 else if (this_controller->pci_revision == SCIC_SDS_PCI_REVISION_A2) in scic_sds_controller_afe_initialization()
1314 else if (this_controller->pci_revision == SCIC_SDS_PCI_REVISION_B0) in scic_sds_controller_afe_initialization()
1327 else if (this_controller->pci_revision == SCIC_SDS_PCI_REVISION_C0) in scic_sds_controller_afe_initialization()
1341 else if (this_controller->pci_revision == SCIC_SDS_PCI_REVISION_C1) in scic_sds_controller_afe_initialization()
1370 this_controller->oem_parameters.sds1.phys[phy_id].afe_tx_amp_control0 in scic_sds_controller_afe_initialization()
1376 this_controller->oem_parameters.sds1.phys[phy_id].afe_tx_amp_control1 in scic_sds_controller_afe_initialization()
1382 this_controller->oem_parameters.sds1.phys[phy_id].afe_tx_amp_control2 in scic_sds_controller_afe_initialization()
1388 this_controller->oem_parameters.sds1.phys[phy_id].afe_tx_amp_control3 in scic_sds_controller_afe_initialization()
1402 //****************************************************************************-
1404 //****************************************************************************-
1432 if (this_controller->parent.state_machine.current_state_id in scic_sds_controller_transition_to_ready()
1511 for (index = 0; index < this_controller->logical_port_entries; index++) in scic_sds_controller_stop_ports()
1513 port_status = this_controller->port_table[index]. in scic_sds_controller_stop_ports()
1514 state_handlers->parent.stop_handler(&this_controller->port_table[index].parent); in scic_sds_controller_stop_ports()
1526 this_controller->port_table[index].logical_port_index, port_status in scic_sds_controller_stop_ports()
1546 this_controller->phy_startup_timer, in scic_sds_controller_phy_timer_start()
1550 this_controller->phy_startup_timer_pending = TRUE; in scic_sds_controller_phy_timer_start()
1564 this_controller->phy_startup_timer in scic_sds_controller_phy_timer_stop()
1567 this_controller->phy_startup_timer_pending = FALSE; in scic_sds_controller_phy_timer_stop()
1573 * - all links have been given an opportunity to start
1574 * - have no indication of a connected device
1575 * - have an indication of a connected device and it has
1591 SCIC_SDS_PHY_T *the_phy = & this_controller->phy_table[index]; in scic_sds_controller_is_start_complete()
1595 this_controller->oem_parameters.sds1.controller.mode_type in scic_sds_controller_is_start_complete()
1600 this_controller->oem_parameters.sds1.controller.mode_type in scic_sds_controller_is_start_complete()
1610 * - all links have been given an opportunity to start in scic_sds_controller_is_start_complete()
1611 * - have no indication of a connected device in scic_sds_controller_is_start_complete()
1612 * - have an indication of a connected device and it has in scic_sds_controller_is_start_complete()
1617 (the_phy->is_in_link_training == FALSE) in scic_sds_controller_is_start_complete()
1618 && (the_phy->parent.state_machine.current_state_id in scic_sds_controller_is_start_complete()
1622 (the_phy->is_in_link_training == FALSE) in scic_sds_controller_is_start_complete()
1623 && (the_phy->parent.state_machine.current_state_id in scic_sds_controller_is_start_complete()
1627 (the_phy->is_in_link_training == TRUE) in scic_sds_controller_is_start_complete()
1628 && (the_phy->parent.state_machine.current_state_id in scic_sds_controller_is_start_complete()
1632 this_controller->port_agent.phy_ready_mask in scic_sds_controller_is_start_complete()
1633 != this_controller->port_agent.phy_configured_mask in scic_sds_controller_is_start_complete()
1665 if (this_controller->phy_startup_timer_pending == FALSE) in scic_sds_controller_start_next_phy()
1667 if (this_controller->next_phy_to_start == SCI_MAX_PHYS) in scic_sds_controller_start_next_phy()
1682 the_phy = &this_controller->phy_table[this_controller->next_phy_to_start]; in scic_sds_controller_start_next_phy()
1685 this_controller->oem_parameters.sds1.controller.mode_type in scic_sds_controller_start_next_phy()
1691 this_controller->next_phy_to_start++; in scic_sds_controller_start_next_phy()
1714 this_controller->phy_table[this_controller->next_phy_to_start].phy_index, in scic_sds_controller_start_next_phy()
1719 this_controller->next_phy_to_start++; in scic_sds_controller_start_next_phy()
1745 phy_status = scic_phy_stop(&this_controller->phy_table[index]); in scic_sds_controller_stop_phys()
1758 this_controller->phy_table[index].phy_index, phy_status in scic_sds_controller_stop_phys()
1783 for (index = 0; index < this_controller->remote_node_entries; index++) in scic_sds_controller_stop_devices()
1785 if (this_controller->device_table[index] != SCI_INVALID_HANDLE) in scic_sds_controller_stop_devices()
1788 device_status = scic_remote_device_stop(this_controller->device_table[index], 0); in scic_sds_controller_stop_devices()
1799 this_controller->device_table[index], device_status in scic_sds_controller_stop_devices()
1808 //****************************************************************************-
1810 //****************************************************************************-
1823 this_controller, this_controller->power_control.timer, in scic_sds_controller_power_control_timer_start()
1827 this_controller->power_control.timer_started = TRUE; in scic_sds_controller_power_control_timer_start()
1840 if (this_controller->power_control.timer_started) in scic_sds_controller_power_control_timer_stop()
1843 this_controller, this_controller->power_control.timer in scic_sds_controller_power_control_timer_stop()
1846 this_controller->power_control.timer_started = FALSE; in scic_sds_controller_power_control_timer_stop()
1877 this_controller->power_control.remote_devices_granted_power = 0; in scic_sds_controller_power_control_timer_handler()
1879 if (this_controller->power_control.phys_waiting == 0) in scic_sds_controller_power_control_timer_handler()
1881 this_controller->power_control.timer_started = FALSE; in scic_sds_controller_power_control_timer_handler()
1890 && (this_controller->power_control.phys_waiting != 0); in scic_sds_controller_power_control_timer_handler()
1893 if (this_controller->power_control.requesters[i] != NULL) in scic_sds_controller_power_control_timer_handler()
1895 if ( this_controller->power_control.remote_devices_granted_power < in scic_sds_controller_power_control_timer_handler()
1896 … this_controller->oem_parameters.sds1.controller.max_number_concurrent_device_spin_up in scic_sds_controller_power_control_timer_handler()
1899 the_phy = this_controller->power_control.requesters[i]; in scic_sds_controller_power_control_timer_handler()
1900 this_controller->power_control.requesters[i] = NULL; in scic_sds_controller_power_control_timer_handler()
1901 this_controller->power_control.phys_waiting--; in scic_sds_controller_power_control_timer_handler()
1902 this_controller->power_control.remote_devices_granted_power ++; in scic_sds_controller_power_control_timer_handler()
1905 if (the_phy->protocol == SCIC_SDS_PHY_PROTOCOL_SAS) in scic_sds_controller_power_control_timer_handler()
1912 current_requester_phy = this_controller->power_control.requesters[j]; in scic_sds_controller_power_control_timer_handler()
1918 … current_requester_phy->phy_type.sas.identify_address_frame_buffer.sas_address.high in scic_sds_controller_power_control_timer_handler()
1919 … == the_phy->phy_type.sas.identify_address_frame_buffer.sas_address.high && in scic_sds_controller_power_control_timer_handler()
1920 … current_requester_phy->phy_type.sas.identify_address_frame_buffer.sas_address.low in scic_sds_controller_power_control_timer_handler()
1921 == the_phy->phy_type.sas.identify_address_frame_buffer.sas_address.low) in scic_sds_controller_power_control_timer_handler()
1923 this_controller->power_control.requesters[j] = NULL; in scic_sds_controller_power_control_timer_handler()
1924 this_controller->power_control.phys_waiting--; in scic_sds_controller_power_control_timer_handler()
1956 if( this_controller->power_control.remote_devices_granted_power < in scic_sds_controller_power_control_queue_insert()
1957 this_controller->oem_parameters.sds1.controller.max_number_concurrent_device_spin_up in scic_sds_controller_power_control_queue_insert()
1960 this_controller->power_control.remote_devices_granted_power ++; in scic_sds_controller_power_control_queue_insert()
1975 current_phy = &this_controller->phy_table[i]; in scic_sds_controller_power_control_queue_insert()
1977 if (current_phy->parent.state_machine.current_state_id == SCI_BASE_PHY_STATE_READY && in scic_sds_controller_power_control_queue_insert()
1978 current_phy->protocol == SCIC_SDS_PHY_PROTOCOL_SAS && in scic_sds_controller_power_control_queue_insert()
1979 current_phy->phy_type.sas.identify_address_frame_buffer.sas_address.high in scic_sds_controller_power_control_queue_insert()
1980 == the_phy->phy_type.sas.identify_address_frame_buffer.sas_address.high && in scic_sds_controller_power_control_queue_insert()
1981 current_phy->phy_type.sas.identify_address_frame_buffer.sas_address.low in scic_sds_controller_power_control_queue_insert()
1982 == the_phy->phy_type.sas.identify_address_frame_buffer.sas_address.low) in scic_sds_controller_power_control_queue_insert()
1992 this_controller->power_control.requesters[the_phy->phy_index] = the_phy; in scic_sds_controller_power_control_queue_insert()
1993 this_controller->power_control.phys_waiting++; in scic_sds_controller_power_control_queue_insert()
2012 if (this_controller->power_control.requesters[the_phy->phy_index] != NULL) in scic_sds_controller_power_control_queue_remove()
2014 this_controller->power_control.phys_waiting--; in scic_sds_controller_power_control_queue_remove()
2017 this_controller->power_control.requesters[the_phy->phy_index] = NULL; in scic_sds_controller_power_control_queue_remove()
2020 //****************************************************************************-
2022 //****************************************************************************-
2039 U32 get_value = this_controller->completion_queue_get; in scic_sds_controller_completion_queue_has_entries()
2043 == COMPLETION_QUEUE_CYCLE_BIT(this_controller->completion_queue[get_index]) in scic_sds_controller_completion_queue_has_entries()
2052 // ---------------------------------------------------------------------------
2073 io_request = this_controller->io_request_table[index]; in scic_sds_controller_task_completion()
2078 && (io_request->io_tag != SCI_CONTROLLER_INVALID_IO_TAG) in scic_sds_controller_task_completion()
2080 scic_sds_io_tag_get_sequence(io_request->io_tag) in scic_sds_controller_task_completion()
2081 == this_controller->io_request_sequence[index] in scic_sds_controller_task_completion()
2115 io_request = this_controller->io_request_table[index]; in scic_sds_controller_sdma_completion()
2132 device = this_controller->device_table[index]; in scic_sds_controller_sdma_completion()
2156 /// This is an unexpected completion type and is un-recoverable in scic_sds_controller_sdma_completion()
2191 = this_controller->uf_control.buffers.array[frame_index].header; in scic_sds_controller_unsolicited_frame()
2192 this_controller->uf_control.buffers.array[frame_index].state in scic_sds_controller_unsolicited_frame()
2204 if (frame_header->is_address_frame) in scic_sds_controller_unsolicited_frame()
2207 phy = &this_controller->phy_table[index]; in scic_sds_controller_unsolicited_frame()
2224 phy = &this_controller->phy_table[index]; in scic_sds_controller_unsolicited_frame()
2229 if (index < this_controller->remote_node_entries) in scic_sds_controller_unsolicited_frame()
2230 device = this_controller->device_table[index]; in scic_sds_controller_unsolicited_frame()
2284 this_controller->parent.error = SCI_CONTROLLER_FATAL_MEMORY_ERROR; in scic_sds_controller_event_completion()
2303 io_request = this_controller->io_request_table[index]; in scic_sds_controller_event_completion()
2312 io_request = this_controller->io_request_table[index]; in scic_sds_controller_event_completion()
2332 device = this_controller->device_table[index]; in scic_sds_controller_event_completion()
2361 phy = &this_controller->phy_table[index]; in scic_sds_controller_event_completion()
2368 if (index < this_controller->remote_node_entries) in scic_sds_controller_event_completion()
2370 device = this_controller->device_table[index]; in scic_sds_controller_event_completion()
2433 this_controller->completion_queue_get in scic_sds_controller_process_completions()
2437 get_index = NORMALIZE_GET_POINTER(this_controller->completion_queue_get); in scic_sds_controller_process_completions()
2438 get_cycle = SMU_CQGR_CYCLE_BIT & this_controller->completion_queue_get; in scic_sds_controller_process_completions()
2440 event_index = NORMALIZE_EVENT_POINTER(this_controller->completion_queue_get); in scic_sds_controller_process_completions()
2441 event_cycle = SMU_CQGR_EVENT_CYCLE_BIT & this_controller->completion_queue_get; in scic_sds_controller_process_completions()
2445 == COMPLETION_QUEUE_CYCLE_BIT(this_controller->completion_queue[get_index]) in scic_sds_controller_process_completions()
2450 completion_entry = this_controller->completion_queue[get_index]; in scic_sds_controller_process_completions()
2499 this_controller->completion_queue_get = in scic_sds_controller_process_completions()
2505 SMU_CQGR_WRITE(this_controller, this_controller->completion_queue_get); in scic_sds_controller_process_completions()
2512 this_controller->completion_queue_get in scic_sds_controller_process_completions()
2548 this_controller->completion_queue_get in scic_sds_controller_transitioned_process_completions()
2552 get_index = NORMALIZE_GET_POINTER(this_controller->completion_queue_get); in scic_sds_controller_transitioned_process_completions()
2553 get_cycle = SMU_CQGR_CYCLE_BIT & this_controller->completion_queue_get; in scic_sds_controller_transitioned_process_completions()
2555 event_index = NORMALIZE_EVENT_POINTER(this_controller->completion_queue_get); in scic_sds_controller_transitioned_process_completions()
2556 event_cycle = SMU_CQGR_EVENT_CYCLE_BIT & this_controller->completion_queue_get; in scic_sds_controller_transitioned_process_completions()
2561 this_controller->completion_queue[get_index]) in scic_sds_controller_transitioned_process_completions()
2566 completion_entry = this_controller->completion_queue[get_index]; in scic_sds_controller_transitioned_process_completions()
2584 // Fall-through in scic_sds_controller_transitioned_process_completions()
2603 this_controller->completion_queue_get = in scic_sds_controller_transitioned_process_completions()
2609 SMU_CQGR_WRITE(this_controller, this_controller->completion_queue_get); in scic_sds_controller_transitioned_process_completions()
2616 this_controller->completion_queue_get in scic_sds_controller_transitioned_process_completions()
2620 //****************************************************************************-
2622 //****************************************************************************-
2665 this_controller->encountered_fatal_error = TRUE; in scic_sds_controller_standard_interrupt_handler()
2744 if (this_controller->encountered_fatal_error == TRUE) in scic_sds_controller_polling_completion_handler()
2759 if (this_controller->restrict_completions == FALSE) in scic_sds_controller_polling_completion_handler()
3171 //****************************************************************************-
3173 //****************************************************************************-
3230 if (this_controller->state_handlers->link_up_handler != NULL) in scic_sds_controller_link_up()
3232 this_controller->state_handlers->link_up_handler( in scic_sds_controller_link_up()
3241 the_phy->phy_index, in scic_sds_controller_link_up()
3261 if (this_controller->state_handlers->link_down_handler != NULL) in scic_sds_controller_link_down()
3263 this_controller->state_handlers->link_down_handler( in scic_sds_controller_link_down()
3272 the_phy->phy_index, in scic_sds_controller_link_down()
3291 if (this_controller->state_handlers->remote_device_started_handler != NULL) in scic_sds_controller_remote_device_started()
3293 this_controller->state_handlers->remote_device_started_handler( in scic_sds_controller_remote_device_started()
3323 for (index = 0; index < this_controller->remote_node_entries; index++) in scic_sds_controller_has_remote_devices_stopping()
3326 (this_controller->device_table[index] != NULL) in scic_sds_controller_has_remote_devices_stopping()
3328 this_controller->device_table[index]->parent.state_machine.current_state_id in scic_sds_controller_has_remote_devices_stopping()
3352 if (this_controller->state_handlers->remote_device_stopped_handler != NULL) in scic_sds_controller_remote_device_stopped()
3354 this_controller->state_handlers->remote_device_stopped_handler( in scic_sds_controller_remote_device_stopped()
3418 this_controller, this_request->io_tag in scic_sds_controller_copy_task_context()
3423 this_request->task_context_buffer, in scic_sds_controller_copy_task_context()
3430 this_request->task_context_buffer = task_context_buffer; in scic_sds_controller_copy_task_context()
3448 if (task_index < this_controller->task_context_entries) in scic_sds_controller_get_task_context_buffer()
3450 return &this_controller->task_context_table[task_index]; in scic_sds_controller_get_task_context_buffer()
3491 if (task_index < this_controller->task_context_entries) in scic_sds_controller_get_io_request_from_tag()
3493 if (this_controller->io_request_table[task_index] != SCI_INVALID_HANDLE) in scic_sds_controller_get_io_request_from_tag()
3497 if (task_sequence == this_controller->io_request_sequence[task_index]) in scic_sds_controller_get_io_request_from_tag()
3499 return this_controller->io_request_table[task_index]; in scic_sds_controller_get_io_request_from_tag()
3533 &this_controller->available_remote_nodes, remote_node_count in scic_sds_controller_allocate_remote_node_context()
3538 this_controller->device_table[node_index] = the_device; in scic_sds_controller_allocate_remote_node_context()
3567 if (this_controller->device_table[node_id] == the_device) in scic_sds_controller_free_remote_node_context()
3569 this_controller->device_table[node_id] = SCI_INVALID_HANDLE; in scic_sds_controller_free_remote_node_context()
3572 &this_controller->available_remote_nodes, remote_node_count, node_id in scic_sds_controller_free_remote_node_context()
3592 (node_id < this_controller->remote_node_entries) in scic_sds_controller_get_remote_node_context_buffer()
3593 && (this_controller->device_table[node_id] != SCI_INVALID_HANDLE) in scic_sds_controller_get_remote_node_context_buffer()
3596 return &this_controller->remote_node_context_table[node_id]; in scic_sds_controller_get_remote_node_context_buffer()
3628 sizeof(SATA_FIS_REG_D2H_T) - sizeof(U32) in scic_sds_controller_copy_sata_response()
3634 * available for re-use by the hardware. The data contained in the
3650 &this_controller->uf_control, frame_index) == TRUE) in scic_sds_controller_release_frame()
3651 SCU_UFQGP_WRITE(this_controller, this_controller->uf_control.get); in scic_sds_controller_release_frame()
3660 &this_controller->parent.state_machine_logger, in scic_sds_controller_initialize_state_logging()
3661 &this_controller->parent.state_machine, in scic_sds_controller_initialize_state_logging()
3662 &this_controller->parent.parent, in scic_sds_controller_initialize_state_logging()
3674 &this_controller->parent.state_machine_logger, in scic_sds_controller_deinitialize_state_logging()
3675 &this_controller->parent.state_machine in scic_sds_controller_deinitialize_state_logging()
3700 …this_controller->oem_parameters.sds1.controller.mode_type = SCIC_PORT_AUTOMATIC_CONFIGURATION_MODE; in scic_sds_controller_set_default_config_parameters()
3703 this_controller->oem_parameters.sds1.controller.max_number_concurrent_device_spin_up = 1; in scic_sds_controller_set_default_config_parameters()
3706 this_controller->oem_parameters.sds1.controller.ssc_sata_tx_spread_level = 0; in scic_sds_controller_set_default_config_parameters()
3707 this_controller->oem_parameters.sds1.controller.ssc_sas_tx_spread_level = 0; in scic_sds_controller_set_default_config_parameters()
3708 this_controller->oem_parameters.sds1.controller.ssc_sas_tx_type = 0; in scic_sds_controller_set_default_config_parameters()
3711 this_controller->oem_parameters.sds1.controller.cable_selection_mask = 0; in scic_sds_controller_set_default_config_parameters()
3716 this_controller->oem_parameters.sds1.ports[index].phy_mask = 0; in scic_sds_controller_set_default_config_parameters()
3724 this_controller->user_parameters.sds1.phys[index].max_speed_generation = 2; in scic_sds_controller_set_default_config_parameters()
3727 this_controller->user_parameters.sds1.phys[index].align_insertion_frequency = 0x7f; in scic_sds_controller_set_default_config_parameters()
3728 … this_controller->user_parameters.sds1.phys[index].in_connection_align_insertion_frequency = 0xff; in scic_sds_controller_set_default_config_parameters()
3729 …this_controller->user_parameters.sds1.phys[index].notify_enable_spin_up_insertion_frequency = 0x33; in scic_sds_controller_set_default_config_parameters()
3732 // is worked around by having the upper 32-bits of SAS address in scic_sds_controller_set_default_config_parameters()
3735 this_controller->oem_parameters.sds1.phys[index].sas_address.sci_format.high in scic_sds_controller_set_default_config_parameters()
3739 this_controller->oem_parameters.sds1.phys[index].sas_address.sci_format.low in scic_sds_controller_set_default_config_parameters()
3740 = 0x00000001 + this_controller->controller_index; in scic_sds_controller_set_default_config_parameters()
3742 if ( (this_controller->pci_revision == SCIC_SDS_PCI_REVISION_A0) in scic_sds_controller_set_default_config_parameters()
3743 || (this_controller->pci_revision == SCIC_SDS_PCI_REVISION_A2) in scic_sds_controller_set_default_config_parameters()
3744 || (this_controller->pci_revision == SCIC_SDS_PCI_REVISION_B0) ) in scic_sds_controller_set_default_config_parameters()
3746 this_controller->oem_parameters.sds1.phys[index].afe_tx_amp_control0 = 0x000E7C03; in scic_sds_controller_set_default_config_parameters()
3747 this_controller->oem_parameters.sds1.phys[index].afe_tx_amp_control1 = 0x000E7C03; in scic_sds_controller_set_default_config_parameters()
3748 this_controller->oem_parameters.sds1.phys[index].afe_tx_amp_control2 = 0x000E7C03; in scic_sds_controller_set_default_config_parameters()
3749 this_controller->oem_parameters.sds1.phys[index].afe_tx_amp_control3 = 0x000E7C03; in scic_sds_controller_set_default_config_parameters()
3753 this_controller->oem_parameters.sds1.phys[index].afe_tx_amp_control0 = 0x000BDD08; in scic_sds_controller_set_default_config_parameters()
3754 this_controller->oem_parameters.sds1.phys[index].afe_tx_amp_control1 = 0x000B7069; in scic_sds_controller_set_default_config_parameters()
3755 this_controller->oem_parameters.sds1.phys[index].afe_tx_amp_control2 = 0x000B7C09; in scic_sds_controller_set_default_config_parameters()
3756 this_controller->oem_parameters.sds1.phys[index].afe_tx_amp_control3 = 0x000AFC6E; in scic_sds_controller_set_default_config_parameters()
3760 this_controller->user_parameters.sds1.stp_inactivity_timeout = 5; in scic_sds_controller_set_default_config_parameters()
3761 this_controller->user_parameters.sds1.ssp_inactivity_timeout = 5; in scic_sds_controller_set_default_config_parameters()
3762 this_controller->user_parameters.sds1.stp_max_occupancy_timeout = 5; in scic_sds_controller_set_default_config_parameters()
3763 this_controller->user_parameters.sds1.ssp_max_occupancy_timeout = 20; in scic_sds_controller_set_default_config_parameters()
3764 this_controller->user_parameters.sds1.no_outbound_task_timeout = 20; in scic_sds_controller_set_default_config_parameters()
3797 if(this_controller->phy_startup_timer != NULL) in scic_sds_controller_release_resource()
3799 scic_cb_timer_destroy(this_controller, this_controller->phy_startup_timer); in scic_sds_controller_release_resource()
3800 this_controller->phy_startup_timer = NULL; in scic_sds_controller_release_resource()
3803 if(this_controller->power_control.timer != NULL) in scic_sds_controller_release_resource()
3805 scic_cb_timer_destroy(this_controller, this_controller->power_control.timer); in scic_sds_controller_release_resource()
3806 this_controller->power_control.timer = NULL; in scic_sds_controller_release_resource()
3809 if(this_controller->timeout_timer != NULL) in scic_sds_controller_release_resource()
3811 scic_cb_timer_destroy(this_controller, this_controller->timeout_timer); in scic_sds_controller_release_resource()
3812 this_controller->timeout_timer = NULL; in scic_sds_controller_release_resource()
3817 &this_controller->port_agent); in scic_sds_controller_release_resource()
3821 port = &this_controller->port_table[index]; in scic_sds_controller_release_resource()
3827 phy = &this_controller->phy_table[index]; in scic_sds_controller_release_resource()
3855 //****************************************************************************-
3857 //****************************************************************************-
3885 this_controller->controller_index = in scic_controller_construct()
3888 this_controller->pci_revision = my_library->pci_revision; in scic_controller_construct()
3891 &this_controller->parent, in scic_controller_construct()
3894 this_controller->memory_descriptors, in scic_controller_construct()
3895 ARRAY_SIZE(this_controller->memory_descriptors), in scic_controller_construct()
3908 // ---------------------------------------------------------------------------
3925 if (this_controller->state_handlers->parent.initialize_handler != NULL) in scic_controller_initialize()
3927 status = this_controller->state_handlers->parent.initialize_handler( in scic_controller_initialize()
3945 // ---------------------------------------------------------------------------
3960 // --------------------------------- in scic_controller_get_suggested_start_timeout()
3965 // per interval - 1 (once OEM parameters are supported). in scic_controller_get_suggested_start_timeout()
3970 + ((SCI_MAX_PHYS-1) * SCIC_SDS_CONTROLLER_POWER_CONTROL_INTERVAL)); in scic_controller_get_suggested_start_timeout()
3973 // ---------------------------------------------------------------------------
3991 if (this_controller->state_handlers->parent.start_handler != NULL) in scic_controller_start()
3993 status = this_controller->state_handlers->parent.start_handler( in scic_controller_start()
4011 // ---------------------------------------------------------------------------
4029 if (this_controller->state_handlers->parent.stop_handler != NULL) in scic_controller_stop()
4031 status = this_controller->state_handlers->parent.stop_handler( in scic_controller_stop()
4049 // ---------------------------------------------------------------------------
4066 if (this_controller->state_handlers->parent.reset_handler != NULL) in scic_controller_reset()
4068 status = this_controller->state_handlers->parent.reset_handler( in scic_controller_reset()
4086 // ---------------------------------------------------------------------------
4159 // ---------------------------------------------------------------------------
4179 status = this_controller->state_handlers->parent.start_io_handler( in scic_controller_start_io()
4180 &this_controller->parent, in scic_controller_start_io()
4189 // ---------------------------------------------------------------------------
4208 status = this_controller->state_handlers->terminate_request_handler( in scic_controller_terminate_request()
4209 &this_controller->parent, in scic_controller_terminate_request()
4217 // ---------------------------------------------------------------------------
4236 status = this_controller->state_handlers->parent.complete_io_handler( in scic_controller_complete_io()
4237 &this_controller->parent, in scic_controller_complete_io()
4245 // ---------------------------------------------------------------------------
4267 if (this_controller->state_handlers->parent.start_task_handler != NULL) in scic_controller_start_task()
4269 status = this_controller->state_handlers->parent.start_task_handler( in scic_controller_start_task()
4270 &this_controller->parent, in scic_controller_start_task()
4288 // ---------------------------------------------------------------------------
4307 if (this_controller->state_handlers->parent.complete_task_handler != NULL) in scic_controller_complete_task()
4309 status = this_controller->state_handlers->parent.complete_task_handler( in scic_controller_complete_task()
4310 &this_controller->parent, in scic_controller_complete_task()
4329 // ---------------------------------------------------------------------------
4347 if (port_index < this_controller->logical_port_entries) in scic_controller_get_port_handle()
4349 *port_handle = &this_controller->port_table[port_index]; in scic_controller_get_port_handle()
4357 // ---------------------------------------------------------------------------
4375 if (phy_index < ARRAY_SIZE(this_controller->phy_table)) in scic_controller_get_phy_handle()
4377 *phy_handle = &this_controller->phy_table[phy_index]; in scic_controller_get_phy_handle()
4392 // ---------------------------------------------------------------------------
4410 if (!sci_pool_empty(this_controller->tci_pool)) in scic_controller_allocate_io_tag()
4412 sci_pool_get(this_controller->tci_pool, task_context); in scic_controller_allocate_io_tag()
4414 sequence_count = this_controller->io_request_sequence[task_context]; in scic_controller_allocate_io_tag()
4422 // ---------------------------------------------------------------------------
4447 if (!sci_pool_full(this_controller->tci_pool)) in scic_controller_free_io_tag()
4449 if (sequence == this_controller->io_request_sequence[index]) in scic_controller_free_io_tag()
4452 this_controller->io_request_sequence[index]); in scic_controller_free_io_tag()
4454 sci_pool_put(this_controller->tci_pool, index); in scic_controller_free_io_tag()
4463 // ---------------------------------------------------------------------------
4472 ASSERT(this_controller->smu_registers != NULL); in scic_controller_enable_interrupts()
4477 // ---------------------------------------------------------------------------
4486 ASSERT(this_controller->smu_registers != NULL); in scic_controller_disable_interrupts()
4491 // ---------------------------------------------------------------------------
4509 (this_controller->parent.state_machine.current_state_id in scic_controller_set_mode()
4511 || (this_controller->parent.state_machine.current_state_id in scic_controller_set_mode()
4518 this_controller->remote_node_entries = in scic_controller_set_mode()
4519 MIN(this_controller->remote_node_entries, SCI_MAX_REMOTE_DEVICES); in scic_controller_set_mode()
4520 this_controller->task_context_entries = in scic_controller_set_mode()
4521 MIN(this_controller->task_context_entries, SCU_IO_REQUEST_COUNT); in scic_controller_set_mode()
4522 this_controller->uf_control.buffers.count = in scic_controller_set_mode()
4523 MIN(this_controller->uf_control.buffers.count, SCU_UNSOLICITED_FRAME_COUNT); in scic_controller_set_mode()
4524 this_controller->completion_event_entries = in scic_controller_set_mode()
4525 MIN(this_controller->completion_event_entries, SCU_EVENT_COUNT); in scic_controller_set_mode()
4526 this_controller->completion_queue_entries = in scic_controller_set_mode()
4527 MIN(this_controller->completion_queue_entries, SCU_COMPLETION_QUEUE_COUNT); in scic_controller_set_mode()
4533 this_controller->remote_node_entries = in scic_controller_set_mode()
4534 MIN(this_controller->remote_node_entries, SCI_MIN_REMOTE_DEVICES); in scic_controller_set_mode()
4535 this_controller->task_context_entries = in scic_controller_set_mode()
4536 MIN(this_controller->task_context_entries, SCI_MIN_IO_REQUESTS); in scic_controller_set_mode()
4537 this_controller->uf_control.buffers.count = in scic_controller_set_mode()
4538 MIN(this_controller->uf_control.buffers.count, SCU_MIN_UNSOLICITED_FRAMES); in scic_controller_set_mode()
4539 this_controller->completion_event_entries = in scic_controller_set_mode()
4540 MIN(this_controller->completion_event_entries, SCU_MIN_EVENTS); in scic_controller_set_mode()
4541 this_controller->completion_queue_entries = in scic_controller_set_mode()
4542 MIN(this_controller->completion_queue_entries, SCU_MIN_COMPLETION_QUEUE_ENTRIES); in scic_controller_set_mode()
4583 // ---------------------------------------------------------------------------
4593 (this_controller->parent.state_machine.current_state_id in scic_user_parameters_set()
4595 || (this_controller->parent.state_machine.current_state_id in scic_user_parameters_set()
4597 || (this_controller->parent.state_machine.current_state_id in scic_user_parameters_set()
4608 ( scic_parms->sds1.phys[index].max_speed_generation in scic_user_parameters_set()
4610 && scic_parms->sds1.phys[index].max_speed_generation in scic_user_parameters_set()
4617 (scic_parms->sds1.phys[index].in_connection_align_insertion_frequency < 3) || in scic_user_parameters_set()
4618 (scic_parms->sds1.phys[index].align_insertion_frequency == 0) || in scic_user_parameters_set()
4619 (scic_parms->sds1.phys[index].notify_enable_spin_up_insertion_frequency == 0) in scic_user_parameters_set()
4627 (scic_parms->sds1.stp_inactivity_timeout == 0) || in scic_user_parameters_set()
4628 (scic_parms->sds1.ssp_inactivity_timeout == 0) || in scic_user_parameters_set()
4629 (scic_parms->sds1.stp_max_occupancy_timeout == 0) || in scic_user_parameters_set()
4630 (scic_parms->sds1.ssp_max_occupancy_timeout == 0) || in scic_user_parameters_set()
4631 (scic_parms->sds1.no_outbound_task_timeout == 0) in scic_user_parameters_set()
4638 (&this_controller->user_parameters), scic_parms, sizeof(*scic_parms)); in scic_user_parameters_set()
4646 // ---------------------------------------------------------------------------
4655 memcpy(scic_parms, (&this_controller->user_parameters), sizeof(*scic_parms)); in scic_user_parameters_get()
4658 // ---------------------------------------------------------------------------
4667 (SCI_BIOS_OEM_PARAM_ELEMENT_T *)(&(scic_parms->sds1)); in scic_oem_parameters_set()
4671 (this_controller->parent.state_machine.current_state_id in scic_oem_parameters_set()
4673 || (this_controller->parent.state_machine.current_state_id in scic_oem_parameters_set()
4675 || (this_controller->parent.state_machine.current_state_id in scic_oem_parameters_set()
4687 this_controller->oem_parameters_version = scic_parms_version; in scic_oem_parameters_set()
4693 if (scic_parms->sds1.ports[index].phy_mask > SCIC_SDS_PARM_PHY_MASK_MAX) in scic_oem_parameters_set()
4702 scic_parms->sds1.phys[index].sas_address.sci_format.high == 0 in scic_oem_parameters_set()
4703 && scic_parms->sds1.phys[index].sas_address.sci_format.low == 0 in scic_oem_parameters_set()
4711 (scic_parms->sds1.phys[index].afe_tx_amp_control0 == 0) || in scic_oem_parameters_set()
4712 (scic_parms->sds1.phys[index].afe_tx_amp_control1 == 0) || in scic_oem_parameters_set()
4713 (scic_parms->sds1.phys[index].afe_tx_amp_control2 == 0) || in scic_oem_parameters_set()
4714 (scic_parms->sds1.phys[index].afe_tx_amp_control3 == 0) in scic_oem_parameters_set()
4722 if (scic_parms->sds1.controller.mode_type == SCIC_PORT_AUTOMATIC_CONFIGURATION_MODE) in scic_oem_parameters_set()
4726 if (scic_parms->sds1.ports[index].phy_mask != 0) in scic_oem_parameters_set()
4732 else if (scic_parms->sds1.controller.mode_type == SCIC_PORT_MANUAL_CONFIGURATION_MODE) in scic_oem_parameters_set()
4736 combined_phy_mask |= scic_parms->sds1.ports[index].phy_mask; in scic_oem_parameters_set()
4749 …if (scic_parms->sds1.controller.max_number_concurrent_device_spin_up > MAX_CONCURRENT_DEVICE_SPIN_… in scic_oem_parameters_set()
4754 if (old_oem_params->controller.do_enable_ssc != 0) in scic_oem_parameters_set()
4757 && (old_oem_params->controller.do_enable_ssc != 0x01)) in scic_oem_parameters_set()
4763 (SCI_BIOS_OEM_PARAM_ELEMENT_v_1_1_T*)(&(scic_parms->sds1)); in scic_oem_parameters_set()
4765 U8 test = oem_params->controller.ssc_sata_tx_spread_level; in scic_oem_parameters_set()
4770 test = oem_params->controller.ssc_sas_tx_spread_level; in scic_oem_parameters_set()
4771 if (oem_params->controller.ssc_sas_tx_type == 0) in scic_oem_parameters_set()
4777 if (oem_params->controller.ssc_sas_tx_type == 1) in scic_oem_parameters_set()
4786 (&this_controller->oem_parameters), scic_parms, sizeof(*scic_parms)); in scic_oem_parameters_set()
4793 // ---------------------------------------------------------------------------
4802 memcpy(scic_parms, (&this_controller->oem_parameters), sizeof(*scic_parms)); in scic_oem_parameters_get()
4805 // ---------------------------------------------------------------------------
4833 // ----- --- --- ----- in scic_controller_set_interrupt_coalescence()
4834 // 0 - - Disabled in scic_controller_set_interrupt_coalescence()
4886 if ( (coalesce_timeout-max) < (2*min - coalesce_timeout) ) in scic_controller_set_interrupt_coalescence()
4912 scic_controller->interrupt_coalesce_number = (U16)coalesce_number; in scic_controller_set_interrupt_coalescence()
4913 scic_controller->interrupt_coalesce_timeout = coalesce_timeout/100; in scic_controller_set_interrupt_coalescence()
4918 // ---------------------------------------------------------------------------
4927 *coalesce_number = scic_controller->interrupt_coalesce_number; in scic_controller_get_interrupt_coalescence()
4928 *coalesce_timeout = scic_controller->interrupt_coalesce_timeout; in scic_controller_get_interrupt_coalescence()
4933 // ---------------------------------------------------------------------------
4942 // ---------------------------------------------------------------------------
4965 zpt_index = offset + (offset - (offset % 4)) + 4; in scic_controller_read_scratch_ram_dword()
4971 offset = offset - 132; in scic_controller_read_scratch_ram_dword()
4973 zpt_index = offset + (offset - (offset % 4)) + 4; in scic_controller_read_scratch_ram_dword()
4986 // ---------------------------------------------------------------------------
5002 zpt_index = offset + (offset - (offset % 4)) + 4; in scic_controller_write_scratch_ram_dword()
5008 offset = offset - 132; in scic_controller_write_scratch_ram_dword()
5010 zpt_index = offset + (offset - (offset % 4)) + 4; in scic_controller_write_scratch_ram_dword()
5024 // ---------------------------------------------------------------------------
5034 // to re-enable interrupts if so desired after the call. in scic_controller_suspend()
5045 &(this_controller->port_table[index])); in scic_controller_suspend()
5057 this_controller->completion_queue_get = 0; in scic_controller_suspend()
5062 // ---------------------------------------------------------------------------
5075 this_controller->restrict_completions = FALSE; in scic_controller_resume()
5081 &(this_controller->port_table[index])); in scic_controller_resume()
5088 SCIC_SDS_PHY_T * curr_phy = &this_controller->phy_table[index]; in scic_controller_resume()
5102 // ---------------------------------------------------------------------------
5120 if (this_controller->parent.state_machine.current_state_id in scic_controller_transition()
5127 if (this_controller->port_table[index].started_request_count != 0) in scic_controller_transition()
5140 this_controller->restrict_completions = restrict_completions; in scic_controller_transition()
5149 // ---------------------------------------------------------------------------
5160 // ---------------------------------------------------------------------------
5219 * - Issue a warning message
5258 * - Issue a warning message
5298 * - Transition to SCI_BASE_CONTROLLER_STATE_RESETTING
5341 * - Currently this function does nothing
5375 this_controller->timeout_timer = scic_cb_timer_create( in scic_sds_controller_reset_state_initialize_handler()
5417 while (terminate_loop-- && (result != SCI_SUCCESS)) in scic_sds_controller_reset_state_initialize_handler()
5457 this_controller->scu_registers->peg0.ptsg.protocol_engine[index], in scic_sds_controller_reset_state_initialize_handler()
5468 this_controller->logical_port_entries = in scic_sds_controller_reset_state_initialize_handler()
5469 MIN(max_supported_ports, this_controller->logical_port_entries); in scic_sds_controller_reset_state_initialize_handler()
5471 this_controller->task_context_entries = in scic_sds_controller_reset_state_initialize_handler()
5472 MIN(max_supported_io_requests, this_controller->task_context_entries); in scic_sds_controller_reset_state_initialize_handler()
5474 this_controller->remote_node_entries = in scic_sds_controller_reset_state_initialize_handler()
5475 MIN(max_supported_devices, this_controller->remote_node_entries); in scic_sds_controller_reset_state_initialize_handler()
5504 &this_controller->phy_table[index], in scic_sds_controller_reset_state_initialize_handler()
5505 &this_controller->scu_registers->peg0.pe[index].tl, in scic_sds_controller_reset_state_initialize_handler()
5506 &this_controller->scu_registers->peg0.pe[index].ll in scic_sds_controller_reset_state_initialize_handler()
5521 (index < this_controller->logical_port_entries) in scic_sds_controller_reset_state_initialize_handler()
5526 &this_controller->port_table[index], in scic_sds_controller_reset_state_initialize_handler()
5527 &this_controller->scu_registers->peg0.ptsg.port[index], in scic_sds_controller_reset_state_initialize_handler()
5528 &this_controller->scu_registers->peg0.ptsg.protocol_engine, in scic_sds_controller_reset_state_initialize_handler()
5529 &this_controller->scu_registers->peg0.viit[index] in scic_sds_controller_reset_state_initialize_handler()
5538 &this_controller->port_agent in scic_sds_controller_reset_state_initialize_handler()
5574 * - Validate we have a good memory descriptor table
5575 * - Initialze the physical memory before programming the hardware
5576 * - Program the SCU hardware with the physical memory addresses passed in
5578 * - Initialzie the TCi pool
5579 * - Initialize the RNi pool
5580 * - Initialize the completion queue
5581 * - Initialize the unsolicited frame data
5582 * - Take the SCU port task scheduler out of reset
5583 * - Start the first phy object.
5584 * - Transition to SCI_BASE_CONTROLLER_STATE_STARTING.
5620 sci_pool_initialize(this_controller->tci_pool); in scic_sds_controller_initialized_state_start_handler()
5621 for (index = 0; index < this_controller->task_context_entries; index++) in scic_sds_controller_initialized_state_start_handler()
5623 sci_pool_put(this_controller->tci_pool, index); in scic_sds_controller_initialized_state_start_handler()
5628 &this_controller->available_remote_nodes, in scic_sds_controller_initialized_state_start_handler()
5629 this_controller->remote_node_entries in scic_sds_controller_initialized_state_start_handler()
5651 // Setup the phy start timer in scic_sds_controller_initialized_state_start_handler()
5658 (index < this_controller->logical_port_entries) && (result == SCI_SUCCESS); in scic_sds_controller_initialized_state_start_handler()
5662 result = this_controller->port_table[index]. in scic_sds_controller_initialized_state_start_handler()
5663 state_handlers->parent.start_handler(&this_controller->port_table[index].parent); in scic_sds_controller_initialized_state_start_handler()
5672 scic_cb_timer_start(controller, this_controller->timeout_timer, timeout); in scic_sds_controller_initialized_state_start_handler()
5690 * - Stop the phy timer
5691 * - Start the next phy
5692 * - Report the link up condition to the port object
5710 this_controller->port_agent.link_up_handler( in scic_sds_controller_starting_state_link_up_handler()
5711 this_controller, &this_controller->port_agent, port, phy in scic_sds_controller_starting_state_link_up_handler()
5721 * - Report the link down condition to the port object
5737 this_controller->port_agent.link_down_handler( in scic_sds_controller_starting_state_link_down_handler()
5738 this_controller, &this_controller->port_agent, port, phy in scic_sds_controller_starting_state_link_down_handler()
5750 * - Start the timeout timer
5751 * - Transition to SCI_BASE_CONTROLLER_STATE_STOPPING.
5772 scic_cb_timer_start(controller, this_controller->timeout_timer, timeout); in scic_sds_controller_ready_state_stop_handler()
5785 * - Start the io request on the remote device
5786 * - if successful
5787 * - assign the io_request to the io_request_table
5788 * - post the request to the hardware
5830 this_controller->io_request_table[ in scic_sds_controller_ready_state_start_io_handler()
5831 scic_sds_io_tag_get_index(the_request->io_tag)] = the_request; in scic_sds_controller_ready_state_start_io_handler()
5845 * - Complete the io request on the remote device
5846 * - if successful
5847 * - remove the io_request to the io_request_table
5883 index = scic_sds_io_tag_get_index(the_request->io_tag); in scic_sds_controller_ready_state_complete_io_handler()
5884 this_controller->io_request_table[index] = SCI_INVALID_HANDLE; in scic_sds_controller_ready_state_complete_io_handler()
5916 this_controller->io_request_table[ in scic_sds_controller_ready_state_continue_io_handler()
5917 scic_sds_io_tag_get_index(the_request->io_tag)] = the_request; in scic_sds_controller_ready_state_continue_io_handler()
5930 * - The remote device is requested to start the task request
5931 * - if successful
5932 * - assign the task to the io_request_table
5933 * - post the request to the SCU hardware
5975 this_controller->io_request_table[ in scic_sds_controller_ready_state_start_task_handler()
5976 scic_sds_io_tag_get_index(the_request->io_tag)] = the_request; in scic_sds_controller_ready_state_start_task_handler()
5985 this_controller->io_request_table[ in scic_sds_controller_ready_state_start_task_handler()
5986 scic_sds_io_tag_get_index(the_request->io_tag)] = the_request; in scic_sds_controller_ready_state_start_task_handler()
5999 * - call the io request terminate function
6000 * - if successful
6001 * - post the terminate request to the SCU hardware
6032 // request sub-type. in scic_sds_controller_ready_state_terminate_request_handler()
6046 * - Stop the phy timer
6047 * - Start the next phy
6048 * - Report the link up condition to the port object
6064 this_controller->port_agent.link_up_handler( in scic_sds_controller_ready_state_link_up_handler()
6065 this_controller, &this_controller->port_agent, port, phy in scic_sds_controller_ready_state_link_up_handler()
6072 * - Report the link down condition to the port object
6088 this_controller->port_agent.link_down_handler( in scic_sds_controller_ready_state_link_down_handler()
6089 this_controller, &this_controller->port_agent, port, phy in scic_sds_controller_ready_state_link_down_handler()
6100 * - This function is not yet implemented
6146 &controller->parent.state_machine, in scic_sds_controller_stopping_state_device_stopped_handler()
6163 * - Issue a warning message
6202 * - Transition to SCI_BASE_CONTROLLER_STATE_RESETTING
6218 if (this_controller->parent.error == SCI_CONTROLLER_FATAL_MEMORY_ERROR) { in scic_sds_controller_failed_state_reset_handler()
6235 * - call the io request terminate function
6236 * - if successful
6237 * - post the terminate request to the SCU hardware
6481 * - Set the state handlers to the controllers initial state.
6502 &this_controller->parent.state_machine, SCI_BASE_CONTROLLER_STATE_RESET); in scic_sds_controller_initial_state_enter()
6508 * - Set the state handlers to the controllers reset state.
6527 scic_sds_port_configuration_agent_construct(&this_controller->port_agent); in scic_sds_controller_reset_state_enter()
6533 &this_controller->port_table[index], in scic_sds_controller_reset_state_enter()
6544 &this_controller->phy_table[index], in scic_sds_controller_reset_state_enter()
6545 &this_controller->port_table[SCI_MAX_PORTS], in scic_sds_controller_reset_state_enter()
6550 this_controller->invalid_phy_mask = 0; in scic_sds_controller_reset_state_enter()
6553 this_controller->completion_event_entries = SCU_EVENT_COUNT; in scic_sds_controller_reset_state_enter()
6554 this_controller->completion_queue_entries = SCU_COMPLETION_QUEUE_COUNT; in scic_sds_controller_reset_state_enter()
6555 this_controller->remote_node_entries = SCI_MAX_REMOTE_DEVICES; in scic_sds_controller_reset_state_enter()
6556 this_controller->logical_port_entries = SCI_MAX_PORTS; in scic_sds_controller_reset_state_enter()
6557 this_controller->task_context_entries = SCU_IO_REQUEST_COUNT; in scic_sds_controller_reset_state_enter()
6558 this_controller->uf_control.buffers.count = SCU_UNSOLICITED_FRAME_COUNT; in scic_sds_controller_reset_state_enter()
6559 this_controller->uf_control.address_table.count= SCU_UNSOLICITED_FRAME_COUNT; in scic_sds_controller_reset_state_enter()
6568 * - Set the state handlers to the controllers initializing state.
6590 * - Set the state handlers to the controllers initialized state.
6612 * - Set the state handlers to the controllers starting state.
6635 * - This function stops the controller starting timeout timer.
6650 scic_cb_timer_stop(object, this_controller->timeout_timer); in scic_sds_controller_starting_state_exit()
6656 this_controller->phy_startup_timer in scic_sds_controller_starting_state_exit()
6659 this_controller->phy_startup_timer = NULL; in scic_sds_controller_starting_state_exit()
6665 * - Set the state handlers to the controllers ready state.
6704 * - This function does nothing.
6739 * - Set the state handlers to the controllers ready state.
6740 * - Stop all of the remote devices on this controller
6741 * - Stop the ports on this controller
6742 * - Stop the phys on this controller
6768 &this_controller->parent.state_machine, in scic_sds_controller_stopping_state_enter()
6777 * - This function stops the controller stopping timeout timer.
6792 scic_cb_timer_stop(this_controller, this_controller->timeout_timer); in scic_sds_controller_stopping_state_exit()
6798 * - Set the state handlers to the controllers stopped state.
6819 this_controller->timeout_timer in scic_sds_controller_stopped_state_enter()
6821 this_controller->timeout_timer = NULL; in scic_sds_controller_stopped_state_enter()
6828 &this_controller->port_agent in scic_sds_controller_stopped_state_enter()
6837 * - Set the state handlers to the controllers resetting state.
6838 * - Write to the SCU hardware reset register to force a reset
6839 * - Transition to the SCI_BASE_CONTROLLER_STATE_RESET
6886 request_count = remote_device->started_request_count; in scic_sds_abort_reqests()
6888 request_count = port->started_request_count; in scic_sds_abort_reqests()
6897 the_request = controller->io_request_table[index]; in scic_sds_abort_reqests()
6901 if (the_request->target_device == remote_device in scic_sds_abort_reqests()
6902 || the_request->target_device->owning_port == port in scic_sds_abort_reqests()
6907 the_request->target_device, in scic_sds_abort_reqests()
6914 request_count--; in scic_sds_abort_reqests()
6938 if (this_controller->parent.error == SCI_CONTROLLER_FATAL_MEMORY_ERROR) in scic_sds_terminate_reqests()
6958 * - Set the state handlers to the controllers failed state.
6976 if (this_controller->parent.error == SCI_CONTROLLER_FATAL_MEMORY_ERROR) in scic_sds_controller_failed_state_enter()
6983 this_controller->parent.error); in scic_sds_controller_failed_state_enter()
6986 // ---------------------------------------------------------------------------