Craig Lutgen | 88a22ad | 2018-10-04 12:30:46 -0500 | [diff] [blame] | 1 | /* |
Girish Gowdra | a707e7c | 2019-11-07 11:36:13 +0530 | [diff] [blame] | 2 | * Copyright 2018-present Open Networking Foundation |
Craig Lutgen | 88a22ad | 2018-10-04 12:30:46 -0500 | [diff] [blame] | 3 | |
Girish Gowdra | a707e7c | 2019-11-07 11:36:13 +0530 | [diff] [blame] | 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
Craig Lutgen | 88a22ad | 2018-10-04 12:30:46 -0500 | [diff] [blame] | 7 | |
Girish Gowdra | a707e7c | 2019-11-07 11:36:13 +0530 | [diff] [blame] | 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
Craig Lutgen | 88a22ad | 2018-10-04 12:30:46 -0500 | [diff] [blame] | 9 | |
Girish Gowdra | a707e7c | 2019-11-07 11:36:13 +0530 | [diff] [blame] | 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
Craig Lutgen | 88a22ad | 2018-10-04 12:30:46 -0500 | [diff] [blame] | 16 | |
| 17 | #ifndef __VENDOR_H__ |
| 18 | #define __VENDOR_H__ |
Girish Gowdra | b0337eb | 2022-03-25 16:44:21 -0700 | [diff] [blame] | 19 | #include "device.h" |
Craig Lutgen | 88a22ad | 2018-10-04 12:30:46 -0500 | [diff] [blame] | 20 | #define VENDOR_ID "EdgeCore" |
Thiyagarajan Subramani | 89fffc0 | 2019-05-13 21:33:20 +0000 | [diff] [blame] | 21 | #define ASFVOLT16 |
Craig Lutgen | 88a22ad | 2018-10-04 12:30:46 -0500 | [diff] [blame] | 22 | #define MODEL_ID "asfvolt16" |
Thiyagarajan Subramani | 89fffc0 | 2019-05-13 21:33:20 +0000 | [diff] [blame] | 23 | #define MAX_SUPPORTED_PON 16 |
Jason Huang | 1d9cfce | 2020-05-20 22:58:47 +0800 | [diff] [blame] | 24 | #define ONU_BIT_TRANSMISSION_DELAY 0.1004823/1000 /* unit: ns to us */ |
| 25 | #define MINIMUM_ONU_RESPONSE_RANGING_TIME 1572135 /* hardcore: this is ranging time for the shortest distance, typically 35us */ |
Girish Gowdra | b0337eb | 2022-03-25 16:44:21 -0700 | [diff] [blame] | 26 | #define DEFAULT_MAC_SYSTEM_MODE BCMOLT_SYSTEM_MODE_XGS__2_X |
| 27 | #define DEFAULT_PON_MODE BCMOLT_PON_TYPE_XGPON |
Girish Gowdra | 252f497 | 2020-09-07 21:24:01 -0700 | [diff] [blame] | 28 | |
| 29 | // DeviceInfo definitions |
| 30 | |
| 31 | #define ONU_ID_START 1 |
| 32 | #define ONU_ID_END 32 |
Girish Gowdra | eec0fc9 | 2021-05-12 15:37:55 -0700 | [diff] [blame] | 33 | #define MAX_ONUS_PER_PON (ONU_ID_END - ONU_ID_START + 1) |
Girish Gowdra | 252f497 | 2020-09-07 21:24:01 -0700 | [diff] [blame] | 34 | |
Girish Gowdra | eec0fc9 | 2021-05-12 15:37:55 -0700 | [diff] [blame] | 35 | #define MAX_ALLOC_ID_PER_ONU 4 |
Girish Gowdra | 252f497 | 2020-09-07 21:24:01 -0700 | [diff] [blame] | 36 | #define ALLOC_ID_START 1024 |
Girish Gowdra | eec0fc9 | 2021-05-12 15:37:55 -0700 | [diff] [blame] | 37 | #define ALLOC_ID_END (ALLOC_ID_START + MAX_ONUS_PER_PON * MAX_ALLOC_ID_PER_ONU) |
Girish Gowdra | 252f497 | 2020-09-07 21:24:01 -0700 | [diff] [blame] | 38 | |
Girish Gowdra | eec0fc9 | 2021-05-12 15:37:55 -0700 | [diff] [blame] | 39 | #define GEM_PORT_ID_PER_ALLOC_ID 8 |
Girish Gowdra | 252f497 | 2020-09-07 21:24:01 -0700 | [diff] [blame] | 40 | #define GEM_PORT_ID_START 1024 |
Girish Gowdra | eec0fc9 | 2021-05-12 15:37:55 -0700 | [diff] [blame] | 41 | #define GEM_PORT_ID_END (GEM_PORT_ID_START + MAX_ONUS_PER_PON * MAX_ALLOC_ID_PER_ONU * GEM_PORT_ID_PER_ALLOC_ID) |
Girish Gowdra | 252f497 | 2020-09-07 21:24:01 -0700 | [diff] [blame] | 42 | |
| 43 | #define FLOW_ID_START 1 |
| 44 | #define FLOW_ID_END 65535 |
Girish Gowdra | eec0fc9 | 2021-05-12 15:37:55 -0700 | [diff] [blame] | 45 | #define MAX_FLOW_ID FLOW_ID_END |
Girish Gowdra | 252f497 | 2020-09-07 21:24:01 -0700 | [diff] [blame] | 46 | #define INVALID_FLOW_ID 0 |
| 47 | |
Girish Gowdra | 72bb465 | 2022-01-18 17:04:30 -0800 | [diff] [blame] | 48 | #define MAC_DEVICE_ACTIVATION_DELAY 2000000 // in microseconds |
| 49 | |
Girish Gowdra | b0337eb | 2022-03-25 16:44:21 -0700 | [diff] [blame] | 50 | /////////////////////////////////////////////////////// |
| 51 | // Constants relevant for decoding PON Trx EEPROM Data |
| 52 | |
| 53 | // Uncomment below line when you need dynamic transceiver detection support |
| 54 | // #define DYNAMIC_PON_TRX_SUPPORT |
| 55 | |
| 56 | |
| 57 | #define TOTAL_PON_TRX_PORTS 16 // total PON transceiver ports |
| 58 | #define TOTAL_PON_PORTS 16 // total PON ports (we could have up to 2 PON ports on the OLT MAC mapped to the external PON Trx) |
| 59 | const int trx_port_to_pon_port_map[TOTAL_PON_TRX_PORTS][TOTAL_PON_PORTS/TOTAL_PON_TRX_PORTS]={{0},{1},{2},{3},{4},{5},{6},{7},{8},{9},{10}, |
| 60 | {11},{12},{13},{14},{15}}; |
| 61 | #define PONS_PER_TRX (TOTAL_PON_TRX_PORTS/TOTAL_PON_PORTS) // if there are more than one OLT MAC device, |
| 62 | // they all have to be of the same type for this to work. |
| 63 | |
| 64 | const int bus_index[TOTAL_PON_TRX_PORTS] = { |
| 65 | 47, 48, 37, 38, 35, 36, 33, 34, |
| 66 | 39, 40, 41, 42, 43, 44, 45, 46 |
| 67 | }; |
| 68 | |
| 69 | |
| 70 | // FIXME: Check the correctness of the below constants for this platform |
| 71 | |
| 72 | #define PORT_ADDRESS 50 |
| 73 | |
| 74 | #define NAME_EEPROM "sfp_eeprom" |
| 75 | |
| 76 | #define EEPROM_VENDOR_NAME_START_IDX 148 |
| 77 | #define EEPROM_VENDOR_NAME_LENGTH 16 |
| 78 | |
| 79 | #define EEPROM_VENDOR_OUI_START_IDX 165 |
| 80 | #define EEPROM_VENDOR_OUI_LENGTH 3 |
| 81 | |
| 82 | #define EEPROM_VENDOR_PART_NUMBER_START_IDX 168 |
| 83 | #define EEPROM_VENDOR_PART_NUMBER_LENGTH 16 |
| 84 | |
| 85 | #define EEPROM_VENDOR_REVISION_START_IDX 184 |
| 86 | #define EEPROM_VENDOR_REVISION_LENGTH 2 |
| 87 | |
| 88 | #define EEPROM_DOWNSTREAM_WAVELENGTH_START_IDX 186 |
| 89 | #define EEPROM_DOWNSTREAM_WAVELENGTH_LENGTH 2 |
| 90 | #define EEPROM_WAVELENGTH_RESOLUTION 0.05 |
| 91 | |
| 92 | // Define valid values below in case of Combo PON Trx is supported |
| 93 | // #define EEPROM_DOWNSTREAM_SECONDARY_WAVELENGTH_START_IDX 120 |
| 94 | // #define EEPROM_DOWNSTREAM_SECONDARY_WAVELENGTH_LENGTH 2 |
| 95 | |
| 96 | |
| 97 | class PonTrx: public PonTrxBase { |
| 98 | // override the base member functions if you need a different implementation |
| 99 | public: |
| 100 | // Get MAC System mode based on the olt mac id and the set of SFP IDs provided |
| 101 | pair<bcmolt_system_mode, bool> get_mac_system_mode(int, set<int>); |
| 102 | |
| 103 | }; |
| 104 | |
Craig Lutgen | 88a22ad | 2018-10-04 12:30:46 -0500 | [diff] [blame] | 105 | #endif |