Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[platform/broadcom] Silverstone update platform i2c driver #3607

Closed

Conversation

pphuchar
Copy link
Contributor

- What I did
Update the Silverstone i2c driver to work with new FPGA i2c firmware version 1.5.
The new FPGA firmware improves i2c stability. This feature is mandatory for the current Silverstone machine which shipped with FPGA firmware version 1.5 by default.

- How I did it

  • Make changes in the platform driver module and init script.
  • Update the sfputil plugins.

- How to verify it
Test with Silverstone FPGA firmware version 1.5 and see the sfputil command works normally.

- Description for the changelog

  • Silverstone update platform i2c driver based on opencore.

- A picture of a cute animal (not mandatory but encouraged)

tiantianlv
tiantianlv previously approved these changes Oct 15, 2019
@lguohan
Copy link
Collaborator

lguohan commented Oct 15, 2019

retest vsimage please

@lguohan
Copy link
Collaborator

lguohan commented Oct 15, 2019

retest vs please

@pphuchar
Copy link
Contributor Author

Regression test with show interface

NOTE: Due to limitation, QSFP-DD module only plug at first two ports, others are QSFP28

root@sonic:/home/admin# show int st
  Interface                            Lanes    Speed    MTU     Alias    Vlan    Oper    Admin                                             Type    Asym PFC
-----------  -------------------------------  -------  -----  --------  ------  ------  -------  -----------------------------------------------  ----------
  Ethernet0          33,34,35,36,37,38,39,40     400G   9100   QSFPDD1  routed      up       up  QSFP-DD Double Density 8X Pluggable Transceiver         N/A
  Ethernet4          41,42,43,44,45,46,47,48     400G   9100   QSFPDD2  routed      up       up  QSFP-DD Double Density 8X Pluggable Transceiver         N/A
  Ethernet8          49,50,51,52,53,54,55,56     400G   9100   QSFPDD3  routed    down       up                                  QSFP28 or later         N/A
 Ethernet12          57,58,59,60,61,62,63,64     400G   9100   QSFPDD4  routed    down       up                                  QSFP28 or later         N/A
 Ethernet16          65,66,67,68,69,70,71,72     400G   9100   QSFPDD5  routed    down       up                                  QSFP28 or later         N/A
 Ethernet20          73,74,75,76,77,78,79,80     400G   9100   QSFPDD6  routed    down       up                                  QSFP28 or later         N/A
 Ethernet24          81,82,83,84,85,86,87,88     400G   9100   QSFPDD7  routed    down       up                                  QSFP28 or later         N/A
 Ethernet28          89,90,91,92,93,94,95,96     400G   9100   QSFPDD8  routed    down       up                                  QSFP28 or later         N/A
 Ethernet32                  1,2,3,4,5,6,7,8     400G   9100   QSFPDD9  routed    down       up                                  QSFP28 or later         N/A
 Ethernet36           9,10,11,12,13,14,15,16     400G   9100  QSFPDD10  routed    down       up                                  QSFP28 or later         N/A
 Ethernet40          17,18,19,20,21,22,23,24     400G   9100  QSFPDD11  routed    down       up                                  QSFP28 or later         N/A
 Ethernet44          25,26,27,28,29,30,31,32     400G   9100  QSFPDD12  routed    down       up                                  QSFP28 or later         N/A
 Ethernet48     97,98,99,100,101,102,103,104     400G   9100  QSFPDD13  routed    down       up                                  QSFP28 or later         N/A
 Ethernet52  105,106,107,108,109,110,111,112     400G   9100  QSFPDD14  routed    down       up                                  QSFP28 or later         N/A
 Ethernet56  113,114,115,116,117,118,119,120     400G   9100  QSFPDD15  routed    down       up                                  QSFP28 or later         N/A
 Ethernet60  121,122,123,124,125,126,127,128     400G   9100  QSFPDD16  routed    down       up                                  QSFP28 or later         N/A
 Ethernet64  129,130,131,132,133,134,135,136     400G   9100  QSFPDD17  routed    down       up                                  QSFP28 or later         N/A
 Ethernet68  137,138,139,140,141,142,143,144     400G   9100  QSFPDD18  routed    down       up                                  QSFP28 or later         N/A
 Ethernet72  145,146,147,148,149,150,151,152     400G   9100  QSFPDD19  routed    down       up                                  QSFP28 or later         N/A
 Ethernet76  153,154,155,156,157,158,159,160     400G   9100  QSFPDD20  routed    down       up                                  QSFP28 or later         N/A
 Ethernet80  225,226,227,228,229,230,231,232     400G   9100  QSFPDD21  routed    down       up                                  QSFP28 or later         N/A
 Ethernet84  233,234,235,236,237,238,239,240     400G   9100  QSFPDD22  routed    down       up                                  QSFP28 or later         N/A
 Ethernet88  241,242,243,244,245,246,247,248     400G   9100  QSFPDD23  routed    down       up                                  QSFP28 or later         N/A
 Ethernet92  249,250,251,252,253,254,255,256     400G   9100  QSFPDD24  routed    down       up                                  QSFP28 or later         N/A
 Ethernet96  161,162,163,164,165,166,167,168     400G   9100  QSFPDD25  routed    down       up                                  QSFP28 or later         N/A
