boards.h (3457B)
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: board.h 8 * Purpose: Definitions for the board type. 9 */ 10 11 #ifndef _SOC_BOARD_H_ 12 #define _SOC_BOARD_H_ 13 14 #include <sal/types.h> 15 16 #include <soc/defs.h> 17 #include <soc/drv.h> 18 19 /* 20 * SOC_BOARD_CXN_MAX: This is the maximum connections allowed on 21 * one board interconnecting units. We count each connection twice 22 * (to support simplex connections and make other things easier.) 23 * This is based on Hercules w/ 8 ports. Draco could conceivably 24 * connect to 13 devices on one board...... 25 * 26 * SOC_BOARD_DEV_MAX: Max number of SOC units controlled by one 27 * CPU. 28 */ 29 30 #define SOC_BOARD_CXN_MAX 16 31 #define SOC_BOARD_DEV_MAX 0 32 33 /* 34 * Typedef: soc_board_cxn_t 35 * Indicate an on board connection with the following data type: 36 * src_port: Port on unit 37 * tx_unit, tx_port: Where does TX of src_port go? 38 * rx_unit, rx_port: Where does RX of src_port come from? 39 * reachable: Which units on this board are 40 * reachable thru tx. This is a BITMAP 41 * indexed by SOC unit number. 42 */ 43 44 typedef struct soc_board_cxn_s { 45 int src_port; /* Port on unit */ 46 int tx_unit; /* Where does TX of src_port go? */ 47 int tx_port; 48 int rx_unit; /* Where does RX of src_port come from? */ 49 int rx_port; 50 uint32 reachable; /* Which units are reachable thru tx */ 51 } soc_board_cxn_t; 52 53 /* 54 * Typedef: soc_unit_info_t 55 * Describe a unit and its connections on a board. 56 * dev_id: Id value from devids.h 57 * num_cxns: How many stack connections to 58 * other chips on this board. 59 * cxn: List of connections. See above. 60 */ 61 typedef struct soc_unit_static_s { 62 int dev_id; 63 soc_driver_t *soc_driver; 64 int max_port; /* Max physical port number */ 65 } soc_unit_static_t; 66 67 typedef struct soc_unit_info_s { 68 soc_unit_static_t *static_info; 69 int num_cxns; 70 soc_board_cxn_t cxn[SOC_BOARD_CXN_MAX]; 71 } soc_unit_info_t; 72 73 /* 74 * Typedef: soc_board_t 75 * Describes a board 76 * board_id: Value from above enum 77 * num_units: How many devices on this board 78 * unit_info: Array of unit descripts from above. 79 * max_vlans: How many VLANs does the board support 80 * max_stg: How many Spanning Tree Groups does it spt 81 * max_trunks: How many trunks does the board support 82 * max_ports_per_trunk: How many ports can be trunked together 83 */ 84 85 typedef struct soc_board_s { 86 soc_board_ids_t board_id; 87 int num_units; 88 soc_unit_info_t unit_info[SOC_BOARD_DEV_MAX]; 89 /* Some parameters related to capabilities */ 90 int max_vlans; 91 int max_stg; 92 int max_trunks; 93 int max_ports_per_trunk; 94 char *board_name; 95 } soc_board_t; 96 97 /* Variable: 98 * known_boards: The list of descriptions of known boards 99 */ 100 101 extern soc_board_t soc_known_boards[SOC_BOARD_NUM_BOARDS]; 102 103 #endif /* _SOC_BOARD_H_ */