Skip to content

optoe: Add CMIS Bank support for transceivers with >8 lanes#473

Open
ishidawataru wants to merge 8 commits intosonic-net:masterfrom
ishidawataru:optoe-bank-support
Open

optoe: Add CMIS Bank support for transceivers with >8 lanes#473
ishidawataru wants to merge 8 commits intosonic-net:masterfrom
ishidawataru:optoe-bank-support

Conversation

@ishidawataru
Copy link

@ishidawataru ishidawataru commented Apr 2, 2025

This patch adds CMIS Bank support to the 'optoe3' device class in order
to enable access to CMIS transceivers with more than 8 lanes (e.g., OSFP-XD, CPO OEs).

  • Bank support is enabled only for the 'optoe3' dev class.
  • The default bank size is set to 4, and can be modified via the 'bank_size' sysfs entry.
  • For 'optoe3', the 'write_max' value is updated to 2 to comply with CMIS requirements,
    which mandate that both bank and page values be updated in a single WRITE operation.

Updated the behavior as below after discussing with @prgeor offline

  • 'bank_size' sysfs entry is added to enable and configure the size of the bank.
  • By default, bank size is set to 0.
  • When enabling bank by setting a value greater than 1, the 'write_max' value is
    automatically updated to 2 to comply with CMIS requirements,
    which mandate that both bank and page values be updated in a single WRITE operation.
  • If the 'write_max' value is already greater than 2, this module keeps the value as is.

Only tested with the SONiC VM + i2c-stub.

admin@sonic:~$ cat /sys/class/i2c-dev/i2c-1/device/1-0050/bank_size
4
admin@sonic:~$ hexdump /sys/class/i2c-dev/i2c-1/device/1-0050/eeprom 
0000000 0000 0000 0000 0000 0000 0000 0000 0000
*
001e880
admin@sonic:~$ echo 1 | sudo tee /sys/class/i2c-dev/i2c-1/device/1-0050/bank_size
1
admin@sonic:~$ hexdump /sys/class/i2c-dev/i2c-1/device/1-0050/eeprom 
0000000 0000 0000 0000 0000 0000 0000 0000 0000
*
0008080

Snip of dmesg. See bank:3 is accessed.

[140341.928384] optoe 1-0050: eeprom write 2@126 --> 2 (4329977748)
[140341.928386] optoe 1-0050: sff_r/w: off 122880, len 2176, chunk_start_offset 124928, chunk_offset 124928, chunk_len 128, pending_len 128
[140341.928388] optoe 1-0050: optoe_eeprom_update_client off 124928 bank:3 page:255 phy_offset:128, count:128, opcode:0
[140341.928391] optoe 1-0050: eeprom write 2@126 --> 2 (4329977748)
[140341.928393] optoe 1-0050: eeprom read 32@128 --> 32 (4329977748)
[140341.928395] optoe 1-0050: eeprom read 32@160 --> 32 (4329977748)
[140341.928397] optoe 1-0050: eeprom read 32@192 --> 32 (4329977748)
[140341.928399] optoe 1-0050: eeprom read 32@224 --> 32 (4329977748)
[140341.928401] optoe 1-0050: eeprom write 2@126 --> 2 (4329977748)
[140341.928413] optoe 1-0050: optoe_read_write: off 125056  len:4096, opcode:r

Not tested with real hardware yet.

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants