blob: 7f49bc528259f5205d385101fb41078e5df4d1a9 [file] [log] [blame]
Thiyagarajan Subramani89fffc02019-05-13 21:33:20 +00001/*
Girish Gowdraa707e7c2019-11-07 11:36:13 +05302 * Copyright 2018-present Open Networking Foundation
Thiyagarajan Subramani89fffc02019-05-13 21:33:20 +00003
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
Thiyagarajan Subramani89fffc02019-05-13 21:33:20 +00007
Girish Gowdraa707e7c2019-11-07 11:36:13 +05308 * http://www.apache.org/licenses/LICENSE-2.0
Thiyagarajan Subramani89fffc02019-05-13 21:33:20 +00009
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 */
Thiyagarajan Subramani89fffc02019-05-13 21:33:20 +000016
17#ifndef __VENDOR_H__
18#define __VENDOR_H__
Girish Gowdrab0337eb2022-03-25 16:44:21 -070019#include "device.h"
20
Thiyagarajan Subramani89fffc02019-05-13 21:33:20 +000021#define VENDOR_ID "EdgeCore"
22#define ASGVOLT64
23#define MODEL_ID "asgvolt64"
24#define MAX_SUPPORTED_PON 64
Jason Huang1d9cfce2020-05-20 22:58:47 +080025#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 Gowdrab0337eb2022-03-25 16:44:21 -070027#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 Gowdra252f4972020-09-07 21:24:01 -070031
32// DeviceInfo definitions
33
34#define ONU_ID_START 1
35#define ONU_ID_END 32
Girish Gowdraeec0fc92021-05-12 15:37:55 -070036#define MAX_ONUS_PER_PON (ONU_ID_END - ONU_ID_START + 1)
Girish Gowdra252f4972020-09-07 21:24:01 -070037
Girish Gowdraeec0fc92021-05-12 15:37:55 -070038#define MAX_ALLOC_ID_PER_ONU 4
Girish Gowdra252f4972020-09-07 21:24:01 -070039#define ALLOC_ID_START 256
Girish Gowdraeec0fc92021-05-12 15:37:55 -070040#define ALLOC_ID_END (ALLOC_ID_START + MAX_ONUS_PER_PON * MAX_ALLOC_ID_PER_ONU)
Girish Gowdra252f4972020-09-07 21:24:01 -070041
Girish Gowdraeec0fc92021-05-12 15:37:55 -070042#define GEM_PORT_ID_PER_ALLOC_ID 8
Girish Gowdra252f4972020-09-07 21:24:01 -070043#define GEM_PORT_ID_START 256
Girish Gowdraeec0fc92021-05-12 15:37:55 -070044#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 -070045
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 Gowdra72bb4652022-01-18 17:04:30 -080051#define MAC_DEVICE_ACTIVATION_DELAY 2000000 // in microseconds
52
Girish Gowdrab0337eb2022-03-25 16:44:21 -070053///////////////////////////////////////////////////////
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)
61const 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
67const 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
104class 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 Subramani89fffc02019-05-13 21:33:20 +0000113#endif