blob: 2e6c499d2e97b8a31b6697a817880afc7836522e [file] [log] [blame]
Craig Lutgen88a22ad2018-10-04 12:30:46 -05001/*
Girish Gowdraa707e7c2019-11-07 11:36:13 +05302 * Copyright 2018-present Open Networking Foundation
Craig Lutgen88a22ad2018-10-04 12:30:46 -05003
Girish Gowdraa707e7c2019-11-07 11:36:13 +05304 * 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 Lutgen88a22ad2018-10-04 12:30:46 -05007
Girish Gowdraa707e7c2019-11-07 11:36:13 +05308 * http://www.apache.org/licenses/LICENSE-2.0
Craig Lutgen88a22ad2018-10-04 12:30:46 -05009
Girish Gowdraa707e7c2019-11-07 11:36:13 +053010 * 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 Lutgen88a22ad2018-10-04 12:30:46 -050016
17#ifndef __VENDOR_H__
18#define __VENDOR_H__
Girish Gowdrab0337eb2022-03-25 16:44:21 -070019#include "device.h"
Craig Lutgen88a22ad2018-10-04 12:30:46 -050020#define VENDOR_ID "EdgeCore"
Thiyagarajan Subramani89fffc02019-05-13 21:33:20 +000021#define ASFVOLT16
Craig Lutgen88a22ad2018-10-04 12:30:46 -050022#define MODEL_ID "asfvolt16"
Thiyagarajan Subramani89fffc02019-05-13 21:33:20 +000023#define MAX_SUPPORTED_PON 16
Jason Huang1d9cfce2020-05-20 22:58:47 +080024#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 Gowdrab0337eb2022-03-25 16:44:21 -070026#define DEFAULT_MAC_SYSTEM_MODE BCMOLT_SYSTEM_MODE_XGS__2_X
27#define DEFAULT_PON_MODE BCMOLT_PON_TYPE_XGPON
Girish Gowdra252f4972020-09-07 21:24:01 -070028
29// DeviceInfo definitions
30
31#define ONU_ID_START 1
32#define ONU_ID_END 32
Girish Gowdraeec0fc92021-05-12 15:37:55 -070033#define MAX_ONUS_PER_PON (ONU_ID_END - ONU_ID_START + 1)
Girish Gowdra252f4972020-09-07 21:24:01 -070034
Girish Gowdraeec0fc92021-05-12 15:37:55 -070035#define MAX_ALLOC_ID_PER_ONU 4
Girish Gowdra252f4972020-09-07 21:24:01 -070036#define ALLOC_ID_START 1024
Girish Gowdraeec0fc92021-05-12 15:37:55 -070037#define ALLOC_ID_END (ALLOC_ID_START + MAX_ONUS_PER_PON * MAX_ALLOC_ID_PER_ONU)
Girish Gowdra252f4972020-09-07 21:24:01 -070038
Girish Gowdraeec0fc92021-05-12 15:37:55 -070039#define GEM_PORT_ID_PER_ALLOC_ID 8
Girish Gowdra252f4972020-09-07 21:24:01 -070040#define GEM_PORT_ID_START 1024
Girish Gowdraeec0fc92021-05-12 15:37:55 -070041#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 Gowdra252f4972020-09-07 21:24:01 -070042
43#define FLOW_ID_START 1
44#define FLOW_ID_END 65535
Girish Gowdraeec0fc92021-05-12 15:37:55 -070045#define MAX_FLOW_ID FLOW_ID_END
Girish Gowdra252f4972020-09-07 21:24:01 -070046#define INVALID_FLOW_ID 0
47
Girish Gowdra72bb4652022-01-18 17:04:30 -080048#define MAC_DEVICE_ACTIVATION_DELAY 2000000 // in microseconds
49
Girish Gowdrab0337eb2022-03-25 16:44:21 -070050///////////////////////////////////////////////////////
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)
59const 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
64const 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
97class 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 Lutgen88a22ad2018-10-04 12:30:46 -0500105#endif