Ethernet100  169,170,171,172,173,174,175,176     400G   9100  QSFPDD26  routed    down       up                                  QSFP28 or later         N/A
Ethernet104  177,178,179,180,181,182,183,184     400G   9100  QSFPDD27  routed    down       up                                  QSFP28 or later         N/A
Ethernet108  185,186,187,188,189,190,191,192     400G   9100  QSFPDD28  routed    down       up                                  QSFP28 or later         N/A
Ethernet112  193,194,195,196,197,198,199,200     400G   9100  QSFPDD29  routed    down       up                                  QSFP28 or later         N/A
Ethernet116  201,202,203,204,205,206,207,208     400G   9100  QSFPDD30  routed    down       up                                  QSFP28 or later         N/A
Ethernet120  209,210,211,212,213,214,215,216     400G   9100  QSFPDD31  routed    down       up                                  QSFP28 or later         N/A
Ethernet124  217,218,219,220,221,222,223,224     400G   9100  QSFPDD32  routed    down       up                                  QSFP28 or later         N/A
root@sonic:/home/admin# show int tra pre
Port         Presence
-----------  ----------
Ethernet0    Present
Ethernet4    Present
Ethernet8    Present
Ethernet12   Present
Ethernet16   Present
Ethernet20   Present
Ethernet24   Present
Ethernet28   Present
Ethernet32   Present
Ethernet36   Present
Ethernet40   Present
Ethernet44   Present
Ethernet48   Present
Ethernet52   Present
Ethernet56   Present
Ethernet60   Present
Ethernet64   Present
Ethernet68   Present
Ethernet72   Present
Ethernet76   Present
Ethernet80   Present
Ethernet84   Present
Ethernet88   Present
Ethernet92   Present
Ethernet96   Present
Ethernet100  Present
Ethernet104  Present
Ethernet108  Present
Ethernet112  Present
Ethernet116  Present
Ethernet120  Present
Ethernet124  Present
root@sonic:/home/admin# show int tra eeprom Ethernet0
Ethernet0: SFP EEPROM detected
        Connector: N/A
        Encoding: N/A
        Extended Identifier: N/A
        Extended RateSelect Compliance: N/A
        Identifier: QSFP-DD Double Density 8X Pluggable Transceiver
        N/A: N/A
        Nominal Bit Rate(100Mbs): N/A
        Specification compliance: 
        Vendor Date Code(YYYY-MM-DD Lot): N/A
        Vendor Name: LEONI
        Vendor OUI: N/A
        Vendor PN: L45593-K900-A115
        Vendor Rev: 02
        Vendor SN: LEO1851G462

root@sonic:/home/admin# show int tra eeprom Ethernet4
Ethernet4: SFP EEPROM detected
        Connector: N/A
        Encoding: N/A
        Extended Identifier: N/A
        Extended RateSelect Compliance: N/A
        Identifier: QSFP-DD Double Density 8X Pluggable Transceiver
        N/A: N/A
        Nominal Bit Rate(100Mbs): N/A
        Specification compliance: 
        Vendor Date Code(YYYY-MM-DD Lot): N/A
        Vendor Name: LEONI
        Vendor OUI: N/A
        Vendor PN: L45593-K900-A115
        Vendor Rev: 02
        Vendor SN: LEO1844G14E

root@sonic:/home/admin# show int tra eeprom Ethernet4 -d
Ethernet4: SFP EEPROM detected
        Connector: N/A
        Encoding: N/A
        Extended Identifier: N/A
        Extended RateSelect Compliance: N/A
        Identifier: QSFP-DD Double Density 8X Pluggable Transceiver
        N/A: N/A
        Nominal Bit Rate(100Mbs): N/A
        Specification compliance: 
        Vendor Date Code(YYYY-MM-DD Lot): N/A
        Vendor Name: LEONI
        Vendor OUI: N/A
        Vendor PN: L45593-K900-A115
        Vendor Rev: 02
        Vendor SN: LEO1844G14E
        ChannelMonitorValues: 
        ChannelThresholdValues: 
        ModuleMonitorValues: 
        ModuleThresholdValues: 

