Path: blob/main/sys/contrib/ncsw/inc/flib/fsl_fman_prs.h
48375 views
/*1* Copyright 2008-2012 Freescale Semiconductor Inc.2*3* Redistribution and use in source and binary forms, with or without4* modification, are permitted provided that the following conditions are met:5* * Redistributions of source code must retain the above copyright6* notice, this list of conditions and the following disclaimer.7* * Redistributions in binary form must reproduce the above copyright8* notice, this list of conditions and the following disclaimer in the9* documentation and/or other materials provided with the distribution.10* * Neither the name of Freescale Semiconductor nor the11* names of its contributors may be used to endorse or promote products12* derived from this software without specific prior written permission.13*14*15* ALTERNATIVELY, this software may be distributed under the terms of the16* GNU General Public License ("GPL") as published by the Free Software17* Foundation, either version 2 of that License or (at your option) any18* later version.19*20* THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY21* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED22* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE23* DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY24* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES25* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;26* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND27* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT28* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS29* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.30*/3132#ifndef __FSL_FMAN_PRS_H33#define __FSL_FMAN_PRS_H3435#include "common/general.h"3637#define FM_PCD_EX_PRS_DOUBLE_ECC 0x0200000038#define FM_PCD_EX_PRS_SINGLE_ECC 0x010000003940#define FM_PCD_PRS_PPSC_ALL_PORTS 0xffff000041#define FM_PCD_PRS_RPIMAC_EN 0x0000000142#define FM_PCD_PRS_PORT_IDLE_STS 0xffff000043#define FM_PCD_PRS_SINGLE_ECC 0x0000400044#define FM_PCD_PRS_DOUBLE_ECC 0x0000400045#define PRS_MAX_CYCLE_LIMIT 81914647#define DEFAULT_MAX_PRS_CYC_LIM 04849struct fman_prs_regs {50uint32_t fmpr_rpclim;51uint32_t fmpr_rpimac;52uint32_t pmeec;53uint32_t res00c[5];54uint32_t fmpr_pevr;55uint32_t fmpr_pever;56uint32_t res028;57uint32_t fmpr_perr;58uint32_t fmpr_perer;59uint32_t res034;60uint32_t res038[10];61uint32_t fmpr_ppsc;62uint32_t res064;63uint32_t fmpr_pds;64uint32_t fmpr_l2rrs;65uint32_t fmpr_l3rrs;66uint32_t fmpr_l4rrs;67uint32_t fmpr_srrs;68uint32_t fmpr_l2rres;69uint32_t fmpr_l3rres;70uint32_t fmpr_l4rres;71uint32_t fmpr_srres;72uint32_t fmpr_spcs;73uint32_t fmpr_spscs;74uint32_t fmpr_hxscs;75uint32_t fmpr_mrcs;76uint32_t fmpr_mwcs;77uint32_t fmpr_mrscs;78uint32_t fmpr_mwscs;79uint32_t fmpr_fcscs;80};8182struct fman_prs_cfg {83uint32_t port_id_stat;84uint16_t max_prs_cyc_lim;85uint32_t prs_exceptions;86};8788uint32_t fman_prs_get_err_event(struct fman_prs_regs *regs, uint32_t ev_mask);89uint32_t fman_prs_get_err_ev_mask(struct fman_prs_regs *regs);90void fman_prs_ack_err_event(struct fman_prs_regs *regs, uint32_t event);91uint32_t fman_prs_get_expt_event(struct fman_prs_regs *regs, uint32_t ev_mask);92uint32_t fman_prs_get_expt_ev_mask(struct fman_prs_regs *regs);93void fman_prs_ack_expt_event(struct fman_prs_regs *regs, uint32_t event);94void fman_prs_defconfig(struct fman_prs_cfg *cfg);95int fman_prs_init(struct fman_prs_regs *regs, struct fman_prs_cfg *cfg);96void fman_prs_enable(struct fman_prs_regs *regs);97void fman_prs_disable(struct fman_prs_regs *regs);98int fman_prs_is_enabled(struct fman_prs_regs *regs);99void fman_prs_set_stst_port_msk(struct fman_prs_regs *regs, uint32_t pid_msk);100void fman_prs_set_stst(struct fman_prs_regs *regs, bool enable);101#endif /* __FSL_FMAN_PRS_H */102103104