openbcm

Git mirror of https://github.com/Broadcom-Network-Switching-Software/OpenBCM
git clone git://git.finwo.net/mirror/broadcom/openbcm
Log | Files | Refs | README

utils_pure_defi.h (3719B)


      1 /* 
      2  * This license is set out in https://raw.githubusercontent.com/Broadcom-Network-Switching-Software/OpenBCM/master/Legal/LICENSE file.
      3  * 
      4  * Copyright 2007-2020 Broadcom Inc. All rights reserved.
      5 */
      6 #ifndef UTILS_PURE_DEFI_INCLUDED
      7 /* { */
      8 #define UTILS_PURE_DEFI_INCLUDED
      9 
     10 #include <appl/diag/dpp/bits_bytes_macros.h>
     11 
     12 /*
     13  * Definitions related to Thermometer chip (DS1721, I2C)
     14  * {
     15  */
     16 #define THERMOMETER_MEZANINE_ARR_LOCATION     1
     17 #define THERMOMETER_FABCRIC_ARR_LOCATION      2
     18 #define THERMOMETER_LINECARD_1_ARR_LOCATION   THERMOMETER_FABCRIC_ARR_LOCATION
     19 #define THERMOMETER_LINECARD_2_ARR_LOCATION   3
     20 #define THERMOMETER_LINECARD_3_ARR_LOCATION   8
     21 #define THERMOMETER_FRONTEND_3_ARR_LOCATION   4
     22 #define THERMOMETER_DB_1_ARR_LOCATION         5
     23 #define THERMOMETER_FRONTEND_4_ARR_LOCATION   6
     24 #define THERMOMETER_FRONTEND_5_ARR_LOCATION   7
     25 
     26 /*
     27  */
     28 /*
     29  */
     30 /*
     31  * GFA first thermometer.
     32  */
     33 /*
     34  * GFA second thermometer.
     35  */
     36 /*
     37  * GFA DB thermometer.
     38  */
     39 /*
     40  * PTG/FTG first thermometer.
     41  */
     42 /*
     43  * TEVB board thermometer.
     44  */
     45 /*
     46  * }
     47  */
     48 
     49 /*
     50  * Definitions related to Thermometer chip (DS1721, I2C)
     51  * {
     52  */
     53 
     54 /*
     55  * TEVB FPGA thermometer.
     56  */
     57 
     58 /*
     59 * Soc_petra MAX1617A thermometer.
     60 */
     61 
     62 /*
     63 * SOC_SAND_FE600 thermometer.
     64 */
     65 
     66 /*
     67  * }
     68  */
     69 
     70 /*
     71  * Definitions related to OBJECT:
     72  *   Real Time Trace Utility
     73  * {
     74  */
     75 /*
     76  * Maximal size of text descriptor of each event, including
     77  * terminating null.
     78  */
     79 #define TRACE_EVENT_TEXT_SIZE        45
     80 /*
     81  * Log-base-2 of maximal number of trace_event elements in the system. This
     82  * is the size of the trace fifo.
     83  * By default, set to 8
     84  */
     85 #define LOG_NUM_TRACE_FIFO_ELEMENTS  8
     86 /*
     87  * Maximal number of trace_event elements in the system. This
     88  * is the size of the trace fifo. Must be a power of 2.
     89  */
     90 #define NUM_TRACE_FIFO_ELEMENTS      BIT(LOG_NUM_TRACE_FIFO_ELEMENTS)
     91 /*
     92  * Mask of significant bits representing num of elements in fifo.
     93  */
     94 /*
     95  * Number of unsigned long parameters that can be stored
     96  * for the formatting string in 'trace_event_text'
     97  */
     98 # define NUM_TRACE_FIFO_PARAMETERS   4
     99 typedef struct
    100 {
    101     /*
    102      * Flag indicating whether this entry is valid.
    103      */
    104   unsigned int  valid ;
    105     /*
    106      * Time of this trace event. Time is from startup, in microseconds.
    107      */
    108   unsigned long time_microseconds ;
    109     /*
    110      * Internal identifier of event
    111      */
    112   int           trace_event_id ;
    113     /*
    114      * Null terminated text description of event.
    115      * This is a formatting string ('printf' style) into
    116      * which trace_params[i] are inserted.
    117      */
    118   char           trace_event_text[TRACE_EVENT_TEXT_SIZE] ;
    119   unsigned long  trace_params[NUM_TRACE_FIFO_PARAMETERS] ;
    120 } TRACE_EVENT ;
    121 typedef struct
    122 {
    123     /*
    124      * Flag. Indicating fifo is locked and may not be loaded with
    125      * new data until unlocked.
    126      */
    127   unsigned int  fifo_locked ;
    128     /*
    129      * Flag. Indicating an attempt was made to load fifo while it
    130      * was locked. (Actually this is a counter of the number of
    131      * attempts. We assume 'unsigned int' will not overflow, itself)
    132      */
    133   unsigned int  load_while_locked ;
    134     /*
    135      * Flag. Indicating fifo is full and has overflown (some information
    136      * has been deleted).  (Actually this is a counter of the
    137      * number of overflow cases, We assume 'unsigned int' will not
    138      * overflow, itself)
    139      */
    140   unsigned int  overflow ;
    141     /*
    142      * Number of valid trace events in fifo.
    143      */
    144   unsigned int  num_elements ;
    145     /*
    146      * Index of NEXT element to 'put' into fifo.
    147      */
    148   unsigned int  put_index ;
    149     /*
    150      * Index of NEXT element to 'get' from fifo.
    151      */
    152   unsigned int  get_index ;
    153   TRACE_EVENT   trace_events[NUM_TRACE_FIFO_ELEMENTS] ;
    154 } TRACE_FIFO ;
    155 /*
    156  * }
    157  */
    158 /* } */
    159 #endif