Lines Matching +full:tx +full:- +full:sync +full:- +full:clock
7 * Copyright (c) 2003-2008 Cavium Networks
14 * AS-IS and WITHOUT ANY WARRANTY; without even the implied warranty
21 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
34 #include <asm/octeon/cvmx-config.h>
36 #include <asm/octeon/cvmx-pko.h>
37 #include <asm/octeon/cvmx-spi.h>
39 #include <asm/octeon/cvmx-spxx-defs.h>
40 #include <asm/octeon/cvmx-stxx-defs.h>
41 #include <asm/octeon/cvmx-srxx-defs.h>
54 { "UNKNOWN", "TX Halfplex", "Rx Halfplex", "Duplex" };
97 * can operate as a full duplex (both Tx and Rx data paths
98 * active) or as a halfplex (either the Tx data path is
100 * @timeout: Timeout to wait for clock synchronization in seconds
108 int res = -1; in cvmx_spi_start_interface()
120 /* Callback to perform clock detection */ in cvmx_spi_start_interface()
126 /* Callback to perform calendar sync */ in cvmx_spi_start_interface()
143 * can operate as a full duplex (both Tx and Rx data paths
144 * active) or as a halfplex (either the Tx data path is
146 * @timeout: Timeout to wait for clock synchronization in seconds
152 int res = -1; in cvmx_spi_restart_interface()
165 /* Callback to perform clock detection */ in cvmx_spi_restart_interface()
171 /* Callback to perform calendar sync */ in cvmx_spi_restart_interface()
188 * can operate as a full duplex (both Tx and Rx data paths
189 * active) or as a halfplex (either the Tx data path is
192 * Returns Zero on success, non-zero error code on failure (will cause
204 uint64_t MS = cvmx_sysinfo_get()->cpu_clock_hz / 1000; in cvmx_spi_reset_cb()
228 cvmx_dprintf("ERROR SPI%d: BIST failed on TX calendar table\n", in cvmx_spi_reset_cb()
298 * Callback to setup calendar and miscellaneous settings before clock detection
303 * can operate as a full duplex (both Tx and Rx data paths
304 * active) or as a halfplex (either the Tx data path is
308 * Returns Zero on success, non-zero error code on failure (will cause
322 srxx_com_ctl.s.prts = num_ports - 1; in cvmx_spi_calendar_setup_cb()
417 * Callback to perform clock detection
422 * can operate as a full duplex (both Tx and Rx data paths
423 * active) or as a halfplex (either the Tx data path is
425 * @timeout: Timeout to wait for clock synchronization in seconds
427 * Returns Zero on success, non-zero error code on failure (will cause
435 uint64_t MS = cvmx_sysinfo_get()->cpu_clock_hz / 1000; in cvmx_spi_clock_detect_cb()
438 * Regardless of operating mode, both Tx and Rx clocks must be in cvmx_spi_clock_detect_cb()
444 * Require 100 clock transitions in order to avoid any noise in cvmx_spi_clock_detect_cb()
452 * We've seen a clock transition, so decrement in cvmx_spi_clock_detect_cb()
455 clock_transitions--; in cvmx_spi_clock_detect_cb()
462 return -1; in cvmx_spi_clock_detect_cb()
469 * Require 100 clock transitions in order to avoid any noise in the in cvmx_spi_clock_detect_cb()
477 * We've seen a clock transition, so decrement in cvmx_spi_clock_detect_cb()
480 clock_transitions--; in cvmx_spi_clock_detect_cb()
487 return -1; in cvmx_spi_clock_detect_cb()
500 * can operate as a full duplex (both Tx and Rx data paths
501 * active) or as a halfplex (either the Tx data path is
505 * Returns Zero on success, non-zero error code on failure (will cause
512 uint64_t MS = cvmx_sysinfo_get()->cpu_clock_hz / 1000; in cvmx_spi_training_cb()
516 /* SRX0 & STX0 Inf0 Links are configured - begin training */ in cvmx_spi_training_cb()
550 rx_training_needed--; in cvmx_spi_training_cb()
556 return -1; in cvmx_spi_training_cb()
569 * can operate as a full duplex (both Tx and Rx data paths
570 * active) or as a halfplex (either the Tx data path is
574 * Returns Zero on success, non-zero error code on failure (will cause
579 uint64_t MS = cvmx_sysinfo_get()->cpu_clock_hz / 1000; in cvmx_spi_calendar_sync_cb()
593 /* STX0 has achieved sync */ in cvmx_spi_calendar_sync_cb()
603 /* Waiting for calendar sync on STX0 STAT */ in cvmx_spi_calendar_sync_cb()
604 cvmx_dprintf("SPI%d: Waiting to sync on STX[%d] STAT\n", in cvmx_spi_calendar_sync_cb()
607 /* SPX0_CLK_STAT - SPX0_CLK_STAT[STXCAL] should be 1 (bit10) */ in cvmx_spi_calendar_sync_cb()
612 return -1; in cvmx_spi_calendar_sync_cb()
626 * can operate as a full duplex (both Tx and Rx data paths
627 * active) or as a halfplex (either the Tx data path is
630 * Returns Zero on success, non-zero error code on failure (will cause
652 cvmx_dprintf("SPI%d: Tx is now up\n", interface); in cvmx_spi_interface_up_cb()
660 gmxx_rxx_frm_max.s.len = 64 * 1024 - 4; in cvmx_spi_interface_up_cb()
664 gmxx_rxx_jabber.s.cnt = 64 * 1024 - 4; in cvmx_spi_interface_up_cb()