Thiyagarajan Subramani | 89fffc0 | 2019-05-13 21:33:20 +0000 | [diff] [blame] | 1 | /* |
Girish Gowdra | a707e7c | 2019-11-07 11:36:13 +0530 | [diff] [blame] | 2 | * Copyright 2018-present Open Networking Foundation |
Thiyagarajan Subramani | 89fffc0 | 2019-05-13 21:33:20 +0000 | [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 |
Thiyagarajan Subramani | 89fffc0 | 2019-05-13 21:33:20 +0000 | [diff] [blame] | 7 | |
Girish Gowdra | a707e7c | 2019-11-07 11:36:13 +0530 | [diff] [blame] | 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
Thiyagarajan Subramani | 89fffc0 | 2019-05-13 21:33:20 +0000 | [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 | */ |
Thiyagarajan Subramani | 89fffc0 | 2019-05-13 21:33:20 +0000 | [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" |
| 20 | |
Thiyagarajan Subramani | 89fffc0 | 2019-05-13 21:33:20 +0000 | [diff] [blame] | 21 | #define VENDOR_ID "EdgeCore" |
| 22 | #define ASGVOLT64 |
| 23 | #define MODEL_ID "asgvolt64" |
| 24 | #define MAX_SUPPORTED_PON 64 |
Jason Huang | 1d9cfce | 2020-05-20 22:58:47 +0800 | [diff] [blame] | 25 | #define ONU_BIT_TRANSMISSION_DELAY 0.8038585/1000 /* unit: ns to us */ |
| 26 | #define MINIMUM_ONU_RESPONSE_RANGING_TIME 198075 /* hardcore: this is ranging time for the shortest distance, typically 35us */ |
Girish Gowdra | b0337eb | 2022-03-25 16:44:21 -0700 | [diff] [blame] | 27 | #define DEFAULT_MAC_SYSTEM_MODE BCMOLT_SYSTEM_MODE_GPON__16_X |
| 28 | //#define DEFAULT_MAC_SYSTEM_MODE BCMOLT_SYSTEM_MODE_XGS__2_X |
| 29 | #define DEFAULT_PON_MODE BCMOLT_PON_TYPE_GPON |
| 30 | // #define DEFAULT_PON_MODE BCMOLT_PON_TYPE_XGPON |
Girish Gowdra | 252f497 | 2020-09-07 21:24:01 -0700 | [diff] [blame] | 31 | |
| 32 | // DeviceInfo definitions |
| 33 | |
| 34 | #define ONU_ID_START 1 |
| 35 | #define ONU_ID_END 32 |
Girish Gowdra | eec0fc9 | 2021-05-12 15:37:55 -0700 | [diff] [blame] | 36 | #define MAX_ONUS_PER_PON (ONU_ID_END - ONU_ID_START + 1) |
Girish Gowdra | 252f497 | 2020-09-07 21:24:01 -0700 | [diff] [blame] | 37 | |
Girish Gowdra | eec0fc9 | 2021-05-12 15:37:55 -0700 | [diff] [blame] | 38 | #define MAX_ALLOC_ID_PER_ONU 4 |
Girish Gowdra | 252f497 | 2020-09-07 21:24:01 -0700 | [diff] [blame] | 39 | #define ALLOC_ID_START 256 |
Girish Gowdra | eec0fc9 | 2021-05-12 15:37:55 -0700 | [diff] [blame] | 40 | #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] | 41 | |
Girish Gowdra | eec0fc9 | 2021-05-12 15:37:55 -0700 | [diff] [blame] | 42 | #define GEM_PORT_ID_PER_ALLOC_ID 8 |
Girish Gowdra | 252f497 | 2020-09-07 21:24:01 -0700 | [diff] [blame] | 43 | #define GEM_PORT_ID_START 256 |
Girish Gowdra | eec0fc9 | 2021-05-12 15:37:55 -0700 | [diff] [blame] | 44 | #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] | 45 | |
| 46 | #define FLOW_ID_START 1 |
| 47 | #define FLOW_ID_END 65535 |
| 48 | #define MAX_FLOW_ID FLOW_ID_END |
| 49 | #define INVALID_FLOW_ID 0 |
| 50 | |
Girish Gowdra | 72bb465 | 2022-01-18 17:04:30 -0800 | [diff] [blame] | 51 | #define MAC_DEVICE_ACTIVATION_DELAY 2000000 // in microseconds |
| 52 | |
Girish Gowdra | b0337eb | 2022-03-25 16:44:21 -0700 | [diff] [blame] | 53 | /////////////////////////////////////////////////////// |
| 54 | // Constants relevant for decoding PON Trx EEPROM Data |
| 55 | |
| 56 | // Uncomment below line when you need dynamic transceiver detection support |
| 57 | //#define DYNAMIC_PON_TRX_SUPPORT |
| 58 | |
| 59 | #define TOTAL_PON_TRX_PORTS 64 // total PON transceiver ports |
| 60 | #define TOTAL_PON_PORTS 64 // total PON ports (we could have up to 2 PON ports on the OLT MAC mapped to the external PON Trx) |
| 61 | 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}, |
| 62 | {11},{12},{13},{14},{15},{16},{17},{18},{19},{20},{21},{22},{23},{24},{25},{26},{27},{28},{29},{30},{31},{32},{33},{34},{35},{36},{37},{38}, |
| 63 | {39},{40},{41},{42},{43},{44},{45},{46},{47},{48},{49},{50},{51},{52},{53},{54},{55},{56},{57},{58},{59},{60},{61},{62},{63}}; |
| 64 | #define PONS_PER_TRX (TOTAL_PON_TRX_PORTS/TOTAL_PON_PORTS) // if there are more than one OLT MAC device, |
| 65 | // they all have to be of the same type for this to work. |
| 66 | |
| 67 | const int bus_index[TOTAL_PON_TRX_PORTS] = { |
| 68 | 41, 42, 56, 55, 43, 44, 54, 53, |
| 69 | 45, 46, 52, 51, 47, 48, 50, 49, |
| 70 | 57, 58, 72, 71, 59, 60, 70, 69, |
| 71 | 61, 62, 68, 67, 63, 64, 66, 65, |
| 72 | 73, 74, 88, 87, 75, 76, 86, 85, |
| 73 | 77, 78, 84, 83, 79, 80, 82, 81, |
| 74 | 89, 90, 104, 103, 91, 92, 102, 101, |
| 75 | 93, 94, 100, 99, 95, 96, 98, 97 |
| 76 | }; |
| 77 | |
| 78 | // FIXME: Check the correctness of the below constants for this platform |
| 79 | |
| 80 | #define PORT_ADDRESS 50 |
| 81 | |
| 82 | #define NAME_EEPROM "eeprom" |
| 83 | |
| 84 | #define EEPROM_VENDOR_NAME_START_IDX 20 |
| 85 | #define EEPROM_VENDOR_NAME_LENGTH 16 |
| 86 | |
| 87 | #define EEPROM_VENDOR_OUI_START_IDX 37 |
| 88 | #define EEPROM_VENDOR_OUI_LENGTH 3 |
| 89 | |
| 90 | #define EEPROM_VENDOR_PART_NUMBER_START_IDX 40 |
| 91 | #define EEPROM_VENDOR_PART_NUMBER_LENGTH 16 |
| 92 | |
| 93 | #define EEPROM_VENDOR_REVISION_START_IDX 56 |
| 94 | #define EEPROM_VENDOR_REVISION_LENGTH 4 |
| 95 | |
| 96 | #define EEPROM_DOWNSTREAM_WAVELENGTH_START_IDX 60 |
| 97 | #define EEPROM_DOWNSTREAM_WAVELENGTH_LENGTH 2 |
| 98 | #define EEPROM_WAVELENGTH_RESOLUTION 1 |
| 99 | |
| 100 | // Define valid values below in case of Combo PON Trx is supported |
| 101 | // #define EEPROM_DOWNSTREAM_SECONDARY_WAVELENGTH_START_IDX 120 |
| 102 | // #define EEPROM_DOWNSTREAM_SECONDARY_WAVELENGTH_LENGTH 2 |
| 103 | |
| 104 | class PonTrx: public PonTrxBase { |
| 105 | public: |
| 106 | // override the base member functions if you need a different implementation |
| 107 | PonTrx(): PonTrxBase("eeprom", 50, "/sys/bus/i2c/devices/%d-00%d/%s") { |
| 108 | |
| 109 | } |
| 110 | |
| 111 | }; |
| 112 | |
Thiyagarajan Subramani | 89fffc0 | 2019-05-13 21:33:20 +0000 | [diff] [blame] | 113 | #endif |