blob: 3fab2a6af2fb067c3eb94eb6cdef70ac4a76caed [file] [log] [blame]
Girish Gowdra5287fde2021-07-31 00:41:45 +00001/*
2 * Copyright 2018-present Open Networking Foundation
3
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
7
8 * http://www.apache.org/licenses/LICENSE-2.0
9
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 */
16
17#ifndef __VENDOR_H__
18#define __VENDOR_H__
Girish Gowdrab0337eb2022-03-25 16:44:21 -070019
20#include "device.h"
21
Girish Gowdra5287fde2021-07-31 00:41:45 +000022#define VENDOR_ID "ONF"
23#define SIM
24#define MODEL_ID "sim"
25#define MAX_SUPPORTED_PON 16
26#define ONU_BIT_TRANSMISSION_DELAY 0.1004823/1000 /* unit: ns to us */
27#define MINIMUM_ONU_RESPONSE_RANGING_TIME 1572135 /* hardcore: this is ranging time for the shortest distance, typically 35us */
28
29// DeviceInfo definitions
30
31#define ONU_ID_START 1
32#define ONU_ID_END 32
33#define MAX_ONUS_PER_PON (ONU_ID_END - ONU_ID_START + 1)
34
35#define MAX_ALLOC_ID_PER_ONU 4
36#define ALLOC_ID_START 1024
37#define ALLOC_ID_END (ALLOC_ID_START + MAX_ONUS_PER_PON * MAX_ALLOC_ID_PER_ONU)
38
39#define GEM_PORT_ID_PER_ALLOC_ID 8
40#define GEM_PORT_ID_START 1024
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)
42
43#define FLOW_ID_START 1
44#define FLOW_ID_END 65535
45#define MAX_FLOW_ID FLOW_ID_END
46#define INVALID_FLOW_ID 0
47
Girish Gowdra72bb4652022-01-18 17:04:30 -080048#define MAC_DEVICE_ACTIVATION_DELAY 200000 // in microseconds
49
Girish Gowdrab0337eb2022-03-25 16:44:21 -070050#define DEFAULT_MAC_SYSTEM_MODE BCMOLT_SYSTEM_MODE_GPON__16_X
51//#define DEFAULT_MAC_SYSTEM_MODE BCMOLT_SYSTEM_MODE_XGS__2_X
52#define DEFAULT_PON_MODE BCMOLT_PON_TYPE_GPON
53// #define DEFAULT_PON_MODE BCMOLT_PON_TYPE_XGPON
54
55
56///////////////////////////////////////////////////////
57// Constants relevant for decoding PON Trx EEPROM Data
58
59#define DYNAMIC_PON_TRX_SUPPORT
60
61#define TOTAL_PON_TRX_PORTS 16 // total PON transceiver ports
62#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)
63const 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},
64{11},{12},{13},{14},{15}};
65#define PONS_PER_TRX (TOTAL_PON_TRX_PORTS/TOTAL_PON_PORTS) // if there are more than one OLT MAC device,
66 // they all have to be of the same type for this to work.
67
68const int bus_index[TOTAL_PON_TRX_PORTS] = {
69 47, 48, 37, 38, 35, 36, 33, 34,
70 39, 40, 41, 42, 43, 44, 45, 46
71};
72
73#define PORT_ADDRESS 50
74
75#define NAME_EEPROM "sfp_eeprom"
76
77#define EEPROM_VENDOR_NAME_START_IDX 148
78#define EEPROM_VENDOR_NAME_LENGTH 16
79
80#define EEPROM_VENDOR_OUI_START_IDX 165
81#define EEPROM_VENDOR_OUI_LENGTH 3
82
83#define EEPROM_VENDOR_PART_NUMBER_START_IDX 168
84#define EEPROM_VENDOR_PART_NUMBER_LENGTH 16
85
86#define EEPROM_VENDOR_REVISION_START_IDX 184
87#define EEPROM_VENDOR_REVISION_LENGTH 2
88
89#define EEPROM_DOWNSTREAM_WAVELENGTH_START_IDX 186
90#define EEPROM_DOWNSTREAM_WAVELENGTH_LENGTH 2
91#define EEPROM_WAVELENGTH_RESOLUTION 0.05
92
93// Define valid values below in case of Combo PON Trx is supported
94// #define EEPROM_DOWNSTREAM_SECONDARY_WAVELENGTH_START_IDX 120
95// #define EEPROM_DOWNSTREAM_SECONDARY_WAVELENGTH_LENGTH 2
96
97///////////////////////////////////////////////////////
98
99
100class PonTrx: public PonTrxBase {
101 public:
102 // override the base member functions if you need a different implementation
103 PonTrx(): PonTrxBase("sfp_eeprom", 50, "%d-00%d/%s") {
104
105 }
106
107};
108
Girish Gowdra5287fde2021-07-31 00:41:45 +0000109#endif