Lines Matching full:interface

92  * Initialize and start the SPI interface.
94 * @interface: The identifier of the packet interface to configure and
95 * use as a SPI interface.
96 * @mode: The operating mode for the SPI interface. The interface
105 int cvmx_spi_start_interface(int interface, cvmx_spi_mode_t mode, int timeout, in cvmx_spi_start_interface() argument
114 INVOKE_CB(cvmx_spi_callbacks.reset_cb, interface, mode); in cvmx_spi_start_interface()
117 INVOKE_CB(cvmx_spi_callbacks.calendar_setup_cb, interface, mode, in cvmx_spi_start_interface()
121 INVOKE_CB(cvmx_spi_callbacks.clock_detect_cb, interface, mode, timeout); in cvmx_spi_start_interface()
124 INVOKE_CB(cvmx_spi_callbacks.training_cb, interface, mode, timeout); in cvmx_spi_start_interface()
127 INVOKE_CB(cvmx_spi_callbacks.calendar_sync_cb, interface, mode, in cvmx_spi_start_interface()
130 /* Callback to handle interface coming up */ in cvmx_spi_start_interface()
131 INVOKE_CB(cvmx_spi_callbacks.interface_up_cb, interface, mode); in cvmx_spi_start_interface()
137 * This routine restarts the SPI interface after it has lost synchronization
140 * @interface: The identifier of the packet interface to configure and
141 * use as a SPI interface.
142 * @mode: The operating mode for the SPI interface. The interface
150 int cvmx_spi_restart_interface(int interface, cvmx_spi_mode_t mode, int timeout) in cvmx_spi_restart_interface() argument
157 cvmx_dprintf("SPI%d: Restart %s\n", interface, modes[mode]); in cvmx_spi_restart_interface()
160 INVOKE_CB(cvmx_spi_callbacks.reset_cb, interface, mode); in cvmx_spi_restart_interface()
166 INVOKE_CB(cvmx_spi_callbacks.clock_detect_cb, interface, mode, timeout); in cvmx_spi_restart_interface()
169 INVOKE_CB(cvmx_spi_callbacks.training_cb, interface, mode, timeout); in cvmx_spi_restart_interface()
172 INVOKE_CB(cvmx_spi_callbacks.calendar_sync_cb, interface, mode, in cvmx_spi_restart_interface()
175 /* Callback to handle interface coming up */ in cvmx_spi_restart_interface()
176 INVOKE_CB(cvmx_spi_callbacks.interface_up_cb, interface, mode); in cvmx_spi_restart_interface()
185 * @interface: The identifier of the packet interface to configure and
186 * use as a SPI interface.
187 * @mode: The operating mode for the SPI interface. The interface
195 int cvmx_spi_reset_cb(int interface, cvmx_spi_mode_t mode) in cvmx_spi_reset_cb() argument
207 spxx_int_msk.u64 = cvmx_read_csr(CVMX_SPXX_INT_MSK(interface)); in cvmx_spi_reset_cb()
208 cvmx_write_csr(CVMX_SPXX_INT_MSK(interface), 0); in cvmx_spi_reset_cb()
209 stxx_int_msk.u64 = cvmx_read_csr(CVMX_STXX_INT_MSK(interface)); in cvmx_spi_reset_cb()
210 cvmx_write_csr(CVMX_STXX_INT_MSK(interface), 0); in cvmx_spi_reset_cb()
212 /* Run BIST in the SPI interface */ in cvmx_spi_reset_cb()
213 cvmx_write_csr(CVMX_SRXX_COM_CTL(interface), 0); in cvmx_spi_reset_cb()
214 cvmx_write_csr(CVMX_STXX_COM_CTL(interface), 0); in cvmx_spi_reset_cb()
217 cvmx_write_csr(CVMX_SPXX_CLK_CTL(interface), spxx_clk_ctl.u64); in cvmx_spi_reset_cb()
219 spxx_bist_stat.u64 = cvmx_read_csr(CVMX_SPXX_BIST_STAT(interface)); in cvmx_spi_reset_cb()
223 interface); in cvmx_spi_reset_cb()
226 interface); in cvmx_spi_reset_cb()
229 interface); in cvmx_spi_reset_cb()
238 cvmx_write_csr(CVMX_SRXX_SPI4_CALX(index, interface), in cvmx_spi_reset_cb()
243 cvmx_write_csr(CVMX_STXX_SPI4_CALX(index, interface), in cvmx_spi_reset_cb()
248 cvmx_write_csr(CVMX_SPXX_INT_REG(interface), in cvmx_spi_reset_cb()
249 cvmx_read_csr(CVMX_SPXX_INT_REG(interface))); in cvmx_spi_reset_cb()
250 cvmx_write_csr(CVMX_SPXX_INT_MSK(interface), spxx_int_msk.u64); in cvmx_spi_reset_cb()
251 cvmx_write_csr(CVMX_STXX_INT_REG(interface), in cvmx_spi_reset_cb()
252 cvmx_read_csr(CVMX_STXX_INT_REG(interface))); in cvmx_spi_reset_cb()
253 cvmx_write_csr(CVMX_STXX_INT_MSK(interface), stxx_int_msk.u64); in cvmx_spi_reset_cb()
267 cvmx_write_csr(CVMX_SPXX_CLK_CTL(interface), spxx_clk_ctl.u64); in cvmx_spi_reset_cb()
272 cvmx_write_csr(CVMX_SPXX_CLK_CTL(interface), spxx_clk_ctl.u64); in cvmx_spi_reset_cb()
288 cvmx_write_csr(CVMX_SPXX_TRN4_CTL(interface), spxx_trn4_ctl.u64); in cvmx_spi_reset_cb()
291 cvmx_write_csr(CVMX_SPXX_DBG_DESKEW_CTL(interface), in cvmx_spi_reset_cb()
300 * @interface: The identifier of the packet interface to configure and
301 * use as a SPI interface.
302 * @mode: The operating mode for the SPI interface. The interface
311 int cvmx_spi_calendar_setup_cb(int interface, cvmx_spi_mode_t mode, in cvmx_spi_calendar_setup_cb() argument
325 cvmx_write_csr(CVMX_SRXX_COM_CTL(interface), srxx_com_ctl.u64); in cvmx_spi_calendar_setup_cb()
339 cvmx_write_csr(CVMX_SRXX_SPI4_CALX(index, interface), in cvmx_spi_calendar_setup_cb()
346 cvmx_write_csr(CVMX_SRXX_SPI4_STAT(interface), in cvmx_spi_calendar_setup_cb()
362 cvmx_write_csr(CVMX_STXX_ARB_CTL(interface), stxx_arb_ctl.u64); in cvmx_spi_calendar_setup_cb()
368 cvmx_write_csr(CVMX_GMXX_TX_SPI_MAX(interface), in cvmx_spi_calendar_setup_cb()
373 cvmx_write_csr(CVMX_GMXX_TX_SPI_THRESH(interface), in cvmx_spi_calendar_setup_cb()
379 cvmx_write_csr(CVMX_GMXX_TX_SPI_CTL(interface), in cvmx_spi_calendar_setup_cb()
387 cvmx_write_csr(CVMX_STXX_SPI4_DAT(interface), in cvmx_spi_calendar_setup_cb()
402 cvmx_write_csr(CVMX_STXX_SPI4_CALX(index, interface), in cvmx_spi_calendar_setup_cb()
409 cvmx_write_csr(CVMX_STXX_SPI4_STAT(interface), in cvmx_spi_calendar_setup_cb()
419 * @interface: The identifier of the packet interface to configure and
420 * use as a SPI interface.
421 * @mode: The operating mode for the SPI interface. The interface
430 int cvmx_spi_clock_detect_cb(int interface, cvmx_spi_mode_t mode, int timeout) in cvmx_spi_clock_detect_cb() argument
439 * present for the SPI interface to operate. in cvmx_spi_clock_detect_cb()
441 cvmx_dprintf("SPI%d: Waiting to see TsClk...\n", interface); in cvmx_spi_clock_detect_cb()
449 stat.u64 = cvmx_read_csr(CVMX_SPXX_CLK_STAT(interface)); in cvmx_spi_clock_detect_cb()
456 cvmx_write_csr(CVMX_SPXX_CLK_STAT(interface), stat.u64); in cvmx_spi_clock_detect_cb()
461 cvmx_dprintf("SPI%d: Timeout\n", interface); in cvmx_spi_clock_detect_cb()
466 cvmx_dprintf("SPI%d: Waiting to see RsClk...\n", interface); in cvmx_spi_clock_detect_cb()
474 stat.u64 = cvmx_read_csr(CVMX_SPXX_CLK_STAT(interface)); in cvmx_spi_clock_detect_cb()
481 cvmx_write_csr(CVMX_SPXX_CLK_STAT(interface), stat.u64); in cvmx_spi_clock_detect_cb()
486 cvmx_dprintf("SPI%d: Timeout\n", interface); in cvmx_spi_clock_detect_cb()
497 * @interface: The identifier of the packet interface to configure and
498 * use as a SPI interface.
499 * @mode: The operating mode for the SPI interface. The interface
508 int cvmx_spi_training_cb(int interface, cvmx_spi_mode_t mode, int timeout) in cvmx_spi_training_cb() argument
529 cvmx_write_csr(CVMX_SPXX_CLK_CTL(interface), spxx_clk_ctl.u64); in cvmx_spi_training_cb()
533 spxx_trn4_ctl.u64 = cvmx_read_csr(CVMX_SPXX_TRN4_CTL(interface)); in cvmx_spi_training_cb()
535 cvmx_write_csr(CVMX_SPXX_TRN4_CTL(interface), spxx_trn4_ctl.u64); in cvmx_spi_training_cb()
538 cvmx_dprintf("SPI%d: Waiting for training\n", interface); in cvmx_spi_training_cb()
548 stat.u64 = cvmx_read_csr(CVMX_SPXX_CLK_STAT(interface)); in cvmx_spi_training_cb()
551 cvmx_write_csr(CVMX_SPXX_CLK_STAT(interface), stat.u64); in cvmx_spi_training_cb()
555 cvmx_dprintf("SPI%d: Timeout\n", interface); in cvmx_spi_training_cb()
566 * @interface: The identifier of the packet interface to configure and
567 * use as a SPI interface.
568 * @mode: The operating mode for the SPI interface. The interface
577 int cvmx_spi_calendar_sync_cb(int interface, cvmx_spi_mode_t mode, int timeout) in cvmx_spi_calendar_sync_cb() argument
581 /* SRX0 interface should be good, send calendar data */ in cvmx_spi_calendar_sync_cb()
585 interface); in cvmx_spi_calendar_sync_cb()
586 srxx_com_ctl.u64 = cvmx_read_csr(CVMX_SRXX_COM_CTL(interface)); in cvmx_spi_calendar_sync_cb()
589 cvmx_write_csr(CVMX_SRXX_COM_CTL(interface), srxx_com_ctl.u64); in cvmx_spi_calendar_sync_cb()
601 cvmx_write_csr(CVMX_STXX_COM_CTL(interface), stxx_com_ctl.u64); in cvmx_spi_calendar_sync_cb()
605 interface, interface); in cvmx_spi_calendar_sync_cb()
609 stat.u64 = cvmx_read_csr(CVMX_SPXX_CLK_STAT(interface)); in cvmx_spi_calendar_sync_cb()
611 cvmx_dprintf("SPI%d: Timeout\n", interface); in cvmx_spi_calendar_sync_cb()
621 * Callback to handle interface up
623 * @interface: The identifier of the packet interface to configure and
624 * use as a SPI interface.
625 * @mode: The operating mode for the SPI interface. The interface
633 int cvmx_spi_interface_up_cb(int interface, cvmx_spi_mode_t mode) in cvmx_spi_interface_up_cb() argument
641 srxx_com_ctl.u64 = cvmx_read_csr(CVMX_SRXX_COM_CTL(interface)); in cvmx_spi_interface_up_cb()
643 cvmx_write_csr(CVMX_SRXX_COM_CTL(interface), srxx_com_ctl.u64); in cvmx_spi_interface_up_cb()
644 cvmx_dprintf("SPI%d: Rx is now up\n", interface); in cvmx_spi_interface_up_cb()
649 stxx_com_ctl.u64 = cvmx_read_csr(CVMX_STXX_COM_CTL(interface)); in cvmx_spi_interface_up_cb()
651 cvmx_write_csr(CVMX_STXX_COM_CTL(interface), stxx_com_ctl.u64); in cvmx_spi_interface_up_cb()
652 cvmx_dprintf("SPI%d: Tx is now up\n", interface); in cvmx_spi_interface_up_cb()
657 cvmx_write_csr(CVMX_GMXX_RXX_FRM_MIN(0, interface), in cvmx_spi_interface_up_cb()
661 cvmx_write_csr(CVMX_GMXX_RXX_FRM_MAX(0, interface), in cvmx_spi_interface_up_cb()
665 cvmx_write_csr(CVMX_GMXX_RXX_JABBER(0, interface), gmxx_rxx_jabber.u64); in cvmx_spi_interface_up_cb()