diff options
author | Juli Mallett <jmallett@FreeBSD.org> | 2010-11-28 06:20:41 +0000 |
---|---|---|
committer | Juli Mallett <jmallett@FreeBSD.org> | 2010-11-28 06:20:41 +0000 |
commit | 7a1e830cbcd5d33aa7fcdd8732e6ea26510508fd (patch) | |
tree | b8a47c127e9100c1078d4e43f050dccc3b15f210 /cvmx-helper-spi.c | |
parent | 1c305b501145f696d3597fb9b5b2091caaa6f67c (diff) |
Notes
Diffstat (limited to 'cvmx-helper-spi.c')
-rw-r--r-- | cvmx-helper-spi.c | 90 |
1 files changed, 52 insertions, 38 deletions
diff --git a/cvmx-helper-spi.c b/cvmx-helper-spi.c index d2138af67859..e181dc430ab1 100644 --- a/cvmx-helper-spi.c +++ b/cvmx-helper-spi.c @@ -1,54 +1,64 @@ /***********************license start*************** - * Copyright (c) 2003-2008 Cavium Networks (support@cavium.com). All rights - * reserved. - * - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials provided - * with the distribution. - * - * * Neither the name of Cavium Networks nor the names of - * its contributors may be used to endorse or promote products - * derived from this software without specific prior written - * permission. - * - * TO THE MAXIMUM EXTENT PERMITTED BY LAW, THE SOFTWARE IS PROVIDED "AS IS" - * AND WITH ALL FAULTS AND CAVIUM NETWORKS MAKES NO PROMISES, REPRESENTATIONS - * OR WARRANTIES, EITHER EXPRESS, IMPLIED, STATUTORY, OR OTHERWISE, WITH - * RESPECT TO THE SOFTWARE, INCLUDING ITS CONDITION, ITS CONFORMITY TO ANY - * REPRESENTATION OR DESCRIPTION, OR THE EXISTENCE OF ANY LATENT OR PATENT - * DEFECTS, AND CAVIUM SPECIFICALLY DISCLAIMS ALL IMPLIED (IF ANY) WARRANTIES - * OF TITLE, MERCHANTABILITY, NONINFRINGEMENT, FITNESS FOR A PARTICULAR - * PURPOSE, LACK OF VIRUSES, ACCURACY OR COMPLETENESS, QUIET ENJOYMENT, QUIET - * POSSESSION OR CORRESPONDENCE TO DESCRIPTION. THE ENTIRE RISK ARISING OUT - * OF USE OR PERFORMANCE OF THE SOFTWARE LIES WITH YOU. - * - * - * For any questions regarding licensing please contact marketing@caviumnetworks.com - * + * Copyright (c) 2003-2010 Cavium Networks (support@cavium.com). All rights + * reserved. + * + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + + * * Neither the name of Cavium Networks nor the names of + * its contributors may be used to endorse or promote products + * derived from this software without specific prior written + * permission. + + * This Software, including technical data, may be subject to U.S. export control + * laws, including the U.S. Export Administration Act and its associated + * regulations, and may be subject to export or import regulations in other + * countries. + + * TO THE MAXIMUM EXTENT PERMITTED BY LAW, THE SOFTWARE IS PROVIDED "AS IS" + * AND WITH ALL FAULTS AND CAVIUM NETWORKS MAKES NO PROMISES, REPRESENTATIONS OR + * WARRANTIES, EITHER EXPRESS, IMPLIED, STATUTORY, OR OTHERWISE, WITH RESPECT TO + * THE SOFTWARE, INCLUDING ITS CONDITION, ITS CONFORMITY TO ANY REPRESENTATION OR + * DESCRIPTION, OR THE EXISTENCE OF ANY LATENT OR PATENT DEFECTS, AND CAVIUM + * SPECIFICALLY DISCLAIMS ALL IMPLIED (IF ANY) WARRANTIES OF TITLE, + * MERCHANTABILITY, NONINFRINGEMENT, FITNESS FOR A PARTICULAR PURPOSE, LACK OF + * VIRUSES, ACCURACY OR COMPLETENESS, QUIET ENJOYMENT, QUIET POSSESSION OR + * CORRESPONDENCE TO DESCRIPTION. THE ENTIRE RISK ARISING OUT OF USE OR + * PERFORMANCE OF THE SOFTWARE LIES WITH YOU. ***********************license end**************************************/ - /** * @file * * Functions for SPI initialization, configuration, * and monitoring. * - * <hr>$Revision: 42417 $<hr> + * <hr>$Revision: 49448 $<hr> */ +#ifdef CVMX_BUILD_FOR_LINUX_KERNEL +#include <asm/octeon/cvmx.h> +#include <asm/octeon/cvmx-config.h> +#ifdef CVMX_ENABLE_PKO_FUNCTIONS +#include <asm/octeon/cvmx-spi.h> +#include <asm/octeon/cvmx-helper.h> +#endif +#include <asm/octeon/cvmx-pko-defs.h> +#include <asm/octeon/cvmx-pip-defs.h> +#else #include "executive-config.h" #include "cvmx-config.h" #ifdef CVMX_ENABLE_PKO_FUNCTIONS @@ -57,6 +67,10 @@ #include "cvmx-spi.h" #include "cvmx-sysinfo.h" #include "cvmx-helper.h" +#endif +#endif + +#ifdef CVMX_ENABLE_PKO_FUNCTIONS /* CVMX_HELPER_SPI_TIMEOUT is used to determine how long the SPI initialization routines wait for SPI training. You can override the value using @@ -120,7 +134,7 @@ int __cvmx_helper_spi_enable(int interface) int ipd_port; for (ipd_port=interface*16; ipd_port<interface*16+num_ports; ipd_port++) { - cvmx_pip_port_cfg_t port_config; + 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; cvmx_write_csr(CVMX_PIP_PRT_CFGX(ipd_port), port_config.u64); |