1210284Sjmallett/***********************license start***************
2232812Sjmallett * Copyright (c) 2003-2010  Cavium Inc. (support@cavium.com). All rights
3215990Sjmallett * reserved.
4210284Sjmallett *
5210284Sjmallett *
6215990Sjmallett * Redistribution and use in source and binary forms, with or without
7215990Sjmallett * modification, are permitted provided that the following conditions are
8215990Sjmallett * met:
9210284Sjmallett *
10215990Sjmallett *   * Redistributions of source code must retain the above copyright
11215990Sjmallett *     notice, this list of conditions and the following disclaimer.
12210284Sjmallett *
13215990Sjmallett *   * Redistributions in binary form must reproduce the above
14215990Sjmallett *     copyright notice, this list of conditions and the following
15215990Sjmallett *     disclaimer in the documentation and/or other materials provided
16215990Sjmallett *     with the distribution.
17215990Sjmallett
18232812Sjmallett *   * Neither the name of Cavium Inc. nor the names of
19215990Sjmallett *     its contributors may be used to endorse or promote products
20215990Sjmallett *     derived from this software without specific prior written
21215990Sjmallett *     permission.
22215990Sjmallett
23215990Sjmallett * This Software, including technical data, may be subject to U.S. export  control
24215990Sjmallett * laws, including the U.S. Export Administration Act and its  associated
25215990Sjmallett * regulations, and may be subject to export or import  regulations in other
26215990Sjmallett * countries.
27215990Sjmallett
28215990Sjmallett * TO THE MAXIMUM EXTENT PERMITTED BY LAW, THE SOFTWARE IS PROVIDED "AS IS"
29232812Sjmallett * AND WITH ALL FAULTS AND CAVIUM INC. MAKES NO PROMISES, REPRESENTATIONS OR
30215990Sjmallett * WARRANTIES, EITHER EXPRESS, IMPLIED, STATUTORY, OR OTHERWISE, WITH RESPECT TO
31215990Sjmallett * THE SOFTWARE, INCLUDING ITS CONDITION, ITS CONFORMITY TO ANY REPRESENTATION OR
32215990Sjmallett * DESCRIPTION, OR THE EXISTENCE OF ANY LATENT OR PATENT DEFECTS, AND CAVIUM
33215990Sjmallett * SPECIFICALLY DISCLAIMS ALL IMPLIED (IF ANY) WARRANTIES OF TITLE,
34215990Sjmallett * MERCHANTABILITY, NONINFRINGEMENT, FITNESS FOR A PARTICULAR PURPOSE, LACK OF
35215990Sjmallett * VIRUSES, ACCURACY OR COMPLETENESS, QUIET ENJOYMENT, QUIET POSSESSION OR
36215990Sjmallett * CORRESPONDENCE TO DESCRIPTION. THE ENTIRE  RISK ARISING OUT OF USE OR
37215990Sjmallett * PERFORMANCE OF THE SOFTWARE LIES WITH YOU.
38210284Sjmallett ***********************license end**************************************/
39210284Sjmallett
40210284Sjmallett
41210284Sjmallett
42210284Sjmallett
43210284Sjmallett
44210284Sjmallett
45215990Sjmallett
46210284Sjmallett/**
47210284Sjmallett * @file
48210284Sjmallett *
49210284Sjmallett * Fixes and workaround for Octeon chip errata. This file
50210284Sjmallett * contains functions called by cvmx-helper to workaround known
51210284Sjmallett * chip errata. For the most part, code doesn't need to call
52210284Sjmallett * these functions directly.
53210284Sjmallett *
54232812Sjmallett * <hr>$Revision: 70030 $<hr>
55210284Sjmallett */
56210284Sjmallett#ifndef __CVMX_HELPER_ERRATA_H__
57210284Sjmallett#define __CVMX_HELPER_ERRATA_H__
58210284Sjmallett
59210284Sjmallett/**
60210284Sjmallett * @INTERNAL
61210284Sjmallett * Function to adjust internal IPD pointer alignments
62210284Sjmallett *
63210284Sjmallett * @return 0 on success
64210284Sjmallett *         !0 on failure
65210284Sjmallett */
66210284Sjmallettextern int __cvmx_helper_errata_fix_ipd_ptr_alignment(void);
67210284Sjmallett
68210284Sjmallett/**
69210284Sjmallett * This function needs to be called on all Octeon chips with
70210284Sjmallett * errata PKI-100.
71210284Sjmallett *
72210284Sjmallett * The Size field is 8 too large in WQE and next pointers
73210284Sjmallett *
74210284Sjmallett *  The Size field generated by IPD is 8 larger than it should
75210284Sjmallett *  be. The Size field is <55:40> of both:
76210284Sjmallett *      - WORD3 in the work queue entry, and
77210284Sjmallett *      - the next buffer pointer (which precedes the packet data
78210284Sjmallett *        in each buffer).
79210284Sjmallett *
80210284Sjmallett * @param work   Work queue entry to fix
81210284Sjmallett * @return Zero on success. Negative on failure
82210284Sjmallett */
83210284Sjmallettextern int cvmx_helper_fix_ipd_packet_chain(cvmx_wqe_t *work);
84210284Sjmallett
85210284Sjmallett/**
86210284Sjmallett * Due to errata G-720, the 2nd order CDR circuit on CN52XX pass
87210284Sjmallett * 1 doesn't work properly. The following code disables 2nd order
88210284Sjmallett * CDR for the specified QLM.
89210284Sjmallett *
90210284Sjmallett * @param qlm    QLM to disable 2nd order CDR for.
91210284Sjmallett */
92210284Sjmallettextern void __cvmx_helper_errata_qlm_disable_2nd_order_cdr(int qlm);
93210284Sjmallett#endif
94