Skip to content

Commit

Permalink
[Celestica Seastone2] Build correct platform files (#9660)
Browse files Browse the repository at this point in the history
* fix workdir for seastone2

Signed-off-by: Viktor Ekmark <viktor@ekmark.se>

* seastone2: Add I2C SFP definition for SFP1

Signed-off-by: Christian Svensson <blue@cmd.nu>

* [device/cel_seastone_2] sfputil logic for SFP1

Earlier logic resulted in the name of SFP1 being SFP33 which is not
correct. The cannonical source is seastone2_fpga module and it calls it
SFP1, so ensure the logic does as well.

Signed-off-by: Christian Svensson <blue@cmd.nu>

* [device/cel_seastone_2] sysfs paths for SFP1

Various changes that plumbs the correct port presence and DOM decoding
for the SFP1 port.

Signed-off-by: Christian Svensson <blue@cmd.nu>

Co-authored-by: Christian Svensson <blue@cmd.nu>
  • Loading branch information
fyx and bluecmd authored Jan 16, 2022
1 parent eaa888d commit 1b657be
Show file tree
Hide file tree
Showing 4 changed files with 60 additions and 18 deletions.
16 changes: 8 additions & 8 deletions device/celestica/x86_64-cel_seastone_2-r0/plugins/sfputil.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,16 +47,16 @@ def get_port_name(self, port_num):
if port_num in self.qsfp_ports:
self._port_name = "QSFP" + str(port_num - self.QSFP_PORT_START + 1)
else:
self._port_name = "SFP" + str(port_num)
self._port_name = "SFP" + str(port_num - self.QSFP_PORT_END)
return self._port_name

# def get_eeprom_dom_raw(self, port_num):
# if port_num in self.qsfp_ports:
# # QSFP DOM EEPROM is also at addr 0x50 and thus also stored in eeprom_ifraw
# return None
# else:
# # Read dom eeprom at addr 0x51
# return self._read_eeprom_devid(port_num, self.DOM_EEPROM_ADDR, 256)
def get_eeprom_dom_raw(self, port_num):
if port_num in self.qsfp_ports:
# QSFP DOM EEPROM is also at addr 0x50 and thus also stored in eeprom_ifraw
return None
else:
# Read dom eeprom as offset 0x100 on optoe eeprom
return self._read_eeprom_devid(port_num, self.DOM_EEPROM_ADDR, 256)

def __init__(self):
# Override port_to_eeprom_mapping for class initialization
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,14 @@ def _initialize_interrupts(self):

for index in range(self.num_sfp):
port_num = index + 1
port_name = "QSFP{}".format(port_num)
port_type = "qsfp"
sysfs_prs_file = "{}_modprs".format(port_type)
if port_num <= 32:
port_name = "QSFP{}".format(port_num)
port_type = "qsfp"
sysfs_prs_file = "{}_modprs".format(port_type)
else:
port_name = "SFP{}".format(port_num - 32)
port_type = "sfp"
sysfs_prs_file = "{}_modabs".format(port_type)

sfp_info_obj[index] = {}
sfp_info_obj[index]['intmask_sysfs'] = self.PATH_INTMASK_SYSFS.format(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"port_num": 32,
"port_num": 33,
"eeprom_path": "/sys/bus/i2c/devices/i2c-{0}/{0}-0050/eeprom",
"port_i2c_mapping": [
2,
Expand Down Expand Up @@ -33,12 +33,13 @@
30,
31,
32,
33
33,
34
],
"get_presence": {
"output_source": "sysfs_value",
"sysfs_path": "/sys/devices/platform/switchboard/SFF/{}/qsfp_modprs",
"argument": "$ref:_port_name",
"sysfs_path": "/sys/devices/platform/switchboard/SFF/{}",
"argument": "$ref:_presence_file",
"output_translator": "False if '{}' == '1' else True"
},
"get_lpmode": {
Expand Down Expand Up @@ -101,6 +102,42 @@
"QSFP29",
"QSFP30",
"QSFP31",
"QSFP32"
"QSFP32",
"SFP1"
],
"_presence_file": [
"QSFP1/qsfp_modprs",
"QSFP2/qsfp_modprs",
"QSFP3/qsfp_modprs",
"QSFP4/qsfp_modprs",
"QSFP5/qsfp_modprs",
"QSFP6/qsfp_modprs",
"QSFP7/qsfp_modprs",
"QSFP8/qsfp_modprs",
"QSFP9/qsfp_modprs",
"QSFP10/qsfp_modprs",
"QSFP11/qsfp_modprs",
"QSFP12/qsfp_modprs",
"QSFP13/qsfp_modprs",
"QSFP14/qsfp_modprs",
"QSFP15/qsfp_modprs",
"QSFP16/qsfp_modprs",
"QSFP17/qsfp_modprs",
"QSFP18/qsfp_modprs",
"QSFP19/qsfp_modprs",
"QSFP20/qsfp_modprs",
"QSFP21/qsfp_modprs",
"QSFP22/qsfp_modprs",
"QSFP23/qsfp_modprs",
"QSFP24/qsfp_modprs",
"QSFP25/qsfp_modprs",
"QSFP26/qsfp_modprs",
"QSFP27/qsfp_modprs",
"QSFP28/qsfp_modprs",
"QSFP29/qsfp_modprs",
"QSFP30/qsfp_modprs",
"QSFP31/qsfp_modprs",
"QSFP32/qsfp_modprs",
"SFP1/sfp_modabs"
]
}
}
2 changes: 1 addition & 1 deletion platform/broadcom/sonic-platform-modules-cel/debian/rules
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ override_dh_auto_build:
(for mod in $(MODULE_DIRS); do \
make -C $(KERNEL_SRC)/build M=$(MOD_SRC_DIR)/$${mod}/modules; \
if [ $$mod = "seastone2" ]; then \
cd services/platform_api; \
cd $(MOD_SRC_DIR)/services/platform_api; \
python3 setup.py bdist_wheel -d $(MOD_SRC_DIR)/$${mod}/modules; \
continue; \
fi; \
Expand Down

0 comments on commit 1b657be

Please sign in to comment.