Skip to content

Commit 25bc8c4

Browse files
authored
[centec] fix some bugs on centec tsingma bsp and v682 sonic_platform package (#10685)
#### Why I did it Fix some bugs on centec tsingma bsp and v682 sonic_platform package. #### How I did it 1. add module license for centec mars phy driver 2. Fix i2c function ability setting for tsingma soc i2c controller 3. Fix eeprom read error on v682 sonic_platform sfp module #### How to verify it Build SONiC image and verify it on centec E530-48T4X and V682-48Y8C board.
1 parent b9a7665 commit 25bc8c4

File tree

4 files changed

+10
-2
lines changed
  • platform
    • centec/sonic-platform-modules-v682
    • centec-arm64/tsingma-bsp/src

4 files changed

+10
-2
lines changed

platform/centec-arm64/tsingma-bsp/src/ctc-phy/mars.c

+3
Original file line numberDiff line numberDiff line change
@@ -314,3 +314,6 @@ static struct mdio_device_id __maybe_unused mars_tbl[] = {
314314
};
315315

316316
MODULE_DEVICE_TABLE(mdio, mars_tbl);
317+
318+
MODULE_AUTHOR("Centec, Inc.");
319+
MODULE_LICENSE("GPL");

platform/centec-arm64/tsingma-bsp/src/i2c-ctc/i2c-ctc.c

+5
Original file line numberDiff line numberDiff line change
@@ -789,6 +789,11 @@ static int ctc_i2c_plat_probe(struct platform_device *pdev)
789789
of_property_read_u32(pdev->dev.of_node, "clock-frequency", &clk_freq);
790790

791791
dev->clk_freq = clk_freq;
792+
793+
dev->functionality = I2C_FUNC_10BIT_ADDR | CTC_IC_DEFAULT_FUNCTIONALITY;
794+
dev->master_cfg = CTC_IC_CON_MASTER | CTC_IC_CON_SLAVE_DISABLE |
795+
CTC_IC_CON_RESTART_EN;
796+
792797
if (dev->clk_freq <= 100000)
793798
dev->master_cfg |= CTC_IC_CON_SPEED_STD;
794799
else if (dev->clk_freq <= 400000)

platform/centec/sonic-platform-modules-v682/48x8c/sonic_platform/sfp.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,7 @@ def get_presence(self):
383383

384384
try:
385385
with open(self.port_to_eeprom_mapping[self.port_num], mode='rb', buffering=0) as fd:
386-
fd.read()
386+
fd.read(256)
387387
except IOError:
388388
return False
389389

platform/centec/sonic-platform-modules-v682/48y8c/sonic_platform/sfp.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,7 @@ def get_presence(self):
383383

384384
try:
385385
with open(self.port_to_eeprom_mapping[self.port_num], mode='rb', buffering=0) as fd:
386-
fd.read()
386+
fd.read(256)
387387
except IOError:
388388
return False
389389

0 commit comments

Comments
 (0)