Path: blob/master/arch/mips/cavium-octeon/executive/cvmx-helper-errata.c
10818 views
/***********************license start***************1* Author: Cavium Networks2*3* Contact: [email protected]4* This file is part of the OCTEON SDK5*6* Copyright (c) 2003-2008 Cavium Networks7*8* This file is free software; you can redistribute it and/or modify9* it under the terms of the GNU General Public License, Version 2, as10* published by the Free Software Foundation.11*12* This file is distributed in the hope that it will be useful, but13* AS-IS and WITHOUT ANY WARRANTY; without even the implied warranty14* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, TITLE, or15* NONINFRINGEMENT. See the GNU General Public License for more16* details.17*18* You should have received a copy of the GNU General Public License19* along with this file; if not, write to the Free Software20* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA21* or visit http://www.gnu.org/licenses/.22*23* This file may also be available under a different license from Cavium.24* Contact Cavium Networks for more information25***********************license end**************************************/2627/**28*29* Fixes and workaround for Octeon chip errata. This file30* contains functions called by cvmx-helper to workaround known31* chip errata. For the most part, code doesn't need to call32* these functions directly.33*34*/35#include <linux/module.h>3637#include <asm/octeon/octeon.h>3839#include <asm/octeon/cvmx-helper-jtag.h>4041/**42* Due to errata G-720, the 2nd order CDR circuit on CN52XX pass43* 1 doesn't work properly. The following code disables 2nd order44* CDR for the specified QLM.45*46* @qlm: QLM to disable 2nd order CDR for.47*/48void __cvmx_helper_errata_qlm_disable_2nd_order_cdr(int qlm)49{50int lane;51cvmx_helper_qlm_jtag_init();52/* We need to load all four lanes of the QLM, a total of 1072 bits */53for (lane = 0; lane < 4; lane++) {54/*55* Each lane has 268 bits. We need to set56* cfg_cdr_incx<67:64> = 3 and cfg_cdr_secord<77> =57* 1. All other bits are zero. Bits go in LSB first,58* so start off with the zeros for bits <63:0>.59*/60cvmx_helper_qlm_jtag_shift_zeros(qlm, 63 - 0 + 1);61/* cfg_cdr_incx<67:64>=3 */62cvmx_helper_qlm_jtag_shift(qlm, 67 - 64 + 1, 3);63/* Zeros for bits <76:68> */64cvmx_helper_qlm_jtag_shift_zeros(qlm, 76 - 68 + 1);65/* cfg_cdr_secord<77>=1 */66cvmx_helper_qlm_jtag_shift(qlm, 77 - 77 + 1, 1);67/* Zeros for bits <267:78> */68cvmx_helper_qlm_jtag_shift_zeros(qlm, 267 - 78 + 1);69}70cvmx_helper_qlm_jtag_update(qlm);71}72EXPORT_SYMBOL(__cvmx_helper_errata_qlm_disable_2nd_order_cdr);737475