blob: b30960ba57568f8fb3599bd48c001875ec9a2f59 [file] [log] [blame]
Arthur Syu094df162022-04-21 17:50:06 +08001/*
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__
19#define VENDOR_ID "Zyxel"
20#define SDA3016SS
21#define MODEL_ID "sda3016ss"
22#define MAX_SUPPORTED_PON 32
23#define MAX_SUPPORTED_SWITCH_PORT 16
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 Gowdrab0337eb2022-03-25 16:44:21 -070026#define DEFAULT_MAC_SYSTEM_MODE BCMOLT_SYSTEM_MODE_XGS__8_X_GPON__8_X_WDMA
27#define DEFAULT_PON_MODE BCMOLT_PON_TYPE_XGPON
Arthur Syu094df162022-04-21 17:50:06 +080028
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 8
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
48#define MAC_DEVICE_ACTIVATION_DELAY 200000 // in microseconds
Girish Gowdrab0337eb2022-03-25 16:44:21 -070049///////////////////////////////////////////////////////
50// Constants relevant for decoding PON Trx EEPROM Data
51
52// Uncomment below line when you need dynamic transceiver detection support
53// #define DYNAMIC_PON_TRX_SUPPORT
54
55
56#define TOTAL_PON_TRX_PORTS 16 // total PON transceiver ports
57#define TOTAL_PON_PORTS 32 // total PON ports (we could have up to 2 PON ports on the OLT MAC mapped to the external PON Trx)
58const 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},
59{11},{12},{13},{14},{15}};
60#define PONS_PER_TRX (TOTAL_PON_TRX_PORTS/TOTAL_PON_PORTS) // if there are more than one OLT MAC device,
61 // they all have to be of the same type for this to work.
62
63const int bus_index[TOTAL_PON_TRX_PORTS] = {
64 47, 48, 37, 38, 35, 36, 33, 34,
65 39, 40, 41, 42, 43, 44, 45, 46
66};
67
68
69// FIXME: Check the correctness of the below constants for this platform
70// This is Combo PON OLT - so not all the values below are accurate.
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};
Arthur Syu094df162022-04-21 17:50:06 +0800104
105#endif