Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions sonic_platform_base/sonic_xcvr/api/broadcom/bailly.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"""
from ..public.cmis import CmisApi
from ...fields.broadcom import bailly
from ...cdb.broadcom.bailly import BaillyCdbFwHandler

class BaillyApi(CmisApi):
RLM_THRESHOLD_FIELDS = {
Expand Down Expand Up @@ -376,3 +377,22 @@ def get_laser_temperature(self):
Bailly has no laser temperature acquisition register, return none.
"""
return None

# Override cdb_fw_hdlr property from parent CmisCdbFw
@property
def cdb_fw_hdlr(self):
if not self._init_cdb_fw_handler:
return None
if self._cdb_fw_hdlr is None:
# Instantiate vendor-specific BaillyCdbFwHandler instead of base CdbFwHandler
self._cdb_fw_hdlr = BaillyCdbFwHandler(
self.xcvr_eeprom.reader,
self.xcvr_eeprom.writer,
self._cdb_mem_map,
)
return self._cdb_fw_hdlr
# Override firmware upgreade function
def module_fw_upgrade(self, imagepath, timeout=5):
#Todo parse firmware hearder
# load/run/commit
pass
18 changes: 18 additions & 0 deletions sonic_platform_base/sonic_xcvr/cdb/broadcom/bailly.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
from ...cdb.cdb_fw import CdbFwHandler

# Vendor custom CDB handler inheriting base community handler
class BaillyCdbFwHandler(CdbFwHandler):
def __init__(self, reader, writer, cdb_map):
super().__init__(reader, writer, cdb_map)

# Reuse parent implementation for consistent opcodes (no override needed)
# Override single opcode method only if Bailly hardware has different logic
def write_epl_block(self, address, data):
# Example: OE firmware strip 4-byte header, vendor custom logic
stripped = data[4:]
return super().write_epl_block(address, stripped)
# Override start download to inject CPO partition ID (0x0101)
def start_fw_download(self, filepath):
# Inject CPO partition info before parent download initialization
# Todo
return super().start_fw_download(filepath)
Loading