Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0-only */
0002 /*******************************************************************************
0003   MMC Header file
0004 
0005   Copyright (C) 2011  STMicroelectronics Ltd
0006 
0007 
0008   Author: Giuseppe Cavallaro <peppe.cavallaro@st.com>
0009 *******************************************************************************/
0010 
0011 #ifndef __MMC_H__
0012 #define __MMC_H__
0013 
0014 /* MMC control register */
0015 /* When set, all counter are reset */
0016 #define MMC_CNTRL_COUNTER_RESET     0x1
0017 /* When set, do not roll over zero after reaching the max value*/
0018 #define MMC_CNTRL_COUNTER_STOP_ROLLOVER 0x2
0019 #define MMC_CNTRL_RESET_ON_READ     0x4 /* Reset after reading */
0020 #define MMC_CNTRL_COUNTER_FREEZER   0x8 /* Freeze counter values to the
0021                          * current value.*/
0022 #define MMC_CNTRL_PRESET        0x10
0023 #define MMC_CNTRL_FULL_HALF_PRESET  0x20
0024 
0025 #define MMC_GMAC4_OFFSET        0x700
0026 #define MMC_GMAC3_X_OFFSET      0x100
0027 #define MMC_XGMAC_OFFSET        0x800
0028 
0029 struct stmmac_counters {
0030     unsigned int mmc_tx_octetcount_gb;
0031     unsigned int mmc_tx_framecount_gb;
0032     unsigned int mmc_tx_broadcastframe_g;
0033     unsigned int mmc_tx_multicastframe_g;
0034     unsigned int mmc_tx_64_octets_gb;
0035     unsigned int mmc_tx_65_to_127_octets_gb;
0036     unsigned int mmc_tx_128_to_255_octets_gb;
0037     unsigned int mmc_tx_256_to_511_octets_gb;
0038     unsigned int mmc_tx_512_to_1023_octets_gb;
0039     unsigned int mmc_tx_1024_to_max_octets_gb;
0040     unsigned int mmc_tx_unicast_gb;
0041     unsigned int mmc_tx_multicast_gb;
0042     unsigned int mmc_tx_broadcast_gb;
0043     unsigned int mmc_tx_underflow_error;
0044     unsigned int mmc_tx_singlecol_g;
0045     unsigned int mmc_tx_multicol_g;
0046     unsigned int mmc_tx_deferred;
0047     unsigned int mmc_tx_latecol;
0048     unsigned int mmc_tx_exesscol;
0049     unsigned int mmc_tx_carrier_error;
0050     unsigned int mmc_tx_octetcount_g;
0051     unsigned int mmc_tx_framecount_g;
0052     unsigned int mmc_tx_excessdef;
0053     unsigned int mmc_tx_pause_frame;
0054     unsigned int mmc_tx_vlan_frame_g;
0055 
0056     /* MMC RX counter registers */
0057     unsigned int mmc_rx_framecount_gb;
0058     unsigned int mmc_rx_octetcount_gb;
0059     unsigned int mmc_rx_octetcount_g;
0060     unsigned int mmc_rx_broadcastframe_g;
0061     unsigned int mmc_rx_multicastframe_g;
0062     unsigned int mmc_rx_crc_error;
0063     unsigned int mmc_rx_align_error;
0064     unsigned int mmc_rx_run_error;
0065     unsigned int mmc_rx_jabber_error;
0066     unsigned int mmc_rx_undersize_g;
0067     unsigned int mmc_rx_oversize_g;
0068     unsigned int mmc_rx_64_octets_gb;
0069     unsigned int mmc_rx_65_to_127_octets_gb;
0070     unsigned int mmc_rx_128_to_255_octets_gb;
0071     unsigned int mmc_rx_256_to_511_octets_gb;
0072     unsigned int mmc_rx_512_to_1023_octets_gb;
0073     unsigned int mmc_rx_1024_to_max_octets_gb;
0074     unsigned int mmc_rx_unicast_g;
0075     unsigned int mmc_rx_length_error;
0076     unsigned int mmc_rx_autofrangetype;
0077     unsigned int mmc_rx_pause_frames;
0078     unsigned int mmc_rx_fifo_overflow;
0079     unsigned int mmc_rx_vlan_frames_gb;
0080     unsigned int mmc_rx_watchdog_error;
0081     /* IPC */
0082     unsigned int mmc_rx_ipc_intr_mask;
0083     unsigned int mmc_rx_ipc_intr;
0084     /* IPv4 */
0085     unsigned int mmc_rx_ipv4_gd;
0086     unsigned int mmc_rx_ipv4_hderr;
0087     unsigned int mmc_rx_ipv4_nopay;
0088     unsigned int mmc_rx_ipv4_frag;
0089     unsigned int mmc_rx_ipv4_udsbl;
0090 
0091     unsigned int mmc_rx_ipv4_gd_octets;
0092     unsigned int mmc_rx_ipv4_hderr_octets;
0093     unsigned int mmc_rx_ipv4_nopay_octets;
0094     unsigned int mmc_rx_ipv4_frag_octets;
0095     unsigned int mmc_rx_ipv4_udsbl_octets;
0096 
0097     /* IPV6 */
0098     unsigned int mmc_rx_ipv6_gd_octets;
0099     unsigned int mmc_rx_ipv6_hderr_octets;
0100     unsigned int mmc_rx_ipv6_nopay_octets;
0101 
0102     unsigned int mmc_rx_ipv6_gd;
0103     unsigned int mmc_rx_ipv6_hderr;
0104     unsigned int mmc_rx_ipv6_nopay;
0105 
0106     /* Protocols */
0107     unsigned int mmc_rx_udp_gd;
0108     unsigned int mmc_rx_udp_err;
0109     unsigned int mmc_rx_tcp_gd;
0110     unsigned int mmc_rx_tcp_err;
0111     unsigned int mmc_rx_icmp_gd;
0112     unsigned int mmc_rx_icmp_err;
0113 
0114     unsigned int mmc_rx_udp_gd_octets;
0115     unsigned int mmc_rx_udp_err_octets;
0116     unsigned int mmc_rx_tcp_gd_octets;
0117     unsigned int mmc_rx_tcp_err_octets;
0118     unsigned int mmc_rx_icmp_gd_octets;
0119     unsigned int mmc_rx_icmp_err_octets;
0120 
0121     /* FPE */
0122     unsigned int mmc_tx_fpe_fragment_cntr;
0123     unsigned int mmc_tx_hold_req_cntr;
0124     unsigned int mmc_rx_packet_assembly_err_cntr;
0125     unsigned int mmc_rx_packet_smd_err_cntr;
0126     unsigned int mmc_rx_packet_assembly_ok_cntr;
0127     unsigned int mmc_rx_fpe_fragment_cntr;
0128 };
0129 
0130 #endif /* __MMC_H__ */