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

greyhound.h (5131B)


      1 /*
      2  * 
      3  * This license is set out in https://raw.githubusercontent.com/Broadcom-Network-Switching-Software/OpenBCM/master/Legal/LICENSE file.
      4  * 
      5  * Copyright 2007-2019 Broadcom Inc. All rights reserved.
      6  *
      7  * File:        greyhound.h
      8  */
      9 
     10 #ifndef _SOC_GREYHOUND_H_
     11 #define _SOC_GREYHOUND_H_
     12 
     13 #include <soc/drv.h>
     14 #include <soc/mem.h>
     15 #include <shared/sram.h>
     16 
     17 enum gh_l2_hash_key_type_e {
     18     /* WARNING: values given match hardware register; do not modify */
     19     GH_L2_HASH_KEY_TYPE_BRIDGE = 0,
     20     GH_L2_HASH_KEY_TYPE_SINGLE_CROSS_CONNECT = 1,
     21     GH_L2_HASH_KEY_TYPE_DOUBLE_CROSS_CONNECT = 2,    
     22     GH_L2_HASH_KEY_TYPE_VIF = 5,
     23     GH_L2_HASH_KEY_TYPE_PE_VID = 6,
     24     GH_L2_HASH_KEY_TYPE_COUNT
     25 };
     26 
     27 enum soc_gh_port_mode_e {
     28     /* WARNING: values given match hardware register; do not modify */
     29     SOC_GH_PORT_MODE_QUAD = 0,
     30     SOC_GH_PORT_MODE_TRI_012 = 1,
     31     SOC_GH_PORT_MODE_TRI_023 = 2,
     32     SOC_GH_PORT_MODE_DUAL = 3,
     33     SOC_GH_PORT_MODE_SINGLE = 4
     34 };
     35 
     36 /* QSGMII MDIO address : MDIO address for por2-port17
     37  *  - this address is just a shadow address for QSGMII PCS register access 
     38  *    but will be really used for PMD register access.
     39  */
     40 #define GH_QSGMII_MDIO_ADDR     0x81
     41 
     42 #define GH_PORT_IS_QSGMII(_unit, _port) \
     43         (IS_GE_PORT((_unit), (_port)) && !IS_XL_PORT((_unit), (_port)))
     44 
     45 extern int soc_greyhound_l2x_base_entry_to_key(int unit, uint32 *entry, uint8 *key);
     46 
     47 typedef int (*soc_greyhound_oam_handler_t)(int unit, 
     48     soc_field_t fault_field);
     49 typedef int (*soc_greyhound_oam_ser_handler_t)(int unit, 
     50     soc_mem_t mem, int index);
     51 
     52 extern int soc_greyhound_port_config_init(int unit, uint16 dev_id);
     53 extern void soc_greyhound_sbus_ring_map_config(int unit);
     54 extern int soc_greyhound_mem_config(int unit, int dev_id);
     55 extern void soc_greyhound_oam_handler_register(int unit, 
     56                                          soc_greyhound_oam_handler_t handler);
     57 extern void soc_greyhound_oam_ser_handler_register(int unit, 
     58                                soc_greyhound_oam_ser_handler_t handler);
     59 extern int soc_greyhound_oam_ser_process(int unit, 
     60                                 soc_mem_t mem, int index);
     61 extern void soc_greyhound_parity_error(void *unit_vp, void *d1, void *d2,
     62                                      void *d3, void *d4);
     63 extern void soc_greyhound_ser_fail(int unit);
     64 extern int soc_greyhound_ser_mem_clear(int unit, soc_mem_t mem);
     65 
     66 extern int _soc_greyhound_mem_parity_control(int unit, soc_mem_t mem,
     67                                             int copyno, int enable);
     68 extern int soc_gh_l2_entry_limit_count_update(int unit);
     69 
     70 #if defined(SER_TR_TEST_SUPPORT)
     71 extern int soc_gh_ser_inject_error(int unit, uint32 flags, soc_mem_t mem,
     72                                     int pipeTarget, int block, int index);
     73 extern int soc_gh_ser_mem_test(int unit, soc_mem_t mem, 
     74                                         _soc_ser_test_t test_type, int cmd);
     75 extern int soc_gh_ser_test(int unit, _soc_ser_test_t test_type);
     76 extern void soc_gh_ser_test_register(int unit);
     77 #endif
     78 
     79 extern int soc_greyhound_port_lanes_set(int unit, soc_port_t port_base,
     80                                        int lanes, int *cur_lanes,
     81                                        int *phy_ports, int *phy_ports_len);
     82 extern int soc_greyhound_port_lanes_get(int unit, soc_port_t port_base,
     83                                        int *cur_lanes);
     84 extern int soc_greyhound_chip_reset(int unit);
     85 extern int soc_greyhound_tsc_reset(int unit);
     86 extern int soc_greyhound_port_hg_speed_get(int unit, soc_port_t port,
     87                                            int *speed);
     88 
     89 #ifdef BCM_WARM_BOOT_SUPPORT
     90 extern int soc_greyhound_chip_warmboot_reset(int unit);
     91 #endif
     92 
     93 extern int soc_gh_temperature_monitor_get(int unit,
     94           int temperature_max,
     95           soc_switch_temperature_monitor_t *temperature_array,
     96           int *temperature_count);
     97 
     98 extern soc_functions_t soc_greyhound_drv_funs;
     99 
    100 extern int soc_gh_xq_mem(int unit, soc_port_t port, soc_mem_t *xq);
    101 
    102 extern int soc_greyhound_pgw_reg_blk_index_get(int unit, 
    103     soc_reg_t reg, soc_port_t port, 
    104     pbmp_t *bm, int *block, int *index, int invalid_blk_check);
    105 extern int _soc_greyhound_features(int unit, soc_feature_t feature);
    106 
    107 extern int soc_greyhound_pgw_encap_field_modify(int unit, 
    108                                 soc_port_t lport, 
    109                                 soc_field_t field, 
    110                                 uint32 val);
    111 extern int soc_greyhound_pgw_encap_field_get(int unit, 
    112                                 soc_port_t lport, 
    113                                 soc_field_t field, 
    114                                 uint32 *val);
    115 extern int _soc_gh_sbus_tsc_block(int unit, 
    116             int phy_port, soc_mem_t wc_ucmem_data, int *block);
    117 #ifdef INCLUDE_AVS
    118 extern int soc_greyhound_avs_init(int unit);
    119 #endif /* INCLUDE_AVS */
    120 
    121 extern int soc_gh_port_eee_timers_setup(int unit, soc_port_t port, int speed);
    122 extern int soc_gh_port_eee_ref_count_init(int unit, soc_port_t port);
    123 
    124 #ifdef PORTMOD_SUPPORT
    125 extern int soc_gh_portctrl_pm_portmod_init(int unit);
    126 extern int soc_gh_portctrl_pm_portmod_deinit(int unit);
    127 #endif
    128 #endif /* !_SOC_GREYHOUND_H_ */