18c2ecf20Sopenharmony_ci/***********************license start***************
28c2ecf20Sopenharmony_ci * Author: Cavium Networks
38c2ecf20Sopenharmony_ci *
48c2ecf20Sopenharmony_ci * Contact: support@caviumnetworks.com
58c2ecf20Sopenharmony_ci * This file is part of the OCTEON SDK
68c2ecf20Sopenharmony_ci *
78c2ecf20Sopenharmony_ci * Copyright (c) 2003-2009 Cavium Networks
88c2ecf20Sopenharmony_ci *
98c2ecf20Sopenharmony_ci * This file is free software; you can redistribute it and/or modify
108c2ecf20Sopenharmony_ci * it under the terms of the GNU General Public License, Version 2, as
118c2ecf20Sopenharmony_ci * published by the Free Software Foundation.
128c2ecf20Sopenharmony_ci *
138c2ecf20Sopenharmony_ci * This file is distributed in the hope that it will be useful, but
148c2ecf20Sopenharmony_ci * AS-IS and WITHOUT ANY WARRANTY; without even the implied warranty
158c2ecf20Sopenharmony_ci * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, TITLE, or
168c2ecf20Sopenharmony_ci * NONINFRINGEMENT.  See the GNU General Public License for more
178c2ecf20Sopenharmony_ci * details.
188c2ecf20Sopenharmony_ci *
198c2ecf20Sopenharmony_ci * You should have received a copy of the GNU General Public License
208c2ecf20Sopenharmony_ci * along with this file; if not, write to the Free Software
218c2ecf20Sopenharmony_ci * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
228c2ecf20Sopenharmony_ci * or visit http://www.gnu.org/licenses/.
238c2ecf20Sopenharmony_ci *
248c2ecf20Sopenharmony_ci * This file may also be available under a different license from Cavium.
258c2ecf20Sopenharmony_ci * Contact Cavium Networks for more information
268c2ecf20Sopenharmony_ci ***********************license end**************************************/
278c2ecf20Sopenharmony_ci
288c2ecf20Sopenharmony_ci/*
298c2ecf20Sopenharmony_ci *
308c2ecf20Sopenharmony_ci * Automatically generated functions useful for enabling
318c2ecf20Sopenharmony_ci * and decoding RSL_INT_BLOCKS interrupts.
328c2ecf20Sopenharmony_ci *
338c2ecf20Sopenharmony_ci */
348c2ecf20Sopenharmony_ci
358c2ecf20Sopenharmony_ci#include <asm/octeon/octeon.h>
368c2ecf20Sopenharmony_ci
378c2ecf20Sopenharmony_ci#include <asm/octeon/cvmx-gmxx-defs.h>
388c2ecf20Sopenharmony_ci#include <asm/octeon/cvmx-pcsx-defs.h>
398c2ecf20Sopenharmony_ci#include <asm/octeon/cvmx-pcsxx-defs.h>
408c2ecf20Sopenharmony_ci#include <asm/octeon/cvmx-spxx-defs.h>
418c2ecf20Sopenharmony_ci#include <asm/octeon/cvmx-stxx-defs.h>
428c2ecf20Sopenharmony_ci
438c2ecf20Sopenharmony_ci#ifndef PRINT_ERROR
448c2ecf20Sopenharmony_ci#define PRINT_ERROR(format, ...)
458c2ecf20Sopenharmony_ci#endif
468c2ecf20Sopenharmony_ci
478c2ecf20Sopenharmony_ci
488c2ecf20Sopenharmony_ci/**
498c2ecf20Sopenharmony_ci * __cvmx_interrupt_gmxx_rxx_int_en_enable enables all interrupt bits in cvmx_gmxx_rxx_int_en_t
508c2ecf20Sopenharmony_ci */
518c2ecf20Sopenharmony_civoid __cvmx_interrupt_gmxx_rxx_int_en_enable(int index, int block)
528c2ecf20Sopenharmony_ci{
538c2ecf20Sopenharmony_ci	union cvmx_gmxx_rxx_int_en gmx_rx_int_en;
548c2ecf20Sopenharmony_ci	cvmx_write_csr(CVMX_GMXX_RXX_INT_REG(index, block),
558c2ecf20Sopenharmony_ci		       cvmx_read_csr(CVMX_GMXX_RXX_INT_REG(index, block)));
568c2ecf20Sopenharmony_ci	gmx_rx_int_en.u64 = 0;
578c2ecf20Sopenharmony_ci	if (OCTEON_IS_MODEL(OCTEON_CN56XX)) {
588c2ecf20Sopenharmony_ci		/* Skipping gmx_rx_int_en.s.reserved_29_63 */
598c2ecf20Sopenharmony_ci		gmx_rx_int_en.s.hg2cc = 1;
608c2ecf20Sopenharmony_ci		gmx_rx_int_en.s.hg2fld = 1;
618c2ecf20Sopenharmony_ci		gmx_rx_int_en.s.undat = 1;
628c2ecf20Sopenharmony_ci		gmx_rx_int_en.s.uneop = 1;
638c2ecf20Sopenharmony_ci		gmx_rx_int_en.s.unsop = 1;
648c2ecf20Sopenharmony_ci		gmx_rx_int_en.s.bad_term = 1;
658c2ecf20Sopenharmony_ci		gmx_rx_int_en.s.bad_seq = 1;
668c2ecf20Sopenharmony_ci		gmx_rx_int_en.s.rem_fault = 1;
678c2ecf20Sopenharmony_ci		gmx_rx_int_en.s.loc_fault = 1;
688c2ecf20Sopenharmony_ci		gmx_rx_int_en.s.pause_drp = 1;
698c2ecf20Sopenharmony_ci		/* Skipping gmx_rx_int_en.s.reserved_16_18 */
708c2ecf20Sopenharmony_ci		/*gmx_rx_int_en.s.ifgerr = 1; */
718c2ecf20Sopenharmony_ci		/*gmx_rx_int_en.s.coldet = 1; // Collision detect */
728c2ecf20Sopenharmony_ci		/*gmx_rx_int_en.s.falerr = 1; // False carrier error or extend error after slottime */
738c2ecf20Sopenharmony_ci		/*gmx_rx_int_en.s.rsverr = 1; // RGMII reserved opcodes */
748c2ecf20Sopenharmony_ci		/*gmx_rx_int_en.s.pcterr = 1; // Bad Preamble / Protocol */
758c2ecf20Sopenharmony_ci		gmx_rx_int_en.s.ovrerr = 1;
768c2ecf20Sopenharmony_ci		/* Skipping gmx_rx_int_en.s.reserved_9_9 */
778c2ecf20Sopenharmony_ci		gmx_rx_int_en.s.skperr = 1;
788c2ecf20Sopenharmony_ci		gmx_rx_int_en.s.rcverr = 1;
798c2ecf20Sopenharmony_ci		/* Skipping gmx_rx_int_en.s.reserved_5_6 */
808c2ecf20Sopenharmony_ci		/*gmx_rx_int_en.s.fcserr = 1; // FCS errors are handled when we get work */
818c2ecf20Sopenharmony_ci		gmx_rx_int_en.s.jabber = 1;
828c2ecf20Sopenharmony_ci		/* Skipping gmx_rx_int_en.s.reserved_2_2 */
838c2ecf20Sopenharmony_ci		gmx_rx_int_en.s.carext = 1;
848c2ecf20Sopenharmony_ci		/* Skipping gmx_rx_int_en.s.reserved_0_0 */
858c2ecf20Sopenharmony_ci	}
868c2ecf20Sopenharmony_ci	if (OCTEON_IS_MODEL(OCTEON_CN30XX)) {
878c2ecf20Sopenharmony_ci		/* Skipping gmx_rx_int_en.s.reserved_19_63 */
888c2ecf20Sopenharmony_ci		/*gmx_rx_int_en.s.phy_dupx = 1; */
898c2ecf20Sopenharmony_ci		/*gmx_rx_int_en.s.phy_spd = 1; */
908c2ecf20Sopenharmony_ci		/*gmx_rx_int_en.s.phy_link = 1; */
918c2ecf20Sopenharmony_ci		/*gmx_rx_int_en.s.ifgerr = 1; */
928c2ecf20Sopenharmony_ci		/*gmx_rx_int_en.s.coldet = 1; // Collision detect */
938c2ecf20Sopenharmony_ci		/*gmx_rx_int_en.s.falerr = 1; // False carrier error or extend error after slottime */
948c2ecf20Sopenharmony_ci		/*gmx_rx_int_en.s.rsverr = 1; // RGMII reserved opcodes */
958c2ecf20Sopenharmony_ci		/*gmx_rx_int_en.s.pcterr = 1; // Bad Preamble / Protocol */
968c2ecf20Sopenharmony_ci		gmx_rx_int_en.s.ovrerr = 1;
978c2ecf20Sopenharmony_ci		gmx_rx_int_en.s.niberr = 1;
988c2ecf20Sopenharmony_ci		gmx_rx_int_en.s.skperr = 1;
998c2ecf20Sopenharmony_ci		gmx_rx_int_en.s.rcverr = 1;
1008c2ecf20Sopenharmony_ci		/*gmx_rx_int_en.s.lenerr = 1; // Length errors are handled when we get work */
1018c2ecf20Sopenharmony_ci		gmx_rx_int_en.s.alnerr = 1;
1028c2ecf20Sopenharmony_ci		/*gmx_rx_int_en.s.fcserr = 1; // FCS errors are handled when we get work */
1038c2ecf20Sopenharmony_ci		gmx_rx_int_en.s.jabber = 1;
1048c2ecf20Sopenharmony_ci		gmx_rx_int_en.s.maxerr = 1;
1058c2ecf20Sopenharmony_ci		gmx_rx_int_en.s.carext = 1;
1068c2ecf20Sopenharmony_ci		gmx_rx_int_en.s.minerr = 1;
1078c2ecf20Sopenharmony_ci	}
1088c2ecf20Sopenharmony_ci	if (OCTEON_IS_MODEL(OCTEON_CN50XX)) {
1098c2ecf20Sopenharmony_ci		/* Skipping gmx_rx_int_en.s.reserved_20_63 */
1108c2ecf20Sopenharmony_ci		gmx_rx_int_en.s.pause_drp = 1;
1118c2ecf20Sopenharmony_ci		/*gmx_rx_int_en.s.phy_dupx = 1; */
1128c2ecf20Sopenharmony_ci		/*gmx_rx_int_en.s.phy_spd = 1; */
1138c2ecf20Sopenharmony_ci		/*gmx_rx_int_en.s.phy_link = 1; */
1148c2ecf20Sopenharmony_ci		/*gmx_rx_int_en.s.ifgerr = 1; */
1158c2ecf20Sopenharmony_ci		/*gmx_rx_int_en.s.coldet = 1; // Collision detect */
1168c2ecf20Sopenharmony_ci		/*gmx_rx_int_en.s.falerr = 1; // False carrier error or extend error after slottime */
1178c2ecf20Sopenharmony_ci		/*gmx_rx_int_en.s.rsverr = 1; // RGMII reserved opcodes */
1188c2ecf20Sopenharmony_ci		/*gmx_rx_int_en.s.pcterr = 1; // Bad Preamble / Protocol */
1198c2ecf20Sopenharmony_ci		gmx_rx_int_en.s.ovrerr = 1;
1208c2ecf20Sopenharmony_ci		gmx_rx_int_en.s.niberr = 1;
1218c2ecf20Sopenharmony_ci		gmx_rx_int_en.s.skperr = 1;
1228c2ecf20Sopenharmony_ci		gmx_rx_int_en.s.rcverr = 1;
1238c2ecf20Sopenharmony_ci		/* Skipping gmx_rx_int_en.s.reserved_6_6 */
1248c2ecf20Sopenharmony_ci		gmx_rx_int_en.s.alnerr = 1;
1258c2ecf20Sopenharmony_ci		/*gmx_rx_int_en.s.fcserr = 1; // FCS errors are handled when we get work */
1268c2ecf20Sopenharmony_ci		gmx_rx_int_en.s.jabber = 1;
1278c2ecf20Sopenharmony_ci		/* Skipping gmx_rx_int_en.s.reserved_2_2 */
1288c2ecf20Sopenharmony_ci		gmx_rx_int_en.s.carext = 1;
1298c2ecf20Sopenharmony_ci		/* Skipping gmx_rx_int_en.s.reserved_0_0 */
1308c2ecf20Sopenharmony_ci	}
1318c2ecf20Sopenharmony_ci	if (OCTEON_IS_MODEL(OCTEON_CN38XX)) {
1328c2ecf20Sopenharmony_ci		/* Skipping gmx_rx_int_en.s.reserved_19_63 */
1338c2ecf20Sopenharmony_ci		/*gmx_rx_int_en.s.phy_dupx = 1; */
1348c2ecf20Sopenharmony_ci		/*gmx_rx_int_en.s.phy_spd = 1; */
1358c2ecf20Sopenharmony_ci		/*gmx_rx_int_en.s.phy_link = 1; */
1368c2ecf20Sopenharmony_ci		/*gmx_rx_int_en.s.ifgerr = 1; */
1378c2ecf20Sopenharmony_ci		/*gmx_rx_int_en.s.coldet = 1; // Collision detect */
1388c2ecf20Sopenharmony_ci		/*gmx_rx_int_en.s.falerr = 1; // False carrier error or extend error after slottime */
1398c2ecf20Sopenharmony_ci		/*gmx_rx_int_en.s.rsverr = 1; // RGMII reserved opcodes */
1408c2ecf20Sopenharmony_ci		/*gmx_rx_int_en.s.pcterr = 1; // Bad Preamble / Protocol */
1418c2ecf20Sopenharmony_ci		gmx_rx_int_en.s.ovrerr = 1;
1428c2ecf20Sopenharmony_ci		gmx_rx_int_en.s.niberr = 1;
1438c2ecf20Sopenharmony_ci		gmx_rx_int_en.s.skperr = 1;
1448c2ecf20Sopenharmony_ci		gmx_rx_int_en.s.rcverr = 1;
1458c2ecf20Sopenharmony_ci		/*gmx_rx_int_en.s.lenerr = 1; // Length errors are handled when we get work */
1468c2ecf20Sopenharmony_ci		gmx_rx_int_en.s.alnerr = 1;
1478c2ecf20Sopenharmony_ci		/*gmx_rx_int_en.s.fcserr = 1; // FCS errors are handled when we get work */
1488c2ecf20Sopenharmony_ci		gmx_rx_int_en.s.jabber = 1;
1498c2ecf20Sopenharmony_ci		gmx_rx_int_en.s.maxerr = 1;
1508c2ecf20Sopenharmony_ci		gmx_rx_int_en.s.carext = 1;
1518c2ecf20Sopenharmony_ci		gmx_rx_int_en.s.minerr = 1;
1528c2ecf20Sopenharmony_ci	}
1538c2ecf20Sopenharmony_ci	if (OCTEON_IS_MODEL(OCTEON_CN31XX)) {
1548c2ecf20Sopenharmony_ci		/* Skipping gmx_rx_int_en.s.reserved_19_63 */
1558c2ecf20Sopenharmony_ci		/*gmx_rx_int_en.s.phy_dupx = 1; */
1568c2ecf20Sopenharmony_ci		/*gmx_rx_int_en.s.phy_spd = 1; */
1578c2ecf20Sopenharmony_ci		/*gmx_rx_int_en.s.phy_link = 1; */
1588c2ecf20Sopenharmony_ci		/*gmx_rx_int_en.s.ifgerr = 1; */
1598c2ecf20Sopenharmony_ci		/*gmx_rx_int_en.s.coldet = 1; // Collision detect */
1608c2ecf20Sopenharmony_ci		/*gmx_rx_int_en.s.falerr = 1; // False carrier error or extend error after slottime */
1618c2ecf20Sopenharmony_ci		/*gmx_rx_int_en.s.rsverr = 1; // RGMII reserved opcodes */
1628c2ecf20Sopenharmony_ci		/*gmx_rx_int_en.s.pcterr = 1; // Bad Preamble / Protocol */
1638c2ecf20Sopenharmony_ci		gmx_rx_int_en.s.ovrerr = 1;
1648c2ecf20Sopenharmony_ci		gmx_rx_int_en.s.niberr = 1;
1658c2ecf20Sopenharmony_ci		gmx_rx_int_en.s.skperr = 1;
1668c2ecf20Sopenharmony_ci		gmx_rx_int_en.s.rcverr = 1;
1678c2ecf20Sopenharmony_ci		/*gmx_rx_int_en.s.lenerr = 1; // Length errors are handled when we get work */
1688c2ecf20Sopenharmony_ci		gmx_rx_int_en.s.alnerr = 1;
1698c2ecf20Sopenharmony_ci		/*gmx_rx_int_en.s.fcserr = 1; // FCS errors are handled when we get work */
1708c2ecf20Sopenharmony_ci		gmx_rx_int_en.s.jabber = 1;
1718c2ecf20Sopenharmony_ci		gmx_rx_int_en.s.maxerr = 1;
1728c2ecf20Sopenharmony_ci		gmx_rx_int_en.s.carext = 1;
1738c2ecf20Sopenharmony_ci		gmx_rx_int_en.s.minerr = 1;
1748c2ecf20Sopenharmony_ci	}
1758c2ecf20Sopenharmony_ci	if (OCTEON_IS_MODEL(OCTEON_CN58XX)) {
1768c2ecf20Sopenharmony_ci		/* Skipping gmx_rx_int_en.s.reserved_20_63 */
1778c2ecf20Sopenharmony_ci		gmx_rx_int_en.s.pause_drp = 1;
1788c2ecf20Sopenharmony_ci		/*gmx_rx_int_en.s.phy_dupx = 1; */
1798c2ecf20Sopenharmony_ci		/*gmx_rx_int_en.s.phy_spd = 1; */
1808c2ecf20Sopenharmony_ci		/*gmx_rx_int_en.s.phy_link = 1; */
1818c2ecf20Sopenharmony_ci		/*gmx_rx_int_en.s.ifgerr = 1; */
1828c2ecf20Sopenharmony_ci		/*gmx_rx_int_en.s.coldet = 1; // Collision detect */
1838c2ecf20Sopenharmony_ci		/*gmx_rx_int_en.s.falerr = 1; // False carrier error or extend error after slottime */
1848c2ecf20Sopenharmony_ci		/*gmx_rx_int_en.s.rsverr = 1; // RGMII reserved opcodes */
1858c2ecf20Sopenharmony_ci		/*gmx_rx_int_en.s.pcterr = 1; // Bad Preamble / Protocol */
1868c2ecf20Sopenharmony_ci		gmx_rx_int_en.s.ovrerr = 1;
1878c2ecf20Sopenharmony_ci		gmx_rx_int_en.s.niberr = 1;
1888c2ecf20Sopenharmony_ci		gmx_rx_int_en.s.skperr = 1;
1898c2ecf20Sopenharmony_ci		gmx_rx_int_en.s.rcverr = 1;
1908c2ecf20Sopenharmony_ci		/*gmx_rx_int_en.s.lenerr = 1; // Length errors are handled when we get work */
1918c2ecf20Sopenharmony_ci		gmx_rx_int_en.s.alnerr = 1;
1928c2ecf20Sopenharmony_ci		/*gmx_rx_int_en.s.fcserr = 1; // FCS errors are handled when we get work */
1938c2ecf20Sopenharmony_ci		gmx_rx_int_en.s.jabber = 1;
1948c2ecf20Sopenharmony_ci		gmx_rx_int_en.s.maxerr = 1;
1958c2ecf20Sopenharmony_ci		gmx_rx_int_en.s.carext = 1;
1968c2ecf20Sopenharmony_ci		gmx_rx_int_en.s.minerr = 1;
1978c2ecf20Sopenharmony_ci	}
1988c2ecf20Sopenharmony_ci	if (OCTEON_IS_MODEL(OCTEON_CN52XX)) {
1998c2ecf20Sopenharmony_ci		/* Skipping gmx_rx_int_en.s.reserved_29_63 */
2008c2ecf20Sopenharmony_ci		gmx_rx_int_en.s.hg2cc = 1;
2018c2ecf20Sopenharmony_ci		gmx_rx_int_en.s.hg2fld = 1;
2028c2ecf20Sopenharmony_ci		gmx_rx_int_en.s.undat = 1;
2038c2ecf20Sopenharmony_ci		gmx_rx_int_en.s.uneop = 1;
2048c2ecf20Sopenharmony_ci		gmx_rx_int_en.s.unsop = 1;
2058c2ecf20Sopenharmony_ci		gmx_rx_int_en.s.bad_term = 1;
2068c2ecf20Sopenharmony_ci		gmx_rx_int_en.s.bad_seq = 0;
2078c2ecf20Sopenharmony_ci		gmx_rx_int_en.s.rem_fault = 1;
2088c2ecf20Sopenharmony_ci		gmx_rx_int_en.s.loc_fault = 0;
2098c2ecf20Sopenharmony_ci		gmx_rx_int_en.s.pause_drp = 1;
2108c2ecf20Sopenharmony_ci		/* Skipping gmx_rx_int_en.s.reserved_16_18 */
2118c2ecf20Sopenharmony_ci		/*gmx_rx_int_en.s.ifgerr = 1; */
2128c2ecf20Sopenharmony_ci		/*gmx_rx_int_en.s.coldet = 1; // Collision detect */
2138c2ecf20Sopenharmony_ci		/*gmx_rx_int_en.s.falerr = 1; // False carrier error or extend error after slottime */
2148c2ecf20Sopenharmony_ci		/*gmx_rx_int_en.s.rsverr = 1; // RGMII reserved opcodes */
2158c2ecf20Sopenharmony_ci		/*gmx_rx_int_en.s.pcterr = 1; // Bad Preamble / Protocol */
2168c2ecf20Sopenharmony_ci		gmx_rx_int_en.s.ovrerr = 1;
2178c2ecf20Sopenharmony_ci		/* Skipping gmx_rx_int_en.s.reserved_9_9 */
2188c2ecf20Sopenharmony_ci		gmx_rx_int_en.s.skperr = 1;
2198c2ecf20Sopenharmony_ci		gmx_rx_int_en.s.rcverr = 1;
2208c2ecf20Sopenharmony_ci		/* Skipping gmx_rx_int_en.s.reserved_5_6 */
2218c2ecf20Sopenharmony_ci		/*gmx_rx_int_en.s.fcserr = 1; // FCS errors are handled when we get work */
2228c2ecf20Sopenharmony_ci		gmx_rx_int_en.s.jabber = 1;
2238c2ecf20Sopenharmony_ci		/* Skipping gmx_rx_int_en.s.reserved_2_2 */
2248c2ecf20Sopenharmony_ci		gmx_rx_int_en.s.carext = 1;
2258c2ecf20Sopenharmony_ci		/* Skipping gmx_rx_int_en.s.reserved_0_0 */
2268c2ecf20Sopenharmony_ci	}
2278c2ecf20Sopenharmony_ci	cvmx_write_csr(CVMX_GMXX_RXX_INT_EN(index, block), gmx_rx_int_en.u64);
2288c2ecf20Sopenharmony_ci}
2298c2ecf20Sopenharmony_ci/**
2308c2ecf20Sopenharmony_ci * __cvmx_interrupt_pcsx_intx_en_reg_enable enables all interrupt bits in cvmx_pcsx_intx_en_reg_t
2318c2ecf20Sopenharmony_ci */
2328c2ecf20Sopenharmony_civoid __cvmx_interrupt_pcsx_intx_en_reg_enable(int index, int block)
2338c2ecf20Sopenharmony_ci{
2348c2ecf20Sopenharmony_ci	union cvmx_pcsx_intx_en_reg pcs_int_en_reg;
2358c2ecf20Sopenharmony_ci	cvmx_write_csr(CVMX_PCSX_INTX_REG(index, block),
2368c2ecf20Sopenharmony_ci		       cvmx_read_csr(CVMX_PCSX_INTX_REG(index, block)));
2378c2ecf20Sopenharmony_ci	pcs_int_en_reg.u64 = 0;
2388c2ecf20Sopenharmony_ci	if (OCTEON_IS_MODEL(OCTEON_CN56XX)) {
2398c2ecf20Sopenharmony_ci		/* Skipping pcs_int_en_reg.s.reserved_12_63 */
2408c2ecf20Sopenharmony_ci		/*pcs_int_en_reg.s.dup = 1; // This happens during normal operation */
2418c2ecf20Sopenharmony_ci		pcs_int_en_reg.s.sync_bad_en = 1;
2428c2ecf20Sopenharmony_ci		pcs_int_en_reg.s.an_bad_en = 1;
2438c2ecf20Sopenharmony_ci		pcs_int_en_reg.s.rxlock_en = 1;
2448c2ecf20Sopenharmony_ci		pcs_int_en_reg.s.rxbad_en = 1;
2458c2ecf20Sopenharmony_ci		/*pcs_int_en_reg.s.rxerr_en = 1; // This happens during normal operation */
2468c2ecf20Sopenharmony_ci		pcs_int_en_reg.s.txbad_en = 1;
2478c2ecf20Sopenharmony_ci		pcs_int_en_reg.s.txfifo_en = 1;
2488c2ecf20Sopenharmony_ci		pcs_int_en_reg.s.txfifu_en = 1;
2498c2ecf20Sopenharmony_ci		pcs_int_en_reg.s.an_err_en = 1;
2508c2ecf20Sopenharmony_ci		/*pcs_int_en_reg.s.xmit_en = 1; // This happens during normal operation */
2518c2ecf20Sopenharmony_ci		/*pcs_int_en_reg.s.lnkspd_en = 1; // This happens during normal operation */
2528c2ecf20Sopenharmony_ci	}
2538c2ecf20Sopenharmony_ci	if (OCTEON_IS_MODEL(OCTEON_CN52XX)) {
2548c2ecf20Sopenharmony_ci		/* Skipping pcs_int_en_reg.s.reserved_12_63 */
2558c2ecf20Sopenharmony_ci		/*pcs_int_en_reg.s.dup = 1; // This happens during normal operation */
2568c2ecf20Sopenharmony_ci		pcs_int_en_reg.s.sync_bad_en = 1;
2578c2ecf20Sopenharmony_ci		pcs_int_en_reg.s.an_bad_en = 1;
2588c2ecf20Sopenharmony_ci		pcs_int_en_reg.s.rxlock_en = 1;
2598c2ecf20Sopenharmony_ci		pcs_int_en_reg.s.rxbad_en = 1;
2608c2ecf20Sopenharmony_ci		/*pcs_int_en_reg.s.rxerr_en = 1; // This happens during normal operation */
2618c2ecf20Sopenharmony_ci		pcs_int_en_reg.s.txbad_en = 1;
2628c2ecf20Sopenharmony_ci		pcs_int_en_reg.s.txfifo_en = 1;
2638c2ecf20Sopenharmony_ci		pcs_int_en_reg.s.txfifu_en = 1;
2648c2ecf20Sopenharmony_ci		pcs_int_en_reg.s.an_err_en = 1;
2658c2ecf20Sopenharmony_ci		/*pcs_int_en_reg.s.xmit_en = 1; // This happens during normal operation */
2668c2ecf20Sopenharmony_ci		/*pcs_int_en_reg.s.lnkspd_en = 1; // This happens during normal operation */
2678c2ecf20Sopenharmony_ci	}
2688c2ecf20Sopenharmony_ci	cvmx_write_csr(CVMX_PCSX_INTX_EN_REG(index, block), pcs_int_en_reg.u64);
2698c2ecf20Sopenharmony_ci}
2708c2ecf20Sopenharmony_ci/**
2718c2ecf20Sopenharmony_ci * __cvmx_interrupt_pcsxx_int_en_reg_enable enables all interrupt bits in cvmx_pcsxx_int_en_reg_t
2728c2ecf20Sopenharmony_ci */
2738c2ecf20Sopenharmony_civoid __cvmx_interrupt_pcsxx_int_en_reg_enable(int index)
2748c2ecf20Sopenharmony_ci{
2758c2ecf20Sopenharmony_ci	union cvmx_pcsxx_int_en_reg pcsx_int_en_reg;
2768c2ecf20Sopenharmony_ci	cvmx_write_csr(CVMX_PCSXX_INT_REG(index),
2778c2ecf20Sopenharmony_ci		       cvmx_read_csr(CVMX_PCSXX_INT_REG(index)));
2788c2ecf20Sopenharmony_ci	pcsx_int_en_reg.u64 = 0;
2798c2ecf20Sopenharmony_ci	if (OCTEON_IS_MODEL(OCTEON_CN56XX)) {
2808c2ecf20Sopenharmony_ci		/* Skipping pcsx_int_en_reg.s.reserved_6_63 */
2818c2ecf20Sopenharmony_ci		pcsx_int_en_reg.s.algnlos_en = 1;
2828c2ecf20Sopenharmony_ci		pcsx_int_en_reg.s.synlos_en = 1;
2838c2ecf20Sopenharmony_ci		pcsx_int_en_reg.s.bitlckls_en = 1;
2848c2ecf20Sopenharmony_ci		pcsx_int_en_reg.s.rxsynbad_en = 1;
2858c2ecf20Sopenharmony_ci		pcsx_int_en_reg.s.rxbad_en = 1;
2868c2ecf20Sopenharmony_ci		pcsx_int_en_reg.s.txflt_en = 1;
2878c2ecf20Sopenharmony_ci	}
2888c2ecf20Sopenharmony_ci	if (OCTEON_IS_MODEL(OCTEON_CN52XX)) {
2898c2ecf20Sopenharmony_ci		/* Skipping pcsx_int_en_reg.s.reserved_6_63 */
2908c2ecf20Sopenharmony_ci		pcsx_int_en_reg.s.algnlos_en = 1;
2918c2ecf20Sopenharmony_ci		pcsx_int_en_reg.s.synlos_en = 1;
2928c2ecf20Sopenharmony_ci		pcsx_int_en_reg.s.bitlckls_en = 0;	/* Happens if XAUI module is not installed */
2938c2ecf20Sopenharmony_ci		pcsx_int_en_reg.s.rxsynbad_en = 1;
2948c2ecf20Sopenharmony_ci		pcsx_int_en_reg.s.rxbad_en = 1;
2958c2ecf20Sopenharmony_ci		pcsx_int_en_reg.s.txflt_en = 1;
2968c2ecf20Sopenharmony_ci	}
2978c2ecf20Sopenharmony_ci	cvmx_write_csr(CVMX_PCSXX_INT_EN_REG(index), pcsx_int_en_reg.u64);
2988c2ecf20Sopenharmony_ci}
2998c2ecf20Sopenharmony_ci
3008c2ecf20Sopenharmony_ci/**
3018c2ecf20Sopenharmony_ci * __cvmx_interrupt_spxx_int_msk_enable enables all interrupt bits in cvmx_spxx_int_msk_t
3028c2ecf20Sopenharmony_ci */
3038c2ecf20Sopenharmony_civoid __cvmx_interrupt_spxx_int_msk_enable(int index)
3048c2ecf20Sopenharmony_ci{
3058c2ecf20Sopenharmony_ci	union cvmx_spxx_int_msk spx_int_msk;
3068c2ecf20Sopenharmony_ci	cvmx_write_csr(CVMX_SPXX_INT_REG(index),
3078c2ecf20Sopenharmony_ci		       cvmx_read_csr(CVMX_SPXX_INT_REG(index)));
3088c2ecf20Sopenharmony_ci	spx_int_msk.u64 = 0;
3098c2ecf20Sopenharmony_ci	if (OCTEON_IS_MODEL(OCTEON_CN38XX)) {
3108c2ecf20Sopenharmony_ci		/* Skipping spx_int_msk.s.reserved_12_63 */
3118c2ecf20Sopenharmony_ci		spx_int_msk.s.calerr = 1;
3128c2ecf20Sopenharmony_ci		spx_int_msk.s.syncerr = 1;
3138c2ecf20Sopenharmony_ci		spx_int_msk.s.diperr = 1;
3148c2ecf20Sopenharmony_ci		spx_int_msk.s.tpaovr = 1;
3158c2ecf20Sopenharmony_ci		spx_int_msk.s.rsverr = 1;
3168c2ecf20Sopenharmony_ci		spx_int_msk.s.drwnng = 1;
3178c2ecf20Sopenharmony_ci		spx_int_msk.s.clserr = 1;
3188c2ecf20Sopenharmony_ci		spx_int_msk.s.spiovr = 1;
3198c2ecf20Sopenharmony_ci		/* Skipping spx_int_msk.s.reserved_2_3 */
3208c2ecf20Sopenharmony_ci		spx_int_msk.s.abnorm = 1;
3218c2ecf20Sopenharmony_ci		spx_int_msk.s.prtnxa = 1;
3228c2ecf20Sopenharmony_ci	}
3238c2ecf20Sopenharmony_ci	if (OCTEON_IS_MODEL(OCTEON_CN58XX)) {
3248c2ecf20Sopenharmony_ci		/* Skipping spx_int_msk.s.reserved_12_63 */
3258c2ecf20Sopenharmony_ci		spx_int_msk.s.calerr = 1;
3268c2ecf20Sopenharmony_ci		spx_int_msk.s.syncerr = 1;
3278c2ecf20Sopenharmony_ci		spx_int_msk.s.diperr = 1;
3288c2ecf20Sopenharmony_ci		spx_int_msk.s.tpaovr = 1;
3298c2ecf20Sopenharmony_ci		spx_int_msk.s.rsverr = 1;
3308c2ecf20Sopenharmony_ci		spx_int_msk.s.drwnng = 1;
3318c2ecf20Sopenharmony_ci		spx_int_msk.s.clserr = 1;
3328c2ecf20Sopenharmony_ci		spx_int_msk.s.spiovr = 1;
3338c2ecf20Sopenharmony_ci		/* Skipping spx_int_msk.s.reserved_2_3 */
3348c2ecf20Sopenharmony_ci		spx_int_msk.s.abnorm = 1;
3358c2ecf20Sopenharmony_ci		spx_int_msk.s.prtnxa = 1;
3368c2ecf20Sopenharmony_ci	}
3378c2ecf20Sopenharmony_ci	cvmx_write_csr(CVMX_SPXX_INT_MSK(index), spx_int_msk.u64);
3388c2ecf20Sopenharmony_ci}
3398c2ecf20Sopenharmony_ci/**
3408c2ecf20Sopenharmony_ci * __cvmx_interrupt_stxx_int_msk_enable enables all interrupt bits in cvmx_stxx_int_msk_t
3418c2ecf20Sopenharmony_ci */
3428c2ecf20Sopenharmony_civoid __cvmx_interrupt_stxx_int_msk_enable(int index)
3438c2ecf20Sopenharmony_ci{
3448c2ecf20Sopenharmony_ci	union cvmx_stxx_int_msk stx_int_msk;
3458c2ecf20Sopenharmony_ci	cvmx_write_csr(CVMX_STXX_INT_REG(index),
3468c2ecf20Sopenharmony_ci		       cvmx_read_csr(CVMX_STXX_INT_REG(index)));
3478c2ecf20Sopenharmony_ci	stx_int_msk.u64 = 0;
3488c2ecf20Sopenharmony_ci	if (OCTEON_IS_MODEL(OCTEON_CN38XX)) {
3498c2ecf20Sopenharmony_ci		/* Skipping stx_int_msk.s.reserved_8_63 */
3508c2ecf20Sopenharmony_ci		stx_int_msk.s.frmerr = 1;
3518c2ecf20Sopenharmony_ci		stx_int_msk.s.unxfrm = 1;
3528c2ecf20Sopenharmony_ci		stx_int_msk.s.nosync = 1;
3538c2ecf20Sopenharmony_ci		stx_int_msk.s.diperr = 1;
3548c2ecf20Sopenharmony_ci		stx_int_msk.s.datovr = 1;
3558c2ecf20Sopenharmony_ci		stx_int_msk.s.ovrbst = 1;
3568c2ecf20Sopenharmony_ci		stx_int_msk.s.calpar1 = 1;
3578c2ecf20Sopenharmony_ci		stx_int_msk.s.calpar0 = 1;
3588c2ecf20Sopenharmony_ci	}
3598c2ecf20Sopenharmony_ci	if (OCTEON_IS_MODEL(OCTEON_CN58XX)) {
3608c2ecf20Sopenharmony_ci		/* Skipping stx_int_msk.s.reserved_8_63 */
3618c2ecf20Sopenharmony_ci		stx_int_msk.s.frmerr = 1;
3628c2ecf20Sopenharmony_ci		stx_int_msk.s.unxfrm = 1;
3638c2ecf20Sopenharmony_ci		stx_int_msk.s.nosync = 1;
3648c2ecf20Sopenharmony_ci		stx_int_msk.s.diperr = 1;
3658c2ecf20Sopenharmony_ci		stx_int_msk.s.datovr = 1;
3668c2ecf20Sopenharmony_ci		stx_int_msk.s.ovrbst = 1;
3678c2ecf20Sopenharmony_ci		stx_int_msk.s.calpar1 = 1;
3688c2ecf20Sopenharmony_ci		stx_int_msk.s.calpar0 = 1;
3698c2ecf20Sopenharmony_ci	}
3708c2ecf20Sopenharmony_ci	cvmx_write_csr(CVMX_STXX_INT_MSK(index), stx_int_msk.u64);
3718c2ecf20Sopenharmony_ci}
372