Add complete bank support for CMIS transceivers#640
Draft
bobby-nexthop wants to merge 1 commit intosonic-net:masterfrom
Draft
Add complete bank support for CMIS transceivers#640bobby-nexthop wants to merge 1 commit intosonic-net:masterfrom
bobby-nexthop wants to merge 1 commit intosonic-net:masterfrom
Conversation
This PR extends the bank parameter support introduced in PR sonic-net#632 to fully enable multi-bank CMIS transceiver support throughout the stack. Changes include: 1. **Memory Map Bank Awareness**: - Updated CmisFlatMemMap, CmisMemMap, and CCmisMemMap to accept bank parameter - Implemented bank-aware getaddr() method in CmisFlatMemMap that correctly calculates linear offsets using the formula from sonic-linux-kernel PR sonic-net#473 - Added bank property to CmisFlatMemMap for read-only access - Added constants: CMIS_EEPROM_PAGE_SIZE, CMIS_NUM_NON_BANKED_PAGES, CMIS_NUM_BANKED_PAGES, CMIS_ARCH_PAGES - Uses unified formula: linear_offset = (bank * CMIS_ARCH_PAGES + page) * page_size + offset - Each bank is treated as a full 256-page (32KB) architectural block for proper alignment 2. **API Factory Updates**: - Added bank parameter to create_xcvr_api() and _create_cmis_api() - Updated CMIS API instantiation to pass bank parameter to memory maps - Modified id_mapping to pass bank parameter for all CMIS module types (0x18, 0x19, 0x1b, 0x1e) 3. **SfpBase Integration**: - Updated refresh_xcvr_api() to pass bank parameter when creating xcvr_api 4. **Field Definitions**: - Added BANKS_SUPPORTED_FIELD constant to consts.py - Added BanksSupported field to MODULE_CHAR_ADVT in CmisMemMap This enables proper support for CMIS modules with multiple memory banks, allowing correct EEPROM access across all banks as defined in the CMIS specification. The offset calculation formula matches the optoe kernel driver implementation in sonic-linux-kernel PR sonic-net#473. Signed-off-by: Bobby McGonigle <bobby@nexthop.ai>
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR extends the bank parameter support introduced in PR #632 to fully enable multi-bank CMIS transceiver support throughout the stack.
Changes include:
Memory Map Bank Awareness:
API Factory Updates:
SfpBase Integration:
Field Definitions:
This enables proper support for CMIS modules with multiple memory banks, allowing correct EEPROM access across all banks as defined in the CMIS specification. The offset calculation formula matches the optoe kernel driver implementation in sonic-linux-kernel PR #473.
Motivation and Context
How Has This Been Tested?
Additional Information (Optional)