From 72d324fab64cfba1e16963a8bcebf29d76ba5027 Mon Sep 17 00:00:00 2001 From: Juli Mallett Date: Mon, 19 Nov 2012 05:24:33 +0000 Subject: [PATCH] Fix packet receive on the ATCA-7220 by disabling FCS-related checks, since the FCS is stripped by the underlying hardware before it reaches the Octeon. --- sys/contrib/octeon-sdk/cvmx-helper-spi.c | 7 +++++++ sys/contrib/octeon-sdk/cvmx-spi.c | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/sys/contrib/octeon-sdk/cvmx-helper-spi.c b/sys/contrib/octeon-sdk/cvmx-helper-spi.c index c5916a18756d..960da0e70e95 100644 --- a/sys/contrib/octeon-sdk/cvmx-helper-spi.c +++ b/sys/contrib/octeon-sdk/cvmx-helper-spi.c @@ -164,6 +164,13 @@ int __cvmx_helper_spi_enable(int interface) cvmx_pip_prt_cfgx_t port_config; port_config.u64 = cvmx_read_csr(CVMX_PIP_PRT_CFGX(ipd_port)); port_config.s.crc_en = 1; +#ifdef OCTEON_VENDOR_RADISYS + /* + * Incoming packets on the RSYS4GBE have the FCS stripped. + */ + if (cvmx_sysinfo_get()->board_type == CVMX_BOARD_TYPE_CUST_RADISYS_RSYS4GBE) + port_config.s.crc_en = 0; +#endif cvmx_write_csr(CVMX_PIP_PRT_CFGX(ipd_port), port_config.u64); } diff --git a/sys/contrib/octeon-sdk/cvmx-spi.c b/sys/contrib/octeon-sdk/cvmx-spi.c index 6f4438217ba4..f901f890f6ef 100644 --- a/sys/contrib/octeon-sdk/cvmx-spi.c +++ b/sys/contrib/octeon-sdk/cvmx-spi.c @@ -652,6 +652,13 @@ int cvmx_spi_interface_up_cb(int interface, cvmx_spi_mode_t mode) gmxx_rxx_frm_min.u64 = 0; gmxx_rxx_frm_min.s.len = 64; +#ifdef OCTEON_VENDOR_RADISYS + /* + * Incoming packets on the RSYS4GBE have the FCS stripped. + */ + if (cvmx_sysinfo_get()->board_type == CVMX_BOARD_TYPE_CUST_RADISYS_RSYS4GBE) + gmxx_rxx_frm_min.s.len -= 4; +#endif cvmx_write_csr(CVMX_GMXX_RXX_FRM_MIN(0,interface), gmxx_rxx_frm_min.u64); gmxx_rxx_frm_max.u64 = 0; gmxx_rxx_frm_max.s.len = 64*1024 - 4;