cvmx-helper-srio.h revision 215976
167115Smarkm/***********************license start***************
267115Smarkm * Copyright (c) 2003-2010  Cavium Networks (support@cavium.com). All rights
367115Smarkm * reserved.
467115Smarkm *
567115Smarkm *
667115Smarkm * Redistribution and use in source and binary forms, with or without
767115Smarkm * modification, are permitted provided that the following conditions are
867115Smarkm * met:
967115Smarkm *
1067115Smarkm *   * Redistributions of source code must retain the above copyright
1167115Smarkm *     notice, this list of conditions and the following disclaimer.
1267115Smarkm *
1367115Smarkm *   * Redistributions in binary form must reproduce the above
1467115Smarkm *     copyright notice, this list of conditions and the following
1567115Smarkm *     disclaimer in the documentation and/or other materials provided
1667115Smarkm *     with the distribution.
1767115Smarkm
1867115Smarkm *   * Neither the name of Cavium Networks nor the names of
1967115Smarkm *     its contributors may be used to endorse or promote products
2067115Smarkm *     derived from this software without specific prior written
2167115Smarkm *     permission.
2267115Smarkm
2367115Smarkm * This Software, including technical data, may be subject to U.S. export  control
2467115Smarkm * laws, including the U.S. Export Administration Act and its  associated
2567115Smarkm * regulations, and may be subject to export or import  regulations in other
2667115Smarkm * countries.
2767115Smarkm
2867115Smarkm * TO THE MAXIMUM EXTENT PERMITTED BY LAW, THE SOFTWARE IS PROVIDED "AS IS"
2967115Smarkm * AND WITH ALL FAULTS AND CAVIUM  NETWORKS MAKES NO PROMISES, REPRESENTATIONS OR
30206622Suqs * WARRANTIES, EITHER EXPRESS, IMPLIED, STATUTORY, OR OTHERWISE, WITH RESPECT TO
3167115Smarkm * THE SOFTWARE, INCLUDING ITS CONDITION, ITS CONFORMITY TO ANY REPRESENTATION OR
3267115Smarkm * DESCRIPTION, OR THE EXISTENCE OF ANY LATENT OR PATENT DEFECTS, AND CAVIUM
33107383Sru * SPECIFICALLY DISCLAIMS ALL IMPLIED (IF ANY) WARRANTIES OF TITLE,
3468678Ssheldonh * MERCHANTABILITY, NONINFRINGEMENT, FITNESS FOR A PARTICULAR PURPOSE, LACK OF
3568678Ssheldonh * VIRUSES, ACCURACY OR COMPLETENESS, QUIET ENJOYMENT, QUIET POSSESSION OR
3668678Ssheldonh * CORRESPONDENCE TO DESCRIPTION. THE ENTIRE  RISK ARISING OUT OF USE OR
3768678Ssheldonh * PERFORMANCE OF THE SOFTWARE LIES WITH YOU.
3875670Sru ***********************license end**************************************/
3967115Smarkm
4084306Sru
4167115Smarkm
4267115Smarkm
4367115Smarkm
4467115Smarkm
45104900Sphk
46104900Sphk/**
47231564Sed * @file
4867115Smarkm *
4967115Smarkm * Functions for SRIO initialization, configuration,
5084306Sru * and monitoring.
5194482Sdavidc *
5294482Sdavidc * <hr>$Revision: 41586 $<hr>
5367115Smarkm */
5467115Smarkm#ifndef __CVMX_HELPER_SRIO_H__
5567115Smarkm#define __CVMX_HELPER_SRIO_H__
5667115Smarkm
5767115Smarkm/**
5867115Smarkm * @INTERNAL
5968678Ssheldonh * Probe a SRIO interface and determine the number of ports
6067115Smarkm * connected to it. The SRIO interface should still be down after
6167115Smarkm * this call.
62107383Sru *
6367115Smarkm * @param interface Interface to probe
6467115Smarkm *
6567115Smarkm * @return Number of ports on the interface. Zero to disable.
66107383Sru */
6768678Ssheldonhextern int __cvmx_helper_srio_probe(int interface);
6867115Smarkm
6967115Smarkm/**
7067115Smarkm * @INTERNAL
7167115Smarkm * Bringup and enable a SRIO interface. After this call packet
7267115Smarkm * I/O should be fully functional. This is called with IPD
7367115Smarkm * enabled but PKO disabled.
74104900Sphk *
7567115Smarkm * @param interface Interface to bring up
7667115Smarkm *
7767115Smarkm * @return Zero on success, negative on failure
78104900Sphk */
7967115Smarkmextern int __cvmx_helper_srio_enable(int interface);
80104900Sphk
81104900Sphk/**
82104900Sphk * @INTERNAL
83107383Sru * Return the link state of an IPD/PKO port as returned by SRIO link status.
84104900Sphk *
8567115Smarkm * @param ipd_port IPD/PKO port to query
8667115Smarkm *
8767115Smarkm * @return Link state
8867115Smarkm */
89131530Sruextern cvmx_helper_link_info_t __cvmx_helper_srio_link_get(int ipd_port);
90131530Sru
9167115Smarkm/**
92107383Sru * @INTERNAL
9367115Smarkm * Configure an IPD/PKO port for the specified link state. This
9467115Smarkm * function does not influence auto negotiation at the PHY level.
9567115Smarkm * The passed link state must always match the link state returned
96107383Sru * by cvmx_helper_link_get(). It is normally best to use
9767115Smarkm * cvmx_helper_link_autoconf() instead.
98107383Sru *
99131530Sru * @param ipd_port  IPD/PKO port to configure
100131530Sru * @param link_info The new link state
10167115Smarkm *
10267115Smarkm * @return Zero on success, negative on failure
103107383Sru */
10467115Smarkmextern int __cvmx_helper_srio_link_set(int ipd_port, cvmx_helper_link_info_t link_info);
10567115Smarkm
10667115Smarkm#endif
107104900Sphk
10867115Smarkm