root@sonic:/home/admin# show int tra eeprom Ethernet0 -d
Ethernet0: SFP EEPROM detected
        Connector: N/A
        Encoding: N/A
        Extended Identifier: N/A
        Extended RateSelect Compliance: N/A
        Identifier: QSFP-DD Double Density 8X Pluggable Transceiver
        N/A: N/A
        Nominal Bit Rate(100Mbs): N/A
        Specification compliance: 
        Vendor Date Code(YYYY-MM-DD Lot): N/A
        Vendor Name: LEONI
        Vendor OUI: N/A
        Vendor PN: L45593-K900-A115
        Vendor Rev: 02
        Vendor SN: LEO1851G462
        ChannelMonitorValues: 
        ChannelThresholdValues: 
        ModuleMonitorValues: 
        ModuleThresholdValues: 

root@sonic:/home/admin# exit
admin@sonic:~$ 

@pphuchar pphuchar marked this pull request as ready for review October 16, 2019 04:36
@lguohan
Copy link
Collaborator

lguohan commented Oct 18, 2019

retest vs please

1 similar comment
@lguohan
Copy link
Collaborator

lguohan commented Oct 24, 2019

retest vs please

@@ -0,0 +1,846 @@
// SPDX-License-Identifier: GPL-2.0
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello,

The reason we keep it as a separate are:

  1. The original i2c-ocores in sonic kernel version 4.9.x is not support polling mode. We use the codes based on kernel 5.1 to support this feature.
  2. We add a workaround to fix read error on some SFP loopback module.

If only the first reason, we can backport the feature from kernel 5.1 to current sonic-linux-kernel, but combined with the 2nd reason, we decide to maintain the codes as a platform-specific.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do we need this workaround? We add a workaround to fix read error on some SFP loopback module.

Copy link
Contributor Author

@pphuchar pphuchar Oct 25, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In some SFP module case.
When reading EEPROM, the i2c core detects the arbitration lost(AL) error and stop the i2c transfer. The AL randomly occurs on the device.

To make the device readable, the limited retry is added to the ocore FSM. When AL detected, it restarts the i2c transfer again until retry used up.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this seems like a generic fix, can you patch the kernel in sonic-linux-kernel?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I will create a PR to patch i2c-ocores.c in sonic-linux-kernel to support polling mode.
For the workaround, we found that it was a bug in the FPGA firmware and fixed with new firmware, so it will not include in this patch.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks. I will review your sonic-linux-kernel patch and merge this pr after kernel patch has been fixed.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The kernel patch has been introduced here sonic-net/sonic-linux-kernel#135.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The driver is updated to use kernel's i2c-ocores module.

@@ -0,0 +1,22 @@
/* SPDX-License-Identifier: GPL-2.0 */
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

kernel existing code.

Copy link
Contributor Author

@pphuchar pphuchar Oct 24, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As we keep the own maintain version of i2c-ocores, this file is needed for module compile.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will be removed after the sonic-net/sonic-linux-kernel#135 is merged.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The driver is updated to use kernel's i2c-ocores module.

@mudsut4ke
Copy link
Contributor

retest broadcom please

@pphuchar pphuchar force-pushed the silverstone-update-opencore branch from 01190a6 to 3c0dcb6 Compare May 27, 2020 13:09
@pphuchar pphuchar force-pushed the silverstone-update-opencore branch from 84b4a98 to 0d3251e Compare May 27, 2020 13:15
@pphuchar
Copy link
Contributor Author

I have rebased the changes onto the master and apply 2 changes

  • Advance the sonic-linux-kernel pointer to includes i2c-ocores patch.
  • Update the platform driver to use i2c-ocores from sonic kernel.

