[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.
This commit is contained in:
LuiSzee 2022-07-06 09:05:03 +08:00 committed by GitHub
parent b9a7665662
commit 25bc8c4054
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 10 additions and 2 deletions

View File

@ -314,3 +314,6 @@ static struct mdio_device_id __maybe_unused mars_tbl[] = {
};
MODULE_DEVICE_TABLE(mdio, mars_tbl);
MODULE_AUTHOR("Centec, Inc.");
MODULE_LICENSE("GPL");

View File

@ -789,6 +789,11 @@ static int ctc_i2c_plat_probe(struct platform_device *pdev)
of_property_read_u32(pdev->dev.of_node, "clock-frequency", &clk_freq);
dev->clk_freq = clk_freq;
dev->functionality = I2C_FUNC_10BIT_ADDR | CTC_IC_DEFAULT_FUNCTIONALITY;
dev->master_cfg = CTC_IC_CON_MASTER | CTC_IC_CON_SLAVE_DISABLE |
CTC_IC_CON_RESTART_EN;
if (dev->clk_freq <= 100000)
dev->master_cfg |= CTC_IC_CON_SPEED_STD;
else if (dev->clk_freq <= 400000)

View File

@ -383,7 +383,7 @@ class Sfp(SfpBase):
try:
with open(self.port_to_eeprom_mapping[self.port_num], mode='rb', buffering=0) as fd:
fd.read()
fd.read(256)
except IOError:
return False

View File

@ -383,7 +383,7 @@ class Sfp(SfpBase):
try:
with open(self.port_to_eeprom_mapping[self.port_num], mode='rb', buffering=0) as fd:
fd.read()
fd.read(256)
except IOError:
return False