@pphuchar pphuchar requested a review from jleveque as a code owner February 6, 2021 20:29
@pphuchar pphuchar closed this Aug 11, 2021
mssonicbld added a commit that referenced this pull request Dec 10, 2024
…atically (#20573)

#### Why I did it
src/sonic-utilities
```
* 32e6de7f - (HEAD -> master, origin/master, origin/HEAD) Update DB migrator script to next branch 202505 (#3664) (3 days ago) [Kumaresh Perumal]
* 8d00aba7 - (origin/test_202411_20, origin/test_202411_100, origin/kperumal_202411, origin/202411) Fix save_file command in generate_dump (#3647) (4 days ago) [DavidZagury]
* 038aaa5f - Revert "Speed up route_check script" (#3653) (4 days ago) [xwjiang-ms]
* 032a0e03 - [config]Restrict YANG validation to Golden Config (#3656) (4 days ago) [jingwenxie]
* 47b79bea - Update gcu_field_operation_validators.conf.json with Arista-7260CX3-D108C10 (#3650) (4 days ago) [Dev Ojha]
* 845f46ef - Update PR checker pipeline to point to bookworm (#3651) (4 days ago) [bingwang-ms]
* 28e645f4 - [show_tech] Filter out a list of commands in generate_dump script which are not applicable to Supervisor (#3646) (5 days ago) [Marty Y. Lok]
* b767cb86 - [cisco|express-boot]: Add support for cisco express boot in sonic-utilities (#3056) (6 days ago) [jhli-cisco]
* f6b9912c - Fix show command column change issue (#3645) (8 days ago) [Feng-msft]
* 9cd6c8de - Debug dump utility dash objects update (#3387) (8 days ago) [Gagan Punathil Ellath]
* f705c456 - Validate interface name length in CLI (#3580) (8 days ago) [Stepan Blyshchak]
* 3d78cb16 - [Mellanox] Update the save_file command in generate_dump to handle folders (#3631) (13 days ago) [DavidZagury]
* 5086a43b - Fix counterpoll show for ENI Counters (#3618) (13 days ago) [Vivek]
* 70f81397 - Extra delay between running firmware and updating firmware version (#3610) (2 weeks ago) [Stephen Sun]
* 636f7f1d - Add port FEC BER show changes (#3607) (2 weeks ago) [vincentpcng]
* 5e60031b - Supports FRR-VRRP configuration (#2949) (3 weeks ago) [Philo]
* 9bd37dc6 - [ARM64][Warm-Reboot]: Get boot arguments from uboot environment (#3613) (3 weeks ago) [Parthiv Shah]
* 171b16c2 - platform/innovium renaming to platform/marvell-teralynx (#3474) (3 weeks ago) [krismarvell]
* 2cbfcc91 - [Mellanox] Add Mellanox-SN5600-C224O8 to gcu_field.json (#3612) (4 weeks ago) [noaOrMlnx]
* a8f7bde0 - PVST Feature commit (#3567) (4 weeks ago) [Divya Kumaran Chandralekha]
* 0e188076 - Refresh dump file modify timestamp before cleanup call (#3595) (4 weeks ago) [anamehra]
* 8f3c5ef5 - [warm-reboot] Add support to pass extra kernel cmdline parameters (#3192) (4 weeks ago) [Pavan Naregundi]
* 96774477 - Run yang validation in db migrator (#3102) (4 weeks ago) [ganglv]
* 9708f52b - [Mellanox] Update C256X1 SKU to be C256S1 in gcu_field.json (#3611) (4 weeks ago) [noaOrMlnx]
* 093ed4aa - [SPM] Add logic to disable the feature before stopping it and enabling it before starting (#3344) (4 weeks ago) [Vadym Hlushko]
* 7d013dff - Fix slash in path. (#3573) (5 weeks ago) [Xincun Li]
* 0af4386e - Consolidate the get running config way. (#3585) (5 weeks ago) [Xincun Li]
* 964b4895 - Fix for integer overflow of counter value if its too large (#3596) (5 weeks ago) [harjotsinghpawra]
* 3354d08a - [config] Bypass standard input for reload (#3597) (5 weeks ago) [jingwenxie]
* 7cbcfda5 - Speed up route_check script (#3544) (5 weeks ago) [Deepak Singhal]
* 329fc223 - Add support of the pensando-dpu platform to generate-dump utility. (#3557) (6 weeks ago) [BHUKYA SIDDHU]
* 0ae2ec1e - Add CLI for bmp configdb entity Enable/Disable (#3286) (6 weeks ago) [Feng-msft]
* 5b37ee6c - Vnet_route_check TCP socket for DB connection. (#3578) (6 weeks ago) [siqbal1986]
* d64a90a0 - Adds logic to get default disk and check disk type (#3399) (6 weeks ago) [Ashwin Srinivasan]
* b2b97340 - [Banner] Added CLI commands to configure Banner and display current configuration (#3021) (6 weeks ago) [Sviatoslav Boichuk]
* d0aa94a1 - Revert "Record and warn tables which not covered by YANG (#3583)" (#3588) (7 weeks ago) [jingwenxie]
* aeda86a1 - Record and warn tables which not covered by YANG (#3583) (7 weeks ago) [jingwenxie]
* dd34d7c4 - Revert "Skip default lanes dup check (#3489)" (#3572) (7 weeks ago) [Xincun Li]
* 6c8007fa - [Mellanox]Remove deprecated sdk sniffer cli and collect sdk dump in show techsupport (#3491) (7 weeks ago) [Yuanzhe]
* 89bb87ad - Add YANG validation for config reload if file is given (#3576) (7 weeks ago) [jingwenxie]
```
#### How I did it
#### How to verify it
#### Description for the changelog
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants